blob: 0906b359e9b9f74e4d1a99145e15d2412e1df025 [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";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080082 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 SensorStateChanged sensor_state_changed = 5 [(module) = "framework"];
85 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
86 SyncStateChanged sync_state_changed = 7 [(module) = "framework"];
87 ScheduledJobStateChanged scheduled_job_state_changed = 8 [(module) = "framework"];
88 ScreenBrightnessChanged screen_brightness_changed = 9 [(module) = "framework"];
89 WakelockStateChanged wakelock_state_changed = 10 [(module) = "framework"];
90 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
91 11 [(module) = "framework"];
92 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
93 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
94 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
95 14 [(module) = "framework"];
96 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
97 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
98 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
99 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800100 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20 [(module) = "framework"];
102 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
103 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
104 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
105 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
106 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
107 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
108 UidProcessStateChanged uid_process_state_changed = 27 [(module) = "framework"];
109 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28 [(module) = "framework"];
110 ScreenStateChanged screen_state_changed = 29 [(module) = "framework"];
111 BatteryLevelChanged battery_level_changed = 30 [(module) = "framework"];
112 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
113 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
114 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800115 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
117 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800118 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
119 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
120 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
122 SettingChanged setting_changed = 41 [(module) = "framework"];
123 ActivityForegroundStateChanged activity_foreground_state_changed =
124 42 [(module) = "framework"];
125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework"];
126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Bookatz8fcd09a2017-12-18 13:01:10 -0800128 AnomalyDetected anomaly_detected = 46;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 AppBreadcrumbReported app_breadcrumb_reported =
130 47 [(allow_from_any_uid) = true, (module) = "framework"];
131 AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
132 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
133 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800134 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800136 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800137 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
139 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800140 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
143 ForegroundServiceStateChanged foreground_service_state_changed
144 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800145 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800146 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
147 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
148 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppDied app_died = 65 [(module) = "framework"];
150 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
151 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800152 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
153 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
155 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800156 SpeakerImpedanceReported speaker_impedance_reported = 71;
157 HardwareFailed hardware_failed = 72;
158 PhysicalDropDetected physical_drop_detected = 73;
159 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800160 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
161 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
163 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework"];
164 ANROccurred anr_occurred = 79 [(module) = "framework"];
165 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
166 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700167 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 KeyValuePairsAtom key_value_pairs_atom =
169 83 [(allow_from_any_uid) = true, (module) = "framework"];
170 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
171 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700172 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
174 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
175 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
176 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700177 BatteryHealthSnapshot battery_health_snapshot = 91;
178 SlowIo slow_io = 92;
179 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
181 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100182 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800183 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700185 // TODO: service state change is very noisy shortly after boot, as well
186 // as at other transitions - coming out of doze, device plugged in, etc.
187 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
189 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
190 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "framework"];
192 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800193 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
194 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
195 105 [(module) = "docsui"];
196 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
197 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
198 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
199 108 [(module) = "docsui"];
200 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
201 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
202 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
205 WifiRunningStateChanged wifi_running_state_changed = 114 [(module) = "framework"];
206 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800209 117 [(module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
211 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
213 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800214 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
215 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
216 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800217 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
218 125 [(module) = "bluetooth"];
219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
220 126 [(module) = "bluetooth"];
221 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
222 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000224 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800225 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
226 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
227 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800228 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800229 NfcErrorOccurred nfc_error_occurred = 134;
230 NfcStateChanged nfc_state_changed = 135;
231 NfcBeamOccurred nfc_beam_occurred = 136;
232 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
233 NfcTagOccurred nfc_tag_occurred = 138;
234 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
235 SeStateChanged se_state_changed = 140;
236 SeOmapiReported se_omapi_reported = 141;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800237 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
238 142 [(module) = "framework"];
239 AttentionManagerServiceResultReported attention_manager_service_result_reported =
240 143 [(module) = "framework"];
241 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800242 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800243 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
244 WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"];
245 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
246 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800247 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800248 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
249 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800250 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
251 151 [(module) = "bluetooth"];
252 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
253 152 [(module) = "bluetooth"];
254 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
255 153 [(module) = "bluetooth"];
256 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
257 154 [(module) = "bluetooth"];
258 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
259 155 [(module) = "bluetooth"];
260 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
261 156 [(module) = "bluetooth"];
262 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
263 157 [(module) = "bluetooth"];
264 BluetoothDeviceFailedContactCounterReported
265 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
266 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
267 159 [(module) = "bluetooth"];
268 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
269 160 [(module) = "bluetooth"];
270 BluetoothQualityReportReported bluetooth_quality_report_reported =
271 161 [(module) = "bluetooth"];
272 BluetoothDeviceInfoReported bluetooth_device_info_reported =
273 162 [(module) = "bluetooth"];
274 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
275 163 [(module) = "bluetooth"];
276 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
277 164 [(module) = "bluetooth"];
278 BluetoothBondStateChanged bluetooth_bond_state_changed =
279 165 [(module) = "bluetooth"];
280 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
281 166 [(module) = "bluetooth"];
282 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
283 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800284 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
285 168 [(module) = "framework"];
286 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700287 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800288 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800289 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800290 DeviceIdentifierAccessDenied device_identifier_access_denied =
291 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800292 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800293 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
294 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
295 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800296 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
297 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800298 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700299 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800300 180 [(module) = "permissioncontroller"];
301 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
302 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800303 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800304 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
305 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
306 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
307 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800308 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
309 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700310 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800311 188 [(module) = "intelligence"];
312 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
313 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800314 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800315 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800316 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
317 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
318 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
319 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
320 MediametricsCodecReported mediametrics_codec_reported = 195;
321 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
322 MediametricsExtractorReported mediametrics_extractor_reported = 197;
323 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
324 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
325 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700326 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800327 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
328 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800329 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800330 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
331 206 [(module) = "framework"];
332 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
333 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
334 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
335 LocationManagerApiUsageReported location_manager_api_usage_reported =
336 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100337 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800338 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100339 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800340 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100341 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800342 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100343 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800344 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100345 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800346 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100347 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100349 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800350 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100351 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800353 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
354 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
355 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
356 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800357 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800358 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700359 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
360 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100362 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800364 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800365 VmsClientConnectionStateChanged vms_client_connection_state_changed =
366 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800367 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
368 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700369 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800370 235 [(module) = "mediaprovider"];
371 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700372 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800373 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
375 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
376 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
377 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800378 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000380 UserspaceRebootReported userspace_reboot_reported = 243;
Will Brockman079fdaa2020-01-12 16:45:03 -0500381 NotificationReported notification_reported = 244;
382 NotificationPanelReported notification_panel_reported = 245;
383 NotificationChannelModified notification_panel_modified = 246;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +0000384 IntegrityCheckResultReported integrity_check_result_reported = 247;
385 IntegrityRulesPushed integrity_rules_pushed = 248;
Jordan Liubedfa702019-12-20 15:08:45 -0800386 CellBroadcastMessageReported cb_message_reported =
387 249 [(module) = "cellbroadcast"];
388 CellBroadcastMessageError cb_message_error =
389 250 [(module) = "cellbroadcast"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000390 }
David Chenc8a43242017-10-17 16:23:28 -0700391
David Chen6e3e6cb2018-01-03 16:14:06 -0800392 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000393 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700394 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800395 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
396 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
397 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
398 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
399 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
400 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800401 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800402 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
403 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
404 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
405 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
406 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
407 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
408 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
409 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
410 SystemUptime system_uptime = 10015 [(module) = "framework"];
411 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
412 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000413 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800414 RemainingBatteryCapacity remaining_battery_capacity = 10019;
415 FullBatteryCapacity full_battery_capacity = 10020;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800416 Temperature temperature = 10021 [(module) = "framework"];
417 BinderCalls binder_calls = 10022 [(module) = "framework"];
418 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
419 LooperStats looper_stats = 10024 [(module) = "framework"];
420 DiskStats disk_stats = 10025 [(module) = "framework"];
421 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
422 AppSize app_size = 10027 [(module) = "framework"];
423 CategorySize category_size = 10028 [(module) = "framework"];
424 ProcStats proc_stats = 10029 [(module) = "framework"];
Bookatz17f0d8a2018-09-13 12:56:32 -0700425 BatteryVoltage battery_voltage = 10030;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800426 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
427 DiskIo disk_io = 10032 [(module) = "framework"];
428 PowerProfile power_profile = 10033 [(module) = "framework"];
429 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
430 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
431 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700432 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
434 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
435 10040 [(module) = "framework"];
436 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
437 10041 [(module) = "framework"];
438 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800439 BatteryLevel battery_level = 10043;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800440 BuildInformation build_information = 10044 [(module) = "framework"];
Maggie White8735b852019-01-18 11:40:49 -0800441 BatteryCycleCount battery_cycle_count = 10045;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800442 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
443 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
444 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
445 RoleHolder role_holder = 10049 [(module) = "framework"];
446 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800447 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
449 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800450 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
451 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
453 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
454 FaceSettings face_settings = 10058 [(module) = "framework"];
455 CoolingDevice cooling_device = 10059 [(module) = "framework"];
456 AppOps app_ops = 10060 [(module) = "framework"];
457 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700458 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
459 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800460 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800461 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800462 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
463 DangerousPermissionStateSampled dangerous_permission_state_sampled =
464 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400465 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000466 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700468 }
yroa1fe77c2018-02-26 14:22:54 -0800469
Bookatz76aafcf2018-09-17 16:17:10 -0700470 // DO NOT USE field numbers above 100,000 in AOSP.
471 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
472 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100473
474 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700475}
476
Yao Chend54f9dd2017-10-17 17:37:48 +0000477/**
Yangster-mac20877162017-12-22 17:19:39 -0800478 * This proto represents a node of an attribution chain.
479 * Note: All attribution chains are represented as a repeated field of type
480 * AttributionNode. It is understood that in such arrays, the order is that
481 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000482 */
Yangster-mac20877162017-12-22 17:19:39 -0800483message AttributionNode {
484 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800485 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800486
Yangster-mac20877162017-12-22 17:19:39 -0800487 // The (optional) string tag for an element in the attribution chain. If the
488 // element has no tag, it is encoded as an empty string.
489 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700490}
491
Yangster-mac48b3d622018-08-18 12:38:11 -0700492message KeyValuePair {
493 optional int32 key = 1;
494 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700495 int32 value_int = 2;
496 int64 value_long = 3;
497 string value_str = 4;
498 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700499 }
500}
501
502message KeyValuePairsAtom {
503 optional int32 uid = 1;
504 repeated KeyValuePair pairs = 2;
505}
506
Yao Chend54f9dd2017-10-17 17:37:48 +0000507/*
508 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800509 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000510 *
511 * RULES:
512 * - The field ids for each atom must start at 1, and count upwards by 1.
513 * Skipping field ids is not allowed.
514 * - These form an API, so renaming, renumbering or removing fields is
515 * not allowed between android releases. (This is not currently enforced,
516 * but there will be a tool to enforce this restriction).
517 * - The types must be built-in protocol buffer types, namely, no sub-messages
518 * are allowed (yet). The bytes type is also not allowed.
519 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800520 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000521 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800522 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000523 * - A field that is a uid should be a string field, tagged with the [xxx]
524 * annotation. The generated code on android will be represented by UIDs,
525 * and those UIDs will be translated in xxx to those strings.
526 *
527 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700528 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000529 * - If there is a UID, it goes first. Think in an object-oriented fashion.
530 * *****************************************************************************
531 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700532
Yao Chend54f9dd2017-10-17 17:37:48 +0000533/**
Tej Singha72344992019-04-17 18:55:08 -0700534 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700535 * Logs when the Thermal service HAL notifies the throttling start/stop events.
536 *
537 * Logged from:
538 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
539 */
540message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700541 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700542 optional android.os.TemperatureTypeEnum sensor_type = 1;
543
Maggie White442b6312019-04-05 16:26:44 -0700544 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700545 enum State {
546 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700547 START = 1; // START indicated that throttling was triggered.
548 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700549 }
Yangster-mace16189a2018-08-26 12:20:16 -0700550 optional State state = 2;
551
552 optional float temperature = 3;
553}
554
555/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 * Logs when the screen state changes.
557 *
558 * Logged from:
559 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
560 */
561message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800562 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700563 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700564}
Yao Chend54f9dd2017-10-17 17:37:48 +0000565
566/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700567 * Logs that the process state of the uid, as determined by ActivityManager
568 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 *
570 * Logged from:
571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
572 */
Bookatzc1a050a2017-10-10 15:49:28 -0700573message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700574 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000575
Bookatzdb026a22018-01-10 19:01:56 -0800576 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700577 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000578}
579
580/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700581 * Logs process state change of a process, as per the activity manager.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
585 */
586message ProcessStateChanged {
587 optional int32 uid = 1;
588 optional string process_name = 2;
589 optional string package_name = 3;
590 // TODO: remove this when validation is done
591 optional int64 version = 5;
592 // The state, from frameworks/base/core/proto/android/app/enums.proto.
593 optional android.app.ProcessStateEnum state = 4;
594}
595
596/**
597 * Logs when ActivityManagerService sleep state is changed.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
601 */
602message ActivityManagerSleepStateChanged {
603 // TODO: import frameworks proto
604 enum State {
605 UNKNOWN = 0;
606 ASLEEP = 1;
607 AWAKE = 2;
608 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700609 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700610}
611
612/**
613 * Logs when system memory state changes.
614 *
615 * Logged from:
616 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
617 */
618message MemoryFactorStateChanged {
619 // TODO: import frameworks proto
620 enum State {
621 MEMORY_UNKNOWN = 0;
622 NORMAL = 1; // normal.
623 MODERATE = 2; // moderate memory pressure.
624 LOW = 3; // low memory.
625 CRITICAL = 4; // critical memory.
626
627 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700628 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629}
630
631/**
632 * Logs when app is using too much cpu, according to ActivityManagerService.
633 *
634 * Logged from:
635 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
636 */
637message ExcessiveCpuUsageReported {
638 optional int32 uid = 1;
639 optional string process_name = 2;
640 optional string package_name = 3;
641 // package version. TODO: remove this when validation is done
642 optional int64 version = 4;
643}
644
645/**
646 * Logs when a cached process is killed, along with its pss.
647 *
648 * Logged from:
649 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
650 */
651message CachedKillReported {
652 optional int32 uid = 1;
653 optional string process_name = 2;
654 optional string package_name = 3;
655 // TODO: remove this when validation is done
656 optional int64 version = 5;
657 optional int64 pss = 4;
658}
659
660/**
661 * Logs when memory stats of a process is reported.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
665 */
666message ProcessMemoryStatReported {
667 optional int32 uid = 1;
668 optional string process_name = 2;
669 optional string package_name = 3;
670 //TODO: remove this when validation is done
671 optional int64 version = 9;
672 optional int64 pss = 4;
673 optional int64 uss = 5;
674 optional int64 rss = 6;
675 enum Type {
676 ADD_PSS_INTERNAL_SINGLE = 0;
677 ADD_PSS_INTERNAL_ALL_MEM = 1;
678 ADD_PSS_INTERNAL_ALL_POLL = 2;
679 ADD_PSS_EXTERNAL = 3;
680 ADD_PSS_EXTERNAL_SLOW = 4;
681 }
682 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800683 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700684}
685
686/**
Bookatzc1a050a2017-10-10 15:49:28 -0700687 * Logs that a process started, finished, crashed, or ANRed.
688 *
689 * Logged from:
690 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
691 */
692message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700693 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700694
David Chen0b5c90c2018-01-25 16:51:49 -0800695 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800696 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700697
Bookatzddccf0a2017-11-28 16:48:14 -0800698 // What lifecycle state the process changed to.
699 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800700 enum State {
701 FINISHED = 0;
702 STARTED = 1;
703 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800704 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800705 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700706}
707
Bookatzc1a050a2017-10-10 15:49:28 -0700708/**
709 * Logs when the ble scan state changes.
710 *
711 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700712 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700713 */
714message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700720 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
721 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700722 }
723 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700724
Bookatze5ec0b42018-03-26 13:34:56 -0700725 // Does the scan have a filter.
726 optional bool is_filtered = 3;
727 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
728 optional bool is_first_match = 4;
729 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
730 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700731}
732
733/**
734 * Logs reporting of a ble scan finding results.
735 *
736 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700737 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700738 */
Bookatzae6738e2018-09-13 11:38:56 -0700739// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700740message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800741 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700742
743 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800744 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700745}
746
747/**
748 * Logs when a sensor state changes.
749 *
750 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700751 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700752 */
753message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800754 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700755
Bookatzc1a050a2017-10-10 15:49:28 -0700756 // The id (int) of the sensor.
757 optional int32 sensor_id = 2;
758
759 enum State {
760 OFF = 0;
761 ON = 1;
762 }
763 optional State state = 3;
764}
765
Bookatzc1a050a2017-10-10 15:49:28 -0700766/**
767 * Logs when GPS state changes.
768 *
769 * Logged from:
770 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
771 */
772message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800773 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700774
775 enum State {
776 OFF = 0;
777 ON = 1;
778 }
779 optional State state = 2;
780}
781
Bookatz48d362e2018-11-06 15:49:08 -0800782/**
783 * Logs when GPS signal quality.
784 *
785 * Logged from:
786 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
787 */
788message GpsSignalQualityChanged {
789 optional android.server.location.GpsSignalQualityEnum level = 1;
790}
791
Bookatzc1a050a2017-10-10 15:49:28 -0700792
793/**
794 * Logs when a sync manager sync state changes.
795 *
796 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700797 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700798 */
799message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800800 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700801
David Chen0b5c90c2018-01-25 16:51:49 -0800802 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800803 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700804
805 enum State {
806 OFF = 0;
807 ON = 1;
808 }
809 optional State state = 3;
810}
811
Yangster-mac96353002018-09-05 11:18:55 -0700812/*
813 * Deferred job stats.
814 *
815 * Logged from:
816 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
817*/
818message DeferredJobStatsReported {
819 repeated AttributionNode attribution_node = 1;
820
821 // Number of jobs deferred.
822 optional int32 num_jobs_deferred = 2;
823
824 // Time since the last job runs.
825 optional int64 time_since_last_job_millis = 3;
826}
827
Bookatzc1a050a2017-10-10 15:49:28 -0700828/**
829 * Logs when a job scheduler job state changes.
830 *
831 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700832 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700833 */
834message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800835 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700836
837 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700839
840 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800841 FINISHED = 0;
842 STARTED = 1;
843 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700844 }
845 optional State state = 3;
846
Tej Singh33a412b2018-03-16 18:43:59 -0700847 // The reason a job has stopped.
848 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700849 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700850 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100851
852 // The standby bucket of the app that scheduled the job. These match the framework constants
853 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
854 // already assigned 0.
855 enum Bucket {
856 UNKNOWN = -1;
857 ACTIVE = 0;
858 WORKING_SET = 1;
859 FREQUENT = 2;
860 RARE = 3;
861 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800862 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100863 }
864 optional Bucket standby_bucket = 5 [default = UNKNOWN];
865
866 // The job id (as assigned by the app).
867 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700868}
869
870/**
871 * Logs when the audio state changes.
872 *
873 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700874 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700875 */
876message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800877 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700878
879 enum State {
880 OFF = 0;
881 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700882 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
883 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700884 }
885 optional State state = 2;
886}
887
888/**
889 * Logs when the video codec state changes.
890 *
891 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700892 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700893 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800894message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800895 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700896
897 enum State {
898 OFF = 0;
899 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700900 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
901 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700902 }
903 optional State state = 2;
904}
905
906/**
907 * Logs when the flashlight state changes.
908 *
909 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700910 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700911 */
912message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
915 enum State {
916 OFF = 0;
917 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700918 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
919 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700920 }
921 optional State state = 2;
922}
923
924/**
925 * Logs when the camera state changes.
926 *
927 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700928 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700929 */
930message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800931 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700932
933 enum State {
934 OFF = 0;
935 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700936 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
937 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700938 }
939 optional State state = 2;
940}
941
942/**
943 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000944 *
945 * Logged from:
946 * TODO
947 */
Bookatzd6746242017-10-24 18:39:35 -0700948message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800949 repeated AttributionNode attribution_node = 1
950 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000951
Bookatz1a1b0462018-01-12 11:47:03 -0800952 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
953 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800954 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
955 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700956
957 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800958 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700959
960 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800961 RELEASE = 0;
962 ACQUIRE = 1;
963 CHANGE_RELEASE = 2;
964 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700965 }
tsaichristineed615642020-01-02 12:53:41 -0800966 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700967}
968
969/**
Bookatzc1a050a2017-10-10 15:49:28 -0700970 * Logs when a partial wakelock is considered 'long' (over 1 min).
971 *
972 * Logged from:
973 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
974 */
975message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800976 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700977
Yao Chend54f9dd2017-10-17 17:37:48 +0000978 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
979 optional string tag = 2;
980
Bookatzc1a050a2017-10-10 15:49:28 -0700981 // TODO: I have no idea what this is.
982 optional string history_tag = 3;
983
984 enum State {
985 OFF = 0;
986 ON = 1;
987 }
988 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000989}
990
Bookatzc1a050a2017-10-10 15:49:28 -0700991/**
Bookatza66083f2018-09-20 17:24:00 -0700992 * Logs when the device is interactive, according to the PowerManager Notifier.
993 *
994 * Logged from:
995 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
996 */
997message InteractiveStateChanged {
998 enum State {
999 OFF = 0;
1000 ON = 1;
1001 }
1002 optional State state = 1;
1003}
1004
1005/**
Bookatzc1a050a2017-10-10 15:49:28 -07001006 * Logs Battery Saver state change.
1007 *
1008 * Logged from:
1009 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1010 */
1011message BatterySaverModeStateChanged {
1012 enum State {
1013 OFF = 0;
1014 ON = 1;
1015 }
1016 optional State state = 1;
1017}
1018
1019/**
1020 * Logs Doze mode state change.
1021 *
1022 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001023 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001024 */
1025message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001026 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001027}
1028
1029
1030/**
1031 * Logs state change of Doze mode including maintenance windows.
1032 *
1033 * Logged from:
1034 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1035 */
1036message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001037 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001038}
1039
1040/**
1041 * Logs screen brightness level.
1042 *
1043 * Logged from:
1044 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1045 */
1046message ScreenBrightnessChanged {
1047 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1048 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001049}
1050
1051/**
1052 * Logs battery level (percent full, from 0 to 100).
1053 *
1054 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001055 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001056 */
1057message BatteryLevelChanged {
1058 // Battery level. Should be in [0, 100].
1059 optional int32 battery_level = 1;
1060}
1061
1062/**
1063 * Logs change in charging status of the device.
1064 *
1065 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001066 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001067 */
1068message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001069 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1070 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001071}
1072
1073/**
1074 * Logs whether the device is plugged in, and what power source it is using.
1075 *
1076 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001077 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001078 */
1079message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001080 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1081 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001082}
1083
Bookatz8c6571b2017-10-24 15:04:41 -07001084/**
1085 * Logs when an app's wakeup alarm fires.
1086 *
1087 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001088 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001089 */
1090message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001091 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001092
1093 // Name of the wakeup alarm.
1094 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001095
1096 // Name of source package (for historical reasons, since BatteryStats tracked it).
1097 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001098
1099 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1100 enum Bucket {
1101 UNKNOWN = 0;
1102 EXEMPTED = 5;
1103 ACTIVE = 10;
1104 WORKING_SET = 20;
1105 FREQUENT = 30;
1106 RARE = 40;
1107 NEVER = 50;
1108 }
1109 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1110 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001111}
1112
1113/**
1114 * Logs when an an app causes the mobile radio to change state.
1115 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1116 *
1117 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001118 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001119 */
1120message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001121 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001122
Bookatz1a1b0462018-01-12 11:47:03 -08001123 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1124 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001125}
1126
1127/**
1128 * Logs when an an app causes the wifi radio to change state.
1129 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1130 *
1131 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001132 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001133 */
1134message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001135 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001136
Bookatz1a1b0462018-01-12 11:47:03 -08001137 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1138 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001139}
1140
1141/**
1142 * Logs kernel wakeup reasons and aborts.
1143 *
1144 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001145 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001146 */
1147message KernelWakeupReported {
1148 // Name of the kernel wakeup reason (or abort).
1149 optional string wakeup_reason_name = 1;
1150
1151 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001152 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001153}
1154
1155/**
Bookatzda1798c2018-12-13 14:16:00 -08001156 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001157 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001158 *
1159 * Logged from:
1160 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1161 */
1162message WifiEnabledStateChanged {
1163 enum State {
1164 OFF = 0;
1165 ON = 1;
1166 }
1167 optional State state = 1;
1168}
1169
1170/**
1171 * 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 -08001172 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1173 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001174 *
1175 * Logged from:
1176 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1177 */
1178message WifiRunningStateChanged {
1179 repeated AttributionNode attribution_node = 1;
1180
1181 enum State {
1182 OFF = 0;
1183 ON = 1;
1184 }
1185 optional State state = 2;
1186}
1187
1188/**
Bookatze5885242017-10-24 20:10:31 -07001189 * Logs wifi locks held by an app.
1190 *
1191 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001192 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001193 */
1194message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001195 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001196
1197 enum State {
1198 OFF = 0;
1199 ON = 1;
1200 }
1201 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001202
1203 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1204 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001205}
1206
1207/**
1208 * Logs wifi signal strength changes.
1209 *
1210 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001211 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001212 */
1213message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001214 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1215 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001216}
1217
1218/**
1219 * Logs wifi scans performed by an app.
1220 *
1221 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001222 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001223 */
1224message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001225 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001226
1227 enum State {
1228 OFF = 0;
1229 ON = 1;
1230 }
1231 optional State state = 2;
1232}
1233
1234/**
Tej Singh4503e102018-01-04 14:35:01 -08001235 * Logs wifi multicast locks held by an app
1236 *
1237 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001238 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001239 */
1240message WifiMulticastLockStateChanged {
1241 repeated AttributionNode attribution_node = 1;
1242
1243 enum State {
1244 OFF = 0;
1245 ON = 1;
1246 }
1247 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001248
1249 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001250}
1251
1252/**
Tej Singh1ea42892018-01-19 09:27:00 -08001253 * Logs shutdown reason and duration on next boot.
1254 *
1255 * Logged from:
1256 * frameworks/base/core/java/com/android/server/BootReceiver.java
1257 */
1258message ShutdownSequenceReported {
1259 // True if shutdown is for a reboot. Default: false if we do not know.
1260 optional bool reboot = 1;
1261
1262 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1263 optional string reason = 2;
1264
1265 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1266 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001267 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001268
1269 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001270 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001271}
1272
Tej Singh6483ea42018-01-25 17:45:49 -08001273
1274/**
1275 * Logs boot reason and duration.
1276 *
1277 * Logged from:
1278 * system/core/bootstat/bootstat.cpp
1279 */
1280message BootSequenceReported {
1281 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1282 // Default: "<EMPTY>" if not available.
1283 optional string bootloader_reason = 1;
1284
1285 // Reason for system boot. Eg. bootloader, reboot,userrequested
1286 // Default: "<EMPTY>" if not available.
1287 optional string system_reason = 2;
1288
1289 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001290 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001291
1292 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001293 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001294
1295 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001296 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001297
1298 // Time since last boot in ms. Default: 0 if not available.
1299 optional int64 time_since_last_boot = 6;
1300}
1301
Tej Singhc477d9c2018-02-05 18:31:39 -08001302
1303/**
1304 * Logs call state and disconnect cause (if applicable).
1305 *
1306 * Logged from:
1307 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1308 */
1309message CallStateChanged {
1310 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1311 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1312 optional android.telecom.CallStateEnum call_state = 1;
1313
1314 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1315 // This value is only applicable when the call_state is DISCONNECTED, and
1316 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1317 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1318 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1319
1320 // True if the call is self-managed, which are apps that use the
1321 // telecom infrastructure to make their own calls.
1322 optional bool self_managed = 3;
1323
1324 // True if call is external. External calls are calls on connected Wear
1325 // devices but show up in Telecom so the user can pull them onto the device.
1326 optional bool external_call = 4;
1327}
1328
Tej Singh1ea42892018-01-19 09:27:00 -08001329/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001330 * Logs keyguard state. The keyguard is the lock screen.
1331 *
1332 * Logged from:
1333 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1334 */
1335message KeyguardStateChanged {
1336 enum State {
1337 UNKNOWN = 0;
1338 // The keyguard is hidden when the phone is unlocked.
1339 HIDDEN = 1;
1340 // The keyguard is shown when the phone is locked (screen turns off).
1341 SHOWN= 2;
1342 // The keyguard is occluded when something is overlaying the keyguard.
1343 // Eg. Opening the camera while on the lock screen.
1344 OCCLUDED = 3;
1345 }
1346 optional State state = 1;
1347}
1348
1349/**
1350 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1351 * prompts the user to enter a password (pattern, pin, etc).
1352 *
1353 * Logged from:
1354 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1355 */
1356
1357message KeyguardBouncerStateChanged {
1358 enum State {
1359 UNKNOWN = 0;
1360 // Bouncer is hidden, either as a result of successfully entering the
1361 // password, screen timing out, or user going back to lock screen.
1362 HIDDEN = 1;
1363 // This is when the user is being prompted to enter the password.
1364 SHOWN = 2;
1365 }
1366 optional State state = 1;
1367}
1368
1369/**
1370 * Logs the result of entering a password into the keyguard bouncer.
1371 *
1372 * Logged from:
1373 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1374 */
1375message KeyguardBouncerPasswordEntered {
1376 enum BouncerResult {
1377 UNKNOWN = 0;
1378 // The password entered was incorrect.
1379 FAILURE = 1;
1380 // The password entered was correct.
1381 SUCCESS = 2;
1382 }
1383 optional BouncerResult result = 1;
1384}
1385
Tej Singha883b372018-02-15 11:30:01 -08001386/*
1387 * Logs changes to the configuration of the device. The configuration is defined
1388 * in frameworks/base/core/java/android/content/res/Configuration.java
1389 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1390 * Please go there to interpret the possible values each field can be.
1391 *
1392 * Logged from:
1393 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1394 */
1395message ResourceConfigurationChanged {
1396 // Bit mask of color capabilities of the screen.
1397 // Contains information about the color gamut and hdr mode of the screen.
1398 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001399 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001400
1401 // The target screen density being rendered to.
1402 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001403 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001404
1405 // Current user preference for the scaling factor for fonts,
1406 // relative to the base density scaling.
1407 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001408 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001409
1410 // Flag indicating whether the hard keyboard is hidden.
1411 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001412 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001413
1414 // The type of keyboard attached to the device.
1415 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1416 optional int32 keyboard = 5;
1417
1418 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1419 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001420 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001421
1422 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1423 // 0 if undefined.
1424 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1425 optional int32 mcc = 7;
1426
1427 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1428 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1429 // MNC_ZERO symbol defined in Configuration.java.
1430 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1431 optional int32 mnc = 8;
1432
1433 // The kind of navigation available on the device.
1434 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1435 optional int32 navigation = 9;
1436
1437 // Flag indicating whether the navigation is available.
1438 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001439 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001440
1441 // Overall orientation of the screen.
1442 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1443 optional int32 orientation = 11;
1444
1445 // The current height of the available screen space, in dp units.
1446 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001447 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001448
1449 // Bit mask of overall layout of the screen.
1450 // Contains information about screen size, whether the screen is wider/taller
1451 // than normal, whether the screen layout is right-tl-left or left-to-right,
1452 // and whether the screen has a rounded shape.
1453 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001454 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001455
1456 // Current width of the available screen space, in dp units.
1457 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001458 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001459
1460 // The smallest screen size an application will see in normal operation.
1461 // This is the smallest value of both screenWidthDp and screenHeightDp
1462 // in portrait and landscape.
1463 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001464 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001465
1466 // The type of touch screen attached to the device.
1467 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1468 optional int32 touchscreen = 16;
1469
1470 // Bit mask of the ui mode.
1471 // Contains information about the overall ui mode of the device.
1472 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1473 // Also contains information about whether the device is in night mode.
1474 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001475 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001476}
1477
Tej Singheee317b2018-03-07 19:28:05 -08001478
1479/**
1480 * Logs changes in the connection state of the mobile radio.
1481 *
1482 * Logged from:
1483 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1484 */
1485message MobileConnectionStateChanged {
1486 // States are from the state machine DataConnection.java.
1487 enum State {
1488 UNKNOWN = 0;
1489 // The connection is inactive, or disconnected.
1490 INACTIVE = 1;
1491 // The connection is being activated, or connecting.
1492 ACTIVATING = 2;
1493 // The connection is active, or connected.
1494 ACTIVE = 3;
1495 // The connection is disconnecting.
1496 DISCONNECTING = 4;
1497 // The connection is disconnecting after creating a connection.
1498 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1499 }
1500 optional State state = 1;
1501 // For multi-sim phones, this distinguishes between the sim cards.
1502 optional int32 sim_slot_index = 2;
1503 // Used to identify the connection. Starts at 0 and increments by 1 for
1504 // every new network created. Resets whenever the device reboots.
1505 optional int32 data_connection_id = 3;
1506 // A bitmask for the capabilities of this connection.
1507 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1508 // Default value (if we have no information): 0
1509 optional int64 capabilities = 4;
1510 // If this connection has internet.
1511 // This just checks if the DEFAULT bit of capabilities is set.
1512 optional bool has_internet = 5;
1513}
1514
1515/**
1516 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1517 *
1518 * Logged from:
1519 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1520 */
1521message MobileRadioTechnologyChanged {
1522 optional android.telephony.NetworkTypeEnum state = 1;
1523 // For multi-sim phones, this distinguishes between the sim cards.
1524 optional int32 sim_slot_index = 2;
1525}
1526
Andrew Chantb56388b2018-03-22 21:07:33 -07001527/**
1528 * Logs the VID and PID of any connected USB devices.
1529 *
1530 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1531 *
1532 * Logged by Vendor.
1533 */
1534message UsbDeviceAttached {
1535 optional int32 vid = 1;
1536 optional int32 pid = 2;
1537 optional bool has_audio = 3;
1538 optional bool has_hid = 4;
1539 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001540 enum State {
1541 STATE_DISCONNECTED = 0;
1542 STATE_CONNECTED = 1;
1543 }
1544 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001545 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001546}
1547
Tej Singheee317b2018-03-07 19:28:05 -08001548
Tej Singhdd7bd352018-02-09 19:33:15 -08001549/**
Tej Singh5d991e12018-03-09 19:48:11 -08001550 * Logs when Bluetooth is enabled and disabled.
1551 *
1552 * Logged from:
1553 * services/core/java/com/android/server/BluetoothManagerService.java
1554 */
1555message BluetoothEnabledStateChanged {
1556 repeated AttributionNode attribution_node = 1;
1557 // Whether or not bluetooth is enabled on the device.
1558 enum State {
1559 UNKNOWN = 0;
1560 ENABLED = 1;
1561 DISABLED = 2;
1562 }
1563 optional State state = 2;
1564 // The reason for being enabled/disabled.
1565 // Eg. Airplane mode, crash, application request.
1566 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1567 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001568 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001569}
1570
1571/**
Jack Hed9837c82019-01-09 01:19:13 -08001572 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001573 *
1574 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001575 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1576 *
1577 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001578 */
1579message BluetoothConnectionStateChanged {
1580 // The state of the connection.
1581 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1582 optional android.bluetooth.ConnectionStateEnum state = 1;
1583 // An identifier that can be used to match connect and disconnect events.
1584 // Currently is last two bytes of a hash of a device level ID and
1585 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001586 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001587 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001588 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1589 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001590 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001591 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001592 // An identifier that can be used to match events for this device.
1593 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1594 // Salt: Randomly generated 256 bit value
1595 // Hash algorithm: HMAC-SHA256
1596 // Size: 32 byte
1597 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001598 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001599}
1600
1601/**
1602 * Logs when a Bluetooth device connects and disconnects over ACL
1603 *
1604 * Logged from:
1605 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1606 *
1607 * Next Tag: 3
1608 */
1609message BluetoothAclConnectionStateChanged {
1610 // An identifier that can be used to match events for this device.
1611 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1612 // Salt: Randomly generated 256 bit value
1613 // Hash algorithm: HMAC-SHA256
1614 // Size: 32 byte
1615 // Default: null or empty if the device identifier is not known
1616 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1617 // The state of the connection.
1618 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1619 optional android.bluetooth.ConnectionStateEnum state = 2;
1620}
1621
1622/**
1623 * Logs when a Bluetooth device connects and disconnects over SCO
1624 *
1625 * Logged from:
1626 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1627 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1628 *
1629 * Next Tag: 4
1630 */
1631message BluetoothScoConnectionStateChanged {
1632 // An identifier that can be used to match events for this device.
1633 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1634 // Salt: Randomly generated 256 bit value
1635 // Hash algorithm: HMAC-SHA256
1636 // Size: 32 byte
1637 // Default: null or empty if the device identifier is not known
1638 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1639 // The state of the connection.
1640 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1641 optional android.bluetooth.ConnectionStateEnum state = 2;
1642 // Codec used for this SCO connection
1643 // Default: UNKNOWN
1644 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001645}
1646
Jack Hec27040a2019-01-09 20:54:41 -08001647/**
1648 * Logged when active device of a profile changes
1649 *
1650 * Logged from:
1651 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1652 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1653 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1654 */
1655message BluetoothActiveDeviceChanged {
1656 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1657 // From android.bluetooth.BluetoothProfile
1658 optional int32 bt_profile = 1;
1659 // An identifier that can be used to match events for this new active device.
1660 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1661 // Salt: Randomly generated 256 bit value
1662 // Hash algorithm: HMAC-SHA256
1663 // Size: 32 byte
1664 // Default: null or empty if there is no active device for this profile
1665 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1666}
1667
Jack Heab86dbd22018-12-18 15:43:27 -08001668// Logs when there is an event affecting Bluetooth device's link layer connection.
1669// - This event is triggered when there is a related HCI command or event
1670// - Users of this metrics can deduce Bluetooth device's connection state from these events
1671// - HCI commands are logged before the command is sent, after receiving command status, and after
1672// receiving command complete
1673// - HCI events are logged when they arrive
1674//
1675// Low level log from system/bt
1676//
1677// Bluetooth classic commands:
1678// - CMD_CREATE_CONNECTION
1679// - CMD_DISCONNECT
1680// - CMD_CREATE_CONNECTION_CANCEL
1681// - CMD_ACCEPT_CONNECTION_REQUEST
1682// - CMD_REJECT_CONNECTION_REQUEST
1683// - CMD_SETUP_ESCO_CONNECTION
1684// - CMD_ACCEPT_ESCO_CONNECTION
1685// - CMD_REJECT_ESCO_CONNECTION
1686// - CMD_ENH_SETUP_ESCO_CONNECTION
1687// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1688//
1689// Bluetooth low energy commands:
1690// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1691// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1692// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1693// - CMD_BLE_CLEAR_WHITE_LIST
1694// - CMD_BLE_ADD_WHITE_LIST
1695// - CMD_BLE_REMOVE_WHITE_LIST
1696//
1697// Bluetooth classic events:
1698// - EVT_CONNECTION_COMP
1699// - EVT_CONNECTION_REQUEST
1700// - EVT_DISCONNECTION_COMP
1701// - EVT_ESCO_CONNECTION_COMP
1702// - EVT_ESCO_CONNECTION_CHANGED
1703//
1704// Bluetooth low energy meta events:
1705// - BLE_EVT_CONN_COMPLETE_EVT
1706// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1707//
1708// Next tag: 10
1709message BluetoothLinkLayerConnectionEvent {
1710 // An identifier that can be used to match events for this device.
1711 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1712 // Salt: Randomly generated 256 bit value
1713 // Hash algorithm: HMAC-SHA256
1714 // Size: 32 byte
1715 // Default: null or empty if the device identifier is not known
1716 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1717 // Connection handle of this connection if available
1718 // Range: 0x0000 - 0x0EFF (12 bits)
1719 // Default: 0xFFFF if the handle is unknown
1720 optional int32 connection_handle = 2;
1721 // Direction of the link
1722 // Default: DIRECTION_UNKNOWN
1723 optional android.bluetooth.DirectionEnum direction = 3;
1724 // Type of this link
1725 // Default: LINK_TYPE_UNKNOWN
1726 optional android.bluetooth.LinkTypeEnum type = 4;
1727
1728 // Reason metadata for this link layer connection event, rules for interpretation:
1729 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1730 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1731 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1732 // set and valid, ignore hci_ble_event
1733
1734 // HCI command associated with this event
1735 // Default: CMD_UNKNOWN
1736 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1737 // HCI event associated with this event
1738 // Default: EVT_UNKNOWN
1739 optional android.bluetooth.hci.EventEnum hci_event = 6;
1740 // HCI BLE meta event associated with this event
1741 // Default: BLE_EVT_UNKNOWN
1742 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1743 // HCI command status code if this is triggerred by hci_cmd
1744 // Default: STATUS_UNKNOWN
1745 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1746 // HCI reason code associated with this event
1747 // Default: STATUS_UNKNOWN
1748 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1749}
1750
Howard Roe103fe22019-01-17 16:52:16 -08001751/**
1752 * Logs when a module is rolled back by Watchdog.
1753 *
1754 * Logged from: Rollback Manager
1755 */
1756message WatchdogRollbackOccurred {
1757 enum RollbackType {
1758 UNKNOWN = 0;
1759 ROLLBACK_INITIATE = 1;
1760 ROLLBACK_SUCCESS = 2;
1761 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001762 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001763 }
1764 optional RollbackType rollback_type = 1;
1765
1766 optional string package_name = 2;
1767
1768 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001769
1770 enum RollbackReasonType {
1771 REASON_UNKNOWN = 0;
1772 REASON_NATIVE_CRASH = 1;
1773 REASON_EXPLICIT_HEALTH_CHECK = 2;
1774 REASON_APP_CRASH = 3;
1775 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001776 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001777 }
1778 optional RollbackReasonType rollback_reason = 4;
1779
1780 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1781 // is initiated. Empty if the package is unknown.
1782 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001783}
1784
Jack Hec27040a2019-01-09 20:54:41 -08001785/**
1786 * Logs when there is a change in Bluetooth A2DP playback state
1787 *
1788 * Logged from:
1789 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1790 */
1791message BluetoothA2dpPlaybackStateChanged {
1792 // An identifier that can be used to match events for this device.
1793 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1794 // Salt: Randomly generated 256 bit value
1795 // Hash algorithm: HMAC-SHA256
1796 // Size: 32 byte
1797 // Default: null or empty if the device identifier is not known
1798 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1799 // Current playback state
1800 // Default: PLAYBACK_STATE_UNKNOWN
1801 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1802 // Current audio coding mode
1803 // Default: AUDIO_CODING_MODE_UNKNOWN
1804 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1805}
1806
1807/**
1808 * Logs when there is a change in A2DP codec config for a particular remote device
1809 *
1810 * Logged from:
1811 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1812 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1813 */
1814message BluetoothA2dpCodecConfigChanged {
1815 // An identifier that can be used to match events for this device.
1816 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1817 // Salt: Randomly generated 256 bit value
1818 // Hash algorithm: HMAC-SHA256
1819 // Size: 32 byte
1820 // Default: null or empty if the device identifier is not known
1821 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1822 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1823 // Default SOURCE_CODEC_TYPE_INVALID
1824 optional int32 codec_type = 2;
1825 // Codec priroity, the higher the more preferred, -1 for disabled
1826 // Default: CODEC_PRIORITY_DEFAULT
1827 optional int32 codec_priority = 3;
1828 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1829 // Default: SAMPLE_RATE_NONE
1830 optional int32 sample_rate = 4;
1831 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1832 // Default: BITS_PER_SAMPLE_NONE
1833 optional int32 bits_per_sample = 5;
1834 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1835 // Default: CHANNEL_MODE_NONE
1836 optional int32 channel_mode = 6;
1837 // Codec specific values
1838 // Default 0
1839 optional int64 codec_specific_1 = 7;
1840 optional int64 codec_specific_2 = 8;
1841 optional int64 codec_specific_3 = 9;
1842 optional int64 codec_specific_4 = 10;
1843}
1844
1845/**
1846 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1847 * Each codec's capability is logged separately due to statsd restriction
1848 *
1849 * Logged from:
1850 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1851 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1852 */
1853message BluetoothA2dpCodecCapabilityChanged {
1854 // An identifier that can be used to match events for this device.
1855 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1856 // Salt: Randomly generated 256 bit value
1857 // Hash algorithm: HMAC-SHA256
1858 // Size: 32 byte
1859 // Default: null or empty if the device identifier is not known
1860 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1861 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1862 // Default SOURCE_CODEC_TYPE_INVALID
1863 optional int32 codec_type = 2;
1864 // Codec priroity, the higher the more preferred, -1 for disabled
1865 // Default: CODEC_PRIORITY_DEFAULT
1866 optional int32 codec_priority = 3;
1867 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1868 // in BluetoothCodecConfig
1869 // Default: empty and SAMPLE_RATE_NONE for individual item
1870 optional int32 sample_rate = 4;
1871 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1872 // in BluetoothCodecConfig
1873 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1874 optional int32 bits_per_sample = 5;
1875 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1876 // BluetoothCodecConfig
1877 // Default: empty and CHANNEL_MODE_NONE for individual item
1878 optional int32 channel_mode = 6;
1879 // Codec specific values
1880 // Default 0
1881 optional int64 codec_specific_1 = 7;
1882 optional int64 codec_specific_2 = 8;
1883 optional int64 codec_specific_3 = 9;
1884 optional int64 codec_specific_4 = 10;
1885}
1886
1887/**
1888 * Logs when A2DP failed to read from PCM source.
1889 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1890 *
1891 * Logged from:
1892 * system/bt
1893 */
1894message BluetoothA2dpAudioUnderrunReported {
1895 // An identifier that can be used to match events for this device.
1896 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1897 // Salt: Randomly generated 256 bit value
1898 // Hash algorithm: HMAC-SHA256
1899 // Size: 32 byte
1900 // Default: null or empty if the device identifier is not known
1901 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1902 // Encoding interval in nanoseconds
1903 // Default: 0
1904 optional int64 encoding_interval_nanos = 2;
1905 // Number of bytes of PCM data that could not be read from the source
1906 // Default: 0
1907 optional int32 num_missing_pcm_bytes = 3;
1908}
1909
1910/**
1911 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1912 * buffer queue is full and we have to drop data
1913 *
1914 * Logged from:
1915 * system/bt
1916 */
1917message BluetoothA2dpAudioOverrunReported {
1918 // An identifier that can be used to match events for this device.
1919 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1920 // Salt: Randomly generated 256 bit value
1921 // Hash algorithm: HMAC-SHA256
1922 // Size: 32 byte
1923 // Default: null or empty if the device identifier is not known
1924 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1925 // Encoding interval in nanoseconds
1926 // Default: 0
1927 optional int64 encoding_interval_nanos = 2;
1928 // Number of buffers dropped in this event
1929 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1930 // Default: 0
1931 optional int32 num_dropped_buffers = 3;
1932 // Number of encoded buffers dropped in this event
1933 // Default 0
1934 optional int32 num_dropped_encoded_frames = 4;
1935 // Number of encoded bytes dropped in this event
1936 // Default: 0
1937 optional int32 num_dropped_encoded_bytes = 5;
1938}
1939
1940/**
1941 * Logs when we receive reports regarding a device's RSSI value
1942 *
1943 * Logged from:
1944 * system/bt
1945 */
1946message BluetoothDeviceRssiReported {
1947 // An identifier that can be used to match events for this device.
1948 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1949 // Salt: Randomly generated 256 bit value
1950 // Hash algorithm: HMAC-SHA256
1951 // Size: 32 byte
1952 // Default: null or empty if the device identifier is not known
1953 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1954 // Connection handle of this connection if available
1955 // Range: 0x0000 - 0x0EFF (12 bits)
1956 // Default: 0xFFFF if the handle is unknown
1957 optional int32 connection_handle = 2;
1958 // HCI command status code if this is triggerred by hci_cmd
1959 // Default: STATUS_UNKNOWN
1960 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1961 // BR/EDR
1962 // Range: -128 ≤ N ≤ 127 (signed integer)
1963 // Units: dB
1964 // LE:
1965 // Range: -127 to 20, 127 (signed integer)
1966 // Units: dBm
1967 // Invalid when an out of range value is reported
1968 optional int32 rssi = 4;
1969}
1970
1971/**
1972 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1973 *
1974 * Logged from:
1975 * system/bt
1976 */
1977message BluetoothDeviceFailedContactCounterReported {
1978 // An identifier that can be used to match events for this device.
1979 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1980 // Salt: Randomly generated 256 bit value
1981 // Hash algorithm: HMAC-SHA256
1982 // Size: 32 byte
1983 // Default: null or empty if the device identifier is not known
1984 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1985 // Connection handle of this connection if available
1986 // Range: 0x0000 - 0x0EFF (12 bits)
1987 // Default: 0xFFFF if the handle is unknown
1988 optional int32 connection_handle = 2;
1989 // HCI command status code if this is triggerred by hci_cmd
1990 // Default: STATUS_UNKNOWN
1991 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1992 // Number of consecutive failed contacts for a connection corresponding to the Handle
1993 // Range: uint16_t, 0-0xFFFF
1994 // Default: 0xFFFFF
1995 optional int32 failed_contact_counter = 4;
1996}
1997
1998/**
1999 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2000 *
2001 * Logged from:
2002 * system/bt
2003 */
2004message BluetoothDeviceTxPowerLevelReported {
2005 // An identifier that can be used to match events for this device.
2006 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2007 // Salt: Randomly generated 256 bit value
2008 // Hash algorithm: HMAC-SHA256
2009 // Size: 32 byte
2010 // Default: null or empty if the device identifier is not known
2011 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2012 // Connection handle of this connection if available
2013 // Range: 0x0000 - 0x0EFF (12 bits)
2014 // Default: 0xFFFF if the handle is unknown
2015 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002016 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002017 // Default: STATUS_UNKNOWN
2018 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2019 // Range: -30 ≤ N ≤ 20
2020 // Units: dBm
2021 // Invalid when an out of range value is reported
2022 optional int32 transmit_power_level = 4;
2023}
Jack Heab86dbd22018-12-18 15:43:27 -08002024
Tej Singh5d991e12018-03-09 19:48:11 -08002025/**
Jack He1021a612019-01-20 21:22:46 -08002026 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2027 * receiving an HCI command from the host
2028 *
2029 * Logged from: system/bt
2030 */
2031message BluetoothHciTimeoutReported {
2032 // HCI command associated with this event
2033 // Default: CMD_UNKNOWN
2034 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2035}
2036
2037/**
2038 * Logs when we receive Bluetooth Link Quality Report event from the controller
2039 * See Android Bluetooth HCI specification for more details
2040 *
2041 * Note: all count and bytes field are counted since last event
2042 *
2043 * Logged from: system/bt
2044 */
2045message BluetoothQualityReportReported {
2046 // Quality report ID
2047 // Original type: uint8_t
2048 // Default: BQR_ID_UNKNOWN
2049 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2050 // Packet type of the connection
2051 // Original type: uint8_t
2052 // Default: BQR_PACKET_TYPE_UNKNOWN
2053 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2054 // Connection handle of the connection
2055 // Original type: uint16_t
2056 optional int32 connection_handle = 3;
2057 // Performing Role for the connection
2058 // Original type: uint8_t
2059 optional int32 connection_role = 4;
2060 // Current Transmit Power Level for the connection. This value is the same as the controller's
2061 // response to the HCI_Read_Transmit_Power_Level HCI command
2062 // Original type: uint8_t
2063 optional int32 tx_power_level = 5;
2064 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2065 // absolute receiver signal strength value
2066 // Original type: int8_t
2067 optional int32 rssi = 6;
2068 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2069 // channels used by the link currently
2070 // Original type: uint8_t
2071 optional int32 snr = 7;
2072 // Indicates the number of unused channels in AFH_channel_map
2073 // Original type: uint8_t
2074 optional int32 unused_afh_channel_count = 8;
2075 // Indicates the number of the channels which are interfered and quality is bad but are still
2076 // selected for AFH
2077 // Original type: uint8_t
2078 optional int32 afh_select_unideal_channel_count = 9;
2079 // Current Link Supervision Timeout Setting
2080 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2081 // Original type: uint16_t
2082 optional int32 lsto = 10;
2083 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2084 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2085 // 0x01 (Piconet Clock)
2086 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2087 // Original type: uint32_t
2088 optional int64 connection_piconet_clock = 11;
2089 // The count of retransmission
2090 // Original type: uint32_t
2091 optional int64 retransmission_count = 12;
2092 // The count of no RX
2093 // Original type: uint32_t
2094 optional int64 no_rx_count = 13;
2095 // The count of NAK (Negative Acknowledge)
2096 // Original type: uint32_t
2097 optional int64 nak_count = 14;
2098 // Controller timestamp of last TX ACK
2099 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2100 // Original type: uint32_t
2101 optional int64 last_tx_ack_timestamp = 15;
2102 // The count of Flow-off (STOP)
2103 // Original type: uint32_t
2104 optional int64 flow_off_count = 16;
2105 // Controller timestamp of last Flow-on (GO)
2106 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2107 // Original type: uint32_t
2108 optional int64 last_flow_on_timestamp = 17;
2109 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2110 // Original type: uint32_t
2111 optional int64 buffer_overflow_bytes = 18;
2112 // Buffer underflow count (in byte) since last event
2113 // Original type: uint32_t
2114 optional int64 buffer_underflow_bytes = 19;
2115}
2116
2117/**
2118 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2119 *
2120 * Notes:
2121 * - Each event can be partially filled as we might learn different pieces of device
2122 * information at different time
2123 * - Multiple device info events can be combined to give more complete picture
2124 * - When multiple device info events tries to describe the same information, the
2125 * later one wins
2126 *
2127 * Logged from:
2128 * packages/apps/Bluetooth
2129 */
Jack Heaea26982019-04-04 11:19:48 -07002130message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Where is this device info obtained from
2139 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2140 // Name of the data source
2141 // For EXTERNAL: package name of the data source
2142 // For INTERNAL: null for general case, component name otherwise
2143 optional string source_name = 3;
2144 // Name of the manufacturer of this device
2145 optional string manufacturer = 4;
2146 // Model of this device
2147 optional string model = 5;
2148 // Hardware version of this device
2149 optional string hardware_version = 6;
2150 // Software version of this device
2151 optional string software_version = 7;
2152}
2153
2154/**
2155 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2156 * device, as documented by the Bluetooth Core HCI specification
2157 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2158 * Vol 2, Part E, Page 1118
2159 *
2160 * Logged from:
2161 * system/bt
2162 */
2163message BluetoothRemoteVersionInfoReported {
2164 // Connection handle of the connection
2165 // Original type: uint16_t
2166 optional int32 connection_handle = 1;
2167 // HCI command status code
2168 // Default: STATUS_UNKNOWN
2169 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2170 // 1 byte Version of current LMP in the remote controller
2171 optional int32 lmp_version = 3;
2172 // 2 bytes LMP manufacturer code of the remote controller
2173 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2174 optional int32 lmp_manufacturer_code = 4;
2175 // 4 bytes subversion of the LMP in the remote controller
2176 optional int32 lmp_subversion = 5;
2177}
2178
2179/**
2180 * Logs when certain Bluetooth SDP attributes are discovered
2181 * Constant definitions are from:
2182 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2183 *
2184 * Current logged attributes:
2185 * - BluetoothProfileDescriptorList
2186 * - Supported Features Bitmask
2187 *
2188 * Logged from:
2189 * system/bt
2190 */
2191message BluetoothSdpAttributeReported {
2192 // An identifier that can be used to match events for this device.
2193 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2194 // Salt: Randomly generated 256 bit value
2195 // Hash algorithm: HMAC-SHA256
2196 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2197 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2198 // Original type: uint16_t
2199 optional int32 protocol_uuid = 2;
2200 // Short form UUIDs used to identify Bluetooth SDP attribute types
2201 // Original type: uint16_t
2202 optional int32 attribute_id = 3;
2203 // Attribute value for the particular attribute
2204 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2205}
2206
2207/**
2208 * Logs when bond state of a Bluetooth device changes
2209 *
2210 * Logged from:
2211 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2212 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2213 */
2214message BluetoothBondStateChanged {
2215 // An identifier that can be used to match events for this device.
2216 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2217 // Salt: Randomly generated 256 bit value
2218 // Hash algorithm: HMAC-SHA256
2219 // Size: 32 byte
2220 // Default: null or empty if the device identifier is not known
2221 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2222 // Preferred transport type to remote dual mode device
2223 // Default: TRANSPORT_AUTO means no preference
2224 optional android.bluetooth.TransportTypeEnum transport = 2;
2225 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2226 // Default: UNKNOWN
2227 optional android.bluetooth.DeviceTypeEnum type = 3;
2228 // Current bond state (NONE, BONDING, BONDED)
2229 // Default: BOND_STATE_UNKNOWN
2230 optional android.bluetooth.BondStateEnum bond_state = 4;
2231 // Bonding sub state
2232 // Default: BOND_SUB_STATE_UNKNOWN
2233 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2234 // Unbond Reason
2235 // Default: UNBOND_REASON_UNKNOWN
2236 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2237}
2238
2239/**
2240 * Logs there is an event related Bluetooth classic pairing
2241 *
2242 * Logged from:
2243 * system/bt
2244 */
2245message BluetoothClassicPairingEventReported {
2246 // An identifier that can be used to match events for this device.
2247 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2248 // Salt: Randomly generated 256 bit value
2249 // Hash algorithm: HMAC-SHA256
2250 // Size: 32 byte
2251 // Default: null or empty if the device identifier is not known
2252 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2253 // Connection handle of this connection if available
2254 // Range: 0x0000 - 0x0EFF (12 bits)
2255 // Default: 0xFFFF if the handle is unknown
2256 optional int32 connection_handle = 2;
2257 // HCI command associated with this event
2258 // Default: CMD_UNKNOWN
2259 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2260 // HCI event associated with this event
2261 // Default: EVT_UNKNOWN
2262 optional android.bluetooth.hci.EventEnum hci_event = 4;
2263 // HCI command status code if this is triggerred by hci_cmd
2264 // Default: STATUS_UNKNOWN
2265 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2266 // HCI reason code associated with this event
2267 // Default: STATUS_UNKNOWN
2268 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002269 // A status value related to this specific event
2270 // Default: 0
2271 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002272}
2273
2274/**
2275 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2276 *
2277 * Logged from:
2278 * system/bt
2279 */
2280message BluetoothSmpPairingEventReported {
2281 // An identifier that can be used to match events for this device.
2282 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2283 // Salt: Randomly generated 256 bit value
2284 // Hash algorithm: HMAC-SHA256
2285 // Size: 32 byte
2286 // Default: null or empty if the device identifier is not known
2287 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2288 // SMP command sent or received over L2CAP
2289 // Default: CMD_UNKNOWN
2290 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2291 // Whether this command is sent or received
2292 // Default: DIRECTION_UNKNOWN
2293 optional android.bluetooth.DirectionEnum direction = 3;
2294 // SMP failure reason code
2295 // Default: PAIRING_FAIL_REASON_DEFAULT
2296 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2297}
2298
2299/**
Jack He815cdba2019-01-30 17:24:55 -08002300 * Logs when a Bluetooth socket’s connection state changed
2301 *
2302 * Logged from:
2303 * system/bt
2304 */
2305message BluetoothSocketConnectionStateChanged {
2306 // An identifier that can be used to match events for this device.
2307 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2308 // Salt: Randomly generated 256 bit value
2309 // Hash algorithm: HMAC-SHA256
2310 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002311 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002312 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002313 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002314 // Default 0 when unknown or don't care
2315 optional int32 port = 2;
2316 // Socket type as mentioned in
2317 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2318 // Default: SOCKET_TYPE_UNKNOWN
2319 optional android.bluetooth.SocketTypeEnum type = 3;
2320 // Socket connection state
2321 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2322 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2323 // Number of bytes sent to remote device during this connection
2324 optional int64 tx_bytes = 5;
2325 // Number of bytes received from remote device during this connection
2326 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002327 // Socket owner's UID
2328 optional int32 uid = 7 [(is_uid) = true];
2329 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2330 // |port| must be spawned by |server_port|
2331 // Default 0 when unknown or don't care
2332 optional int32 server_port = 8;
2333 // Whether this is a server listener socket
2334 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002335}
2336
2337/**
Jack He71426802019-04-02 13:32:52 -07002338 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2339 *
2340 * Logged from:
2341 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2342 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2343 *
2344 */
2345message BluetoothClassOfDeviceReported {
2346 // An identifier that can be used to match events for this device.
2347 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2348 // Salt: Randomly generated 256 bit value
2349 // Hash algorithm: HMAC-SHA256
2350 // Size: 32 byte
2351 // Default: null or empty if this is a server listener socket
2352 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2353 // Class of Device (CoD) value including both Major, Minor device class and service class
2354 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2355 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2356 // Default: 0
2357 optional int32 class_of_device = 2;
2358}
2359
2360/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002361 * Logs when something is plugged into or removed from the USB-C connector.
2362 *
2363 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002364 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002365 */
2366message UsbConnectorStateChanged {
2367 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002368 STATE_DISCONNECTED = 0;
2369 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002370 }
2371 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002372 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002373 // Last active session in ms.
2374 // 0 when the port is in connected state.
2375 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002376}
2377
2378/**
2379 * Logs the reported speaker impedance.
2380 *
2381 * Logged from:
2382 * Vendor audio implementation.
2383 */
2384message SpeakerImpedanceReported {
2385 optional int32 speaker_location = 1;
2386 optional int32 impedance = 2;
2387}
2388
2389/**
2390 * Logs the report of a failed hardware.
2391 *
2392 * Logged from:
2393 * Vendor HALs.
2394 *
2395 */
2396message HardwareFailed {
2397 enum HardwareType {
2398 HARDWARE_FAILED_UNKNOWN = 0;
2399 HARDWARE_FAILED_MICROPHONE = 1;
2400 HARDWARE_FAILED_CODEC = 2;
2401 HARDWARE_FAILED_SPEAKER = 3;
2402 HARDWARE_FAILED_FINGERPRINT = 4;
2403 }
2404 optional HardwareType hardware_type = 1;
2405
Maggie White6dcd8572019-01-31 14:11:50 -08002406 /**
2407 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002408 * the same hardware_type. The specific locations are vendor defined integers,
2409 * referring to board-specific numbering schemes.
2410 */
2411 optional int32 hardware_location = 2;
2412
Maggie White6dcd8572019-01-31 14:11:50 -08002413 /**
2414 * failure_code is specific to the HardwareType of the failed hardware.
2415 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002416 */
Maggie White6dcd8572019-01-31 14:11:50 -08002417 enum HardwareErrorCode {
2418 UNKNOWN = 0;
2419 COMPLETE = 1;
2420 SPEAKER_HIGH_Z = 2;
2421 SPEAKER_SHORT = 3;
2422 FINGERPRINT_SENSOR_BROKEN = 4;
2423 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002424 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002425 }
2426 optional int32 failure_code = 3;
2427}
2428
2429/**
2430 * Log an event when the device has been physically dropped.
2431 * Reported from the /vendor partition.
2432 */
2433message PhysicalDropDetected {
2434 // Confidence that the event was actually a drop, 0 -> 100
2435 optional int32 confidence_pctg = 1;
2436 // Peak acceleration of the drop, in 1/1000s of a g.
2437 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002438 // Duration of freefall in ms
2439 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002440}
2441
2442/**
2443 * Log bucketed battery charge cycles.
2444 *
2445 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002446 * a given charge point. For example, if 10 cycle buckets are
2447 * initialized, bucket 1 is the lowest 1/10th of the battery,
2448 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002449 *
2450 * Logged from:
2451 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2452 */
2453message ChargeCyclesReported {
2454 optional int32 cycle_bucket_1 = 1;
2455 optional int32 cycle_bucket_2 = 2;
2456 optional int32 cycle_bucket_3 = 3;
2457 optional int32 cycle_bucket_4 = 4;
2458 optional int32 cycle_bucket_5 = 5;
2459 optional int32 cycle_bucket_6 = 6;
2460 optional int32 cycle_bucket_7 = 7;
2461 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002462 optional int32 cycle_bucket_9 = 9;
2463 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002464}
2465
2466/**
Howard Roa46b6582018-09-18 16:45:02 -07002467 * Log battery health snapshot.
2468 *
2469 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2470 * are snapshotted periodically over 24hrs.
2471 */
2472message BatteryHealthSnapshot {
2473 enum BatterySnapshotType {
2474 UNKNOWN = 0;
2475 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2476 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2477 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2478 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2479 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2480 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2481 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2482 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2483 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2484 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2485 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2486 }
2487 optional BatterySnapshotType type = 1;
2488 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002489 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002490 // Voltage Battery Voltage, in microVolts.
2491 optional int32 voltage_micro_volt = 3;
2492 // Current Battery current, in microAmps.
2493 optional int32 current_micro_amps = 4;
2494 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2495 optional int32 open_circuit_micro_volt = 5;
2496 // Resistance Battery Resistance, in microOhms.
2497 optional int32 resistance_micro_ohm = 6;
2498 // Level Battery Level, as % of full.
2499 optional int32 level_percent = 7;
2500}
2501
2502/**
2503 * Log slow I/O operations on the primary storage.
2504 */
2505message SlowIo {
2506 // Classifications of IO Operations.
2507 enum IoOperation {
2508 UNKNOWN = 0;
2509 READ = 1;
2510 WRITE = 2;
2511 UNMAP = 3;
2512 SYNC = 4;
2513 }
2514 optional IoOperation operation = 1;
2515
2516 // The number of slow IO operations of this type over 24 hours.
2517 optional int32 count = 2;
2518}
2519
2520/**
2521 * Log battery caused shutdown with the last recorded voltage.
2522 */
2523message BatteryCausedShutdown {
2524 // The last recorded battery voltage prior to shutdown.
2525 optional int32 last_recorded_micro_volt = 1;
2526}
2527
2528/**
Tej Singha72344992019-04-17 18:55:08 -07002529 * Logs when ThermalService receives throttling events.
2530 *
2531 * Logged from:
2532 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2533 */
2534message ThermalThrottlingSeverityStateChanged {
2535 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2536 optional android.os.TemperatureTypeEnum sensor_type = 1;
2537
2538 // The name of the temperature source. Eg. CPU0
2539 optional string sensor_name = 2;
2540
2541 // Temperature in tenths of a degree C.
2542 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2543 optional int32 temperature_deci_celsius = 3;
2544
2545 // Relative severity of the throttling, see enum definition.
2546 optional android.os.ThrottlingSeverityEnum severity = 4;
2547}
2548
2549/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002550 * Logs the duration of a davey (jank of >=700ms) when it occurs
2551 *
2552 * Logged from:
2553 * frameworks/base/libs/hwui/JankTracker.cpp
2554 */
2555message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002556 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002557 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002558
Tej Singhbb8554a2018-01-26 11:59:14 -08002559 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002560 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002561}
2562
2563/**
Bookatze5885242017-10-24 20:10:31 -07002564 * Logs phone signal strength changes.
2565 *
2566 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002567 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002568 */
2569message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002570 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2571 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002572}
2573
Yangster4ccebea2018-10-09 17:09:02 -07002574
2575/**
2576 * Logs when the phone state, sim state or signal strength changes
2577 *
2578 * Logged from:
2579 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2580 */
2581message PhoneServiceStateChanged {
2582 optional android.telephony.ServiceStateEnum state = 1;
2583 optional android.telephony.SimStateEnum sim_state = 2;
2584 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2585}
2586
2587/**
2588 * Logs when the phone becomes on or off.
2589 *
2590 * Logged from:
2591 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2592 */
2593message PhoneStateChanged {
2594 enum State {
2595 OFF = 0;
2596 ON = 1;
2597 }
2598 optional State state = 1;
2599}
2600
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002601message BackGesture {
2602 enum BackType {
2603 DEFAULT_BACK_TYPE = 0;
2604 COMPLETED = 1;
2605 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2606 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2607 INCOMPLETE = 4;
2608 }
2609 optional BackType type = 1;
2610
2611 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2612 enum WindowHorizontalLocation {
2613 DEFAULT_LOCATION = 0;
2614 LEFT = 1;
2615 RIGHT = 2;
2616 }
2617 optional WindowHorizontalLocation x_location = 3;
2618}
2619
2620message ExclusionRectStateChanged {
2621 optional string component_name = 1; // if not available, simply packageName
2622 optional int32 requested_height = 2; // px
2623 optional int32 rejected_height = 3; // px
2624
2625 enum WindowHorizontalLocation {
2626 DEFAULT_LOCATION = 0;
2627 LEFT = 1;
2628 RIGHT = 2;
2629 }
2630 optional WindowHorizontalLocation x_location = 4;
2631 optional bool landscape = 5;
2632 optional bool splitscreen = 6;
2633 optional int32 duration_millis = 7;
2634}
2635
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002636message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002637 optional android.stats.launcher.LauncherAction action = 1;
2638 optional android.stats.launcher.LauncherState src_state = 2;
2639 optional android.stats.launcher.LauncherState dst_state = 3;
2640 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002641 optional bool is_swipe_up_enabled = 5;
2642}
2643
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002644message StyleUIChanged {
2645 optional android.stats.style.Action action = 1;
2646 optional int32 color_package_hash = 2;
2647 optional int32 font_package_hash = 3;
2648 optional int32 shape_package_hash = 4;
2649 optional int32 clock_package_hash = 5;
2650 optional int32 launcher_grid = 6;
2651 optional int32 wallpaper_category_hash = 7;
2652 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002653 optional int32 color_preference = 9;
2654 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002655}
2656
David Chenc28b2bb2017-10-24 12:52:52 -07002657/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002658 * Logs when Settings UI has changed.
2659 *
2660 * Logged from:
2661 * packages/apps/Settings
2662 */
2663message SettingsUIChanged {
2664 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002665 * Where this SettingsUIChange event comes from. For example, if
2666 * it's a PAGE_VISIBLE event, where the page is opened from.
2667 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002668 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002669
2670 /**
2671 * What the UI action is.
2672 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002673 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002674
2675 /**
2676 * Where the action is happening
2677 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002678 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002679
2680 /**
2681 * What preference changed in this event.
2682 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002683 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002684
2685 /**
2686 * The new value of the changed preference.
2687 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002688 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002689}
2690
2691/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002692 * Logs basic timing information about touch events.
2693 * Reported at most every 5 minutes while device is being interacted with.
2694 *
2695 * Logged from:
2696 * frameworks/native/services/inputflinger
2697 */
2698message TouchEventReported {
2699 /**
2700 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002701 * and the standard deviation of the time spent processing touchscreen events
2702 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002703 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002704 * On supported devices, the starting point is taken during the hard interrupt inside the
2705 * kernel touch driver. On all other devices, the starting point is taken inside
2706 * the kernel's input event subsystem upon receipt of the input event.
2707 * The ending point is taken inside InputDispatcher, just after the input event
2708 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002709 */
2710 // Minimum value
2711 optional float latency_min_micros = 1;
2712 // Maximum value
2713 optional float latency_max_micros = 2;
2714 // Average value
2715 optional float latency_mean_micros = 3;
2716 // Standard deviation
2717 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002718 // Number of touch events (input_event) in this report
2719 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002720}
2721
2722/**
Philip Quinn0eded622019-01-29 12:46:28 -08002723 * Logs gesture classification and timing information for touch events.
2724 *
2725 * Logged from:
2726 * frameworks/base/core/java/android/view/GestureDetector.java
2727 * frameworks/base/core/java/android/view/View.java
2728 */
2729message TouchGestureClassified {
2730 // The source of the classification (e.g. Java class name).
2731 optional string source = 1;
2732
2733 enum Classification {
2734 UNKNOWN_CLASSIFICATION = 0;
2735 SINGLE_TAP = 1;
2736 DOUBLE_TAP = 2;
2737 LONG_PRESS = 3;
2738 DEEP_PRESS = 4;
2739 SCROLL = 5;
2740 }
2741 // The classification of the gesture.
2742 optional Classification classification = 2;
2743
2744 // The interval from the start of a touch event stream until the
2745 // classification was made.
2746 optional int32 latency_millis = 3;
2747
2748 // The distance from the location of the first touch event to the
2749 // location of the touch event when the classification was made.
2750 optional float displacement_px = 4;
2751}
2752
2753/**
David Chenc28b2bb2017-10-24 12:52:52 -07002754 * Logs that a setting was updated.
2755 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002756 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002757 * The tag and is_default allow resetting of settings to default values based on the specified
2758 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2759 */
2760message SettingChanged {
2761 // The name of the setting.
2762 optional string setting = 1;
2763
2764 // The change being imposed on this setting. May represent a number, eg "3".
2765 optional string value = 2;
2766
2767 // The new value of this setting. For most settings, this is same as value. For some settings,
2768 // value is +X or -X where X represents an element in a set. For example, if the previous value
2769 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2770 // The +/- feature is currently only used for location_providers_allowed.
2771 optional string new_value = 3;
2772
2773 // The previous value of this setting.
2774 optional string prev_value = 4;
2775
2776 // The tag used with the is_default for resetting sets of settings. This is generally null.
2777 optional string tag = 5;
2778
Bookatz90867622018-01-31 15:05:57 -08002779 // True if this setting with tag should be resettable.
2780 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002781
David Chenbd789912018-03-16 17:19:55 -07002782 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002783 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002784
2785 enum ChangeReason {
2786 UPDATED = 1; // Updated can be an insertion or an update.
2787 DELETED = 2;
2788 }
2789 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002790}
Chenjie Yub3dda412017-10-24 13:41:59 -07002791
Chenjie Yu05013b32017-11-21 10:21:41 -08002792/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002793 * Logs activity going to foreground or background
2794 *
2795 * Logged from:
2796 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2797 */
2798message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002799 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002800 optional string pkg_name = 2;
2801 optional string class_name = 3;
2802
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002803 enum State {
2804 BACKGROUND = 0;
2805 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002806 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002807 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002808}
David Chenc8a43242017-10-17 16:23:28 -07002809
2810/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002811 * Logs when a volume entered low Storage state.
2812 * Logged from:
2813 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2814 */
2815message LowStorageStateChanged {
2816 // Volume that ran out of storage.
2817 optional string volume_description = 1;
2818
2819 enum State {
2820 UNKNOWN = 0;
2821 OFF = 1;
2822 ON = 2;
2823 }
2824 optional State state = 2;
2825}
2826
2827/**
2828 * Logs when an app is downgraded.
2829 * Logged from:
2830 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2831 */
2832message AppDowngraded {
2833 optional string package_name = 1;
2834 // Size of the package (all data) before being downgraded.
2835 optional int64 size_in_bytes_before = 2;
2836 // Size of the package (all data) after being downgraded.
2837 optional int64 size_in_bytes_after = 3;
2838
2839 optional bool aggressive = 4;
2840}
2841
2842/**
2843 * Logs when an app is optimized after being downgraded.
2844 * Logged from:
2845 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2846 */
2847message AppOptimizedAfterDowngraded {
2848 optional string package_name = 1;
2849}
2850
2851/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002852 * Logs whenever an app is installed on external storage.
2853 * Logged from:
2854 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2855 */
2856message AppInstallOnExternalStorageReported {
2857 // The type of external storage.
2858 optional android.stats.storage.ExternalStorageType storage_type = 1;
2859 // The name of the package that is installed on the sd card.
2860 optional string package_name = 2;
2861}
2862
2863/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002865 * Logged from:
2866 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2867 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002868message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002869 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002870
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002871 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002872
2873 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002874 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002875 optional string process_name = 3;
2876
2877 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002878 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002879
2880 optional string package_name = 5;
2881
2882 enum InstantApp {
2883 UNAVAILABLE = 0;
2884 FALSE = 1;
2885 TRUE = 2;
2886 }
2887 optional InstantApp is_instant_app = 6;
2888
2889 enum ForegroundState {
2890 UNKNOWN = 0;
2891 BACKGROUND = 1;
2892 FOREGROUND = 2;
2893 }
2894 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002895
2896 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002897}
David Chen9e3808c2017-11-20 17:25:34 -08002898
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002899/**
2900 * Logs when a WTF (What a Terrible Failure) happened.
2901 * Logged from:
2902 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2903 */
2904message WTFOccurred {
2905 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002906
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002907 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002908
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002909 // The name of the process.
2910 // system_server if it is not by an app
2911 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002912
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002913 // The pid if available. -1 means not available.
2914 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002915
2916 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002917}
2918
2919/**
2920 * Logs when system server reports low memory.
2921 * Logged from:
2922 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2923 */
2924message LowMemReported {
2925}
2926
2927/**
2928 * Logs when an app ANR (App Not Responding) occurs.
2929 * Logged from:
2930 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2931 */
2932message ANROccurred {
2933 optional int32 uid = 1 [(is_uid) = true];
2934
2935 optional string process_name = 2;
2936
2937 optional string short_component_name = 3;
2938
2939 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002940
2941 enum InstantApp {
2942 UNAVAILABLE = 0;
2943 FALSE = 1;
2944 TRUE = 2;
2945 }
2946 optional InstantApp is_instant_app = 5;
2947
2948 enum ForegroundState {
2949 UNKNOWN = 0;
2950 BACKGROUND = 1;
2951 FOREGROUND = 2;
2952 }
2953 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002954
2955 optional android.server.ErrorSource error_source = 7;
2956
2957 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002958}
2959
Bookatza7020bd2018-08-28 16:29:35 -07002960/**
2961 * Logs when the vibrator state changes.
2962 * Logged from:
2963 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2964 */
2965message VibratorStateChanged {
2966 repeated AttributionNode attribution_node = 1;
2967
2968 enum State {
2969 OFF = 0;
2970 ON = 1;
2971 }
2972 optional State state = 2;
2973
2974 // Duration (in milliseconds) requested to keep the vibrator on.
2975 // Only applicable for State == ON.
2976 optional int64 duration_millis = 3;
2977}
2978
David Chen0a368b22017-12-06 16:28:16 -08002979/*
2980 * Allows other apps to push events into statsd.
2981 * Logged from:
2982 * frameworks/base/core/java/android/util/StatsLog.java
2983 */
David Chen0b5c90c2018-01-25 16:51:49 -08002984message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002985 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002986 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002987
2988 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2989 optional int32 label = 2;
2990
2991 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2992 // predicates for the metrics).
2993 enum State {
2994 UNKNOWN = 0;
2995 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2996 STOP = 2;
2997 START = 3;
2998 }
2999 optional State state = 3;
3000}
3001
David Chen9e3808c2017-11-20 17:25:34 -08003002/**
Bookatz7948c872018-09-04 12:58:33 -07003003 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3004 * For example, this could be due to the user manually changing the time.
3005 *
3006 * Logged from:
3007 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3008 */
3009message WallClockTimeShifted {
3010 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3011 optional int64 wall_clock_timestamp_millis = 1;
3012}
3013
3014/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003015 * Logs when statsd detects an anomaly.
3016 *
3017 * Logged from:
3018 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3019 */
3020message AnomalyDetected {
3021 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003022 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003023
Yangster-mac94e197c2018-01-02 16:03:03 -08003024 // Id of the config whose anomaly detection alert fired.
3025 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003026
Yangster-mac94e197c2018-01-02 16:03:03 -08003027 // Id of the alert (i.e. name of the anomaly that was detected).
3028 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003029}
3030
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003032 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003033 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003034
3035 // The app package name.
3036 optional string pkg_name = 2;
3037
3038 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003039 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003040 WARM = 1;
3041 HOT = 2;
3042 COLD = 3;
3043 }
3044 // The transition type.
3045 optional TransitionType type = 3;
3046
3047 // The activity name.
3048 optional string activity_name = 4;
3049
3050 // The name of the calling app. Empty if not set.
3051 optional string calling_pkg_name = 5;
3052
3053 // Whether the app is an instant app.
3054 optional bool is_instant_app = 6;
3055
3056 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003057 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003058
Bookatz80d11a02018-01-16 10:46:35 -08003059 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003060
David Chen0b5c90c2018-01-25 16:51:49 -08003061 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003062 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003063 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003064 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003065 optional int32 bind_application_delay_millis = 11;
3066 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003067
3068 // Empty if not set.
3069 optional string launch_token = 13;
3070
Calin Juravle759fbda2018-02-20 19:52:30 +00003071 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003072 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003073
3074 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003075 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003076}
3077
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003078message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003079 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003080 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003081
3082 // The app package name.
3083 optional string pkg_name = 2;
3084
3085 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003086 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003087 WARM = 1;
3088 HOT = 2;
3089 COLD = 3;
3090 }
3091 // The transition type.
3092 optional TransitionType type = 3;
3093
3094 // The activity name.
3095 optional string activity_name = 4;
3096}
3097
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003098message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003099 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003100 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003101
3102 // The app package name.
3103 optional string pkg_name = 2;
3104
3105 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003106 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003107 WITH_BUNDLE = 1;
3108 WITHOUT_BUNDLE = 2;
3109 }
3110 // The transition type.
3111 optional TransitionType type = 3;
3112
3113 // The activity name.
3114 optional string activity_name = 4;
3115
3116 optional bool transition_process_running = 5;
3117
3118 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003119 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003120}
3121
Bookatz8fcd09a2017-12-18 13:01:10 -08003122/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003123 * Logs a picture-in-picture action
3124 * Logged from:
3125 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3126 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3127 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3128 */
3129message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003130 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003131 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003132
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003133 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003134
Chenjie Yu52cacc62017-12-08 18:11:45 -08003135 enum State {
3136 ENTERED = 1;
3137 EXPANDED_TO_FULL_SCREEN = 2;
3138 MINIMIZED = 3;
3139 DISMISSED = 4;
3140 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003141 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003142}
3143
3144/**
Chenjie Yue8904192017-12-08 19:12:57 -08003145 * Logs overlay action
3146 * Logged from:
3147 * services/core/java/com/android/server/wm/Session.java
3148 */
3149message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003150 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003151
tsaichristine10978642019-09-10 14:12:49 -07003152 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003153
3154 optional bool using_alert_window = 3;
3155
3156 enum State {
3157 ENTERED = 1;
3158 EXITED = 2;
3159 }
tsaichristine10978642019-09-10 14:12:49 -07003160 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003161}
3162
Chenjie Yuccfe6452018-01-30 11:33:21 -08003163/*
3164 * Logs foreground service starts and stops.
3165 * Note that this is not when a service starts or stops, but when it is
3166 * considered foreground.
3167 * Logged from
3168 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3169 */
3170message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003171 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003172 // package_name + "/" + class_name
3173 optional string short_name = 2;
3174
3175 enum State {
3176 ENTER = 1;
3177 EXIT = 2;
3178 }
3179 optional State state = 3;
3180}
3181
Chenjie Yue8904192017-12-08 19:12:57 -08003182/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003183 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3184 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3185 * attributed back to the parent (host) uid. One example is Chrome.
3186 *
3187 * Logged from:
3188 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3189 */
3190message IsolatedUidChanged {
3191 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003192 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003193 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003194 optional int32 parent_uid = 1;
3195
3196 optional int32 isolated_uid = 2;
3197
3198 // We expect an isolated uid to be removed before if it's used for another parent uid.
3199 enum Event {
3200 REMOVED = 0;
3201 CREATED = 1;
3202 }
3203 optional Event event = 3;
3204}
3205
3206/*
3207 * Logs the reception of an incoming network packet causing the main system to wake up for
3208 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3209 * and processed by WakeupController.cpp.
3210 */
3211message PacketWakeupOccurred {
3212 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3213 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003214 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003215 // The interface name on which the packet was received.
3216 optional string iface = 2;
3217 // The ethertype value of the packet.
3218 optional int32 ethertype = 3;
3219 // String representation of the destination MAC address of the packet.
3220 optional string destination_hardware_address = 4;
3221 // String representation of the source address of the packet if this was an IP packet.
3222 optional string source_ip = 5;
3223 // String representation of the destination address of the packet if this was an IP packet.
3224 optional string destination_ip = 6;
3225 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3226 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3227 // families.
3228 optional int32 ip_next_header = 7;
3229 // The source port if this was a TCP or UDP packet.
3230 optional int32 source_port = 8;
3231 // The destination port if this was a TCP or UDP packet.
3232 optional int32 destination_port = 9;
3233}
3234
3235/*
3236 * Logs the memory stats for an app on startup.
3237 * Logged from:
3238 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3239 */
3240message AppStartMemoryStateCaptured {
3241 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003242 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003243
3244 // The process name.
3245 optional string process_name = 2;
3246
3247 // The activity name.
3248 optional string activity_name = 3;
3249
3250 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003251 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003252
3253 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003254 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003255
3256 // RSS
3257 optional int64 rss_in_bytes = 6;
3258
3259 // CACHE
3260 optional int64 cache_in_bytes = 7;
3261
3262 // SWAP
3263 optional int64 swap_in_bytes = 8;
3264}
3265
3266/*
3267 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3268 * for LMK event.
3269 * Logged from:
3270 * system/core/lmkd/lmkd.c
3271 */
3272message LmkStateChanged {
3273 enum State {
3274 UNKNOWN = 0;
3275 START = 1;
3276 STOP = 2;
3277 }
3278 optional State state = 1;
3279}
3280
3281/*
3282 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3283 * Logged from:
3284 * system/core/lmkd/lmkd.c
3285 */
3286message LmkKillOccurred {
3287 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003288 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003289
3290 // The process name.
3291 optional string process_name = 2;
3292
3293 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003294 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003295
3296 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003297 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003298
3299 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003300 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003301
3302 // RSS
3303 optional int64 rss_in_bytes = 6;
3304
3305 // CACHE
3306 optional int64 cache_in_bytes = 7;
3307
3308 // SWAP
3309 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003310
3311 // The elapsed real time of start of the process.
3312 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003313
3314 // Min oom adj score considered by lmkd.
3315 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003316}
3317
Rajeev Kumar51b54602018-03-01 12:18:26 -08003318/*
3319 * Logs when the ActivityManagerService detects that an app died.
3320 *
3321 * Logged from:
3322 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3323 */
3324message AppDied {
3325 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003326 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003327}
3328
Howard Ro21a039c2018-08-06 14:55:47 -07003329/**
3330 * An atom for generic metrics logging. Available from Android Q.
3331 */
3332message GenericAtom {
3333 // The uid of the application that sent this custom atom.
3334 optional int32 uid = 1 [(is_uid) = true];
3335
3336 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003337 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003338}
3339
Tej Singhd6d6d772018-09-05 17:41:25 -07003340/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003341 * Atom for simple logging of user interaction and impression events, such as "the user touched
3342 * this button" or "this dialog was displayed".
3343 * Keep the UI event stream clean: don't use for system or background events.
3344 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003345 *
3346 * Logged from:
3347 * frameworks/base/services/core/java/com/android/server/
3348 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003349 */
3350message UiEventReported {
3351 // The event_id.
3352 optional int32 event_id = 1;
3353 // The event's source or target uid and package, if applicable.
3354 // For example, the package posting a notification, or the destination package of a share.
3355 optional int32 uid = 2 [(is_uid) = true];
3356 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003357 // An identifier used to disambiguate which logs refer to a particular instance of some
3358 // UI element. Useful when there might be multiple instances simultaneously active.
3359 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003360}
3361
3362/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003363 * Reports a notification was created or updated.
3364 *
3365 * Logged from:
3366 * frameworks/base/services/core/java/com/android/server/notification/
3367 */
3368message NotificationReported {
3369 // The event_id (as for UiEventReported).
3370 optional int32 event_id = 1;
3371 // The notifying app's uid and package.
3372 optional int32 uid = 2 [(is_uid) = true];
3373 optional string package_name = 3;
3374 // A small system-assigned identifier for the notification.
3375 // Locally probably-unique, but expect collisions across users and/or days.
3376 optional int32 instance_id = 4;
3377 // The app-assigned notification ID and tag
3378 optional int32 notification_id = 5;
3379 optional string notification_tag = 6;
3380 optional string channel_id = 7; // App-assigned channel ID
3381
3382 // Grouping information
3383 optional string group_id = 8; // Group the notification currently belongs to
3384 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3385 optional bool is_group_summary = 10; // Tags the group-summary notification
3386
3387 // Attributes
3388 optional string category = 11; // App-assigned notification category (API-defined strings)
3389 optional int32 style = 12; // App-assigned notification style
3390 optional int32 num_people = 13; // Number of Person records attached to the notification
3391
3392 // Ordering, importance and interruptiveness
3393
3394 optional int32 position = 14; // Position in NotificationManager's list
3395
3396 optional android.stats.sysui.NotificationImportance importance = 15;
3397 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3398
3399 enum NotificationImportanceExplanation {
3400 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3401 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3402 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3403 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3404 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3405 // Like _APP, but based on pre-channels priority signal.
3406 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3407 }
3408
3409 optional NotificationImportanceExplanation importance_source = 17;
3410 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3411 optional NotificationImportanceExplanation importance_initial_source = 19;
3412 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3413 optional int32 assistant_hash = 21;
3414 optional float assistant_ranking_score = 22;
3415}
3416
3417message Notification {
3418 // The notifying app's uid and package.
3419 optional int32 uid = 1 [(is_uid) = true];
3420 optional string package_name = 2;
3421 // A small system-assigned identifier for the notification.
3422 optional int32 instance_id = 3;
3423
3424 // Grouping information.
3425 optional int32 group_instance_id = 4;
3426 optional bool is_group_summary = 5;
3427
3428 // The section of the shade that the notification is in.
3429 // See NotificationSectionsManager.PriorityBucket.
3430 enum NotificationSection {
3431 SECTION_UNKNOWN = 0;
3432 SECTION_PEOPLE = 1;
3433 SECTION_ALERTING = 2;
3434 SECTION_SILENT = 3;
3435 }
3436 optional NotificationSection section = 6;
3437}
3438
3439message NotificationList {
3440 repeated Notification notifications = 1; // An ordered sequence of notifications.
3441}
3442
3443/**
3444 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3445 *
3446 * Logged from:
3447 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3448 */
3449message NotificationPanelReported {
3450 // The event_id (as for UiEventReported).
3451 optional int32 event_id = 1;
3452 optional int32 num_notifications = 2;
3453 // The notifications in the panel, in the order that they appear there.
3454 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3455}
3456
3457/**
3458 * Reports a notification channel, or channel group, was created, updated, or deleted.
3459 *
3460 * Logged from:
3461 * frameworks/base/services/core/java/com/android/server/notification/
3462 */
3463message NotificationChannelModified {
3464 // The event_id (as for UiEventReported).
3465 optional int32 event_id = 1;
3466 // The notifying app's uid and package.
3467 optional int32 uid = 2 [(is_uid) = true];
3468 optional string package_name = 3;
3469 // App-assigned notification channel ID or channel-group ID
3470 optional string channel_id = 4;
3471 // Previous importance setting, if applicable
3472 optional android.stats.sysui.NotificationImportance old_importance = 5;
3473 // New importance setting
3474 optional android.stats.sysui.NotificationImportance importance = 6;
3475}
3476
3477
3478/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003479 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003480 *
3481 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003482 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003483 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003484message BiometricAcquired {
3485 // Biometric modality that was acquired.
3486 optional android.hardware.biometrics.ModalityEnum modality = 1;
3487 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3488 optional int32 user = 2;
3489 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3490 optional bool is_crypto = 3;
3491 // Action that the device is performing. Acquired messages are only expected for enroll and
3492 // authenticate. Other actions may indicate an error.
3493 optional android.hardware.biometrics.ActionEnum action = 4;
3494 // The client that this acquisition was received for.
3495 optional android.hardware.biometrics.ClientEnum client = 5;
3496 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3497 optional int32 acquire_info = 6;
3498 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3499 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003500 // Dictates if this message should trigger additional debugging.
3501 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003502}
3503
3504/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003505 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003506 *
3507 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003508 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003509 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003510message BiometricAuthenticated {
3511 // Biometric modality that was used.
3512 optional android.hardware.biometrics.ModalityEnum modality = 1;
3513 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3514 optional int32 user = 2;
3515 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3516 // storage.
3517 optional bool is_crypto = 3;
3518 // The client that this acquisition was received for.
3519 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003520 // If authentication requires user confirmation. See BiometricPrompt's
3521 // setRequireConfirmation(bool) method.
3522 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003523
Kevin Chyn1741a072019-01-17 11:54:40 -08003524 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003525 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003526 REJECTED = 1;
3527 PENDING_CONFIRMATION = 2;
3528 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003529 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003530
3531 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003532 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003533 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3534 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3535 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3536 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003537 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003538 // Dictates if this message should trigger additional debugging.
3539 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003540}
3541
3542/**
3543 * Logs when a biometric error occurs.
3544 *
3545 * Logged from:
3546 * frameworks/base/services/core/java/com/android/server/biometrics
3547 */
3548message BiometricErrorOccurred {
3549 // Biometric modality that was used.
3550 optional android.hardware.biometrics.ModalityEnum modality = 1;
3551 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3552 optional int32 user = 2;
3553 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3554 optional bool is_crypto = 3;
3555 // Action that the device is performing.
3556 optional android.hardware.biometrics.ActionEnum action = 4;
3557 // The client that this acquisition was received for.
3558 optional android.hardware.biometrics.ClientEnum client = 5;
3559 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3560 // are unique to modality.
3561 optional int32 error_info = 6;
3562 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3563 // by the vendor and not specified by the HIDL interface.
3564 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003565 // Dictates if this message should trigger additional debugging.
3566 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003567 // Time spent during the authentication attempt.
3568 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003569}
3570
3571/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003572 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003573 * Logged from:
3574 * frameworks/base/services/core/java/com/android/server/biometrics
3575 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003576message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003577 // Biometric modality.
3578 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003579 // Type of issue detected.
3580 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003581 // Dictates if this message should trigger additional debugging.
3582 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003583}
Howard Ro688ae182018-09-25 00:09:36 -07003584
joshmccloskey6f952b22019-03-25 20:59:35 -07003585/**
3586 * Logs when a biometric enrollment occurs.
3587 *
3588 * Logged from:
3589 * frameworks/base/services/core/java/com/android/server/biometrics
3590 */
3591message BiometricEnrolled {
3592 // Biometric modality that was used.
3593 optional android.hardware.biometrics.ModalityEnum modality = 1;
3594 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3595 optional int32 user = 2;
3596 // The amount of time the enrollment took in milliseconds.
3597 optional int64 latency_millis = 3;
3598 // Whether or not the enrollment was successful.
3599 optional bool success = 4;
3600}
3601
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003602/*
Tej Singh0d176952019-01-16 19:10:54 -08003603 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003604 */
Tej Singh0d176952019-01-16 19:10:54 -08003605message FlagFlipUpdateOccurred {
3606 // If the event is from a flag config package, specify the package name.
3607 optional string flag_flip_package_name = 1;
3608
3609 // The order id of the package
3610 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003611}
3612
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003613/**
3614 * Potential experiment ids that goes with a train install.
3615 */
3616message TrainExperimentIds {
3617 repeated int64 experiment_id = 1;
3618}
3619
Yangster-macb89807e2018-11-15 21:10:57 -08003620/*
3621 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003622 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003623 */
3624message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003625 // Name of the train.
3626 optional string train_name = 1;
3627 // Version code for a "train" of packages that need to be installed atomically
3628 optional int64 train_version_code = 2;
3629 // After installation of this package, device requires a restart.
3630 optional bool requires_staging = 3;
3631 // Rollback should be enabled for this install.
3632 optional bool rollback_enabled = 4;
3633 // Requires low latency monitoring if possible.
3634 optional bool requires_low_latency_monitor = 5;
3635
Yangster-macb89807e2018-11-15 21:10:57 -08003636 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003637 UNKNOWN = 0;
3638 INSTALL_REQUESTED = 1;
3639 INSTALL_STARTED = 2;
3640 INSTALL_STAGED_NOT_READY = 3;
3641 INSTALL_STAGED_READY = 4;
3642 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003643 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3644 // and INSTALL_FAILURE_COMMIT.
3645 INSTALL_FAILURE = 6 [deprecated = true];
3646 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003647 INSTALL_CANCELLED = 7;
3648 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003649 INSTALLER_ROLLBACK_INITIATED = 9;
3650 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3651 INSTALLER_ROLLBACK_STAGED = 11;
3652 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3653 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3654 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3655 INSTALLER_ROLLBACK_SUCCESS = 15;
3656 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003657 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3658 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3659 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3660 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3661 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3662 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003663 INSTALL_FAILURE_DOWNLOAD = 23;
3664 INSTALL_FAILURE_STATE_MISMATCH = 24;
3665 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003666 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003667 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003668 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003669 // Possible experiment ids for monitoring this push.
3670 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3671 // user id
3672 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003673 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003674}
3675
Tej Singhc9203082019-05-03 13:42:23 -07003676/* Test atom, is not logged anywhere */
3677message TestAtomReported {
3678 repeated AttributionNode attribution_node = 1;
3679 optional int32 int_field = 2;
3680 optional int64 long_field = 3;
3681 optional float float_field = 4;
3682 optional string string_field = 5;
3683 optional bool boolean_field = 6;
3684 enum State {
3685 UNKNOWN = 0;
3686 OFF = 1;
3687 ON = 2;
3688 }
3689 optional State state = 7;
3690 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3691}
3692
Maggie Whitefc1aa592018-11-28 21:55:23 -08003693/** Represents USB port overheat event. */
3694message UsbPortOverheatEvent {
3695 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3696 optional int32 plug_temperature_deci_c = 1;
3697
3698 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3699 optional int32 max_temperature_deci_c = 2;
3700
3701 /* Time between USB plug event and overheat threshold trip, in seconds. */
3702 optional int32 time_to_overheat_secs = 3;
3703
3704 /* Time between overheat threshold trip and hysteresis, in seconds. */
3705 optional int32 time_to_hysteresis_secs = 4;
3706
3707 /* Time between hysteresis and active mitigation ending, in seconds. */
3708 optional int32 time_to_inactive_secs = 5;
3709};
3710
Maggie White8735b852019-01-18 11:40:49 -08003711/**
3712 * Logs total effective full charge and discharge cycles on a battery.
3713 * Here are some examples of one effective cycle:
3714 * 1) the battery charges from 0% to 100% and drains back to 0%,
3715 * 2) charging from 50% to 100% and draining back to 50% twice.
3716 * Pulled from:
3717 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3718 */
3719message BatteryCycleCount {
3720 /* Number of total charge and discharge cycles on the system battery. */
3721 optional int32 cycle_count = 1;
3722}
3723
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003724/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003725 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3726 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003727 * Pulled from:
3728 * StatsCompanionService
3729 */
3730
Carmen Agimof12dec122019-03-06 16:14:38 +00003731message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003732
Carmen Agimof12dec122019-03-06 16:14:38 +00003733 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003734 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003735 PUBLIC = 1;
3736 PRIVATE = 2;
3737 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003738 }
3739
Carmen Agimof12dec122019-03-06 16:14:38 +00003740 // The type of external storage.
3741 optional android.stats.storage.ExternalStorageType storage_type = 1;
3742 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3743 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003744 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003745 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003746}
3747
Yangster-macb89807e2018-11-15 21:10:57 -08003748/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003749 * Logs when a connection becomes available and lost.
3750 * Logged in StatsCompanionService.java
3751 */
3752message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003753 // Id of the network.
3754 optional int32 net_id = 1;
3755
3756 enum State {
3757 UNKNOWN = 0;
3758 CONNECTED = 1;
3759 DISCONNECTED = 2;
3760 }
3761 // Connected state of a network.
3762 optional State state = 2;
3763}
3764
3765/**
3766 * Logs when a service starts and stops.
3767 * Logged from:
3768 * services/core/java/com/android/server/am/ActiveServices.java
3769 */
3770message ServiceStateChanged {
3771
3772 optional int32 uid = 1 [(is_uid) = true];
3773
3774 optional string package_name = 2;
3775
3776 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003777
3778 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003779 START = 1;
3780 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003781 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003782
3783 optional State state = 4;
3784}
3785
3786/**
3787 * Logs when a service is launched.
3788 * Logged from:
3789 * services/core/java/com/android/server/am/ActiveServices.java
3790 */
3791message ServiceLaunchReported {
3792
3793 optional int32 uid = 1 [(is_uid) = true];
3794
3795 optional string package_name = 2;
3796
3797 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003798}
Howard Ro688ae182018-09-25 00:09:36 -07003799
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003800/**
3801 * Logs when a hidden API is used.
3802 *
3803 * Logged from:
3804 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3805 */
3806message HiddenApiUsed {
3807 // The uid of the app making the hidden access.
3808 optional int32 uid = 1 [(is_uid) = true];
3809
3810 // Signature of the method or field accessed.
3811 optional string signature = 2;
3812
3813 enum AccessMethod {
3814 NONE = 0;
3815 REFLECTION = 1;
3816 JNI = 2;
3817 LINKING = 3;
3818 }
3819
3820 // Type of access.
3821 optional AccessMethod access_method = 3;
3822
3823 // Whether the access was prevented or not.
3824 optional bool access_denied = 4;
3825}
3826
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003827/**
3828 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3829 * - When user sees privacy chip
3830 * - When user clicks privacy chip
3831 * - How does the user exit the Privacy Dialog
3832 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003833 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3834 */
3835message PrivacyIndicatorsInteracted {
3836
3837 enum Type {
3838 UNKNOWN = 0;
3839 CHIP_VIEWED = 1;
3840 CHIP_CLICKED = 2;
3841 DIALOG_PRIVACY_SETTINGS = 3;
3842 DIALOG_DISMISS = 4;
3843 DIALOG_LINE_ITEM = 5;
3844 }
3845
3846 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3847
3848 // Used if the type is LINE_ITEM
3849 optional string package_name = 2;
3850}
3851
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003852/**
3853 * Logs information about a package that is moved from the internal to external storage and vice
3854 * versa.
3855 * It logs the package name, the type of the external storage where the package is installed
3856 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3857 * and the move type: if it's from internal to external or the other way around.
3858 *
3859 * Logged from:
3860 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3861 */
3862message AppMovedStorageReported {
3863 enum MoveType {
3864 UNKNOWN = 0;
3865 TO_EXTERNAL = 1;
3866 TO_INTERNAL = 2;
3867 }
3868 // The type of the external storage.
3869 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3870 // The type of move.
3871 optional MoveType move_type = 2;
3872 // The name of the package that was moved.
3873 optional string package_name = 3;
3874}
3875
jianjin8f2dee02019-03-29 14:03:08 -07003876/**
3877 * Logs when system server watchdog occurs.
3878 * Logged from:
3879 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3880 */
3881message SystemServerWatchdogOccurred {
3882 optional string subject = 1;
3883}
3884
3885/**
3886 * Logs when new file added to tombstones.
3887 * Logged from:
3888 * frameworks/base/core/java/com/android/server/BootReceiver.java
3889 */
3890message TombStoneOccurred {
3891}
3892
Hai Zhang5d3328d2019-04-13 21:25:06 +08003893/*
3894 * Information about a role request
3895 *
3896 * Logged from:
3897 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3898 */
3899message RoleRequestResultReported {
3900 // UID of application requesting the role
3901 optional int32 requesting_uid = 1;
3902
3903 // Package name of application requesting the role
3904 optional string requesting_package_name = 2;
3905
3906 // The role to be granted
3907 optional string role_name = 3;
3908
3909 // The count of applications qualifying for the role
3910 optional int32 qualifying_count = 4;
3911
3912 // UID of application current granted the role
3913 optional int32 current_uid = 5;
3914
3915 // Package name of application current granted the role
3916 optional string current_package_name = 6;
3917
3918 // UID of another application that user chose to grant the role to, instead of the requesting
3919 // application
3920 optional int32 granted_another_uid = 7;
3921
3922 // Package name of another application that user chose to grant the role to, instead of the
3923 // requesting application
3924 optional string granted_another_package_name = 8;
3925
3926 enum Result {
3927 UNDEFINED = 0;
3928 // role request was ignored
3929 IGNORED = 1;
3930 // role request was ignored because it's already granted
3931 IGNORED_ALREADY_GRANTED = 2;
3932 // role request was ignored because the application isn't qualified
3933 IGNORED_NOT_QUALIFIED = 3;
3934 // role request was ignored because user said it should be always denied
3935 IGNORED_USER_ALWAYS_DENIED = 4;
3936 // role was granted by user action
3937 USER_GRANTED = 5;
3938 // role was denied by user action
3939 USER_DENIED = 6;
3940 // role was denied by user granting another application the role
3941 USER_DENIED_GRANTED_ANOTHER = 7;
3942 // role was denied and set to be always denied by the user
3943 USER_DENIED_WITH_ALWAYS = 8;
3944 }
3945 // The result of the role request
3946 optional Result result = 9;
3947}
3948
Mark Tabrya824a642019-11-05 12:26:12 -08003949/**
3950 * Logs when a Vehicle Maps Service client's connection state has changed
3951 *
3952 * Logged from:
3953 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3954 */
3955message VmsClientConnectionStateChanged {
3956 // The UID of the VMS client app
3957 optional int32 uid = 1 [(is_uid) = true];
3958
3959 enum State {
3960 UNKNOWN = 0;
3961 // Attempting to connect to the client
3962 CONNECTING = 1;
3963 // Client connection established
3964 CONNECTED = 2;
3965 // Client connection closed unexpectedly
3966 DISCONNECTED = 3;
3967 // Client connection closed by VMS
3968 TERMINATED = 4;
3969 // Error establishing the client connection
3970 CONNECTION_ERROR = 5;
3971 }
3972
3973 optional State state = 2;
3974}
3975
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003976/**
3977 * Logs when MediaProvider has successfully finished scanning a storage volume.
3978 *
3979 * Logged from:
3980 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3981 */
3982message MediaProviderScanEvent {
3983 enum Reason {
3984 // Scan triggered due to unknown reason
3985 UNKNOWN = 0;
3986 // Scan triggered due to storage volume being mounted
3987 MOUNTED = 1;
3988 // Scan triggered due to explicit user action or app request
3989 DEMAND = 2;
3990 // Scan triggered due to idle maintenance
3991 IDLE = 3;
3992 }
3993
3994 // Volume type that this event pertains to
3995 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3996 // Reason why this scan was triggered
3997 optional Reason reason = 2;
3998 // Total number of files scanned
3999 optional int64 item_count = 3;
4000 // Duration of scan, normalized per file
4001 optional float normalized_duration_millis = 4;
4002 // Number of database inserts, normalized per file
4003 optional float normalized_insert_count = 5;
4004 // Number of database updates, normalized per file
4005 optional float normalized_update_count = 6;
4006 // Number of database deletes, normalized per file
4007 optional float normalized_delete_count = 7;
4008}
4009
4010/**
4011 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4012 *
4013 * Logged from:
4014 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4015 */
4016message MediaProviderDeletionEvent {
4017 // Volume type that this event pertains to
4018 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4019 // Device timestamp when this deletion event occurred
4020 optional int64 timestamp_millis = 2;
4021 // App that requested deletion
4022 optional string package_name = 3;
4023 // Number of items that were deleted
4024 optional int32 item_count = 4;
4025}
4026
4027/**
4028 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4029 *
4030 * Logged from:
4031 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4032 */
4033message MediaProviderPermissionEvent {
4034 enum Result {
4035 UNKNOWN = 0;
4036 USER_GRANTED = 1;
4037 AUTO_GRANTED = 2;
4038 USER_DENIED = 3;
4039 USER_DENIED_WITH_PREJUDICE = 4;
4040 AUTO_DENIED = 5;
4041 }
4042
4043 // Volume type that this event pertains to
4044 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4045 // Device timestamp when this permission event occurred
4046 optional int64 timestamp_millis = 2;
4047 // App that requested permission
4048 optional string package_name = 3;
4049 // Number of items that were requested
4050 optional int32 item_count = 4;
4051 // Result of this request
4052 optional Result result = 5;
4053}
4054
4055/**
4056 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4057 *
4058 * Logged from:
4059 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4060 */
4061message MediaProviderSchemaChange {
4062 // Volume type that this event pertains to
4063 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4064 // Old database version code
4065 optional int32 version_from = 2;
4066 // New database version code
4067 optional int32 version_to = 3;
4068 // Total number of files in database
4069 optional int64 item_count = 4;
4070 // Duration of schema change, normalized per file
4071 optional float normalized_duration_millis = 5;
4072}
4073
4074/**
4075 * Logs when MediaProvider has finished an idle maintenance job.
4076 *
4077 * Logged from:
4078 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4079 */
4080message MediaProviderIdleMaintenance {
4081 // Volume type that this event pertains to
4082 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4083
4084 // Total number of files in database
4085 optional int64 item_count = 2;
4086 // Duration of idle maintenance, normalized per file
4087 optional float normalized_duration_millis = 3;
4088 // Number of thumbnails found to be stale, normalized per file
4089 optional float normalized_stale_thumbnails = 4;
4090 // Number of items found to be expired, normalized per file
4091 optional float normalized_expired_media = 5;
4092}
4093
Keun young Park3e033cb2019-12-18 11:27:35 -08004094/**
4095 * Represents boot time event with duration in ms.
4096 *
4097 * Logged from: bootstat and various system server components. Check each enums for details.
4098 */
4099message BootTimeEventDuration {
4100 enum DurationEvent {
4101 UNKNOWN = 0;
4102 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4103 ABSOLUTE_BOOT_TIME = 1;
4104 // Bootloader's 1st stage execution time.
4105 // Logged from bootstat.
4106 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4107 // Bootloader's 1st stage loading time.
4108 // Logged from bootstat.
4109 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4110 // Bootloader's kernel loading time.
4111 // Logged from bootstat.
4112 BOOTLOADER_KERNEL_LOAD = 4;
4113 // Bootloader's 2nd stage execution time.
4114 // Logged from bootstat.
4115 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4116 // Bootloader's 2nd stage loading time.
4117 // Logged from bootstat.
4118 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4119 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4120 // for locked device.
4121 // Logged from bootstat.
4122 BOOTLOADER_UI_WAIT = 7;
4123 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4124 // Logged from bootstat.
4125 BOOTLOADER_TOTAL = 8;
4126 // Shutdown duration inside init for the reboot before the current boot up.
4127 // Logged from f/b/services/.../BootReceiver.java.
4128 SHUTDOWN_DURATION = 9;
4129 // Total time for mounting of disk devices during bootup.
4130 // Logged from f/b/services/.../BootReceiver.java.
4131 MOUNT_DEFAULT_DURATION = 10;
4132 // Total time for early stage mounting of disk devices during bootup.
4133 // Logged from f/b/services/.../BootReceiver.java.
4134 MOUNT_EARLY_DURATION = 11;
4135 // Total time for late stage mounting of disk devices during bootup.
4136 // Logged from f/b/services/.../BootReceiver.java.
4137 MOUNT_LATE_DURATION = 12;
4138 // Average time to scan non-system app after OTA
4139 // Logged from f/b/services/.../PackageManagerService.java
4140 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4141 // Time to initialize Package manager after OTA
4142 // Logged from f/b/services/.../PackageManagerService.java
4143 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4144 // Time to scan all system app from Package manager after OTA
4145 // Logged from f/b/services/.../PackageManagerService.java
4146 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4147 // Init's total time for cold boot stage.
4148 // Logged from bootstat.
4149 COLDBOOT_WAIT = 16;
4150 // Init's total time for initializing selinux.
4151 // Logged from bootstat.
4152 SELINUX_INIT = 17;
4153 // Time since last factory reset.
4154 // Logged from bootstat.
4155 FACTORY_RESET_TIME_SINCE_RESET = 18;
4156 }
4157
4158 // Type of the event.
4159 optional DurationEvent event = 1;
4160 // Duration of the event in ms.
4161 optional int64 duration_millis = 2;
4162}
4163
4164/**
4165 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4166 * since boot-up.
4167 *
4168 * Logged from: bootstat and various system server components. Check each enums for details.
4169 */
4170message BootTimeEventElapsedTime {
4171 enum ElapsedTimeEvent {
4172 UNKNOWN = 0;
4173 // Time when init starts 1st stage. Logged from bootstat.
4174 ANDROID_INIT_STAGE_1 = 1;
4175 // Time when sys.boot_completed prop is set.
4176 // Logged from bootstat.
4177 BOOT_COMPLETE = 2;
4178 // BOOT_COMPLETE for encrypted device.
4179 BOOT_COMPLETE_ENCRYPTION = 3;
4180 // BOOT_COMPLETE for device with no encryption.
4181 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4182 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4183 BOOT_COMPLETE_POST_DESCRYPT = 5;
4184 // BOOT_COMPLETE after factory reset.
4185 FACTORY_RESET_BOOT_COMPLETE = 6;
4186 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4187 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4188 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4189 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4190 // BOOT_COMPLETE after OTA.
4191 OTA_BOOT_COMPLETE = 9;
4192 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4193 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4194 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4195 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4196 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4197 // Logged from f/b/services/.../UserController.java
4198 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4199 // Time when the system starts sending BOOT_COMPLETED broadcast.
4200 // Logged from f/b/services/.../UserController.java
4201 FRAMEWORK_BOOT_COMPLETED = 13;
4202 // Time when the package manager starts init.
4203 // Logged from f/b/services/.../SystemServer.java
4204 PACKAGE_MANAGER_INIT_START = 14;
4205 // Time when package manager is ready
4206 // Logged from f/b/services/.../SystemServer.java
4207 PACKAGE_MANAGER_INIT_READY = 15;
4208 // Represents the time when user has entered unlock credential for system with user pin.
4209 // Logged from bootstat.
4210 POST_DECRYPT = 16;
4211 // Represents the start of zygote's init.
4212 // Logged from zygote itself.
4213 ZYGOTE_INIT_START = 17;
4214 // Represents the start of secondary zygote's init.
4215 // TODO: add logging to zygote
4216 SECONDARY_ZYGOTE_INIT_START = 18;
4217 // Represents the start of system server's init.
4218 // Logged from f/b/services/.../SystemServer.java
4219 SYSTEM_SERVER_INIT_START = 19;
4220 // Represents the completion of system server's init.
4221 // Logged from f/b/services/.../SystemServer.java
4222 SYSTEM_SERVER_READY = 20;
4223 // Represents the start of launcher during boot-up.
4224 // TODO: add logging
4225 LAUNCHER_START = 21;
4226 // Represents the completion of launcher's initial rendering. User can use other apps from
4227 // launcher from this point.
4228 // TODO: add logging
4229 LAUNCHER_SHOWN = 22;
4230 }
4231
4232 // Type of the event.
4233 optional ElapsedTimeEvent event = 1;
4234 // Time since bootup for the event.
4235 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4236 optional int64 time_millis = 2;
4237}
4238
4239/**
4240 * Boot time events with UTC time.
4241 *
4242 * Logged from: bootstat and various system server components. Check each enums for details.
4243 */
4244message BootTimeEventUtcTime {
4245 enum UtcTimeEvent {
4246 UNKNOWN = 0;
4247 // Time of the bootstat's marking of 1st boot after the last factory reset.
4248 // Logged from bootstat.
4249 FACTORY_RESET_RESET_TIME = 1;
4250 // The time when bootstat records FACTORY_RESET_* events. This is close to
4251 // BOOT_COMPLETE time for the current bootup.
4252 // Logged from bootstat.
4253 FACTORY_RESET_CURRENT_TIME = 2;
4254 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4255 // Logged from bootstat.
4256 FACTORY_RESET_RECORD_VALUE = 3;
4257 }
4258
4259 // Type of the event.
4260 optional UtcTimeEvent event = 1;
4261 // UTC time for the event.
4262 optional int64 utc_time_secs = 2;
4263}
4264
4265/**
4266 * Boot time events representing specific error code during bootup.
4267 * Meaning of error code can be different per each event type.
4268 *
4269 * Logged from: bootstat and various system server components. Check each enums for details.
4270 */
4271message BootTimeEventErrorCode {
4272 enum ErrorCodeEvent {
4273 UNKNOWN = 0;
4274 // Linux error code for time() call to get the current UTC time.
4275 // Logged from bootstat.
4276 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4277 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4278 // as UMOUNT_STAT_* from init/reboot.cpp.
4279 // Logged from f/b/services/.../BootReceiver.java.
4280 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004281 // Reprepsents fie system mounting error code of /data partition for the current boot.
4282 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004283 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004284 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004285 }
4286
4287 // Type of the event.
4288 optional ErrorCodeEvent event = 1;
4289 // error code defined per each event type.
4290 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4291 // FS_MGR_FS_STAT.
4292 optional int32 error_code = 2;
4293}
4294
Chenjie Yubbcbc602018-02-05 16:51:52 -08004295//////////////////////////////////////////////////////////////////////
4296// Pulled atoms below this line //
4297//////////////////////////////////////////////////////////////////////
4298
4299/**
David Chenc8a43242017-10-17 16:23:28 -07004300 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4301 *
4302 * Pulled from:
4303 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4304 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004305message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004306 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004307
4308 optional int64 rx_bytes = 2;
4309
4310 optional int64 rx_packets = 3;
4311
4312 optional int64 tx_bytes = 4;
4313
4314 optional int64 tx_packets = 5;
4315}
4316
4317/**
4318 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4319 *
4320 * Pulled from:
4321 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4322 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004323message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004324 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004325
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004326 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4327 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004328
4329 optional int64 rx_bytes = 3;
4330
4331 optional int64 rx_packets = 4;
4332
4333 optional int64 tx_bytes = 5;
4334
4335 optional int64 tx_packets = 6;
4336}
4337
4338/**
4339 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4340 *
4341 * Pulled from:
4342 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4343 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004344message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004345 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004346
4347 optional int64 rx_bytes = 2;
4348
4349 optional int64 rx_packets = 3;
4350
4351 optional int64 tx_bytes = 4;
4352
4353 optional int64 tx_packets = 5;
4354}
4355
4356/**
4357 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4358 *
4359 * Pulled from:
4360 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4361 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004362message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004363 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004364
Yao Chenc40a19d2018-03-15 16:48:25 -07004365 // 1 denotes foreground and 0 denotes background. This is called Set in
4366 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004367 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004368
4369 optional int64 rx_bytes = 3;
4370
4371 optional int64 rx_packets = 4;
4372
4373 optional int64 tx_bytes = 5;
4374
4375 optional int64 tx_packets = 6;
4376}
4377
4378/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004379 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4380 *
4381 * Pulled from:
4382 * StatsCompanionService
4383 */
4384message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004385 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004386
4387 optional int64 rx_bytes = 2;
4388
4389 optional int64 tx_bytes = 3;
4390}
4391
4392/**
David Chenc8a43242017-10-17 16:23:28 -07004393 * Pulls the kernel wakelock durations. This atom is adapted from
4394 * android/internal/os/KernelWakelockStats.java
4395 *
4396 * Pulled from:
4397 * StatsCompanionService using KernelWakelockReader.
4398 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004399message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004400 optional string name = 1;
4401
4402 optional int32 count = 2;
4403
4404 optional int32 version = 3;
4405
Yangster-maca8a30442018-10-13 23:46:34 -07004406 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004407}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004408
Chenjie Yu05013b32017-11-21 10:21:41 -08004409/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004410 * Pulls low power state information. If power.stats HAL is not available, this
4411 * includes platform and subsystem sleep state information,
4412 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4413 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004414 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004415 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004416 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4417 * as defined in:
4418 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004419 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004420message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004421 // Subsystem name
4422 optional string subsystem_name = 1;
4423 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4424 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004425 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4426 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004427 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004428 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004429 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004430 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004431 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004432}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004433
Chenjie Yu05013b32017-11-21 10:21:41 -08004434/**
Bookatz92da2832018-11-01 18:10:03 -07004435 * Pulls on-device power measurement information.
4436 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4437 * Pulled from:
4438 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4439 */
4440message OnDevicePowerMeasurement {
4441 // Name of the subsystem (to which the rail belongs).
4442 optional string subsystem_name = 1;
4443
4444 // Rail name. The rail lies within the subsystem.
4445 optional string rail_name = 2;
4446
4447 // Time (in ms since boot) at which the rail energy value was measured.
4448 // This may differ slightly from the time that statsd logs this information.
4449 optional uint64 measurement_timestamp_millis = 3;
4450
4451 // Accumulated energy used via the rail since device boot in uWs.
4452 optional uint64 energy_microwatt_secs = 4;
4453}
4454
4455/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004456 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004457 * Pulls the time the cpu spend on the frequency index. Frequency index
4458 * starts from highest to lowest. The value should be monotonically
4459 * increasing since boot. However, if there is a cpu
4460 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004461 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004462message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004463 optional uint32 cluster = 1;
4464 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004465 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004466}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004467
Chenjie Yu05013b32017-11-21 10:21:41 -08004468/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004469 * Pulls Cpu Time Per Uid.
4470 * Note that isolated process uid time should be attributed to host uids.
4471 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004472message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004473 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004474 optional uint64 user_time_micros = 2;
4475 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004476}
4477
4478/**
4479 * Pulls Cpu Time Per Uid per frequency.
4480 * Note that isolated process uid time should be attributed to host uids.
4481 * For each uid, we order the time by descending frequencies.
4482 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004483message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004484 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004485 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004486 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004487}
Hugo Benichi884970e2017-11-14 22:42:46 +09004488
Chenjie Yu05013b32017-11-21 10:21:41 -08004489/**
4490 * Pulls Wifi Controller Activity Energy Info
4491 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004492message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004493 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004494 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004495 // stack reported state
4496 // TODO: replace this with proto enum
4497 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004498 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004499 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004500 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004501 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004502 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004503 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004504 // product of current(mA), voltage(V) and time(ms)
4505 optional uint64 controller_energy_used = 6;
4506}
4507
4508/**
4509 * Pulls Modem Activity Energy Info
4510 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004511message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004512 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004513 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004514 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004515 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004516 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004517 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004518 /**
4519 * Tx power index
4520 * index 0 = tx_power < 0dBm
4521 * index 1 = 0dBm < tx_power < 5dBm
4522 * index 2 = 5dBm < tx_power < 15dBm
4523 * index 3 = 15dBm < tx_power < 20dBm
4524 * index 4 = tx_power > 20dBm
4525 */
4526 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004527 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004528 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004529 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004530 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004531 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004532 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004533 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004534 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004535 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004536 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004537 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004538 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004539 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004540}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004541
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004542/**
4543 * Pulls Bluetooth Activity Energy Info
4544 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4545 */
4546message BluetoothActivityInfo {
4547 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004548 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004549 // bluetooth stack state
4550 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004551 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004552 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004553 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004554 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004555 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004556 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004557 // product of current(mA), voltage(V) and time(ms)
4558 optional uint64 energy_used = 6;
4559}
4560
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004561/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004562 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004563 *
4564 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004565 */
4566message ProcessMemoryState {
4567 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004568 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004569
4570 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004571 // Usually package name, "system" for system server.
4572 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004573 optional string process_name = 2;
4574
Rafal Slawikda51b932018-12-13 16:31:33 +00004575 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004576 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004577
4578 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004579 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004580
4581 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004582 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004583
Rajeev Kumar90235992018-01-29 11:06:48 -08004584 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004585 // Value is read from memory.stat, field total_rss if per-app memory
4586 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004587 optional int64 rss_in_bytes = 6;
4588
4589 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004590 // Value is read from memory.stat, field total_cache if per-app memory
4591 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004592 optional int64 cache_in_bytes = 7;
4593
4594 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004595 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004596 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004597 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004598
Rafal Slawik203c3db2019-09-25 19:53:01 +01004599 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004600 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004601
Rafal Slawik203c3db2019-09-25 19:53:01 +01004602 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4603 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004604
Rafal Slawik203c3db2019-09-25 19:53:01 +01004605 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4606 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004607}
4608
4609/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004610 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004611 *
4612 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4613 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004614 *
4615 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004616 */
4617message ProcessMemoryHighWaterMark {
4618 // The uid if available. -1 means not available.
4619 optional int32 uid = 1 [(is_uid) = true];
4620
Rafal Slawikda51b932018-12-13 16:31:33 +00004621 // The process name.
4622 // Usually package name or process cmdline.
4623 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004624 optional string process_name = 2;
4625
Rafal Slawik239b6802019-09-09 18:46:01 +01004626 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4627 // computed by converting kilobytes to bytes.
4628 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4629
Rafal Slawik3bea8952018-11-15 12:39:33 +00004630 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4631 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004632 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004633}
4634
4635/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004636 * Logs the memory stats for a process.
4637 *
4638 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4639 * and for selected native processes.
4640 */
4641message ProcessMemorySnapshot {
4642 // The uid if available. -1 means not available.
4643 optional int32 uid = 1 [(is_uid) = true];
4644
4645 // The process name.
4646 // Usually package name or process cmdline.
4647 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4648 optional string process_name = 2;
4649
4650 // The pid of the process.
4651 // Allows to disambiguate instances of the process.
4652 optional int32 pid = 3;
4653
4654 // The current OOM score adjustment value.
4655 // Read from ProcessRecord for managed processes.
4656 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4657 optional int32 oom_score_adj = 4;
4658
4659 // The current RSS of the process.
4660 // VmRSS from /proc/pid/status.
4661 optional int32 rss_in_kilobytes = 5;
4662
4663 // The current anon RSS of the process.
4664 // RssAnon from /proc/pid/status.
4665 optional int32 anon_rss_in_kilobytes = 6;
4666
4667 // The current swap size of the process.
4668 // VmSwap from /proc/pid/status.
4669 optional int32 swap_in_kilobytes = 7;
4670
4671 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4672 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4673}
4674
4675/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004676 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004677 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004678message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004679 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004680}
4681
4682/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004683 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004684 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004685message SystemUptime {
4686 // Milliseconds since the system was booted.
4687 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4688 // for external input).
4689 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004690 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004691}
4692
4693/*
4694 * Reads from /proc/uid_concurrent_active_time which has the format:
4695 * active: X (X is # cores)
4696 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4697 * [uid1]: [time-0] [time-1] [time-2] ... ...
4698 * ...
4699 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4700 * The file contains a monotonically increasing count of time for a single boot.
4701 */
4702message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004703 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004704 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004705}
4706
4707/**
4708 * Reads from /proc/uid_concurrent_policy_time which has the format:
4709 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4710 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4711 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4712 * ...
4713 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4714 * The file contains a monotonically increasing count of time for a single boot.
4715 */
4716message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004717 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004718 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004719 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004720}
4721
4722/*
4723 * Pulls free disk space, for data, system partition and temporary directory.
4724 */
4725message DiskSpace {
4726 // available bytes in data partition
4727 optional uint64 data_available_bytes = 1;
4728 // available bytes in system partition
4729 optional uint64 system_available_bytes = 2;
4730 // available bytes in download cache or temp directories
4731 optional uint64 temp_available_bytes = 3;
4732}
Tej Singhbf972d92018-01-10 20:51:13 -08004733
4734/**
4735 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004736 *
4737 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004738 */
4739message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004740 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004741}
4742
4743/**
4744 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004745 * Pulled from:
4746 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004747 */
4748message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004749 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004750}
4751
4752/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004753 * Pulls battery voltage.
4754 * Pulled from:
4755 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4756 */
4757message BatteryVoltage {
4758 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004759 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004760}
4761
4762/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004763 * Pulls battery level (percent full, from 0 to 100).
4764 *
4765 * Pulled from:
4766 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4767 */
4768message BatteryLevel {
4769 // Battery level. Should be in [0, 100].
4770 optional int32 battery_level = 1;
4771}
4772
4773/**
Tej Singhd89137e2018-03-26 14:51:40 -07004774 * Pulls the temperature of various parts of the device.
4775 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004776 *
Maggie White442b6312019-04-05 16:26:44 -07004777 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004778 */
4779message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004780 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004781 optional android.os.TemperatureTypeEnum sensor_location = 1;
4782
4783 // The name of the temperature source. Eg. CPU0
4784 optional string sensor_name = 2;
4785
Tej Singhd89137e2018-03-26 14:51:40 -07004786 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004787 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004788 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004789
4790 // Relative severity of the throttling, see enum definition.
4791 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004792}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004793
4794/**
4795 * Pulls the statistics of calls to Binder.
4796 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004797 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4798 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004799 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004800 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004801 */
4802message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004803 // UID of the process responsible for the binder transaction. It will be set if the process
4804 // executing the binder transaction attribute the transaction to another uid using
4805 // Binder.setThreadWorkSource().
4806 //
4807 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004808 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004809 // UID of the process executing the binder transaction.
4810 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004811 // Fully qualified class name of the API call.
4812 //
4813 // This is a system server class name.
4814 //
4815 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4816 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4817 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4818 // commonly used APIs.
4819 optional string service_class_name = 2;
4820 // Method name of the API call. It can also be a transaction code if we cannot
4821 // resolve it to a name. See Binder#getTransactionName.
4822 //
4823 // This is a system server method name.
4824 optional string service_method_name = 3;
4825 // Total number of API calls.
4826 optional int64 call_count = 4;
4827 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4828 optional bool screen_interactive = 13;
4829 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4830 // call_count will be equal to recorded_call_count.
4831 //
4832 // If recorded_call_count is different than call_count, it means data collection has been
4833 // sampled. All the fields below will be sampled in this case.
4834 optional int64 recorded_call_count = 12;
4835 // Number of exceptions thrown by the API.
4836 optional int64 recorded_exception_count = 5;
4837 // Total latency of all API calls.
4838 // Average can be computed using total_latency_micros / recorded_call_count.
4839 optional int64 recorded_total_latency_micros = 6;
4840 // Maximum latency of one API call.
4841 optional int64 recorded_max_latency_micros = 7;
4842 // Total CPU usage of all API calls.
4843 // Average can be computed using total_cpu_micros / recorded_call_count.
4844 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4845 optional int64 recorded_total_cpu_micros = 8;
4846 // Maximum CPU usage of one API call.
4847 optional int64 recorded_max_cpu_micros = 9;
4848 // Maximum parcel reply size of one API call.
4849 optional int64 recorded_max_reply_size_bytes = 10;
4850 // Maximum parcel request size of one API call.
4851 optional int64 recorded_max_request_size_bytes = 11;
4852}
4853
4854/**
4855 * Pulls the statistics of exceptions during calls to Binder.
4856 *
4857 * Binder stats are cumulative from boot unless somebody reset the data using
4858 * > adb shell dumpsys binder_calls_stats --reset
4859 */
4860message BinderCallsExceptions {
4861 // Exception class name, e.g. java.lang.IllegalArgumentException.
4862 //
4863 // This is an exception class name thrown by the system server.
4864 optional string exception_class_name = 1;
4865 // Total number of exceptions.
4866 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004867}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004868
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004869/**
4870 * Pulls the statistics of message dispatching on HandlerThreads.
4871 *
4872 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4873 * config on the device.
4874 *
4875 * Next tag: 11
4876 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004877message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004878 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004879 optional int32 uid = 1 [(is_uid) = true];
4880
4881 // Fully qualified class name of the handler target class.
4882 //
4883 // This field does not contain PII. This is a system server class name.
4884 optional string handler_class_name = 2;
4885
4886 // The name of the thread that runs the Looper.
4887 //
4888 // This field does not contain PII. This is a system server thread name.
4889 optional string looper_thread_name = 3;
4890
4891 // The name of the dispatched message.
4892 //
4893 // This field does not contain PII. This is a system server constant or class
4894 // name.
4895 optional string message_name = 4;
4896
4897 // Total number of successfully dispatched messages.
4898 optional int64 message_count = 5;
4899
4900 // Total number of messages that failed dispatching.
4901 optional int64 exception_count = 6;
4902
4903 // Total number of processed messages we have data recorded for. If we
4904 // collected data for all the messages, message_count will be equal to
4905 // recorded_message_count.
4906 //
4907 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004908 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004909 optional int64 recorded_message_count = 7;
4910
4911 // Total latency of all processed messages.
4912 // Average can be computed using recorded_total_latency_micros /
4913 // recorded_message_count.
4914 optional int64 recorded_total_latency_micros = 8;
4915
4916 // Total CPU usage of all processed message.
4917 // Average can be computed using recorded_total_cpu_micros /
4918 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004919 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004920 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004921
4922 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4923 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004924
4925 // Max recorded CPU usage of all processed messages.
4926 optional int64 recorded_max_cpu_micros = 11;
4927
4928 // Max recorded latency of all processed messages.
4929 optional int64 recorded_max_latency_micros = 12;
4930
4931 // Total number of messages we tracked the dispatching delay for. If we
4932 // collected data for all the messages, message_count will be equal to
4933 // recorded_delay_message_count.
4934 //
4935 // If recorded_delay_message_count is different than message_count, it means data
4936 // collection has been sampled or/and not all messages specified the target dispatch time.
4937 // The fields below will be sampled in this case.
4938 optional int64 recorded_delay_message_count = 13;
4939
4940 // Total dispatching delay of all processed messages.
4941 // Calculated as a difference between the target dispatching time (Message.when)
4942 // and the actual dispatching time.
4943 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4944 optional int64 recorded_total_delay_millis = 14;
4945
4946 // Max dispatching delay of all processed messages.
4947 // Calculated as a difference between the target dispatching time (Message.when)
4948 // and the actual dispatching time.
4949 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004950}
Tej Singh86dc9db2018-09-06 00:39:57 +00004951
4952/**
4953 * Pulls disk information, such as write speed and latency.
4954 */
4955message DiskStats {
4956 // Time taken to open, write 512B to, and close a file.
4957 // -1 if error performing the check.
4958 optional int64 data_write_latency_millis = 1;
4959
4960 optional bool file_based_encryption = 2;
4961
4962 // Recent disk write speed in kB/s.
4963 // -1 if error querying storageed.
4964 // 0 if data is unavailable.
4965 optional int32 recent_disk_write_speed = 3;
4966}
4967
4968
4969/**
4970 * Free and total bytes of the Data, Cache, and System partition.
4971 */
4972message DirectoryUsage {
4973 enum Directory {
4974 UNKNOWN = 0;
4975 DATA = 1;
4976 CACHE = 2;
4977 SYSTEM = 3;
4978 }
4979 optional Directory directory = 1;
4980 optional int64 free_bytes = 2;
4981 optional int64 total_bytes = 3;
4982}
4983
4984
4985/**
4986 * Size of an application: apk size, data size, and cache size.
4987 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4988 * Information is only reported for apps with the primary user (user 0).
4989 * Sizes are aggregated by package name.
4990 */
4991message AppSize {
4992 // Including uids will involve modifying diskstats logic.
4993 optional string package_name = 1;
4994 // App size in bytes. -1 if unavailable.
4995 optional int64 app_size_bytes = 2;
4996 // App data size in bytes. -1 if unavailable.
4997 optional int64 app_data_size_bytes = 3;
4998 // App cache size in bytes. -1 if unavailable.
4999 optional int64 app_cache_size_bytes = 4;
5000 // Time that the cache file was produced.
5001 // Uses System.currentTimeMillis(), which is wall clock time.
5002 optional int64 cache_time_millis = 5;
5003}
5004
5005
5006/**
5007 * Size of a particular category. Eg: photos, videos.
5008 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5009 */
5010message CategorySize {
5011 enum Category {
5012 UNKNOWN = 0;
5013 APP_SIZE = 1;
5014 APP_DATA_SIZE = 2;
5015 APP_CACHE_SIZE = 3;
5016 PHOTOS = 4;
5017 VIDEOS = 5;
5018 AUDIO = 6;
5019 DOWNLOADS = 7;
5020 SYSTEM = 8;
5021 OTHER = 9;
5022 }
5023 optional Category category = 1;
5024 // Category size in bytes.
5025 optional int64 size_bytes = 2;
5026 // Time that the cache file was produced.
5027 // Uses System.currentTimeMillis(), which is wall clock time.
5028 optional int64 cache_time_millis = 3;
5029}
Tej Singhd6d6d772018-09-05 17:41:25 -07005030
5031/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005032 * Pulls per uid I/O stats. The stats are cumulative since boot.
5033 *
5034 * Read/write bytes are I/O events from a storage device
5035 * Read/write chars are data requested by read/write syscalls, and can be
5036 * satisfied by caching.
5037 *
5038 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5039 */
5040message DiskIo {
5041 optional int32 uid = 1 [(is_uid) = true];
5042 optional int64 fg_chars_read = 2;
5043 optional int64 fg_chars_write = 3;
5044 optional int64 fg_bytes_read = 4;
5045 optional int64 fg_bytes_write = 5;
5046 optional int64 bg_chars_read = 6;
5047 optional int64 bg_chars_write = 7;
5048 optional int64 bg_bytes_read = 8;
5049 optional int64 bg_bytes_write = 9;
5050 optional int64 fg_fsync = 10;
5051 optional int64 bg_fsync= 11;
5052}
5053
5054
5055/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005056 * Pulls the number of fingerprints for each user.
5057 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005058 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005059 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005060message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005061 // The associated user. Eg: 0 for owners, 10+ for others.
5062 // Defined in android/os/UserHandle.java
5063 optional int32 user = 1;
5064 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005065 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005066}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005067
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005068/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005069 * Pulls the number of faces for each user.
5070 *
5071 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5072 */
5073message NumFacesEnrolled {
5074 // The associated user. Eg: 0 for owners, 10+ for others.
5075 // Defined in android/os/UserHandle.java
5076 optional int32 user = 1;
5077 // Number of faces registered to that user.
5078 optional int32 num_faces_enrolled = 2;
5079}
5080/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005081 * A mapping of role holder -> role
5082 */
5083message RoleHolder {
5084 // uid of the role holder
5085 optional int32 uid = 1 [(is_uid) = true];
5086
5087 // package name of the role holder
5088 optional string package_name = 2;
5089
5090 // the role held
5091 optional string role = 3;
5092}
5093
Yangsteraf9aee72018-10-12 09:26:16 -07005094message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005095 // These are all in byte resolution.
5096 optional int64 min = 1 [deprecated = true];
5097 optional int64 average = 2 [deprecated = true];
5098 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005099
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005100 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5101 // int64 fields.
5102 optional int32 mean_kb = 4;
5103 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005104}
5105
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005106// A reduced subset of process states; reducing the number of possible states allows more
5107// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5108enum ProcessStateAggregated {
5109 PROCESS_STATE_UNKNOWN = 0;
5110 // Persistent system process.
5111 PROCESS_STATE_PERSISTENT = 1;
5112 // Top activity; actually any visible activity.
5113 PROCESS_STATE_TOP = 2;
5114 // Process binding to top or a foreground service.
5115 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5116 // Processing running a foreground service.
5117 PROCESS_STATE_FGS = 4;
5118 // Important foreground process (ime, wallpaper, etc).
5119 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5120 // Important background process.
5121 PROCESS_STATE_BACKGROUND = 6;
5122 // Process running a receiver.
5123 PROCESS_STATE_RECEIVER = 7;
5124 // All kinds of cached processes.
5125 PROCESS_STATE_CACHED = 8;
5126}
5127
5128// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005129message ProcessStatsStateProto {
5130 optional android.service.procstats.ScreenState screen_state = 1;
5131
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005132 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005133
5134 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5135 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005136 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5137
5138 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005139
5140 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005141 optional int64 duration_millis = 4 [deprecated = true];
5142 // Same as above, but with minute resolution so it fits into an int32.
5143 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005144
5145 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005146 optional int64 realtime_duration_millis = 9 [deprecated = true];
5147 // Same as above, but with minute resolution so it fits into an int32.
5148 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005149
5150 // # of samples taken
5151 optional int32 sample_size = 5;
5152
5153 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005154 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005155
5156 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005157 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005158
5159 // RSS is memory resident for this process
5160 optional AggStats rss = 8;
5161}
5162
5163// Next Tag: 7
5164message ProcessStatsProto {
5165 // Name of process.
5166 optional string process = 1;
5167
5168 // Uid of the process.
5169 optional int32 uid = 2;
5170
5171 // Information about how often kills occurred
5172 message Kill {
5173 // Count of excessive CPU kills
5174 optional int32 cpu = 1;
5175
5176 // Count of kills when cached
5177 optional int32 cached = 2;
5178
5179 // PSS stats during cached kill
5180 optional AggStats cached_pss = 3;
5181 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005182 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005183
5184 // Time and memory spent in various states.
5185 repeated ProcessStatsStateProto states = 5;
5186
5187 // Total time process has been running... screen_state, memory_state, and process_state
5188 // will not be set.
5189 optional ProcessStatsStateProto total_running_state = 6;
5190}
5191
5192message PackageServiceOperationStatsProto {
5193 // Operate enum: Started, Foreground, Bound, Executing
5194 optional android.service.procstats.ServiceOperationState operation = 1;
5195
5196 // Number of times the service was in this operation.
5197 optional int32 count = 2;
5198
5199 // Information about a state the service can be in.
5200 message StateStats {
5201 // Screen state enum.
5202 optional android.service.procstats.ScreenState screen_state = 1;
5203 // Memory state enum.
5204 optional android.service.procstats.MemoryState memory_state = 2;
5205
5206 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005207 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005208 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005209 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005210 }
5211 repeated StateStats state_stats = 3;
5212}
5213
5214message PackageServiceStatsProto {
5215 // Name of service component.
5216 optional string service_name = 1;
5217
5218 // The operation stats.
5219 // The package_name, package_uid, package_version, service_name will not be set to save space.
5220 repeated PackageServiceOperationStatsProto operation_stats = 2;
5221}
5222
5223message PackageAssociationSourceProcessStatsProto {
5224 // Uid of the process.
5225 optional int32 process_uid = 1;
5226 // Process name.
5227 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005228 // Package name.
5229 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005230 // Total count of the times this association appeared.
5231 optional int32 total_count = 3;
5232
5233 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005234 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005235
5236 // Total count of the times this association became actively impacting its target process.
5237 optional int32 active_count = 5;
5238
5239 // Information on one source in this association.
5240 message StateStats {
5241 // Process state enum.
5242 optional android.service.procstats.ProcessState process_state = 1;
5243 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005244 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005245 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005246 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005247 }
5248 repeated StateStats active_state_stats = 6;
5249}
5250
5251message PackageAssociationProcessStatsProto {
5252 // Name of the target component.
5253 optional string component_name = 1;
5254 // Information on one source in this association.
5255 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5256}
5257
5258
5259message ProcessStatsPackageProto {
5260 // Name of package.
5261 optional string package = 1;
5262
5263 // Uid of the package.
5264 optional int32 uid = 2;
5265
5266 // Version of the package.
5267 optional int64 version = 3;
5268
5269 // Stats for each process running with the package loaded in to it.
5270 repeated ProcessStatsProto process_stats = 4;
5271
5272 // Stats for each of the package's services.
5273 repeated PackageServiceStatsProto service_stats = 5;
5274
5275 // Stats for each association with the package.
5276 repeated PackageAssociationProcessStatsProto association_stats = 6;
5277}
5278
5279message ProcessStatsSectionProto {
5280 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005281 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005282
5283 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005284 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005285
5286 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005287 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005288
5289 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005290 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005291
5292 // System runtime library. e.g. "libdvm.so", "libart.so".
5293 optional string runtime = 5;
5294
5295 // whether kernel reports swapped pss.
5296 optional bool has_swapped_pss = 6;
5297
5298 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5299 enum Status {
5300 STATUS_UNKNOWN = 0;
5301 STATUS_COMPLETE = 1;
5302 STATUS_PARTIAL = 2;
5303 STATUS_SHUTDOWN = 3;
5304 STATUS_SYSPROPS = 4;
5305 }
5306 repeated Status status = 7;
5307
Chenjie Yub2ecc792019-01-17 10:27:26 -08005308 // Number of pages available of various types and sizes, representation fragmentation.
5309 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5310
Yangsteraf9aee72018-10-12 09:26:16 -07005311 // Stats for each process.
5312 repeated ProcessStatsProto process_stats = 8;
5313
5314 // Stats for each package.
5315 repeated ProcessStatsPackageProto package_stats = 9;
5316}
5317
Chenjie Yub2ecc792019-01-17 10:27:26 -08005318message ProcessStatsAvailablePagesProto {
5319 // Node these pages are in (as per /proc/pagetypeinfo)
5320 optional int32 node = 1;
5321
5322 // Zone these pages are in (as per /proc/pagetypeinfo)
5323 optional string zone = 2;
5324
5325 // Label for the type of these pages (as per /proc/pagetypeinfo)
5326 optional string label = 3;
5327
5328 // Distribution of number of pages available by order size. First entry in array is
5329 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5330 repeated int32 pages_per_order = 4;
5331}
5332
Chenjie Yu12e5e672018-09-14 15:54:59 -07005333/**
5334 * Pulled from ProcessStatsService.java
5335 */
5336message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005337 optional ProcessStatsSectionProto proc_stats_section = 1;
5338}
5339
Chenjie Yuf910b7802019-01-11 16:08:20 -08005340/**
5341 * Pulled from ProcessStatsService.java
5342 */
5343message ProcStatsPkgProc {
5344 optional ProcessStatsSectionProto proc_stats_section = 1;
5345}
5346
Chris Wrencdea3b72019-11-22 16:58:17 -05005347// Next Tag: 2
5348message PackageRemoteViewInfoProto {
5349 optional string package_name = 1;
5350 // add per-package additional info here (like channels)
5351}
5352
5353// Next Tag: 2
5354message NotificationRemoteViewsProto {
5355 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5356}
5357
5358/**
5359 * Pulled from NotificationManagerService.java
5360 */
5361message NotificationRemoteViews {
5362 optional NotificationRemoteViewsProto notification_remote_views = 1;
5363}
5364
Yangsteraf9aee72018-10-12 09:26:16 -07005365message PowerProfileProto {
5366 optional double cpu_suspend = 1;
5367
5368 optional double cpu_idle = 2;
5369
5370 optional double cpu_active = 3;
5371
5372 message CpuCluster {
5373 optional int32 id = 1;
5374 optional double cluster_power = 2;
5375 optional int32 cores = 3;
5376 repeated int64 speed = 4;
5377 repeated double core_power = 5;
5378 }
5379
5380 repeated CpuCluster cpu_cluster = 40;
5381
5382 optional double wifi_scan = 4;
5383
5384 optional double wifi_on = 5;
5385
5386 optional double wifi_active = 6;
5387
5388 optional double wifi_controller_idle = 7;
5389
5390 optional double wifi_controller_rx = 8;
5391
5392 optional double wifi_controller_tx = 9;
5393
5394 repeated double wifi_controller_tx_levels = 10;
5395
5396 optional double wifi_controller_operating_voltage = 11;
5397
5398 optional double bluetooth_controller_idle = 12;
5399
5400 optional double bluetooth_controller_rx = 13;
5401
5402 optional double bluetooth_controller_tx = 14;
5403
5404 optional double bluetooth_controller_operating_voltage = 15;
5405
5406 optional double modem_controller_sleep = 16;
5407
5408 optional double modem_controller_idle = 17;
5409
5410 optional double modem_controller_rx = 18;
5411
5412 repeated double modem_controller_tx = 19;
5413
5414 optional double modem_controller_operating_voltage = 20;
5415
5416 optional double gps_on = 21;
5417
5418 repeated double gps_signal_quality_based = 22;
5419
5420 optional double gps_operating_voltage = 23;
5421
5422 optional double bluetooth_on = 24;
5423
5424 optional double bluetooth_active = 25;
5425
5426 optional double bluetooth_at_cmd = 26;
5427
5428 optional double ambient_display = 27;
5429
5430 optional double screen_on = 28;
5431
5432 optional double radio_on = 29;
5433
5434 optional double radio_scanning = 30;
5435
5436 optional double radio_active = 31;
5437
5438 optional double screen_full = 32;
5439
5440 optional double audio = 33;
5441
5442 optional double video = 34;
5443
5444 optional double flashlight = 35;
5445
5446 optional double memory = 36;
5447
5448 optional double camera = 37;
5449
5450 optional double wifi_batched_scan = 38;
5451
5452 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005453}
Chenjie Yuab530202018-09-26 12:39:20 -07005454
5455/**
5456 * power_profile.xml and other constants for power model calculations.
5457 * Pulled from PowerProfile.java
5458 */
5459message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005460 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005461}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005462
5463/**
arangelovd5db50e2018-10-12 20:24:39 +01005464 * Logs when a user restriction was added or removed.
5465 *
5466 * Logged from:
5467 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5468 */
5469message UserRestrictionChanged {
5470 // The raw string of the user restriction as defined in UserManager.
5471 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5472 optional string restriction = 1;
5473 // Whether the restriction is enabled or disabled.
5474 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005475}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005476
5477/**
5478 * Pulls process user time and system time. Puller takes a snapshot of all pids
5479 * in the system and returns cpu stats for those that are working at the time.
5480 * Dead pids will be dropped. Kernel processes are excluded.
5481 * Min cool-down is 5 sec.
5482 */
5483message ProcessCpuTime {
5484 optional int32 uid = 1 [(is_uid) = true];
5485
5486 optional string process_name = 2;
5487 // Process cpu time in user space, cumulative from boot/process start
5488 optional int64 user_time_millis = 3;
5489 // Process cpu time in system space, cumulative from boot/process start
5490 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005491}
Misha Wagner5a51e002018-10-03 15:04:09 +01005492
5493/**
5494 * Pulls the CPU usage for each thread.
5495 *
5496 * Read from /proc/$PID/task/$TID/time_in_state files.
5497 *
5498 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5499 * time_in_state files not being present on some phones, have not been addressed. These should be
5500 * considered before a public release.
5501 */
5502message CpuTimePerThreadFreq {
5503 // UID that owns the process.
5504 optional int32 uid = 1 [(is_uid) = true];
5505 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005506 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005507 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005508 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005509 // Name of the process taken from `/proc/$PID/cmdline`.
5510 optional string process_name = 4;
5511 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5512 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005513
5514 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5515 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5516 // frequencies are given here as the alternative is sending eight separate atoms. This method
5517 // significantly reduces the amount of data created
5518 optional int32 frequency1_khz = 6;
5519 optional int32 time1_millis = 7;
5520 optional int32 frequency2_khz = 8;
5521 optional int32 time2_millis = 9;
5522 optional int32 frequency3_khz = 10;
5523 optional int32 time3_millis = 11;
5524 optional int32 frequency4_khz = 12;
5525 optional int32 time4_millis = 13;
5526 optional int32 frequency5_khz = 14;
5527 optional int32 time5_millis = 15;
5528 optional int32 frequency6_khz = 16;
5529 optional int32 time6_millis = 17;
5530 optional int32 frequency7_khz = 18;
5531 optional int32 time7_millis = 19;
5532 optional int32 frequency8_khz = 20;
5533 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005534}
Bookatz75ee6042018-11-09 12:27:37 -08005535
5536/**
Bookatz366a4432018-11-20 09:42:33 -08005537 * Pulls information about the device's build.
5538 */
5539message BuildInformation {
5540 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5541 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5542 optional string fingerprint = 1;
5543
5544 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5545 optional string brand = 2;
5546
5547 // Build.PRODUCT. The name of the overall product.
5548 optional string product = 3;
5549
5550 // Build.DEVICE. The name of the industrial design.
5551 optional string device = 4;
5552
5553 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5554 optional string version_release = 5;
5555
5556 // Build.ID. E.g. a label like "M4-rc20".
5557 optional string id = 6;
5558
5559 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5560 // represent this build.
5561 optional string version_incremental = 7;
5562
5563 // Build.TYPE. The type of build, like "user" or "eng".
5564 optional string type = 8;
5565
5566 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5567 optional string tags = 9;
5568}
5569
5570/**
Adam He420947c2019-01-23 15:59:09 -08005571 * Logs information about mismatched caller for content capture.
5572 *
5573 * Logged from:
5574 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5575 */
5576message ContentCaptureCallerMismatchReported {
5577 optional string intended_package = 1;
5578 optional string calling_package = 2;
5579}
5580
5581/**
5582 * Logs information about content capture service events.
5583 *
5584 * Logged from:
5585 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5586 */
5587message ContentCaptureServiceEvents {
5588 // The type of event.
5589 enum Event {
5590 UNKNOWN = 0;
5591 ON_CONNECTED = 1;
5592 ON_DISCONNECTED = 2;
5593 SET_WHITELIST = 3;
5594 SET_DISABLED = 4;
5595 ON_USER_DATA_REMOVED = 5;
5596 }
5597 optional Event event = 1;
5598 // component/package of content capture service.
5599 optional string service_info = 2;
5600 // component/package of target.
5601 // it's a concatenated list of component/package for SET_WHITELIST event
5602 // separated by " ".
5603 optional string target_info = 3;
5604}
5605
5606/**
5607 * Logs information about content capture session events.
5608 *
5609 * Logged from:
5610 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5611 */
5612message ContentCaptureSessionEvents {
5613 // The type of event.
5614 enum Event {
5615 UNKNOWN = 0;
5616 ON_SESSION_STARTED = 1;
5617 ON_SESSION_FINISHED = 2;
5618 SESSION_NOT_CREATED = 3;
5619 }
5620 optional int32 session_id = 1;
5621 optional Event event = 2;
5622 // (n/a on session finished)
5623 optional int32 state_flags = 3;
5624 // component/package of content capture service.
5625 optional string service_info = 4;
5626 // component/package of app.
5627 // (n/a on session finished)
5628 optional string app_info = 5;
5629 optional bool is_child_session = 6;
5630}
5631
5632/**
5633 * Logs information about session being flushed.
5634 *
5635 * Logged from:
5636 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5637 */
5638message ContentCaptureFlushed {
5639 optional int32 session_id = 1;
5640 // component/package of content capture service.
5641 optional string service_info = 2;
5642 // component/package of app.
5643 optional string app_info = 3;
5644 // session start/finish events
5645 optional int32 child_session_started = 4;
5646 optional int32 child_session_finished = 5;
5647 // count of view events.
5648 optional int32 view_appeared_count = 6;
5649 optional int32 view_disappeared_count = 7;
5650 optional int32 view_text_changed_count = 8;
5651
5652 // Flush stats.
5653 optional int32 max_events = 9;
5654 optional int32 idle_flush_freq = 10;
5655 optional int32 text_flush_freq = 11;
5656 optional int32 flush_reason = 12;
5657}
5658
5659/**
Bookatz75ee6042018-11-09 12:27:37 -08005660 * Pulls on-device BatteryStats power use calculations for the overall device.
5661 */
5662message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005663 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5664 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5665 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5666 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005667}
5668
5669/**
5670 * Pulls on-device BatteryStats power use calculations broken down by uid.
5671 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5672 * that is attributed to non-uid items. They must all be included to get the total power use.
5673 */
5674message DeviceCalculatedPowerBlameUid {
5675 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5676 optional int32 uid = 1 [(is_uid) = true];
5677
Bookatz3dbc13a2018-12-21 12:16:51 -08005678 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5679 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5680 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005681}
5682
5683/**
5684 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5685 * drain type.
5686 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5687 * is attributed uids. They must all be included to get the total power use.
5688 */
5689message DeviceCalculatedPowerBlameOther {
5690 // The type of item whose power use is being reported.
5691 enum DrainType {
5692 AMBIENT_DISPLAY = 0;
5693 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5694 BLUETOOTH = 2;
5695 CAMERA = 3;
5696 // Cell-standby
5697 CELL = 4;
5698 FLASHLIGHT = 5;
5699 IDLE = 6;
5700 MEMORY = 7;
5701 // Amount that total computed drain exceeded the drain estimated using the
5702 // battery level changes and capacity.
5703 OVERCOUNTED = 8;
5704 PHONE = 9;
5705 SCREEN = 10;
5706 // Amount that total computed drain was below the drain estimated using the
5707 // battery level changes and capacity.
5708 UNACCOUNTED = 11;
5709 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5710 WIFI = 13;
5711 }
5712 optional DrainType drain_type = 1;
5713
Bookatz3dbc13a2018-12-21 12:16:51 -08005714 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5715 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5716 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005717}
arangelov4e994062018-11-13 16:12:38 +00005718
5719/**
5720 * Logs device policy features.
5721 *
5722 * Logged from:
5723 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5724 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5725 */
5726message DevicePolicyEvent {
5727 // The event id - unique for each event.
5728 optional android.stats.devicepolicy.EventId event_id = 1;
5729 // The admin package name.
5730 optional string admin_package_name = 2;
5731 // A generic integer parameter.
5732 optional int32 integer_value = 3;
5733 // A generic boolean parameter.
5734 optional bool boolean_value = 4;
5735 // A parameter specifying a time period in milliseconds.
5736 optional uint64 time_period_millis = 5;
5737 // A parameter specifying a list of package names, bundle extras or string parameters.
5738 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5739}
shawnlinea5b66b2018-11-13 15:05:29 +08005740
5741/**
5742 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5743 *
5744 * Logged from:
5745 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5746 */
5747message DocsUILaunchReported {
5748 optional android.stats.docsui.LaunchAction launch_action = 1;
5749 optional bool has_initial_uri = 2;
5750 optional android.stats.docsui.MimeType mime_type = 3;
5751 optional android.stats.docsui.Root initial_root = 4;
5752}
5753
5754/**
5755 * Logs root/app visited event in file managers/picker. Call this when the user
5756 * taps on root/app in hamburger menu.
5757 *
5758 * Logged from:
5759 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5760 */
5761message DocsUIRootVisitedReported {
5762 optional android.stats.docsui.ContextScope scope = 1;
5763 optional android.stats.docsui.Root root = 2;
5764}
5765
5766/**
5767 * Logs file operation stats. Call this when a file operation has completed.
5768 *
5769 * Logged from:
5770 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5771 */
5772message DocsUIFileOperationReported {
5773 optional android.stats.docsui.Provider provider = 1;
5774 optional android.stats.docsui.FileOperation file_op = 2;
5775}
5776
5777/**
5778 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5779 * mode.
5780 *
5781 * Logged from:
5782 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5783 */
5784message DocsUIFileOperationCopyMoveModeReported {
5785 optional android.stats.docsui.FileOperation file_op = 1;
5786 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5787}
5788
5789
5790/**
5791 * Logs file sub operation stats. Call this when a file operation has failed.
5792 *
5793 * Logged from:
5794 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5795 */
5796message DocsUIFileOperationFailureReported {
5797 optional android.stats.docsui.Authority authority = 1;
5798 optional android.stats.docsui.SubFileOperation sub_op = 2;
5799}
5800
5801/**
5802* Logs the cancellation of a file operation. Call this when a job is canceled
5803*
5804* Logged from:
5805* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5806*/
5807message DocsUIFileOperationCanceledReported {
5808 optional android.stats.docsui.FileOperation file_op = 1;
5809}
5810
5811/**
5812 * Logs startup time in milliseconds.
5813 *
5814 * Logged from:
5815 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5816 */
5817message DocsUIStartupMsReported {
5818 optional int32 startup_millis = 1;
5819}
5820
5821/**
5822 * Logs the action that was started by user.
5823 *
5824 * Logged from:
5825 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5826 */
5827message DocsUIUserActionReported {
5828 optional android.stats.docsui.UserAction action = 1;
5829}
5830
5831/**
5832 * Logs the invalid type when invalid scoped access is requested.
5833 *
5834 * Logged from:
5835 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5836 */
5837message DocsUIInvalidScopedAccessRequestReported {
5838 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005839}
Ben Murdochbab399f2018-12-06 11:01:38 +00005840
5841/**
shawnlina75e82d2019-01-07 10:31:12 +08005842 * Logs the package name that launches docsui picker mode.
5843 *
5844 * Logged from:
5845 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5846 */
5847message DocsUIPickerLaunchedFromReported {
5848 optional string package_name = 1;
5849}
5850
5851/**
5852 * Logs the search type.
5853 *
5854 * Logged from:
5855 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5856 */
5857message DocsUISearchTypeReported {
5858 optional android.stats.docsui.SearchType search_type = 1;
5859}
5860
5861/**
5862 * Logs the search mode.
5863 *
5864 * Logged from:
5865 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5866 */
5867message DocsUISearchModeReported {
5868 optional android.stats.docsui.SearchMode search_mode = 1;
5869}
5870
5871/**
5872 * Logs the pick result information.
5873 *
5874 * Logged from:
5875 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5876 */
5877message DocsUIPickResultReported {
5878 optional int32 total_action_count = 1;
5879 optional int64 duration_millis = 2;
5880 optional int32 file_count= 3;
5881 optional bool is_searching = 4;
5882 optional android.stats.docsui.Root picked_from = 5;
5883 optional android.stats.docsui.MimeType mime_type = 6;
5884 optional int32 repeatedly_pick_times = 7;
5885}
5886
5887/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005888 * Logs when an app's memory is compacted.
5889 *
5890 * Logged from:
5891 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5892 */
5893message AppCompacted {
5894 // The pid of the process being compacted.
5895 optional int32 pid = 1;
5896
5897 // The name of the process being compacted.
5898 optional string process_name = 2;
5899
5900 // The type of compaction.
5901 enum Action {
5902 UNKNOWN = 0;
5903 SOME = 1;
5904 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005905 PERSISTENT = 3;
5906 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005907 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005908 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005909
5910 // Total RSS in kilobytes consumed by the process prior to compaction.
5911 optional int64 before_rss_total_kilobytes = 4;
5912
5913 // File RSS in kilobytes consumed by the process prior to compaction.
5914 optional int64 before_rss_file_kilobytes = 5;
5915
5916 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5917 optional int64 before_rss_anon_kilobytes = 6;
5918
5919 // Swap in kilobytes consumed by the process prior to compaction.
5920 optional int64 before_swap_kilobytes = 7;
5921
5922 // Total RSS in kilobytes consumed by the process after compaction.
5923 optional int64 after_rss_total_kilobytes = 8;
5924
5925 // File RSS in kilobytes consumed by the process after compaction.
5926 optional int64 after_rss_file_kilobytes = 9;
5927
5928 // Anonymous RSS in kilobytes consumed by the process after compaction.
5929 optional int64 after_rss_anon_kilobytes = 10;
5930
5931 // Swap in kilobytes consumed by the process after compaction.
5932 optional int64 after_swap_kilobytes = 11;
5933
5934 // The time taken to perform compaction in milliseconds.
5935 optional int64 time_to_compact_millis = 12;
5936
5937 // The last compaction action performed for this app.
5938 optional Action last_action = 13;
5939
Ben Murdoch01720b82018-12-19 18:03:44 +00005940 // The last time that compaction was attempted on this process in milliseconds
5941 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5942 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005943
Ben Murdoch885c21b2019-03-15 18:02:04 +00005944 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005945 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005946
5947 // The process state at the time of compaction.
5948 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005949
5950 // Free ZRAM in kilobytes before compaction.
5951 optional int64 before_zram_free_kilobytes = 17;
5952
5953 // Free ZRAM in kilobytes after compaction.
5954 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005955}
lifr157fc552018-12-12 16:38:04 +08005956
5957/**
lifrb6b90b62019-03-29 00:40:17 +08005958 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5959 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5960 *
lifr1f74b052019-04-16 22:16:30 +08005961 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5962 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5963 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5964 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005965 */
5966message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005967 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005968
lifr1f74b052019-04-16 22:16:30 +08005969 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005970
5971 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005972 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005973
lifr1f74b052019-04-16 22:16:30 +08005974 // Only valid for event_type = EVENT_GETADDRINFO.
5975 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005976
lifr1f74b052019-04-16 22:16:30 +08005977 // Flags passed to android_res_nsend() defined in multinetwork.h
5978 // Only valid for event_type = EVENT_RESNSEND.
5979 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005980
lifrad9becc2019-05-20 11:04:41 +08005981 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005982
5983 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005984 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005985
5986 // Additional pass-through fields opaque to statsd.
5987 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005988 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005989
5990 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5991 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005992}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005993
5994/**
5995 * Logs when a data stall event occurs.
5996 *
5997 * Log from:
5998 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5999 */
6000message DataStallEvent {
6001 // Data stall evaluation type.
6002 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6003 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6004 optional int32 evaluation_type = 1;
6005 // See definition in data_stall_event.proto.
6006 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6007 // See definition in data_stall_event.proto.
6008 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6009 // See definition in data_stall_event.proto.
6010 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6011 // See definition in data_stall_event.proto.
6012 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6013 // See definition in data_stall_event.proto.
6014 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6015}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006016
6017/*
6018 * Logs when RescueParty resets some set of experiment flags.
6019 *
6020 * Logged from:
6021 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6022 */
6023message RescuePartyResetReported {
6024 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6025 optional int32 rescue_level = 1;
6026}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006027
6028/**
6029 * Logs when signed config is received from an APK, and if that config was applied successfully.
6030 * Logged from:
6031 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6032 */
6033message SignedConfigReported {
6034 enum Type {
6035 UNKNOWN_TYPE = 0;
6036 GLOBAL_SETTINGS = 1;
6037 }
6038 optional Type type = 1;
6039
6040 // The final status of the signed config received.
6041 enum Status {
6042 UNKNOWN_STATUS = 0;
6043 APPLIED = 1;
6044 BASE64_FAILURE_CONFIG = 2;
6045 BASE64_FAILURE_SIGNATURE = 3;
6046 SECURITY_EXCEPTION = 4;
6047 INVALID_CONFIG = 5;
6048 OLD_CONFIG = 6;
6049 SIGNATURE_CHECK_FAILED = 7;
6050 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006051 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006052 }
6053 optional Status status = 2;
6054
6055 // The version of the signed config processed.
6056 optional int32 version = 3;
6057
6058 // The package name that the config was extracted from.
6059 optional string from_package = 4;
6060
6061 enum Key {
6062 NO_KEY = 0;
6063 DEBUG = 1;
6064 PRODUCTION = 2;
6065 }
6066 // Which key was used to verify the config.
6067 optional Key verified_with = 5;
6068}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006069
6070/*
6071 * Logs GNSS Network-Initiated (NI) location events.
6072 *
6073 * Logged from:
6074 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6075 */
6076message GnssNiEventReported {
6077 // The type of GnssNiEvent.
6078 enum EventType {
6079 UNKNOWN = 0;
6080 NI_REQUEST = 1;
6081 NI_RESPONSE = 2;
6082 }
6083 optional EventType event_type = 1;
6084
6085 // An ID generated by HAL to associate NI notifications and UI responses.
6086 optional int32 notification_id = 2;
6087
6088 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006089 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006090
6091 // NI requires notification.
6092 optional bool need_notify = 4;
6093
6094 // NI requires verification.
6095 optional bool need_verify = 5;
6096
6097 // NI requires privacy override, no notification/minimal trace.
6098 optional bool privacy_override = 6;
6099
6100 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6101 // seconds.
6102 optional int32 timeout = 7;
6103
6104 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006105 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006106
6107 // String representing the requester of the network inititated location request.
6108 optional string requestor_id = 9;
6109
6110 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6111 // network initiated location request.
6112 optional string text = 10;
6113
6114 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006115 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006116
6117 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006118 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006119
6120 // True if SUPL ES is enabled.
6121 optional bool is_supl_es_enabled = 13;
6122
6123 // True if GNSS location is enabled.
6124 optional bool is_location_enabled = 14;
6125
6126 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006127 optional android.server.location.GnssUserResponseType user_response = 15;
6128}
6129
6130/**
6131 * Logs GNSS non-framework (NFW) location notification.
6132 *
6133 * Logged from:
6134 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6135 */
6136message GnssNfwNotificationReported {
6137 // Package name of the Android proxy application representing the non-framework entity that
6138 // requested location. Set to empty string if unknown.
6139 optional string proxy_app_package_name = 1;
6140
6141 // Protocol stack that initiated the non-framework location request.
6142 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6143
6144 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6145 // set to empty string. This field is opaque to the framework and used for logging purposes.
6146 optional string other_protocol_stack_name = 3;
6147
6148 // Source initiating/receiving the location information.
6149 optional android.server.location.NfwRequestor requestor = 4;
6150
6151 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6152 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6153 // and used for logging purposes.
6154 optional string requestor_id = 5;
6155
6156 // Indicates whether location information was provided for this request.
6157 optional android.server.location.NfwResponseType response_type = 6;
6158
6159 // True if the device is in user initiated emergency session.
6160 optional bool in_emergency_mode = 7;
6161
6162 // True if cached location is provided.
6163 optional bool is_cached_location = 8;
6164
6165 // True if proxy app permission mismatch between framework and GNSS HAL.
6166 optional bool is_permission_mismatched = 9;
6167}
6168
6169/**
6170 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6171 *
6172 * Logged from:
6173 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6174 */
6175message GnssConfigurationReported {
6176 // SUPL host name.
6177 optional string supl_host = 1;
6178
6179 // SUPL port number.
6180 optional int32 supl_port = 2;
6181
6182 // C2K host name.
6183 optional string c2k_host = 3;
6184
6185 // C2K port number.
6186 optional int32 c2k_port = 4;
6187
6188 // The SUPL version requested by Carrier.
6189 optional int32 supl_ver = 5;
6190
6191 // The SUPL mode.
6192 optional android.server.location.SuplMode supl_mode = 6;
6193
6194 // True if NI emergency SUPL restrictions is enabled.
6195 optional bool supl_es = 7;
6196
6197 // LTE Positioning Profile settings
6198 optional android.server.location.LppProfile lpp_profile = 8;
6199
6200 // Positioning protocol on A-Glonass system.
6201 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6202
6203 // True if emergency PDN is used. Otherwise, regular PDN is used.
6204 optional bool use_emergency_pdn_for_emergency_supl= 10;
6205
6206 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6207 optional android.server.location.GpsLock gps_lock = 11;
6208
6209 // Number of seconds to extend the emergency session duration post emergency call.
6210 optional int32 es_extension_sec = 12;
6211
6212 // The full list of package names of proxy Android applications representing the non-framework
6213 // location access entities (on/off the device) for which the framework user has granted
6214 // non-framework location access permission. The package names are concatenated in one string
6215 // with spaces as separators.
6216 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006217}
Jack Yu95b64f32018-12-13 18:26:11 +08006218
6219/**
6220 * Logs when a NFC device's error occurred.
6221 * Logged from:
6222 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6223 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6224 */
6225message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006226 enum Type {
6227 UNKNOWN = 0;
6228 CMD_TIMEOUT = 1;
6229 ERROR_NOTIFICATION = 2;
6230 AID_OVERFLOW = 3;
6231 }
6232 optional Type type = 1;
6233 // If it's nci cmd timeout, log the timeout command.
6234 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006235
Alex Salod7c3eef2019-01-25 14:43:27 -08006236 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006237}
6238
6239/**
6240 * Logs when a NFC device's state changed event
6241 * Logged from:
6242 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6243 */
6244message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006245 enum State {
6246 UNKNOWN = 0;
6247 OFF = 1;
6248 ON = 2;
6249 ON_LOCKED = 3; // Secure Nfc enabled.
6250 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6251 }
6252 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006253}
6254
6255/**
6256 * Logs when a NFC Beam Transaction occurred.
6257 * Logged from:
6258 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6259 */
6260message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006261 enum Operation {
6262 UNKNOWN = 0;
6263 SEND = 1;
6264 RECEIVE = 2;
6265 }
6266 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006267}
6268
6269/**
6270 * Logs when a NFC Card Emulation Transaction occurred.
6271 * Logged from:
6272 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6273 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6274 */
6275message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006276 enum Category {
6277 UNKNOWN = 0;
6278 HCE_PAYMENT = 1;
6279 HCE_OTHER = 2;
6280 OFFHOST = 3;
6281 }
6282 // Transaction belongs to HCE payment or HCE other category, or offhost.
6283 optional Category category = 1;
6284 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6285 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006286}
6287
6288/**
6289 * Logs when a NFC Tag event occurred.
6290 * Logged from:
6291 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6292 */
6293message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006294 enum Type {
6295 UNKNOWN = 0;
6296 URL = 1;
6297 BT_PAIRING = 2;
6298 PROVISION = 3;
6299 WIFI_CONNECT = 4;
6300 APP_LAUNCH = 5;
6301 OTHERS = 6;
6302 }
6303 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006304}
6305
6306/**
6307 * Logs when Hce transaction triggered
6308 * Logged from:
6309 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6310 */
6311message NfcHceTransactionOccurred {
6312 // The latency period(in microseconds) it took for the first HCE data
6313 // exchange.
6314 optional uint32 latency_micros = 1;
6315}
6316
6317/**
6318 * Logs when SecureElement state event changed
6319 * Logged from:
6320 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6321 */
6322message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006323 enum State {
6324 UNKNOWN = 0;
6325 INITIALIZED = 1;
6326 DISCONNECTED = 2;
6327 CONNECTED = 3;
6328 HALCRASH = 4;
6329 }
6330 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006331
Alex Salod7c3eef2019-01-25 14:43:27 -08006332 optional string state_change_reason = 2;
6333 // SIMx or eSEx.
6334 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006335}
6336
6337/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006338 * Information about a permission grant request
6339 */
6340message PermissionGrantRequestResultReported {
6341 // unique value identifying an API call. A API call might result in multiple of these atoms
6342 optional int64 request_id = 1;
6343
6344 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006345 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006346
6347 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006348 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006349
6350 // The permission to be granted
6351 optional string permission_name = 4;
6352
6353 // If the permission was explicitly requested via the API or added by the system
6354 optional bool is_implicit = 5;
6355
6356 enum Result {
6357 UNDEFINED = 0;
6358 // permission request was ignored
6359 IGNORED = 1;
6360 // permission request was ignored because it was user fixed
6361 IGNORED_USER_FIXED = 2;
6362 // permission request was ignored because it was policy fixed
6363 IGNORED_POLICY_FIXED = 3;
6364 // permission was granted by user action
6365 USER_GRANTED = 4;
6366 // permission was automatically granted
6367 AUTO_GRANTED = 5;
6368 // permission was denied by user action
6369 USER_DENIED = 6;
6370 // permission was denied with prejudice by the user
6371 USER_DENIED_WITH_PREJUDICE = 7;
6372 // permission was automatically denied
6373 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006374 // permission request was ignored because permission is restricted
6375 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006376 // one time permission was granted by user action
6377 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006378 // user ignored request by leaving the request screen without choosing any option
6379 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006380 // user granted the permission after being linked to settings
6381 USER_GRANTED_IN_SETTINGS = 12;
6382 // user denied the permission after being linked to settings
6383 USER_DENIED_IN_SETTINGS = 13;
6384 // user denied the permission with prejudice after being linked to settings
6385 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6386 // permission was automatically revoked after one-time permission expired
6387 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006388 }
6389 // The result of the permission grant
6390 optional Result result = 6;
6391}
6392
6393/**
Jack Yu95b64f32018-12-13 18:26:11 +08006394 * Logs when Omapi API used
6395 * Logged from:
6396 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6397 */
6398message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006399 enum Operation {
6400 UNKNOWN = 0;
6401 OPEN_CHANNEL = 1;
6402 }
6403 optional Operation operation = 1;
6404 // SIMx or eSEx.
6405 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006406
Alex Salod7c3eef2019-01-25 14:43:27 -08006407 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006408}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006409
6410/**
Alex Saloa060aee2019-01-21 14:36:41 -08006411 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6412 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006413 * Logged from:
6414 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6415 */
6416message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006417 optional int64 dispatch_latency_millis = 1;
6418}
6419
6420/**
6421 * Logs AttentionManagerService attention check result.
6422 *
6423 * Logged from:
6424 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6425 */
6426message AttentionManagerServiceResultReported {
6427 // See core/java/android/service/attention/AttentionService.java
6428 enum AttentionCheckResult {
6429 UNKNOWN = 20;
6430 ATTENTION_SUCCESS_ABSENT = 0;
6431 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006432 ATTENTION_FAILURE_UNKNOWN = 2;
6433 ATTENTION_FAILURE_CANCELLED = 3;
6434 ATTENTION_FAILURE_PREEMPTED = 4;
6435 ATTENTION_FAILURE_TIMED_OUT = 5;
6436 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006437 }
6438 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006439}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006440
6441/**
6442 * Logs when an adb connection changes state.
6443 *
6444 * Logged from:
6445 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6446 */
6447message AdbConnectionChanged {
6448 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6449 // previously selected for this system.
6450 optional int64 last_connection_time_millis = 1;
6451
6452 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6453 // to reconnect via adb without user interaction.
6454 optional int64 auth_window_millis = 2;
6455
6456 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6457 optional android.debug.AdbConnectionStateEnum state = 3;
6458
6459 // True if the 'always allow' option was selected for this system.
6460 optional bool always_allow = 4;
6461}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006462
6463/*
6464 * Logs the reported speech DSP status.
6465 *
6466 * Logged from:
6467 * Vendor audio implementation.
6468 */
6469message SpeechDspStatReported {
6470 // The total Speech DSP uptime in milliseconds.
6471 optional int32 total_uptime_millis = 1;
6472 // The total Speech DSP downtime in milliseconds.
6473 optional int32 total_downtime_millis = 2;
6474 optional int32 total_crash_count = 3;
6475 optional int32 total_recover_count = 4;
6476}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006477
6478/**
6479 * Logs USB connector contaminant status.
6480 *
6481 * Logged from: USB Service.
6482 */
6483message UsbContaminantReported {
6484 optional string id = 1;
6485 optional android.service.usb.ContaminantPresenceStatus status = 2;
6486}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006487
6488/**
6489 * This atom is for debugging purpose.
6490 */
6491message DebugElapsedClock {
6492 // Monotically increasing value for each pull.
6493 optional int64 pull_count = 1;
6494 // Time from System.elapsedRealtime.
6495 optional int64 elapsed_clock_millis = 2;
6496 // Time from System.elapsedRealtime.
6497 optional int64 same_elapsed_clock_millis = 3;
6498 // Diff between current elapsed time and elapsed time from previous pull.
6499 optional int64 elapsed_clock_diff_millis = 4;
6500
6501 enum Type {
6502 TYPE_UNKNOWN = 0;
6503 ALWAYS_PRESENT = 1;
6504 PRESENT_ON_ODD_PULLS = 2;
6505 }
6506 // Type of behavior for the pulled data.
6507 optional Type type = 5;
6508}
6509
6510/**
6511 * This atom is for debugging purpose.
6512 */
6513message DebugFailingElapsedClock {
6514 // Monotically increasing value for each pull.
6515 optional int64 pull_count = 1;
6516 // Time from System.elapsedRealtime.
6517 optional int64 elapsed_clock_millis = 2;
6518 // Time from System.elapsedRealtime.
6519 optional int64 same_elapsed_clock_millis = 3;
6520 // Diff between current elapsed time and elapsed time from previous pull.
6521 optional int64 elapsed_clock_diff_millis = 4;
6522}
Steven Wuacef6bb2019-01-23 14:21:17 -05006523
6524/** Logs System UI bubbles event changed.
6525 *
6526 * Logged from:
6527 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6528 */
6529message BubbleUIChanged {
6530
6531 // The app package that is posting the bubble.
6532 optional string package_name = 1;
6533
6534 // The notification channel that is posting the bubble.
6535 optional string notification_channel = 2;
6536
6537 // The notification id associated with the posted bubble.
6538 optional int32 notification_id = 3;
6539
6540 // The position of the bubble within the bubble stack.
6541 optional int32 position = 4;
6542
6543 // The total number of bubbles within the bubble stack.
6544 optional int32 total_number = 5;
6545
6546 // User interactions with the bubble.
6547 enum Action {
6548 UNKNOWN = 0;
6549 POSTED = 1;
6550 UPDATED = 2;
6551 EXPANDED = 3;
6552 COLLAPSED = 4;
6553 DISMISSED = 5;
6554 STACK_DISMISSED = 6;
6555 STACK_MOVED = 7;
6556 HEADER_GO_TO_APP = 8;
6557 HEADER_GO_TO_SETTINGS = 9;
6558 PERMISSION_OPT_IN = 10;
6559 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006560 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006561 SWIPE_LEFT = 13;
6562 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006563 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006564 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006565 }
6566 optional Action action = 6;
6567
6568 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6569 optional float normalized_x_position = 7;
6570 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006571
6572 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6573 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006574
6575 // Whether the bubble is an on-going one.
6576 optional bool is_ongoing = 10;
6577
6578 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006579 // This is deprecated and the value should be ignored.
6580 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006581}
Kweku Adams8845d012018-12-11 20:06:45 -08006582
6583/**
Steven Wu552f63f2019-02-05 13:41:36 -05006584 * Logs System UI bubbles developer errors.
6585 *
6586 * Logged from:
6587 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6588 */
6589message BubbleDeveloperErrorReported {
6590
6591 // The app package that is posting the bubble.
6592 optional string package_name = 1;
6593
6594 // Bubble developer error type enums.
6595 enum Error {
6596 UNKNOWN = 0;
6597 ACTIVITY_INFO_MISSING = 1;
6598 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6599 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6600 }
6601 optional Error error = 2 [default = UNKNOWN];
6602}
6603
6604/**
Kweku Adams8845d012018-12-11 20:06:45 -08006605 * Logs that a constraint for a scheduled job has changed.
6606 *
6607 * Logged from:
6608 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6609 */
6610message ScheduledJobConstraintChanged {
6611 repeated AttributionNode attribution_node = 1;
6612
6613 // Name of the job.
6614 optional string job_name = 2;
6615
6616 optional com.android.server.job.ConstraintEnum constraint = 3;
6617
6618 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006619 UNKNOWN = 0;
6620 UNSATISFIED = 1;
6621 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006622 }
6623 optional State state = 4;
6624}
Alex Salod7c3eef2019-01-25 14:43:27 -08006625
6626/**
6627 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6628 * returns true.
6629 *
6630 * Logged from:
6631 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6632 */
6633message ScreenTimeoutExtensionReported {
6634 // Describes how many times in a row did the power manager reset the screen off timeout.
6635 optional uint32 consecutive_timeout_extended_count = 1;
6636}
Hui Yu885aca12019-01-10 17:11:34 -08006637
6638/*
6639* Logs number of milliseconds it takes to start a process.
6640* The definition of app process start time is from the app launch time to
6641* the time that Zygote finished forking the app process and loaded the
6642* application package's java classes.
6643
6644* This metric is different from AppStartOccurred which is for foreground
6645* activity only.
6646
6647* ProcessStartTime can report all processes (both foreground and background)
6648* start time.
6649*
6650* Logged from:
6651* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6652*/
6653message ProcessStartTime {
6654 // The uid of the ProcessRecord.
6655 optional int32 uid = 1 [(is_uid) = true];
6656
6657 // The process pid.
6658 optional int32 pid = 2;
6659
6660 // The process name.
6661 // Usually package name, "system" for system server.
6662 // Provided by ActivityManagerService.
6663 optional string process_name = 3;
6664
6665 enum StartType {
6666 UNKNOWN = 0;
6667 WARM = 1;
6668 HOT = 2;
6669 COLD = 3;
6670 }
6671
6672 // The start type.
6673 optional StartType type = 4;
6674
6675 // The elapsed realtime at the start of the process.
6676 optional int64 process_start_time_millis = 5;
6677
6678 // Number of milliseconds it takes to reach bind application.
6679 optional int32 bind_application_delay_millis = 6;
6680
6681 // Number of milliseconds it takes to finish start of the process.
6682 optional int32 process_start_delay_millis = 7;
6683
6684 // hostingType field in ProcessRecord, the component type such as "activity",
6685 // "service", "content provider", "broadcast" or other strings.
6686 optional string hosting_type = 8;
6687
6688 // hostingNameStr field in ProcessRecord. The component class name that runs
6689 // in this process.
6690 optional string hosting_name = 9;
6691}
6692
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006693/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006694 * Track Media Codec usage
6695 * Logged from:
6696 * frameworks/av/media/libstagefright/MediaCodec.cpp
6697 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6698 */
6699message MediametricsCodecReported {
6700 optional int64 timestamp_nanos = 1;
6701 optional string package_name = 2;
6702 optional int64 package_version_code = 3;
6703 optional int64 media_apex_version = 4;
6704
6705 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6706}
6707
6708/**
6709 * Track Media Extractor (pulling video/audio streams out of containers) usage
6710 * Logged from:
6711 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6712 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6713 */
6714message MediametricsExtractorReported {
6715 optional int64 timestamp_nanos = 1;
6716 optional string package_name = 2;
6717 optional int64 package_version_code = 3;
6718 optional int64 media_apex_version = 4;
6719
6720 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6721}
6722
6723/**
6724 * Track how we arbitrate between microphone/input requests.
6725 * Logged from
6726 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6727 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6728 */
6729message MediametricsAudiopolicyReported {
6730 optional int64 timestamp_nanos = 1;
6731 optional string package_name = 2;
6732 optional int64 package_version_code = 3;
6733 optional int64 media_apex_version = 4;
6734
6735 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6736}
6737
6738/**
6739 * Track how we arbitrate between microphone requests.
6740 * Logged from
6741 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6742 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6743 */
6744message MediametricsAudiorecordReported {
6745 optional int64 timestamp_nanos = 1;
6746 optional string package_name = 2;
6747 optional int64 package_version_code = 3;
6748 optional int64 media_apex_version = 4;
6749
6750 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6751}
6752
6753/**
6754 * Track how we arbitrate between microphone/input requests.
6755 * Logged from
6756 * frameworks/av/media/libnblog/ReportPerformance.cpp
6757 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6758 */
6759message MediametricsAudiothreadReported {
6760 optional int64 timestamp_nanos = 1;
6761 optional string package_name = 2;
6762 optional int64 package_version_code = 3;
6763 optional int64 media_apex_version = 4;
6764
6765 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6766}
6767
6768/**
6769 * Track how we arbitrate between microphone/input requests.
6770 * Logged from
6771 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6772 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6773 */
6774message MediametricsAudiotrackReported {
6775 optional int64 timestamp_nanos = 1;
6776 optional string package_name = 2;
6777 optional int64 package_version_code = 3;
6778 optional int64 media_apex_version = 4;
6779
6780 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6781}
6782
6783/**
6784 * Track information about DRM framework performance
6785 * Logged from
6786 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6787 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6788 */
6789message MediametricsMediadrmReported {
6790 optional int64 timestamp_nanos = 1;
6791 optional string package_name = 2;
6792 optional int64 package_version_code = 3;
6793 optional int64 media_apex_version = 4;
6794
6795 // vendor+description tell about which DRM plugin is in use on this device
6796 optional string vendor = 5;
6797 optional string description = 6;
6798 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6799 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6800}
6801
6802/**
6803 * Track information about the widevine DRM plugin performance
6804 * Logged from
6805 * vendor/widevine/libwvdrmengine/cdm/metrics
6806 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6807 */
6808message MediametricsDrmWidevineReported {
6809 optional int64 timestamp_nanos = 1;
6810 optional string package_name = 2;
6811 optional int64 package_version_code = 3;
6812 optional int64 media_apex_version = 4;
6813
6814 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6815}
6816
6817/**
6818 * Track information about recordings (e.g. camcorder)
6819 * Logged from
6820 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6821 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6822 */
6823message MediametricsRecorderReported {
6824 optional int64 timestamp_nanos = 1;
6825 optional string package_name = 2;
6826 optional int64 package_version_code = 3;
6827 optional int64 media_apex_version = 4;
6828
6829 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6830}
6831
6832/**
6833 * Track Media Player usage
6834 * Logged from:
6835 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6836 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6837 */
6838message MediametricsNuPlayerReported {
6839 optional int64 timestamp_nanos = 1;
6840 optional string package_name = 2;
6841 optional int64 package_version_code = 3;
6842 optional int64 media_apex_version = 4;
6843
6844 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6845}
6846
6847/**
Robert Shiha4beed32019-08-19 14:15:23 -07006848 * Track Legacy DRM usage
6849 * Logged from
6850 * frameworks/av/drm/drmserver/DrmManager.cpp
6851 */
6852message MediametricsDrmManagerReported {
6853 optional int64 timestamp_nanos = 1;
6854 optional string package_name = 2;
6855 optional int64 package_version_code = 3;
6856 optional int64 media_apex_version = 4;
6857
6858 enum Method {
6859 METHOD_NOT_FOUND = -1;
6860 GET_CONSTRAINTS = 0;
6861 GET_METADATA = 1;
6862 CAN_HANDLE = 2;
6863 PROCESS_DRM_INFO = 3;
6864 ACQUIRE_DRM_INFO = 4;
6865 SAVE_RIGHTS = 5;
6866 GET_ORIGINAL_MIME_TYPE = 6;
6867 GET_DRM_OBJECT_TYPE = 7;
6868 CHECK_RIGHTS_STATUS = 8;
6869 REMOVE_RIGHTS = 9;
6870 REMOVE_ALL_RIGHTS = 10;
6871 OPEN_CONVERT_SESSION = 11;
6872 OPEN_DECRYPT_SESSION = 12;
6873 }
6874
6875 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6876 optional string plugin_id = 5;
6877 optional string description = 6;
6878 optional Method method = 7;
6879 optional string mime_types = 8;
6880}
6881
6882/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006883 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006884 * Pulled from: StatsCompanionService
6885*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006886message DangerousPermissionState {
6887 // Name of the permission
6888 optional string permission_name = 1;
6889
6890 // Uid of the package
6891 optional int32 uid = 2 [(is_uid) = true];
6892
6893 // Package requesting the permission
6894 optional string package_name = 3;
6895
6896 // If the permission is granted to the uid
6897 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006898
6899 // Permission flags as per android.content.pm.PermissionFlags
6900 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006901}
6902
Michael Groover4a0ca942019-01-24 17:41:25 -08006903/**
6904 * Logs when a package is denied access to a device identifier based on the new access requirements.
6905 *
6906 * Logged from:
6907 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6908 */
6909message DeviceIdentifierAccessDenied {
6910 // The name of the package denied access to the requested device identifier.
6911 optional string package_name = 1;
6912
6913 // The name of the device identifier method the package attempted to invoke.
6914 optional string method_name = 2;
6915
6916 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08006917 // Starting from Android 11, this boolean is not set and will always be false.
6918 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006919
6920 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006921 // Starting from Android 11, this boolean is not set and will always be false.
6922 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006923}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006924
6925/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006926 * Pulls the ongoing mainline install train version code.
6927 * Pulled from StatsCompanionService
6928 */
6929message TrainInfo {
6930 optional int64 train_version_code = 1;
6931
6932 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006933
6934 optional string train_name = 3;
6935
6936 enum Status {
6937 UNKNOWN = 0;
6938 INSTALL_REQUESTED = 1;
6939 INSTALL_STARTED = 2;
6940 INSTALL_STAGED_NOT_READY = 3;
6941 INSTALL_STAGED_READY = 4;
6942 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006943 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6944 // and INSTALL_FAILURE_COMMIT.
6945 INSTALL_FAILURE = 6 [deprecated = true];
6946 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006947 INSTALL_CANCELLED = 7;
6948 INSTALLER_ROLLBACK_REQUESTED = 8;
6949 INSTALLER_ROLLBACK_INITIATED = 9;
6950 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6951 INSTALLER_ROLLBACK_STAGED = 11;
6952 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6953 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6954 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6955 INSTALLER_ROLLBACK_SUCCESS = 15;
6956 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006957 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6958 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6959 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6960 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6961 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6962 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006963 INSTALL_FAILURE_DOWNLOAD = 23;
6964 INSTALL_FAILURE_STATE_MISMATCH = 24;
6965 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006966 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006967 }
6968 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006969}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006970
6971/**
6972 * Logs the gesture stage changed event.
6973 *
6974 * Logged from:
6975 * frameworks/base/packages/SystemUI/
6976 */
6977message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006978 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006979}
6980
6981/**
6982 * Logs the feedback type.
6983 *
6984 * Logged from:
6985 * frameworks/base/packages/SystemUI/
6986 */
6987message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006988 // Whether or not the gesture was used.
6989 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006990}
6991
6992/**
6993 * Logs the progress.
6994 *
6995 * Logged from:
6996 * frameworks/base/packages/SystemUI/
6997 */
6998message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006999 // [0,100] progress for the assist gesture.
7000 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007001}
Neil Fullerdb14b482019-02-05 19:44:44 +00007002
7003/*
7004 * Information about the time zone data on a device.
7005 */
7006message TimeZoneDataInfo {
7007 // A version identifier for the data set on device. e.g. "2018i"
7008 optional string tzdb_version = 1;
7009}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007010
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007011/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007012 * Logs the GPU stats global health information.
7013 *
7014 * Logged from:
7015 * frameworks/native/services/gpuservice/gpustats/
7016 */
7017message GpuStatsGlobalInfo {
7018 // Package name of the gpu driver.
7019 optional string driver_package_name = 1;
7020
7021 // Version name of the gpu driver.
7022 optional string driver_version_name = 2;
7023
7024 // Version code of the gpu driver.
7025 optional int64 driver_version_code = 3;
7026
7027 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7028 optional int64 driver_build_time = 4;
7029
7030 // Total count of the gl driver gets loaded.
7031 optional int64 gl_loading_count = 5;
7032
7033 // Total count of the gl driver fails to be loaded.
7034 optional int64 gl_loading_failure_count = 6;
7035
7036 // Total count of the Vulkan driver gets loaded.
7037 optional int64 vk_loading_count = 7;
7038
7039 // Total count of the Vulkan driver fails to be loaded.
7040 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007041
7042 // Api version of the system Vulkan driver.
7043 optional int32 vulkan_version = 9;
7044
7045 // Api version of the system CPU Vulkan driver.
7046 optional int32 cpu_vulkan_version = 10;
7047
7048 // Api version of the system GLES driver.
7049 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007050
7051 // Total count of the angle driver gets loaded.
7052 optional int64 angle_loading_count = 12;
7053
7054 // Total count of the angle driver fails to be loaded.
7055 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007056}
7057
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007058/**
7059 * GPU driver loading time info.
7060 */
7061message GpuDriverLoadingTime {
7062 // List of all the driver loading times for this app. The list size is
7063 // capped at 50.
7064 repeated int64 driver_loading_time = 1;
7065}
7066
7067/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007068 * Logs the GPU stats per app health information.
7069 *
7070 * Logged from:
7071 * frameworks/native/services/gpuservice/gpustats/
7072 */
7073message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007074 // Package name of the application that loads the gpu driver. Total number
7075 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007076 optional string app_package_name = 1;
7077
7078 // Version code of the gpu driver this app loads.
7079 optional int64 driver_version_code = 2;
7080
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007081 // gl driver loading time info.
7082 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7083 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007084
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007085 // Vulkan driver loading time info.
7086 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7087 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007088
7089 // Angle driver loading time info.
7090 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7091 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007092
7093 // CPU Vulkan implementation is in use.
7094 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007095
7096 // App is not doing pre-rotation correctly.
7097 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007098
7099 // App creates GLESv1 context.
7100 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007101}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007102
7103/*
7104 * Logs the size of the system ion heap.
7105 *
7106 * Pulled from StatsCompanionService.
7107 */
7108message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007109 // Deprecated due to limited support of ion stats in debugfs.
7110 // Use `IonHeapSize` instead.
7111 option deprecated = true;
7112
Rafal Slawikd4e87572019-03-12 13:08:38 +00007113 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007114 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007115 optional int64 size_in_bytes = 1;
7116}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007117
Rafal Slawik77987ed2019-06-17 12:28:23 +01007118/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007119 * Logs the total size of the ion heap.
7120 *
7121 * Pulled from StatsCompanionService.
7122 */
7123message IonHeapSize {
7124 // Total size of all ion heaps in kilobytes.
7125 // Read from: /sys/kernel/ion/total_heaps_kb.
7126 optional int32 total_size_kb = 1;
7127}
7128
7129/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007130 * Logs the per-process size of the system ion heap.
7131 *
7132 * Pulled from StatsCompanionService.
7133 */
7134message ProcessSystemIonHeapSize {
7135 // The uid if available. -1 means not available.
7136 optional int32 uid = 1 [(is_uid) = true];
7137
7138 // The process name (from /proc/PID/cmdline).
7139 optional string process_name = 2;
7140
7141 // Sum of sizes of all allocations.
7142 optional int32 total_size_in_kilobytes = 3;
7143
7144 // Number of allocations.
7145 optional int32 allocation_count = 4;
7146
7147 // Size of the largest allocation.
7148 optional int32 max_size_in_kilobytes = 5;
7149}
7150
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007151/**
7152 * Push network stack events.
7153 *
7154 * Log from:
7155 * frameworks/base/packages/NetworkStack/
7156 */
7157message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007158 // The id that indicates the event reported from NetworkStack.
7159 optional int32 event_id = 1;
7160 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007161 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7162}
Carmen Agimofa769c152019-03-04 14:39:14 +00007163
7164/**
7165 * Logs the apps that are installed on the external storage.
7166 * Pulled from:
7167 * StatsCompanionService
7168 */
7169message AppsOnExternalStorageInfo {
7170 // The type of the external storage.
7171 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7172 // The name of the package that is installed on the external storage.
7173 optional string package_name = 2;
7174}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007175
7176/**
7177 * Logs the settings related to Face.
7178 * Logged from:
7179 * frameworks/base/services/core/java/com/android/server/stats
7180 */
7181message FaceSettings {
7182 // Whether or not face unlock is allowed on Keyguard.
7183 optional bool unlock_keyguard_enabled = 1;
7184 // Whether or not face unlock dismisses the Keyguard.
7185 optional bool unlock_dismisses_keyguard = 2;
7186 // Whether or not face unlock requires attention.
7187 optional bool unlock_attention_required = 3;
7188 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7189 optional bool unlock_app_enabled = 4;
7190 // Whether or not face unlock always requires user confirmation.
7191 optional bool unlock_always_require_confirmation = 5;
7192 // Whether or not a diverse set of poses are required during enrollment.
7193 optional bool unlock_diversity_required = 6;
7194}
Maggie White442b6312019-04-05 16:26:44 -07007195
7196/**
7197 * Logs cooling devices maintained by the kernel.
7198 *
7199 * Pulled from StatsCompanionService.java
7200 */
7201message CoolingDevice {
7202 // The type of cooling device being reported. Eg. CPU, GPU...
7203 optional android.os.CoolingTypeEnum device_location = 1;
7204 // The name of the cooling device source. Eg. CPU0
7205 optional string device_name = 2;
7206 // Current throttle state of the cooling device. The value can any unsigned
7207 // integer between 0 and max_state defined in its driver. 0 means device is
7208 // not in throttling, higher value means deeper throttling.
7209 optional int32 state = 3;
7210}
Ben Blount763a5d52019-04-10 11:48:58 -07007211
7212/**
7213 * Intelligence has several counter-type events that don't warrant a
7214 * full separate atom. These are primarily API call counters but also include
7215 * counters for feature usage and specific failure modes.
7216 *
7217 * Logged from the Intelligence mainline module.
7218 */
7219message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007220 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007221 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007222 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007223 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007224 // How many times the event occured (to report a batch of high frequency events).
7225 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007226 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007227 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007228}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007229
7230/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007231 * Logs when Car Power state changed.
7232 *
7233 * Logged from:
7234 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7235 */
7236message CarPowerStateChanged {
7237 // States come from CpmsState in CarPowerManagementService.java.
7238 enum State {
7239 WAIT_FOR_VHAL = 0;
7240 ON = 1;
7241 SHUTDOWN_PREPARE = 2;
7242 WAIT_FOR_FINISH = 3;
7243 SUSPEND = 4;
7244 SIMULATE_SLEEP = 5;
7245 }
7246 optional State state = 1;
7247}
7248
7249/**
7250 * Logs whether GarageMode is entered.
7251 *
7252 * Logged from:
7253 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7254 */
7255message GarageModeInfo {
7256 // Whether GarageMode is entered.
7257 optional bool is_garage_mode = 1;
7258}
Martijn Coenencd95d462019-04-25 17:09:45 +02007259
7260/**
7261 * Historical app ops data per package.
7262 */
7263message AppOps {
7264 // Uid of the package requesting the op
7265 optional int32 uid = 1 [(is_uid) = true];
7266
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007267 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007268 optional string package_name = 2;
7269
7270 // operation id; maps to the OP_* constants in AppOpsManager.java
7271 optional int32 op_id = 3;
7272
7273 // The number of times the op was granted while the app was in the
7274 // foreground (only for trusted requests)
7275 optional int64 trusted_foreground_granted_count = 4;
7276
7277 // The number of times the op was granted while the app was in the
7278 // background (only for trusted requests)
7279 optional int64 trusted_background_granted_count = 5;
7280
7281 // The number of times the op was rejected while the app was in the
7282 // foreground (only for trusted requests)
7283 optional int64 trusted_foreground_rejected_count = 6;
7284
7285 // The number of times the op was rejected while the app was in the
7286 // background (only for trusted requests)
7287 optional int64 trusted_background_rejected_count = 7;
7288
7289 // For long-running operations, total duration of the operation
7290 // while the app was in the foreground (only for trusted requests)
7291 optional int64 trusted_foreground_duration_millis = 8;
7292
7293 // For long-running operations, total duration of the operation
7294 // while the app was in the background (only for trusted requests)
7295 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007296
7297 // Whether AppOps is guarded by Runtime permission
7298 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007299}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007300
7301/**
7302 * Location Manager API Usage information(e.g. API under usage,
7303 * API call's parameters).
7304 * Logged from:
7305 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7306 */
7307message LocationManagerApiUsageReported {
7308
7309 // Indicating if usage starts or usage ends.
7310 optional android.stats.location.UsageState state = 1;
7311
7312 // LocationManagerService's API in use.
7313 // We can identify which API from LocationManager is
7314 // invoking current LMS API by the combination of
7315 // API parameter(e.g. is_listener_null, is_intent_null,
7316 // is_location_request_null)
7317 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7318
7319 // Name of the package calling the API.
7320 optional string calling_package_name = 3;
7321
7322 // Type of the location provider.
7323 optional android.stats.location.ProviderType provider = 4;
7324
7325 // Quality of the location request
7326 optional android.stats.location.LocationRequestQuality quality = 5;
7327
7328 // The desired interval for active location updates, in milliseconds.
7329 // Bucketized to reduce cardinality.
7330 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7331
7332 // Minimum distance between location updates, in meters.
7333 // Bucketized to reduce cardinality.
7334 optional android.stats.location.SmallestDisplacementBucket
7335 bucketized_smallest_displacement = 7;
7336
7337 // The number of location updates.
7338 optional int64 num_updates = 8;
7339
7340 // The request expiration time, in millisecond since boot.
7341 // Bucketized to reduce cardinality.
7342 optional android.stats.location.ExpirationBucket
7343 bucketized_expire_in = 9;
7344
7345 // Type of Callback passed in for this API.
7346 optional android.stats.location.CallbackType callback_type = 10;
7347
7348 // The radius of the central point of the alert
7349 // region, in meters. Only for API REQUEST_GEOFENCE.
7350 // Bucketized to reduce cardinality.
7351 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7352
7353 // Activity Importance of API caller.
7354 // Categorized to 3 types that are interesting from location's perspective.
7355 optional android.stats.location.ActivityImportance activiy_importance = 12;
7356}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007357
7358/**
7359 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7360 */
7361message ReviewPermissionsFragmentResultReported {
7362 // unique value identifying a permission group change. A permission group change might result
7363 // in multiple of these atoms
7364 optional int64 change_id = 1;
7365
7366 // UID of package the permission belongs to
7367 optional int32 uid = 2 [(is_uid) = true];
7368
7369 // Name of package the permission belongs to
7370 optional string package_name = 3;
7371
7372 // The permission to be granted
7373 optional string permission_name = 4;
7374
7375 // The result of the permission grant
7376 optional bool permission_granted = 5;
7377}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007378
7379/**
7380* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7381* Logged from: RuntimePermissionUpdgradeController
7382*/
7383message RuntimePermissionsUpgradeResult {
7384 // Permission granted as result of upgrade
7385 optional string permission_name = 1;
7386
7387 // UID of package granted permission
7388 optional int32 uid = 2 [(is_uid) = true];
7389
7390 // Name of package granted permission
7391 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007392}
7393
7394/**
7395* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7396*/
7397message GrantPermissionsActivityButtonActions {
7398 // Permission granted as result of upgrade
7399 optional string permission_group_name = 1;
7400
7401 // UID of package granted permission
7402 optional int32 uid = 2 [(is_uid) = true];
7403
7404 // Name of package requesting permission
7405 optional string package_name = 3;
7406
7407 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7408 // LABEL_ constants in GrantPermissionActivity.java
7409 optional int32 buttons_presented = 4;
7410
7411 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7412 optional int32 button_clicked = 5;
7413}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007414
7415/**
7416 * Information about LocationAccessCheck notification presented to user
7417 */
7418message LocationAccessCheckNotificationAction {
7419
7420 // id which identifies single session of user interacting with permission controller
7421 optional int64 session_id = 1;
7422
7423 // Uid of package for which location access check is presented
7424 optional int32 package_uid = 2;
7425
7426 // Name of package for which location access check is presented
7427 optional string package_name = 3;
7428
7429 enum Result {
7430 UNDEFINED = 0;
7431 // notification was presented to the user
7432 NOTIFICATION_PRESENTED = 1;
7433 // notification was declined by the user
7434 NOTIFICATION_DECLINED = 2;
7435 // notification was clicked by the user
7436 NOTIFICATION_CLICKED = 3;
7437 }
7438
7439 // View / interaction recorded
7440 optional Result result = 4;
7441}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007442
7443/**
7444 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7445 */
7446message AppPermissionFragmentActionReported {
7447 // id which identifies single session of user interacting with permission controller
7448 optional int64 session_id = 1;
7449
7450 // unique value identifying a permission group change. A permission group change might result
7451 // in multiple of these atoms
7452 optional int64 change_id = 2;
7453
7454 // UID of package the permission belongs to
7455 optional int32 uid = 3 [(is_uid) = true];
7456
7457 // Name of package the permission belongs to
7458 optional string package_name = 4;
7459
7460 // The permission to be granted
7461 optional string permission_name = 5;
7462
7463 // The result of the permission grant
7464 optional bool permission_granted = 6;
7465}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007466
7467/**
7468* Information about a AppPermissionFragment viewed by user
7469*/
7470message AppPermissionFragmentViewed {
7471 // id which identifies single session of user interacting with permission controller
7472 optional int64 session_id = 1;
7473
7474 // UID of package for which permissions are viewed
7475 optional int32 uid = 2 [(is_uid) = true];
7476
7477 // Name of package for which permissions are viewed
7478 optional string package_name = 3;
7479
7480 // Permission group viewed
7481 optional string permission_group_name = 4;
7482}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007483
7484/**
7485* Information about a AppPermissionsFragment viewed by user
7486*/
7487message AppPermissionsFragmentViewed {
7488 // id which identifies single session of user interacting with permission controller
7489 optional int64 session_id = 1;
7490
7491 // id which identifies single view as every view might have several logging records
7492 // with different package information attached
7493 optional int64 view_id = 2;
7494
7495 // Permission group viewed
7496 optional string permission_group_name = 3;
7497
7498 // UID of package for which permissions are viewed
7499 optional int32 uid = 4 [(is_uid) = true];
7500
7501 // Name of package for which permissions are viewed
7502 optional string package_name = 5;
7503
7504 // Category in which permission is included
7505 enum Category {
7506 UNDEFINED = 0;
7507 ALLOWED = 1;
7508 ALLOWED_FOREGROUND = 2;
7509 DENIED = 3;
7510 }
7511 optional Category category = 6;
7512}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007513
7514/**
7515* Information about a PermissionAppsFragment viewed by user.
7516* Logged from ui/handheld/PermissionAppsFragment.java
7517*/
7518message PermissionAppsFragmentViewed {
7519 // id which identifies single session of user interacting with permission controller
7520 optional int64 session_id = 1;
7521
7522 // id which identifies single view as every view might have several logging records
7523 // with different package information attached
7524 optional int64 view_id = 2;
7525
7526 // Permission group viewed
7527 optional string permission_group_name = 3;
7528
7529 // UID of package for which permissions are viewed
7530 optional int32 uid = 4 [(is_uid) = true];
7531
7532 // Name of package for which permissions are viewed
7533 optional string package_name = 5;
7534
7535 // Category in which app is included
7536 enum Category {
7537 UNDEFINED = 0;
7538 ALLOWED = 1;
7539 ALLOWED_FOREGROUND = 2;
7540 DENIED = 3;
7541 }
7542 optional Category category = 6;
7543}
Tony Make2b1b672019-07-29 16:59:47 +01007544
7545/**
7546 * Logs when there is a smart selection related event.
7547 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7548 * Logged from: TextClassifierEventLogger.java
7549 */
7550message TextSelectionEvent {
7551 // A session ID.
7552 optional string session_id = 1;
7553
7554 // Event type of this event.
7555 optional android.stats.textclassifier.EventType event_type = 2;
7556
Tony Mak9c84bd22019-12-09 07:27:25 +00007557 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007558 optional string model_name = 3;
7559
7560 // Type of widget that was involved in triggering this event.
7561 optional android.stats.textclassifier.WidgetType widget_type = 4;
7562
7563 // Index of this event in a session.
7564 optional int32 event_index = 5;
7565
7566 // Entity type that is involved.
7567 optional string entity_type = 6;
7568
7569 // Relative word index of the start of the selection.
7570 optional int32 relative_word_start_index = 7;
7571
7572 // Relative word (exclusive) index of the end of the selection.
7573 optional int32 relative_word_end_index = 8;
7574
7575 // Relative word index of the start of the smart selection.
7576 optional int32 relative_suggested_word_start_index = 9;
7577
7578 // Relative word (exclusive) index of the end of the smart selection.
7579 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007580
7581 // Name of source package.
7582 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007583}
7584
7585/**
7586 * Logs when there is a smart linkify related event.
7587 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7588 * Logged from: TextClassifierEventLogger.java
7589 */
7590message TextLinkifyEvent {
7591 // A session ID.
7592 optional string session_id = 1;
7593
7594 // Event type of this event.
7595 optional android.stats.textclassifier.EventType event_type = 2;
7596
Tony Mak9c84bd22019-12-09 07:27:25 +00007597 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007598 optional string model_name = 3;
7599
7600 // Type of widget that was involved in triggering this event.
7601 optional android.stats.textclassifier.WidgetType widget_type = 4;
7602
7603 // Index of this event in a session.
7604 optional int32 event_index = 5;
7605
7606 // Entity type that is involved.
7607 optional string entity_type = 6;
7608
7609 // Number of links detected.
7610 optional int32 num_links = 7;
7611
7612 // The total length of all links.
7613 optional int32 linked_text_length = 8;
7614
7615 // Length of input text.
7616 optional int32 text_length = 9;
7617
7618 // Time spent on generating links in ms.
7619 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007620
7621 // Name of source package.
7622 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007623}
7624
7625/**
7626 * Logs when there is a conversation actions related event.
7627 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7628 * Logged from: TextClassifierEventLogger.java
7629 */
7630message ConversationActionsEvent {
7631 // A session ID.
7632 optional string session_id = 1;
7633
7634 // Event type of this event.
7635 optional android.stats.textclassifier.EventType event_type = 2;
7636
Tony Mak9c84bd22019-12-09 07:27:25 +00007637 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007638 optional string model_name = 3;
7639
7640 // Type of widget that was involved in triggering this event.
7641 optional android.stats.textclassifier.WidgetType widget_type = 4;
7642
7643 // The first entity type that is involved.
7644 optional string first_entity_type = 5;
7645
7646 // The second entity type that is involved.
7647 optional string second_entity_type = 6;
7648
7649 // The third entity type that is involved.
7650 optional string third_entity_type = 7;
7651
7652 // The score of the first entity type.
7653 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007654
7655 // Name of source package.
7656 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007657
7658 // Name of the annotator model that is involved in this event.
7659 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007660}
7661
7662/**
7663 * Logs when there is a language detection related event.
7664 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7665 * Logged from: TextClassifierEventLogger.java
7666 */
7667message LanguageDetectionEvent {
7668 // A session ID.
7669 optional string session_id = 1;
7670
7671 // Event type of this event.
7672 optional android.stats.textclassifier.EventType event_type = 2;
7673
Tony Mak9c84bd22019-12-09 07:27:25 +00007674 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007675 optional string model_name = 3;
7676
7677 // Type of widget that was involved in triggering this event.
7678 optional android.stats.textclassifier.WidgetType widget_type = 4;
7679
7680 // Detected language.
7681 optional string language_tag = 5;
7682
7683 // Score of the detected language.
7684 optional float score = 6;
7685
7686 // Position of this action.
7687 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007688
7689 // Name of source package.
7690 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007691}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007692
7693/**
7694 * Information about an OTA update attempt by update_engine.
7695 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7696 */
7697message UpdateEngineUpdateAttemptReported {
7698 // The number of attempts for the update engine to apply a given payload.
7699 optional int32 attempt_number = 1;
7700
7701 optional android.stats.otaupdate.PayloadType payload_type = 2;
7702
7703 // The total time in minutes for the update engine to apply a given payload.
7704 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7705 // it's increased when the system is sleeping.
7706 optional int32 duration_boottime_in_minutes = 3;
7707
7708 // The total time in minutes for the update engine to apply a given payload.
7709 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7710 // and it's not increased when the system is sleeping.
7711 optional int32 duration_monotonic_in_minutes = 4;
7712
7713 // The size of the payload in MiBs.
7714 optional int32 payload_size_mib = 5;
7715
7716 // The attempt result reported by the update engine for an OTA update.
7717 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7718
7719 // The error code reported by the update engine after an OTA update attempt
7720 // on A/B devices.
7721 optional android.stats.otaupdate.ErrorCode error_code = 7;
7722
7723 // The build fingerprint of the source system. The value is read from a
7724 // system property when the device takes the update. e.g.
7725 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7726 optional string source_fingerprint = 8;
7727}
7728
7729/**
7730 * Information about all the attempts the device make before finishing the
7731 * successful update.
7732 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7733 */
7734message UpdateEngineSuccessfulUpdateReported {
7735 // The number of attempts for the update engine to apply the payload for a
7736 // successful update.
7737 optional int32 attempt_count = 1;
7738
7739 optional android.stats.otaupdate.PayloadType payload_type = 2;
7740
7741 optional int32 payload_size_mib = 3;
7742
7743 // The total number of bytes downloaded by update_engine since the last
7744 // successful update.
7745 optional int32 total_bytes_downloaded_mib = 4;
7746
7747 // The ratio in percentage of the over-downloaded bytes compared to the
7748 // total bytes needed to successfully install the update. e.g. 200 if we
7749 // download 200MiB in total for a 100MiB package.
7750 optional int32 download_overhead_percentage = 5;
7751
7752 // The total time in minutes for the update engine to apply the payload for a
7753 // successful update.
7754 optional int32 total_duration_minutes = 6;
7755
7756 // The number of reboot of the device during a successful update.
7757 optional int32 reboot_count = 7;
7758}
Alec Mourie088e762019-07-02 13:10:55 -07007759
7760/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007761 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7762 * key to indicate whether it was successful or not.
7763 *
7764 * Logged from:
7765 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7766 */
7767message RebootEscrowRecoveryReported {
7768 optional bool successful = 1;
7769}
7770
7771/**
Alec Mourie088e762019-07-02 13:10:55 -07007772 * Global display pipeline metrics reported by SurfaceFlinger.
7773 * Pulled from:
7774 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7775 */
7776message SurfaceflingerStatsGlobalInfo {
7777 // Total number of frames presented during the tracing period
7778 optional int64 total_frames = 1;
7779 // Total number of frames missed
7780 optional int64 missed_frames = 2;
7781 // Total number of frames that fell back to client composition
7782 optional int64 client_composition_frames = 3;
7783 // Total time the display was turned on
7784 optional int64 display_on_millis = 4;
7785 // Total time that was spent performing animations.
7786 // This is derived from the present-to-present layer histogram
7787 optional int64 animation_millis = 5;
7788}
7789
7790/**
7791 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7792 * The number of layers uploaded will be restricted due to size limitations.
7793 * Pulled from:
7794 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7795 */
7796message SurfaceflingerStatsLayerInfo {
7797 // The layer for this set of metrics
7798 // For now we can infer that the package name is included in the layer
7799 // name.
7800 optional string layer_name = 1;
7801 // Total number of frames presented
7802 optional int64 total_frames = 2;
7803 // Total number of dropped frames while latching a buffer for this layer.
7804 optional int64 dropped_frames = 3;
7805 // Set of timings measured between successive presentation timestamps.
7806 optional FrameTimingHistogram present_to_present = 4
7807 [(android.os.statsd.log_mode) = MODE_BYTES];
7808 // Set of timings measured from when an app queued a buffer for
7809 // presentation, until the buffer was actually presented to the
7810 // display.
7811 optional FrameTimingHistogram post_to_present = 5
7812 [(android.os.statsd.log_mode) = MODE_BYTES];
7813 // Set of timings measured from when a buffer is ready to be presented,
7814 // until the buffer was actually presented to the display.
7815 optional FrameTimingHistogram acquire_to_present = 6
7816 [(android.os.statsd.log_mode) = MODE_BYTES];
7817 // Set of timings measured from when a buffer was latched by
7818 // SurfaceFlinger, until the buffer was presented to the display
7819 optional FrameTimingHistogram latch_to_present = 7
7820 [(android.os.statsd.log_mode) = MODE_BYTES];
7821 // Set of timings measured from the desired presentation to the actual
7822 // presentation time
7823 optional FrameTimingHistogram desired_to_present = 8
7824 [(android.os.statsd.log_mode) = MODE_BYTES];
7825 // Set of timings measured from when an app queued a buffer for
7826 // presentation, until the buffer was ready to be presented.
7827 optional FrameTimingHistogram post_to_acquire = 9
7828 [(android.os.statsd.log_mode) = MODE_BYTES];
7829}
7830
7831/**
7832 * Histogram of frame counts bucketed by time in milliseconds.
7833 * Because of size limitations, we hard-cap the number of buckets, with
7834 * buckets for corresponding to larger milliseconds being less precise.
7835 */
7836message FrameTimingHistogram {
7837 // Timings in milliseconds that describes a set of histogram buckets
7838 repeated int32 time_millis_buckets = 1;
7839 // Number of frames that match to each time_millis, i.e. the bucket
7840 // contents
7841 // It's required that len(time_millis) == len(frame_count)
7842 repeated int64 frame_counts = 2;
7843}
Emilian Peev6729f372019-08-29 09:14:09 -07007844
Emilian Peev6729f372019-08-29 09:14:09 -07007845/**
7846 * Information about camera facing and API level usage.
7847 * Logged from:
7848 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7849 */
7850message CameraActionEvent {
7851 // Camera session duration
7852 optional int64 duration = 1;
7853
7854 // Camera API level used
7855 optional int32 api_level = 2;
7856
7857 // Name of client package
7858 optional string package_name = 3;
7859
7860 // Camera facing
7861 enum Facing {
7862 UNKNOWN = 0;
7863 BACK = 1;
7864 FRONT = 2;
7865 EXTERNAL = 3;
7866 }
7867 optional Facing facing = 4;
7868}
atrost01a20932019-08-28 15:40:37 +01007869
7870/**
7871 * Logs when a compatibility change is affecting an app.
7872 *
7873 * Logged from:
7874 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7875 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7876 */
7877message AppCompatibilityChangeReported {
7878 // The UID of the app being affected by the compatibilty change.
7879 optional int32 uid = 1 [(is_uid) = true];
7880
7881 // The ID of the change affecting the app.
7882 optional int64 change_id = 2;
7883
7884 enum State {
7885 UNKNOWN_STATE = 0;
7886 ENABLED = 1;
7887 DISABLED = 2;
7888 LOGGED = 3;
7889 }
7890
7891 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7892 // logged otherwise.
7893 optional State state = 3;
7894
7895 enum Source {
7896 UNKNOWN_SOURCE = 0;
7897 APP_PROCESS = 1;
7898 SYSTEM_SERVER = 2;
7899 }
7900
7901 // Where it was logged from.
7902 optional Source source = 4;
7903
7904}
Hector Dearman40579f62019-11-01 13:19:30 +00007905
7906/**
7907 * Logged from
7908 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7909 */
7910message PerfettoUploaded {
7911 enum Event {
7912 PERFETTO_UNDEFINED = 0;
7913 PERFETTO_TRACE_BEGIN = 1;
7914 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7915 PERFETTO_ON_CONNECT = 3;
7916 PERFETTO_ON_TRACING_DISABLED = 4;
7917 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7918 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7919 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7920 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7921 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7922 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7923 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7924 PERFETTO_TRIGGER_BEGIN = 12;
7925 PERFETTO_TRIGGER_SUCCESS = 13;
7926 PERFETTO_TRIGGER_FAILURE = 14;
7927 PERFETTO_HIT_GUARDRAILS = 15;
7928 PERFETTO_ON_TIMEOUT = 16;
7929 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7930 }
7931
7932 // Which stage of the pipeline we are reporting from.
7933 optional Event event = 1;
7934
7935 // UUID matching the one set inside the SystemInfo trace packet.
7936 optional int64 trace_uuid_lsb = 2;
7937 optional int64 trace_uuid_msb = 3;
7938}
Mark Tabrya824a642019-11-05 12:26:12 -08007939
7940/**
7941 * Pulls client metrics on data transferred via Vehicle Maps Service.
7942 * Metrics are keyed by uid + layer.
7943 *
7944 * Pulled from:
7945 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7946 */
7947message VmsClientStats {
7948 // UID of the VMS client app
7949 optional int32 uid = 1 [(is_uid) = true];
7950
7951 // VMS layer definition
7952 optional int32 layer_type = 2;
7953 optional int32 layer_channel = 3;
7954 optional int32 layer_version = 4;
7955
7956 // Bytes and packets sent by the client for the layer
7957 optional int64 tx_bytes = 5;
7958 optional int64 tx_packets = 6;
7959
7960 // Bytes and packets received by the client for the layer
7961 optional int64 rx_bytes = 7;
7962 optional int64 rx_packets = 8;
7963
7964 // Bytes and packets dropped due to client error
7965 optional int64 dropped_bytes = 9;
7966 optional int64 dropped_packets = 10;
7967}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007968
7969/**
7970 * State of a dangerous permission requested by a package - sampled
7971 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7972*/
7973message DangerousPermissionStateSampled {
7974 // Name of the permission
7975 optional string permission_name = 1;
7976
7977 // Uid of the package
7978 optional int32 uid = 2 [(is_uid) = true];
7979
7980 // If the permission is granted to the uid
7981 optional bool is_granted = 3;
7982
7983 // Permission flags as per android.content.pm.PermissionFlags
7984 optional int32 permission_flags = 4;
7985}
7986
Stan Iliev637ba5e2019-08-16 13:43:08 -04007987/**
7988 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7989 */
7990enum PipelineType {
7991 GL = 0;
7992 VULKAN = 1;
7993}
7994
7995/**
7996 * HWUI stats for a given app.
7997 */
7998message GraphicsStats {
7999 // The package name of the app
8000 optional string package_name = 1;
8001
8002 // The version code of the app
8003 optional int64 version_code = 2;
8004
8005 // The start & end timestamps in UTC as
8006 // milliseconds since January 1, 1970
8007 // Compatible with java.util.Date#setTime()
8008 optional int64 stats_start = 3;
8009
8010 optional int64 stats_end = 4;
8011
8012 // HWUI renders pipeline type: GL or Vulkan.
8013 optional PipelineType pipeline = 5;
8014
8015 // Distinct frame count.
8016 optional int32 total_frames = 6;
8017
8018 // Number of "missed vsync" events.
8019 optional int32 missed_vsync_count = 7;
8020
8021 // Number of frames in triple-buffering scenario (high input latency)
8022 optional int32 high_input_latency_count = 8;
8023
8024 // Number of "slow UI thread" events.
8025 optional int32 slow_ui_thread_count = 9;
8026
8027 // Number of "slow bitmap upload" events.
8028 optional int32 slow_bitmap_upload_count = 10;
8029
8030 // Number of "slow draw" events.
8031 optional int32 slow_draw_count = 11;
8032
8033 // Number of frames that missed their deadline (aka, visibly janked)
8034 optional int32 missed_deadline_count = 12;
8035
8036 // The frame time histogram for the package
8037 optional FrameTimingHistogram cpu_histogram = 13
8038 [(android.os.statsd.log_mode) = MODE_BYTES];
8039
8040 // The gpu frame time histogram for the package
8041 optional FrameTimingHistogram gpu_histogram = 14
8042 [(android.os.statsd.log_mode) = MODE_BYTES];
8043
8044 // UI mainline module version.
8045 optional int64 version_ui_module = 15;
8046
8047 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8048 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8049 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8050 // more apps are running / rendering.
8051 optional bool is_today = 16;
8052}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008053
8054/**
8055 * Message related to dangerous (runtime) app ops access
8056 */
8057message RuntimeAppOpsAccess {
8058 // Uid of the package accessing app op
8059 optional int32 uid = 1 [(is_uid) = true];
8060
8061 // Name of the package accessing app op
8062 optional string package_name = 2;
8063
8064 // operation id; maps to the OP_* constants in AppOpsManager.java
8065 optional int32 op_id = 3;
8066
8067 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8068 // Features must be provided through manifest using <feature> tag available in R and above.
8069 optional string feature_id = 4;
8070
8071 // message related to app op access, limited to 600 chars by API
8072 optional string message = 5;
8073
8074 enum SamplingStrategy {
8075 DEFAULT = 0;
8076 UNIFORM = 1;
8077 RARELY_USED = 2;
8078 }
8079
8080 // sampling strategy used to collect this message
8081 optional SamplingStrategy sampling_strategy = 6;
8082}
8083
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008084/*
8085 * Logs userspace reboot outcome and duration.
8086 *
8087 * Logged from:
8088 * frameworks/base/core/java/com/android/server/BootReceiver.java
8089 */
8090message UserspaceRebootReported {
8091 // Possible outcomes of userspace reboot.
8092 enum Outcome {
8093 // Default value in case platform failed to determine the outcome.
8094 OUTCOME_UNKNOWN = 0;
8095 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8096 SUCCESS = 1;
8097 // Userspace reboot shutdown sequence was aborted.
8098 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8099 // Remounting userdata into checkpointing mode failed.
8100 FAILED_USERDATA_REMOUNT = 3;
8101 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8102 // reboot.
8103 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8104 }
8105 // Outcome of userspace reboot. Always set.
8106 optional Outcome outcome = 1;
8107 // Duration of userspace reboot in case it has a successful outcome.
8108 // Duration is measured as time between userspace reboot was initiated and until boot completed
8109 // (e.g. sys.boot_completed=1).
8110 optional int64 duration_millis = 2;
8111 // State of primary user's (user0) credential encryption storage.
8112 enum UserEncryptionState {
8113 // Default value.
8114 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8115 // Credential encrypted storage is unlocked.
8116 UNLOCKED = 1;
8117 // Credential encrypted storage is locked.
8118 LOCKED = 2;
8119 }
8120 // State of primary user's encryption storage at the moment boot completed. Always set.
8121 optional UserEncryptionState user_encryption_state = 3;
8122}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008123
8124/*
8125 * Logs integrity check information during each install.
8126 *
8127 * Logged from:
8128 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8129 */
8130message IntegrityCheckResultReported {
8131 optional string package_name = 1;
8132 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008133 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008134 optional string installer_package_name = 4;
8135 enum Response {
8136 UNKNOWN = 0;
8137 ALLOWED = 1;
8138 REJECTED = 2;
8139 FORCE_ALLOWED = 3;
8140 }
8141 optional Response response = 5;
8142 // An estimate on the cause of the response. This will only be populated for
8143 // REJECTED and FORCE_ALLOWED
8144 optional bool caused_by_app_cert_rule = 6;
8145 optional bool caused_by_installer_rule = 7;
8146}
8147
8148/**
8149 * Logs the information about the rules and the provider whenever rules are
8150 * pushed into AppIntegrityManager.
8151 *
8152 * Logged from:
8153 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8154 */
8155message IntegrityRulesPushed {
8156 optional bool success = 1;
8157 // Package name of the app that pushed the rules.
8158 optional string rule_provider = 2;
8159 // Version string of arbitrary format provided by the rule provider to
8160 // identify the rules.
8161 optional string rule_version = 3;
8162}
Jordan Liubedfa702019-12-20 15:08:45 -08008163
8164/**
8165 * Logs when a cell broadcast message is received on the device.
8166 *
8167 * Logged from CellBroadcastService module:
8168 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8169 */
8170message CellBroadcastMessageReported {
8171 // The type of Cell Broadcast message
8172 enum CbType {
8173 UNKNOWN_TYPE = 0;
8174 GSM = 1;
8175 CDMA = 2;
8176 CDMA_SPC = 3;
8177 }
8178
8179 // GSM, CDMA, CDMA-SCP
8180 optional CbType type = 1;
8181}
8182
8183/**
8184 * Logs when an error occurs while handling a cell broadcast message;
8185 *
8186 * Logged from CellBroadcastService module:
8187 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8188 */
8189message CellBroadcastMessageError {
8190 // The type of error raised when trying to handle a cell broadcast message
8191 enum ErrorType {
8192 UNKNOWN_TYPE = 0;
8193 CDMA_DECODING_ERROR = 1;
8194 CDMA_SCP_EMPTY = 2;
8195 CDMA_SCP_HANDLING_ERROR = 3;
8196 GSM_INVALID_HEADER_LENGTH = 4;
8197 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8198 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8199 GSM_INVALID_PDU = 7;
8200 GSM_INVALID_GEO_FENCING_DATA = 8;
8201 GSM_UMTS_INVALID_WAC = 9;
8202 FAILED_TO_INSERT_TO_DB = 10;
8203 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8204 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8205 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8206 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8207 }
8208
8209 // What kind of error occurred
8210 optional ErrorType type = 1;
8211
8212 // Exception message (or log message) associated with the error (max 1000 chars)
8213 optional string exception_message = 2;
8214}