blob: 12058cae1a2ae85acde8a6ad0c6ce729680dfb01 [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;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800229 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
230 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
231 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
232 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
233 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
234 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800235 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
236 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
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"];
xshu2c3d9e42019-09-26 17:54:02 -0700390 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
391 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
392 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000393 }
David Chenc8a43242017-10-17 16:23:28 -0700394
David Chen6e3e6cb2018-01-03 16:14:06 -0800395 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000396 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700397 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800398 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
399 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
400 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
401 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
402 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
403 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800404 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800405 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
406 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
407 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
408 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
409 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
410 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
411 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
412 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
413 SystemUptime system_uptime = 10015 [(module) = "framework"];
414 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
415 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000416 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800417 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
418 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800419 Temperature temperature = 10021 [(module) = "framework"];
420 BinderCalls binder_calls = 10022 [(module) = "framework"];
421 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
422 LooperStats looper_stats = 10024 [(module) = "framework"];
423 DiskStats disk_stats = 10025 [(module) = "framework"];
424 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
425 AppSize app_size = 10027 [(module) = "framework"];
426 CategorySize category_size = 10028 [(module) = "framework"];
427 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800428 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800429 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
430 DiskIo disk_io = 10032 [(module) = "framework"];
431 PowerProfile power_profile = 10033 [(module) = "framework"];
432 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
433 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
434 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700435 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800436 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
437 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
438 10040 [(module) = "framework"];
439 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
440 10041 [(module) = "framework"];
441 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800442 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800443 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800444 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800445 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
446 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
447 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
448 RoleHolder role_holder = 10049 [(module) = "framework"];
449 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800450 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
452 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800453 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
454 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
456 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
457 FaceSettings face_settings = 10058 [(module) = "framework"];
458 CoolingDevice cooling_device = 10059 [(module) = "framework"];
459 AppOps app_ops = 10060 [(module) = "framework"];
460 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700461 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
462 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800464 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
466 DangerousPermissionStateSampled dangerous_permission_state_sampled =
467 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400468 GraphicsStats graphics_stats = 10068;
Kenny Root6c218db2020-02-02 17:43:44 +0000469 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
470 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700471 }
yroa1fe77c2018-02-26 14:22:54 -0800472
Bookatz76aafcf2018-09-17 16:17:10 -0700473 // DO NOT USE field numbers above 100,000 in AOSP.
474 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
475 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100476
477 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700478}
479
Yao Chend54f9dd2017-10-17 17:37:48 +0000480/**
Yangster-mac20877162017-12-22 17:19:39 -0800481 * This proto represents a node of an attribution chain.
482 * Note: All attribution chains are represented as a repeated field of type
483 * AttributionNode. It is understood that in such arrays, the order is that
484 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000485 */
Yangster-mac20877162017-12-22 17:19:39 -0800486message AttributionNode {
487 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800488 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800489
Yangster-mac20877162017-12-22 17:19:39 -0800490 // The (optional) string tag for an element in the attribution chain. If the
491 // element has no tag, it is encoded as an empty string.
492 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700493}
494
Yangster-mac48b3d622018-08-18 12:38:11 -0700495message KeyValuePair {
496 optional int32 key = 1;
497 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700498 int32 value_int = 2;
499 int64 value_long = 3;
500 string value_str = 4;
501 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700502 }
503}
504
505message KeyValuePairsAtom {
506 optional int32 uid = 1;
507 repeated KeyValuePair pairs = 2;
508}
509
Yao Chend54f9dd2017-10-17 17:37:48 +0000510/*
511 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800512 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000513 *
514 * RULES:
515 * - The field ids for each atom must start at 1, and count upwards by 1.
516 * Skipping field ids is not allowed.
517 * - These form an API, so renaming, renumbering or removing fields is
518 * not allowed between android releases. (This is not currently enforced,
519 * but there will be a tool to enforce this restriction).
520 * - The types must be built-in protocol buffer types, namely, no sub-messages
521 * are allowed (yet). The bytes type is also not allowed.
522 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800523 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000524 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800525 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000526 * - A field that is a uid should be a string field, tagged with the [xxx]
527 * annotation. The generated code on android will be represented by UIDs,
528 * and those UIDs will be translated in xxx to those strings.
529 *
530 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700531 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000532 * - If there is a UID, it goes first. Think in an object-oriented fashion.
533 * *****************************************************************************
534 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700535
Yao Chend54f9dd2017-10-17 17:37:48 +0000536/**
Tej Singha72344992019-04-17 18:55:08 -0700537 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700538 * Logs when the Thermal service HAL notifies the throttling start/stop events.
539 *
540 * Logged from:
541 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
542 */
543message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700544 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700545 optional android.os.TemperatureTypeEnum sensor_type = 1;
546
Maggie White442b6312019-04-05 16:26:44 -0700547 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700548 enum State {
549 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700550 START = 1; // START indicated that throttling was triggered.
551 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700552 }
Yangster-mace16189a2018-08-26 12:20:16 -0700553 optional State state = 2;
554
555 optional float temperature = 3;
556}
557
558/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000559 * Logs when the screen state changes.
560 *
561 * Logged from:
562 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
563 */
564message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800565 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700566 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700567}
Yao Chend54f9dd2017-10-17 17:37:48 +0000568
569/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700570 * Logs that the process state of the uid, as determined by ActivityManager
571 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
575 */
Bookatzc1a050a2017-10-10 15:49:28 -0700576message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700577 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000578
Bookatzdb026a22018-01-10 19:01:56 -0800579 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700580 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000581}
582
583/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700584 * Logs process state change of a process, as per the activity manager.
585 *
586 * Logged from:
587 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
588 */
589message ProcessStateChanged {
590 optional int32 uid = 1;
591 optional string process_name = 2;
592 optional string package_name = 3;
593 // TODO: remove this when validation is done
594 optional int64 version = 5;
595 // The state, from frameworks/base/core/proto/android/app/enums.proto.
596 optional android.app.ProcessStateEnum state = 4;
597}
598
599/**
600 * Logs when ActivityManagerService sleep state is changed.
601 *
602 * Logged from:
603 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
604 */
605message ActivityManagerSleepStateChanged {
606 // TODO: import frameworks proto
607 enum State {
608 UNKNOWN = 0;
609 ASLEEP = 1;
610 AWAKE = 2;
611 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700612 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700613}
614
615/**
616 * Logs when system memory state changes.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
620 */
621message MemoryFactorStateChanged {
622 // TODO: import frameworks proto
623 enum State {
624 MEMORY_UNKNOWN = 0;
625 NORMAL = 1; // normal.
626 MODERATE = 2; // moderate memory pressure.
627 LOW = 3; // low memory.
628 CRITICAL = 4; // critical memory.
629
630 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700631 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700632}
633
634/**
635 * Logs when app is using too much cpu, according to ActivityManagerService.
636 *
637 * Logged from:
638 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
639 */
640message ExcessiveCpuUsageReported {
641 optional int32 uid = 1;
642 optional string process_name = 2;
643 optional string package_name = 3;
644 // package version. TODO: remove this when validation is done
645 optional int64 version = 4;
646}
647
648/**
649 * Logs when a cached process is killed, along with its pss.
650 *
651 * Logged from:
652 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
653 */
654message CachedKillReported {
655 optional int32 uid = 1;
656 optional string process_name = 2;
657 optional string package_name = 3;
658 // TODO: remove this when validation is done
659 optional int64 version = 5;
660 optional int64 pss = 4;
661}
662
663/**
xshu2c3d9e42019-09-26 17:54:02 -0700664 * Logs the change in wifi health.
665 *
666 * Logged from:
667 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
668 */
669message WifiHealthStatReported {
670 // duration this stat is obtained over in milliseconds
671 optional int32 duration_millis = 1;
672 // whether wifi is classified as sufficient for the user's data traffic, determined
673 // by whether the calculated throughput exceeds the average demand within |duration_millis|
674 optional bool is_sufficient = 2;
675 // whether the calculated throughput is exceeds the minimum required for typical usage
676 optional bool is_throughput_good = 3;
677 // whether cellular data is available
678 optional bool is_cell_data_available = 4;
679 // the WLAN channel the connected network is on (ie. 2412)
680 optional int32 frequency = 5;
681}
682
683/**
684 * Logged when wifi detects a significant change in connection failure rate.
685 *
686 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
687 *
688 */
689message WifiFailureStatReported {
690 enum AbnormalityType {
691 UNKNOWN = 0;
692 SIGNIFICANT_INCREASE = 1;
693 SIGNIFICANT_DECREASE = 2;
694 SIMPLY_HIGH = 3;
695 }
696 enum FailureType {
697 FAILURE_UNKNOWN = 0;
698 FAILURE_CONNECTION = 1;
699 FAILURE_ASSOCIATION_REJECTION = 2;
700 FAILURE_ASSOCIATION_TIMEOUT = 3;
701 FAILURE_AUTHENTICATION = 4;
702 FAILURE_NON_LOCAL_DISCONNECTION = 5;
703 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
704 }
705 // Reason for uploading this stat
706 optional AbnormalityType abnormality_type = 1;
707 // The particular type of failure
708 optional FailureType failure_type = 2;
709 // How many times we have encountered this combination of AbnormalityType and FailureType
710 optional int32 failure_count = 3;
711}
712
713/**
714 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
715 *
716 * Logged from:
717 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
718 */
719message WifiConnectionResultReported {
720 enum FailureCode {
721 FAILURE_UNKNOWN = 0;
722 FAILURE_ASSOCIATION_TIMEOUT = 1;
723 FAILURE_ASSOCIATION_REJECTION = 2;
724 FAILURE_AUTHENTICATION_GENERAL = 3;
725 FAILURE_AUTHENTICATION_EAP = 4;
726 FAILURE_DHCP = 5;
727 FAILURE_NETWORK_DISCONNECTION = 6;
728 FAILURE_ROAM_TIMEOUT = 7;
729 }
730 // true represents a successful connection
731 optional bool connection_result = 1;
732 // reason for the connection failure
733 optional FailureCode failure_code = 2;
734 // scan rssi before the connection attempt
735 optional int32 rssi = 3;
736}
737
738/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700739 * Logs when memory stats of a process is reported.
740 *
741 * Logged from:
742 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
743 */
744message ProcessMemoryStatReported {
745 optional int32 uid = 1;
746 optional string process_name = 2;
747 optional string package_name = 3;
748 //TODO: remove this when validation is done
749 optional int64 version = 9;
750 optional int64 pss = 4;
751 optional int64 uss = 5;
752 optional int64 rss = 6;
753 enum Type {
754 ADD_PSS_INTERNAL_SINGLE = 0;
755 ADD_PSS_INTERNAL_ALL_MEM = 1;
756 ADD_PSS_INTERNAL_ALL_POLL = 2;
757 ADD_PSS_EXTERNAL = 3;
758 ADD_PSS_EXTERNAL_SLOW = 4;
759 }
760 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800761 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700762}
763
764/**
Bookatzc1a050a2017-10-10 15:49:28 -0700765 * Logs that a process started, finished, crashed, or ANRed.
766 *
767 * Logged from:
768 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
769 */
770message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700771 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700772
David Chen0b5c90c2018-01-25 16:51:49 -0800773 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800774 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700775
Bookatzddccf0a2017-11-28 16:48:14 -0800776 // What lifecycle state the process changed to.
777 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800778 enum State {
779 FINISHED = 0;
780 STARTED = 1;
781 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800782 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800783 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700784}
785
Bookatzc1a050a2017-10-10 15:49:28 -0700786/**
787 * Logs when the ble scan state changes.
788 *
789 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700790 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700791 */
792message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800793 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700794
795 enum State {
796 OFF = 0;
797 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700798 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
799 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700800 }
801 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700802
Bookatze5ec0b42018-03-26 13:34:56 -0700803 // Does the scan have a filter.
804 optional bool is_filtered = 3;
805 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
806 optional bool is_first_match = 4;
807 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
808 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700809}
810
811/**
812 * Logs reporting of a ble scan finding results.
813 *
814 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700815 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700816 */
Bookatzae6738e2018-09-13 11:38:56 -0700817// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700818message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800819 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700820
821 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800822 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700823}
824
825/**
826 * Logs when a sensor state changes.
827 *
828 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700829 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700830 */
831message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800832 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700833
Bookatzc1a050a2017-10-10 15:49:28 -0700834 // The id (int) of the sensor.
835 optional int32 sensor_id = 2;
836
837 enum State {
838 OFF = 0;
839 ON = 1;
840 }
841 optional State state = 3;
842}
843
Bookatzc1a050a2017-10-10 15:49:28 -0700844/**
845 * Logs when GPS state changes.
846 *
847 * Logged from:
848 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
849 */
850message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800851 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700852
853 enum State {
854 OFF = 0;
855 ON = 1;
856 }
857 optional State state = 2;
858}
859
Bookatz48d362e2018-11-06 15:49:08 -0800860/**
861 * Logs when GPS signal quality.
862 *
863 * Logged from:
864 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
865 */
866message GpsSignalQualityChanged {
867 optional android.server.location.GpsSignalQualityEnum level = 1;
868}
869
Bookatzc1a050a2017-10-10 15:49:28 -0700870
871/**
872 * Logs when a sync manager sync state changes.
873 *
874 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700875 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700876 */
877message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800878 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700879
David Chen0b5c90c2018-01-25 16:51:49 -0800880 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800881 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 enum State {
884 OFF = 0;
885 ON = 1;
886 }
887 optional State state = 3;
888}
889
Yangster-mac96353002018-09-05 11:18:55 -0700890/*
891 * Deferred job stats.
892 *
893 * Logged from:
894 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
895*/
896message DeferredJobStatsReported {
897 repeated AttributionNode attribution_node = 1;
898
899 // Number of jobs deferred.
900 optional int32 num_jobs_deferred = 2;
901
902 // Time since the last job runs.
903 optional int64 time_since_last_job_millis = 3;
904}
905
Bookatzc1a050a2017-10-10 15:49:28 -0700906/**
907 * Logs when a job scheduler job 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 ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
915 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700917
918 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800919 FINISHED = 0;
920 STARTED = 1;
921 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700922 }
923 optional State state = 3;
924
Tej Singh33a412b2018-03-16 18:43:59 -0700925 // The reason a job has stopped.
926 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700927 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700928 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100929
930 // The standby bucket of the app that scheduled the job. These match the framework constants
931 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
932 // already assigned 0.
933 enum Bucket {
934 UNKNOWN = -1;
935 ACTIVE = 0;
936 WORKING_SET = 1;
937 FREQUENT = 2;
938 RARE = 3;
939 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800940 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100941 }
942 optional Bucket standby_bucket = 5 [default = UNKNOWN];
943
944 // The job id (as assigned by the app).
945 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700946}
947
948/**
949 * Logs when the audio state changes.
950 *
951 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700952 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700953 */
954message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800955 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700956
957 enum State {
958 OFF = 0;
959 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700960 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
961 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700962 }
963 optional State state = 2;
964}
965
966/**
967 * Logs when the video codec state changes.
968 *
969 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700971 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800972message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800973 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700974
975 enum State {
976 OFF = 0;
977 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700978 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
979 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700980 }
981 optional State state = 2;
982}
983
984/**
985 * Logs when the flashlight state changes.
986 *
987 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700988 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700989 */
990message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800991 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700992
993 enum State {
994 OFF = 0;
995 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700996 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
997 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700998 }
999 optional State state = 2;
1000}
1001
1002/**
1003 * Logs when the camera state changes.
1004 *
1005 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001006 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001007 */
1008message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001009 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001010
1011 enum State {
1012 OFF = 0;
1013 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001014 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1015 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001016 }
1017 optional State state = 2;
1018}
1019
1020/**
1021 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001022 *
1023 * Logged from:
1024 * TODO
1025 */
Bookatzd6746242017-10-24 18:39:35 -07001026message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001027 repeated AttributionNode attribution_node = 1
1028 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001029
Bookatz1a1b0462018-01-12 11:47:03 -08001030 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1031 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -08001032 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
1033 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001034
1035 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -08001036 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -07001037
1038 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001039 RELEASE = 0;
1040 ACQUIRE = 1;
1041 CHANGE_RELEASE = 2;
1042 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001043 }
tsaichristineed615642020-01-02 12:53:41 -08001044 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -07001045}
1046
1047/**
Bookatzc1a050a2017-10-10 15:49:28 -07001048 * Logs when a partial wakelock is considered 'long' (over 1 min).
1049 *
1050 * Logged from:
1051 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1052 */
1053message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001054 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001055
Yao Chend54f9dd2017-10-17 17:37:48 +00001056 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1057 optional string tag = 2;
1058
Bookatzc1a050a2017-10-10 15:49:28 -07001059 // TODO: I have no idea what this is.
1060 optional string history_tag = 3;
1061
1062 enum State {
1063 OFF = 0;
1064 ON = 1;
1065 }
1066 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001067}
1068
Bookatzc1a050a2017-10-10 15:49:28 -07001069/**
Bookatza66083f2018-09-20 17:24:00 -07001070 * Logs when the device is interactive, according to the PowerManager Notifier.
1071 *
1072 * Logged from:
1073 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1074 */
1075message InteractiveStateChanged {
1076 enum State {
1077 OFF = 0;
1078 ON = 1;
1079 }
1080 optional State state = 1;
1081}
1082
1083/**
Bookatzc1a050a2017-10-10 15:49:28 -07001084 * Logs Battery Saver state change.
1085 *
1086 * Logged from:
1087 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1088 */
1089message BatterySaverModeStateChanged {
1090 enum State {
1091 OFF = 0;
1092 ON = 1;
1093 }
1094 optional State state = 1;
1095}
1096
1097/**
1098 * Logs Doze mode state change.
1099 *
1100 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001101 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001102 */
1103message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001104 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001105}
1106
1107
1108/**
1109 * Logs state change of Doze mode including maintenance windows.
1110 *
1111 * Logged from:
1112 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1113 */
1114message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001115 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001116}
1117
1118/**
1119 * Logs screen brightness level.
1120 *
1121 * Logged from:
1122 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1123 */
1124message ScreenBrightnessChanged {
1125 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1126 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001127}
1128
1129/**
1130 * Logs battery level (percent full, from 0 to 100).
1131 *
1132 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001133 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001134 */
1135message BatteryLevelChanged {
1136 // Battery level. Should be in [0, 100].
1137 optional int32 battery_level = 1;
1138}
1139
1140/**
1141 * Logs change in charging status of the device.
1142 *
1143 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001144 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001145 */
1146message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001147 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1148 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001149}
1150
1151/**
1152 * Logs whether the device is plugged in, and what power source it is using.
1153 *
1154 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001155 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001156 */
1157message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001158 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1159 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001160}
1161
Bookatz8c6571b2017-10-24 15:04:41 -07001162/**
1163 * Logs when an app's wakeup alarm fires.
1164 *
1165 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001166 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001167 */
1168message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001169 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001170
1171 // Name of the wakeup alarm.
1172 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001173
1174 // Name of source package (for historical reasons, since BatteryStats tracked it).
1175 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001176
1177 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1178 enum Bucket {
1179 UNKNOWN = 0;
1180 EXEMPTED = 5;
1181 ACTIVE = 10;
1182 WORKING_SET = 20;
1183 FREQUENT = 30;
1184 RARE = 40;
1185 NEVER = 50;
1186 }
1187 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1188 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001189}
1190
1191/**
1192 * Logs when an an app causes the mobile radio to change state.
1193 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1194 *
1195 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001196 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001197 */
1198message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001199 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001200
Bookatz1a1b0462018-01-12 11:47:03 -08001201 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1202 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001203}
1204
1205/**
1206 * Logs when an an app causes the wifi radio to change state.
1207 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1208 *
1209 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001210 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001211 */
1212message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001213 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001214
Bookatz1a1b0462018-01-12 11:47:03 -08001215 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1216 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001217}
1218
1219/**
1220 * Logs kernel wakeup reasons and aborts.
1221 *
1222 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001223 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001224 */
1225message KernelWakeupReported {
1226 // Name of the kernel wakeup reason (or abort).
1227 optional string wakeup_reason_name = 1;
1228
1229 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001230 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001231}
1232
1233/**
Bookatzda1798c2018-12-13 14:16:00 -08001234 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001235 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001236 *
1237 * Logged from:
1238 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1239 */
1240message WifiEnabledStateChanged {
1241 enum State {
1242 OFF = 0;
1243 ON = 1;
1244 }
1245 optional State state = 1;
1246}
1247
1248/**
1249 * 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 -08001250 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1251 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001252 *
1253 * Logged from:
1254 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1255 */
1256message WifiRunningStateChanged {
1257 repeated AttributionNode attribution_node = 1;
1258
1259 enum State {
1260 OFF = 0;
1261 ON = 1;
1262 }
1263 optional State state = 2;
1264}
1265
1266/**
Bookatze5885242017-10-24 20:10:31 -07001267 * Logs wifi locks held by an app.
1268 *
1269 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001270 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001271 */
1272message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001273 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001274
1275 enum State {
1276 OFF = 0;
1277 ON = 1;
1278 }
1279 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001280
1281 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1282 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001283}
1284
1285/**
1286 * Logs wifi signal strength changes.
1287 *
1288 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001289 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001290 */
1291message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001292 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1293 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001294}
1295
1296/**
1297 * Logs wifi scans performed by an app.
1298 *
1299 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001300 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001301 */
1302message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001303 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001304
1305 enum State {
1306 OFF = 0;
1307 ON = 1;
1308 }
1309 optional State state = 2;
1310}
1311
1312/**
Tej Singh4503e102018-01-04 14:35:01 -08001313 * Logs wifi multicast locks held by an app
1314 *
1315 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001316 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001317 */
1318message WifiMulticastLockStateChanged {
1319 repeated AttributionNode attribution_node = 1;
1320
1321 enum State {
1322 OFF = 0;
1323 ON = 1;
1324 }
1325 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001326
1327 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001328}
1329
1330/**
Tej Singh1ea42892018-01-19 09:27:00 -08001331 * Logs shutdown reason and duration on next boot.
1332 *
1333 * Logged from:
1334 * frameworks/base/core/java/com/android/server/BootReceiver.java
1335 */
1336message ShutdownSequenceReported {
1337 // True if shutdown is for a reboot. Default: false if we do not know.
1338 optional bool reboot = 1;
1339
1340 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1341 optional string reason = 2;
1342
1343 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1344 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001345 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001346
1347 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001348 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001349}
1350
Tej Singh6483ea42018-01-25 17:45:49 -08001351
1352/**
1353 * Logs boot reason and duration.
1354 *
1355 * Logged from:
1356 * system/core/bootstat/bootstat.cpp
1357 */
1358message BootSequenceReported {
1359 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1360 // Default: "<EMPTY>" if not available.
1361 optional string bootloader_reason = 1;
1362
1363 // Reason for system boot. Eg. bootloader, reboot,userrequested
1364 // Default: "<EMPTY>" if not available.
1365 optional string system_reason = 2;
1366
1367 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001368 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001369
1370 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001371 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001372
1373 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001374 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001375
1376 // Time since last boot in ms. Default: 0 if not available.
1377 optional int64 time_since_last_boot = 6;
1378}
1379
Tej Singhc477d9c2018-02-05 18:31:39 -08001380
1381/**
1382 * Logs call state and disconnect cause (if applicable).
1383 *
1384 * Logged from:
1385 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1386 */
1387message CallStateChanged {
1388 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1389 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1390 optional android.telecom.CallStateEnum call_state = 1;
1391
1392 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1393 // This value is only applicable when the call_state is DISCONNECTED, and
1394 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1395 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1396 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1397
1398 // True if the call is self-managed, which are apps that use the
1399 // telecom infrastructure to make their own calls.
1400 optional bool self_managed = 3;
1401
1402 // True if call is external. External calls are calls on connected Wear
1403 // devices but show up in Telecom so the user can pull them onto the device.
1404 optional bool external_call = 4;
1405}
1406
Tej Singh1ea42892018-01-19 09:27:00 -08001407/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001408 * Logs keyguard state. The keyguard is the lock screen.
1409 *
1410 * Logged from:
1411 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1412 */
1413message KeyguardStateChanged {
1414 enum State {
1415 UNKNOWN = 0;
1416 // The keyguard is hidden when the phone is unlocked.
1417 HIDDEN = 1;
1418 // The keyguard is shown when the phone is locked (screen turns off).
1419 SHOWN= 2;
1420 // The keyguard is occluded when something is overlaying the keyguard.
1421 // Eg. Opening the camera while on the lock screen.
1422 OCCLUDED = 3;
1423 }
1424 optional State state = 1;
1425}
1426
1427/**
1428 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1429 * prompts the user to enter a password (pattern, pin, etc).
1430 *
1431 * Logged from:
1432 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1433 */
1434
1435message KeyguardBouncerStateChanged {
1436 enum State {
1437 UNKNOWN = 0;
1438 // Bouncer is hidden, either as a result of successfully entering the
1439 // password, screen timing out, or user going back to lock screen.
1440 HIDDEN = 1;
1441 // This is when the user is being prompted to enter the password.
1442 SHOWN = 2;
1443 }
1444 optional State state = 1;
1445}
1446
1447/**
1448 * Logs the result of entering a password into the keyguard bouncer.
1449 *
1450 * Logged from:
1451 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1452 */
1453message KeyguardBouncerPasswordEntered {
1454 enum BouncerResult {
1455 UNKNOWN = 0;
1456 // The password entered was incorrect.
1457 FAILURE = 1;
1458 // The password entered was correct.
1459 SUCCESS = 2;
1460 }
1461 optional BouncerResult result = 1;
1462}
1463
Tej Singha883b372018-02-15 11:30:01 -08001464/*
1465 * Logs changes to the configuration of the device. The configuration is defined
1466 * in frameworks/base/core/java/android/content/res/Configuration.java
1467 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1468 * Please go there to interpret the possible values each field can be.
1469 *
1470 * Logged from:
1471 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1472 */
1473message ResourceConfigurationChanged {
1474 // Bit mask of color capabilities of the screen.
1475 // Contains information about the color gamut and hdr mode of the screen.
1476 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001477 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001478
1479 // The target screen density being rendered to.
1480 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001481 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001482
1483 // Current user preference for the scaling factor for fonts,
1484 // relative to the base density scaling.
1485 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001486 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001487
1488 // Flag indicating whether the hard keyboard is hidden.
1489 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001490 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001491
1492 // The type of keyboard attached to the device.
1493 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1494 optional int32 keyboard = 5;
1495
1496 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1497 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001498 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001499
1500 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1501 // 0 if undefined.
1502 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1503 optional int32 mcc = 7;
1504
1505 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1506 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1507 // MNC_ZERO symbol defined in Configuration.java.
1508 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1509 optional int32 mnc = 8;
1510
1511 // The kind of navigation available on the device.
1512 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1513 optional int32 navigation = 9;
1514
1515 // Flag indicating whether the navigation is available.
1516 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001517 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001518
1519 // Overall orientation of the screen.
1520 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1521 optional int32 orientation = 11;
1522
1523 // The current height of the available screen space, in dp units.
1524 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001525 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001526
1527 // Bit mask of overall layout of the screen.
1528 // Contains information about screen size, whether the screen is wider/taller
1529 // than normal, whether the screen layout is right-tl-left or left-to-right,
1530 // and whether the screen has a rounded shape.
1531 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001532 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001533
1534 // Current width of the available screen space, in dp units.
1535 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001536 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001537
1538 // The smallest screen size an application will see in normal operation.
1539 // This is the smallest value of both screenWidthDp and screenHeightDp
1540 // in portrait and landscape.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // The type of touch screen attached to the device.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1546 optional int32 touchscreen = 16;
1547
1548 // Bit mask of the ui mode.
1549 // Contains information about the overall ui mode of the device.
1550 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1551 // Also contains information about whether the device is in night mode.
1552 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001553 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001554}
1555
Tej Singheee317b2018-03-07 19:28:05 -08001556
1557/**
1558 * Logs changes in the connection state of the mobile radio.
1559 *
1560 * Logged from:
1561 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1562 */
1563message MobileConnectionStateChanged {
1564 // States are from the state machine DataConnection.java.
1565 enum State {
1566 UNKNOWN = 0;
1567 // The connection is inactive, or disconnected.
1568 INACTIVE = 1;
1569 // The connection is being activated, or connecting.
1570 ACTIVATING = 2;
1571 // The connection is active, or connected.
1572 ACTIVE = 3;
1573 // The connection is disconnecting.
1574 DISCONNECTING = 4;
1575 // The connection is disconnecting after creating a connection.
1576 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1577 }
1578 optional State state = 1;
1579 // For multi-sim phones, this distinguishes between the sim cards.
1580 optional int32 sim_slot_index = 2;
1581 // Used to identify the connection. Starts at 0 and increments by 1 for
1582 // every new network created. Resets whenever the device reboots.
1583 optional int32 data_connection_id = 3;
1584 // A bitmask for the capabilities of this connection.
1585 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1586 // Default value (if we have no information): 0
1587 optional int64 capabilities = 4;
1588 // If this connection has internet.
1589 // This just checks if the DEFAULT bit of capabilities is set.
1590 optional bool has_internet = 5;
1591}
1592
1593/**
1594 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1595 *
1596 * Logged from:
1597 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1598 */
1599message MobileRadioTechnologyChanged {
1600 optional android.telephony.NetworkTypeEnum state = 1;
1601 // For multi-sim phones, this distinguishes between the sim cards.
1602 optional int32 sim_slot_index = 2;
1603}
1604
Andrew Chantb56388b2018-03-22 21:07:33 -07001605/**
1606 * Logs the VID and PID of any connected USB devices.
1607 *
1608 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1609 *
1610 * Logged by Vendor.
1611 */
1612message UsbDeviceAttached {
1613 optional int32 vid = 1;
1614 optional int32 pid = 2;
1615 optional bool has_audio = 3;
1616 optional bool has_hid = 4;
1617 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001618 enum State {
1619 STATE_DISCONNECTED = 0;
1620 STATE_CONNECTED = 1;
1621 }
1622 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001623 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001624}
1625
Tej Singheee317b2018-03-07 19:28:05 -08001626
Tej Singhdd7bd352018-02-09 19:33:15 -08001627/**
Tej Singh5d991e12018-03-09 19:48:11 -08001628 * Logs when Bluetooth is enabled and disabled.
1629 *
1630 * Logged from:
1631 * services/core/java/com/android/server/BluetoothManagerService.java
1632 */
1633message BluetoothEnabledStateChanged {
1634 repeated AttributionNode attribution_node = 1;
1635 // Whether or not bluetooth is enabled on the device.
1636 enum State {
1637 UNKNOWN = 0;
1638 ENABLED = 1;
1639 DISABLED = 2;
1640 }
1641 optional State state = 2;
1642 // The reason for being enabled/disabled.
1643 // Eg. Airplane mode, crash, application request.
1644 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1645 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001646 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001647}
1648
1649/**
Jack Hed9837c82019-01-09 01:19:13 -08001650 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001651 *
1652 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001653 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1654 *
1655 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001656 */
1657message BluetoothConnectionStateChanged {
1658 // The state of the connection.
1659 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1660 optional android.bluetooth.ConnectionStateEnum state = 1;
1661 // An identifier that can be used to match connect and disconnect events.
1662 // Currently is last two bytes of a hash of a device level ID and
1663 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001664 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001665 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001666 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1667 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001668 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001669 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001670 // An identifier that can be used to match events for this device.
1671 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1672 // Salt: Randomly generated 256 bit value
1673 // Hash algorithm: HMAC-SHA256
1674 // Size: 32 byte
1675 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001676 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001677}
1678
1679/**
1680 * Logs when a Bluetooth device connects and disconnects over ACL
1681 *
1682 * Logged from:
1683 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1684 *
1685 * Next Tag: 3
1686 */
1687message BluetoothAclConnectionStateChanged {
1688 // An identifier that can be used to match events for this device.
1689 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1690 // Salt: Randomly generated 256 bit value
1691 // Hash algorithm: HMAC-SHA256
1692 // Size: 32 byte
1693 // Default: null or empty if the device identifier is not known
1694 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1695 // The state of the connection.
1696 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1697 optional android.bluetooth.ConnectionStateEnum state = 2;
1698}
1699
1700/**
1701 * Logs when a Bluetooth device connects and disconnects over SCO
1702 *
1703 * Logged from:
1704 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1705 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1706 *
1707 * Next Tag: 4
1708 */
1709message BluetoothScoConnectionStateChanged {
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 // The state of the connection.
1718 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1719 optional android.bluetooth.ConnectionStateEnum state = 2;
1720 // Codec used for this SCO connection
1721 // Default: UNKNOWN
1722 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001723}
1724
Jack Hec27040a2019-01-09 20:54:41 -08001725/**
1726 * Logged when active device of a profile changes
1727 *
1728 * Logged from:
1729 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1730 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1731 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1732 */
1733message BluetoothActiveDeviceChanged {
1734 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1735 // From android.bluetooth.BluetoothProfile
1736 optional int32 bt_profile = 1;
1737 // An identifier that can be used to match events for this new active device.
1738 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1739 // Salt: Randomly generated 256 bit value
1740 // Hash algorithm: HMAC-SHA256
1741 // Size: 32 byte
1742 // Default: null or empty if there is no active device for this profile
1743 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1744}
1745
Jack Heab86dbd22018-12-18 15:43:27 -08001746// Logs when there is an event affecting Bluetooth device's link layer connection.
1747// - This event is triggered when there is a related HCI command or event
1748// - Users of this metrics can deduce Bluetooth device's connection state from these events
1749// - HCI commands are logged before the command is sent, after receiving command status, and after
1750// receiving command complete
1751// - HCI events are logged when they arrive
1752//
1753// Low level log from system/bt
1754//
1755// Bluetooth classic commands:
1756// - CMD_CREATE_CONNECTION
1757// - CMD_DISCONNECT
1758// - CMD_CREATE_CONNECTION_CANCEL
1759// - CMD_ACCEPT_CONNECTION_REQUEST
1760// - CMD_REJECT_CONNECTION_REQUEST
1761// - CMD_SETUP_ESCO_CONNECTION
1762// - CMD_ACCEPT_ESCO_CONNECTION
1763// - CMD_REJECT_ESCO_CONNECTION
1764// - CMD_ENH_SETUP_ESCO_CONNECTION
1765// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1766//
1767// Bluetooth low energy commands:
1768// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1769// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1770// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1771// - CMD_BLE_CLEAR_WHITE_LIST
1772// - CMD_BLE_ADD_WHITE_LIST
1773// - CMD_BLE_REMOVE_WHITE_LIST
1774//
1775// Bluetooth classic events:
1776// - EVT_CONNECTION_COMP
1777// - EVT_CONNECTION_REQUEST
1778// - EVT_DISCONNECTION_COMP
1779// - EVT_ESCO_CONNECTION_COMP
1780// - EVT_ESCO_CONNECTION_CHANGED
1781//
1782// Bluetooth low energy meta events:
1783// - BLE_EVT_CONN_COMPLETE_EVT
1784// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1785//
1786// Next tag: 10
1787message BluetoothLinkLayerConnectionEvent {
1788 // An identifier that can be used to match events for this device.
1789 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1790 // Salt: Randomly generated 256 bit value
1791 // Hash algorithm: HMAC-SHA256
1792 // Size: 32 byte
1793 // Default: null or empty if the device identifier is not known
1794 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1795 // Connection handle of this connection if available
1796 // Range: 0x0000 - 0x0EFF (12 bits)
1797 // Default: 0xFFFF if the handle is unknown
1798 optional int32 connection_handle = 2;
1799 // Direction of the link
1800 // Default: DIRECTION_UNKNOWN
1801 optional android.bluetooth.DirectionEnum direction = 3;
1802 // Type of this link
1803 // Default: LINK_TYPE_UNKNOWN
1804 optional android.bluetooth.LinkTypeEnum type = 4;
1805
1806 // Reason metadata for this link layer connection event, rules for interpretation:
1807 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1808 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1809 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1810 // set and valid, ignore hci_ble_event
1811
1812 // HCI command associated with this event
1813 // Default: CMD_UNKNOWN
1814 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1815 // HCI event associated with this event
1816 // Default: EVT_UNKNOWN
1817 optional android.bluetooth.hci.EventEnum hci_event = 6;
1818 // HCI BLE meta event associated with this event
1819 // Default: BLE_EVT_UNKNOWN
1820 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1821 // HCI command status code if this is triggerred by hci_cmd
1822 // Default: STATUS_UNKNOWN
1823 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1824 // HCI reason code associated with this event
1825 // Default: STATUS_UNKNOWN
1826 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1827}
1828
Howard Roe103fe22019-01-17 16:52:16 -08001829/**
1830 * Logs when a module is rolled back by Watchdog.
1831 *
1832 * Logged from: Rollback Manager
1833 */
1834message WatchdogRollbackOccurred {
1835 enum RollbackType {
1836 UNKNOWN = 0;
1837 ROLLBACK_INITIATE = 1;
1838 ROLLBACK_SUCCESS = 2;
1839 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001840 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001841 }
1842 optional RollbackType rollback_type = 1;
1843
1844 optional string package_name = 2;
1845
1846 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001847
1848 enum RollbackReasonType {
1849 REASON_UNKNOWN = 0;
1850 REASON_NATIVE_CRASH = 1;
1851 REASON_EXPLICIT_HEALTH_CHECK = 2;
1852 REASON_APP_CRASH = 3;
1853 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001854 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001855 }
1856 optional RollbackReasonType rollback_reason = 4;
1857
1858 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1859 // is initiated. Empty if the package is unknown.
1860 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001861}
1862
Jack Hec27040a2019-01-09 20:54:41 -08001863/**
1864 * Logs when there is a change in Bluetooth A2DP playback state
1865 *
1866 * Logged from:
1867 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1868 */
1869message BluetoothA2dpPlaybackStateChanged {
1870 // An identifier that can be used to match events for this device.
1871 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1872 // Salt: Randomly generated 256 bit value
1873 // Hash algorithm: HMAC-SHA256
1874 // Size: 32 byte
1875 // Default: null or empty if the device identifier is not known
1876 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1877 // Current playback state
1878 // Default: PLAYBACK_STATE_UNKNOWN
1879 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1880 // Current audio coding mode
1881 // Default: AUDIO_CODING_MODE_UNKNOWN
1882 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1883}
1884
1885/**
1886 * Logs when there is a change in A2DP codec config for a particular remote device
1887 *
1888 * Logged from:
1889 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1890 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1891 */
1892message BluetoothA2dpCodecConfigChanged {
1893 // An identifier that can be used to match events for this device.
1894 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1895 // Salt: Randomly generated 256 bit value
1896 // Hash algorithm: HMAC-SHA256
1897 // Size: 32 byte
1898 // Default: null or empty if the device identifier is not known
1899 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1900 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1901 // Default SOURCE_CODEC_TYPE_INVALID
1902 optional int32 codec_type = 2;
1903 // Codec priroity, the higher the more preferred, -1 for disabled
1904 // Default: CODEC_PRIORITY_DEFAULT
1905 optional int32 codec_priority = 3;
1906 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1907 // Default: SAMPLE_RATE_NONE
1908 optional int32 sample_rate = 4;
1909 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1910 // Default: BITS_PER_SAMPLE_NONE
1911 optional int32 bits_per_sample = 5;
1912 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1913 // Default: CHANNEL_MODE_NONE
1914 optional int32 channel_mode = 6;
1915 // Codec specific values
1916 // Default 0
1917 optional int64 codec_specific_1 = 7;
1918 optional int64 codec_specific_2 = 8;
1919 optional int64 codec_specific_3 = 9;
1920 optional int64 codec_specific_4 = 10;
1921}
1922
1923/**
1924 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1925 * Each codec's capability is logged separately due to statsd restriction
1926 *
1927 * Logged from:
1928 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1929 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1930 */
1931message BluetoothA2dpCodecCapabilityChanged {
1932 // An identifier that can be used to match events for this device.
1933 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1934 // Salt: Randomly generated 256 bit value
1935 // Hash algorithm: HMAC-SHA256
1936 // Size: 32 byte
1937 // Default: null or empty if the device identifier is not known
1938 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1939 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1940 // Default SOURCE_CODEC_TYPE_INVALID
1941 optional int32 codec_type = 2;
1942 // Codec priroity, the higher the more preferred, -1 for disabled
1943 // Default: CODEC_PRIORITY_DEFAULT
1944 optional int32 codec_priority = 3;
1945 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1946 // in BluetoothCodecConfig
1947 // Default: empty and SAMPLE_RATE_NONE for individual item
1948 optional int32 sample_rate = 4;
1949 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1950 // in BluetoothCodecConfig
1951 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1952 optional int32 bits_per_sample = 5;
1953 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1954 // BluetoothCodecConfig
1955 // Default: empty and CHANNEL_MODE_NONE for individual item
1956 optional int32 channel_mode = 6;
1957 // Codec specific values
1958 // Default 0
1959 optional int64 codec_specific_1 = 7;
1960 optional int64 codec_specific_2 = 8;
1961 optional int64 codec_specific_3 = 9;
1962 optional int64 codec_specific_4 = 10;
1963}
1964
1965/**
1966 * Logs when A2DP failed to read from PCM source.
1967 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1968 *
1969 * Logged from:
1970 * system/bt
1971 */
1972message BluetoothA2dpAudioUnderrunReported {
1973 // An identifier that can be used to match events for this device.
1974 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1975 // Salt: Randomly generated 256 bit value
1976 // Hash algorithm: HMAC-SHA256
1977 // Size: 32 byte
1978 // Default: null or empty if the device identifier is not known
1979 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1980 // Encoding interval in nanoseconds
1981 // Default: 0
1982 optional int64 encoding_interval_nanos = 2;
1983 // Number of bytes of PCM data that could not be read from the source
1984 // Default: 0
1985 optional int32 num_missing_pcm_bytes = 3;
1986}
1987
1988/**
1989 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1990 * buffer queue is full and we have to drop data
1991 *
1992 * Logged from:
1993 * system/bt
1994 */
1995message BluetoothA2dpAudioOverrunReported {
1996 // An identifier that can be used to match events for this device.
1997 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1998 // Salt: Randomly generated 256 bit value
1999 // Hash algorithm: HMAC-SHA256
2000 // Size: 32 byte
2001 // Default: null or empty if the device identifier is not known
2002 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2003 // Encoding interval in nanoseconds
2004 // Default: 0
2005 optional int64 encoding_interval_nanos = 2;
2006 // Number of buffers dropped in this event
2007 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2008 // Default: 0
2009 optional int32 num_dropped_buffers = 3;
2010 // Number of encoded buffers dropped in this event
2011 // Default 0
2012 optional int32 num_dropped_encoded_frames = 4;
2013 // Number of encoded bytes dropped in this event
2014 // Default: 0
2015 optional int32 num_dropped_encoded_bytes = 5;
2016}
2017
2018/**
2019 * Logs when we receive reports regarding a device's RSSI value
2020 *
2021 * Logged from:
2022 * system/bt
2023 */
2024message BluetoothDeviceRssiReported {
2025 // An identifier that can be used to match events for this device.
2026 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2027 // Salt: Randomly generated 256 bit value
2028 // Hash algorithm: HMAC-SHA256
2029 // Size: 32 byte
2030 // Default: null or empty if the device identifier is not known
2031 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2032 // Connection handle of this connection if available
2033 // Range: 0x0000 - 0x0EFF (12 bits)
2034 // Default: 0xFFFF if the handle is unknown
2035 optional int32 connection_handle = 2;
2036 // HCI command status code if this is triggerred by hci_cmd
2037 // Default: STATUS_UNKNOWN
2038 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2039 // BR/EDR
2040 // Range: -128 ≤ N ≤ 127 (signed integer)
2041 // Units: dB
2042 // LE:
2043 // Range: -127 to 20, 127 (signed integer)
2044 // Units: dBm
2045 // Invalid when an out of range value is reported
2046 optional int32 rssi = 4;
2047}
2048
2049/**
2050 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2051 *
2052 * Logged from:
2053 * system/bt
2054 */
2055message BluetoothDeviceFailedContactCounterReported {
2056 // An identifier that can be used to match events for this device.
2057 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2058 // Salt: Randomly generated 256 bit value
2059 // Hash algorithm: HMAC-SHA256
2060 // Size: 32 byte
2061 // Default: null or empty if the device identifier is not known
2062 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2063 // Connection handle of this connection if available
2064 // Range: 0x0000 - 0x0EFF (12 bits)
2065 // Default: 0xFFFF if the handle is unknown
2066 optional int32 connection_handle = 2;
2067 // HCI command status code if this is triggerred by hci_cmd
2068 // Default: STATUS_UNKNOWN
2069 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2070 // Number of consecutive failed contacts for a connection corresponding to the Handle
2071 // Range: uint16_t, 0-0xFFFF
2072 // Default: 0xFFFFF
2073 optional int32 failed_contact_counter = 4;
2074}
2075
2076/**
2077 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2078 *
2079 * Logged from:
2080 * system/bt
2081 */
2082message BluetoothDeviceTxPowerLevelReported {
2083 // An identifier that can be used to match events for this device.
2084 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2085 // Salt: Randomly generated 256 bit value
2086 // Hash algorithm: HMAC-SHA256
2087 // Size: 32 byte
2088 // Default: null or empty if the device identifier is not known
2089 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2090 // Connection handle of this connection if available
2091 // Range: 0x0000 - 0x0EFF (12 bits)
2092 // Default: 0xFFFF if the handle is unknown
2093 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002094 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002095 // Default: STATUS_UNKNOWN
2096 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2097 // Range: -30 ≤ N ≤ 20
2098 // Units: dBm
2099 // Invalid when an out of range value is reported
2100 optional int32 transmit_power_level = 4;
2101}
Jack Heab86dbd22018-12-18 15:43:27 -08002102
Tej Singh5d991e12018-03-09 19:48:11 -08002103/**
Jack He1021a612019-01-20 21:22:46 -08002104 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2105 * receiving an HCI command from the host
2106 *
2107 * Logged from: system/bt
2108 */
2109message BluetoothHciTimeoutReported {
2110 // HCI command associated with this event
2111 // Default: CMD_UNKNOWN
2112 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2113}
2114
2115/**
2116 * Logs when we receive Bluetooth Link Quality Report event from the controller
2117 * See Android Bluetooth HCI specification for more details
2118 *
2119 * Note: all count and bytes field are counted since last event
2120 *
2121 * Logged from: system/bt
2122 */
2123message BluetoothQualityReportReported {
2124 // Quality report ID
2125 // Original type: uint8_t
2126 // Default: BQR_ID_UNKNOWN
2127 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2128 // Packet type of the connection
2129 // Original type: uint8_t
2130 // Default: BQR_PACKET_TYPE_UNKNOWN
2131 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2132 // Connection handle of the connection
2133 // Original type: uint16_t
2134 optional int32 connection_handle = 3;
2135 // Performing Role for the connection
2136 // Original type: uint8_t
2137 optional int32 connection_role = 4;
2138 // Current Transmit Power Level for the connection. This value is the same as the controller's
2139 // response to the HCI_Read_Transmit_Power_Level HCI command
2140 // Original type: uint8_t
2141 optional int32 tx_power_level = 5;
2142 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2143 // absolute receiver signal strength value
2144 // Original type: int8_t
2145 optional int32 rssi = 6;
2146 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2147 // channels used by the link currently
2148 // Original type: uint8_t
2149 optional int32 snr = 7;
2150 // Indicates the number of unused channels in AFH_channel_map
2151 // Original type: uint8_t
2152 optional int32 unused_afh_channel_count = 8;
2153 // Indicates the number of the channels which are interfered and quality is bad but are still
2154 // selected for AFH
2155 // Original type: uint8_t
2156 optional int32 afh_select_unideal_channel_count = 9;
2157 // Current Link Supervision Timeout Setting
2158 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2159 // Original type: uint16_t
2160 optional int32 lsto = 10;
2161 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2162 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2163 // 0x01 (Piconet Clock)
2164 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2165 // Original type: uint32_t
2166 optional int64 connection_piconet_clock = 11;
2167 // The count of retransmission
2168 // Original type: uint32_t
2169 optional int64 retransmission_count = 12;
2170 // The count of no RX
2171 // Original type: uint32_t
2172 optional int64 no_rx_count = 13;
2173 // The count of NAK (Negative Acknowledge)
2174 // Original type: uint32_t
2175 optional int64 nak_count = 14;
2176 // Controller timestamp of last TX ACK
2177 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2178 // Original type: uint32_t
2179 optional int64 last_tx_ack_timestamp = 15;
2180 // The count of Flow-off (STOP)
2181 // Original type: uint32_t
2182 optional int64 flow_off_count = 16;
2183 // Controller timestamp of last Flow-on (GO)
2184 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2185 // Original type: uint32_t
2186 optional int64 last_flow_on_timestamp = 17;
2187 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2188 // Original type: uint32_t
2189 optional int64 buffer_overflow_bytes = 18;
2190 // Buffer underflow count (in byte) since last event
2191 // Original type: uint32_t
2192 optional int64 buffer_underflow_bytes = 19;
2193}
2194
2195/**
2196 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2197 *
2198 * Notes:
2199 * - Each event can be partially filled as we might learn different pieces of device
2200 * information at different time
2201 * - Multiple device info events can be combined to give more complete picture
2202 * - When multiple device info events tries to describe the same information, the
2203 * later one wins
2204 *
2205 * Logged from:
2206 * packages/apps/Bluetooth
2207 */
Jack Heaea26982019-04-04 11:19:48 -07002208message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002209 // An identifier that can be used to match events for this device.
2210 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2211 // Salt: Randomly generated 256 bit value
2212 // Hash algorithm: HMAC-SHA256
2213 // Size: 32 byte
2214 // Default: null or empty if the device identifier is not known
2215 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2216 // Where is this device info obtained from
2217 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2218 // Name of the data source
2219 // For EXTERNAL: package name of the data source
2220 // For INTERNAL: null for general case, component name otherwise
2221 optional string source_name = 3;
2222 // Name of the manufacturer of this device
2223 optional string manufacturer = 4;
2224 // Model of this device
2225 optional string model = 5;
2226 // Hardware version of this device
2227 optional string hardware_version = 6;
2228 // Software version of this device
2229 optional string software_version = 7;
2230}
2231
2232/**
2233 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2234 * device, as documented by the Bluetooth Core HCI specification
2235 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2236 * Vol 2, Part E, Page 1118
2237 *
2238 * Logged from:
2239 * system/bt
2240 */
2241message BluetoothRemoteVersionInfoReported {
2242 // Connection handle of the connection
2243 // Original type: uint16_t
2244 optional int32 connection_handle = 1;
2245 // HCI command status code
2246 // Default: STATUS_UNKNOWN
2247 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2248 // 1 byte Version of current LMP in the remote controller
2249 optional int32 lmp_version = 3;
2250 // 2 bytes LMP manufacturer code of the remote controller
2251 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2252 optional int32 lmp_manufacturer_code = 4;
2253 // 4 bytes subversion of the LMP in the remote controller
2254 optional int32 lmp_subversion = 5;
2255}
2256
2257/**
2258 * Logs when certain Bluetooth SDP attributes are discovered
2259 * Constant definitions are from:
2260 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2261 *
2262 * Current logged attributes:
2263 * - BluetoothProfileDescriptorList
2264 * - Supported Features Bitmask
2265 *
2266 * Logged from:
2267 * system/bt
2268 */
2269message BluetoothSdpAttributeReported {
2270 // An identifier that can be used to match events for this device.
2271 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2272 // Salt: Randomly generated 256 bit value
2273 // Hash algorithm: HMAC-SHA256
2274 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2275 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2276 // Original type: uint16_t
2277 optional int32 protocol_uuid = 2;
2278 // Short form UUIDs used to identify Bluetooth SDP attribute types
2279 // Original type: uint16_t
2280 optional int32 attribute_id = 3;
2281 // Attribute value for the particular attribute
2282 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2283}
2284
2285/**
2286 * Logs when bond state of a Bluetooth device changes
2287 *
2288 * Logged from:
2289 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2290 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2291 */
2292message BluetoothBondStateChanged {
2293 // An identifier that can be used to match events for this device.
2294 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2295 // Salt: Randomly generated 256 bit value
2296 // Hash algorithm: HMAC-SHA256
2297 // Size: 32 byte
2298 // Default: null or empty if the device identifier is not known
2299 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2300 // Preferred transport type to remote dual mode device
2301 // Default: TRANSPORT_AUTO means no preference
2302 optional android.bluetooth.TransportTypeEnum transport = 2;
2303 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2304 // Default: UNKNOWN
2305 optional android.bluetooth.DeviceTypeEnum type = 3;
2306 // Current bond state (NONE, BONDING, BONDED)
2307 // Default: BOND_STATE_UNKNOWN
2308 optional android.bluetooth.BondStateEnum bond_state = 4;
2309 // Bonding sub state
2310 // Default: BOND_SUB_STATE_UNKNOWN
2311 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2312 // Unbond Reason
2313 // Default: UNBOND_REASON_UNKNOWN
2314 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2315}
2316
2317/**
2318 * Logs there is an event related Bluetooth classic pairing
2319 *
2320 * Logged from:
2321 * system/bt
2322 */
2323message BluetoothClassicPairingEventReported {
2324 // An identifier that can be used to match events for this device.
2325 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2326 // Salt: Randomly generated 256 bit value
2327 // Hash algorithm: HMAC-SHA256
2328 // Size: 32 byte
2329 // Default: null or empty if the device identifier is not known
2330 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2331 // Connection handle of this connection if available
2332 // Range: 0x0000 - 0x0EFF (12 bits)
2333 // Default: 0xFFFF if the handle is unknown
2334 optional int32 connection_handle = 2;
2335 // HCI command associated with this event
2336 // Default: CMD_UNKNOWN
2337 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2338 // HCI event associated with this event
2339 // Default: EVT_UNKNOWN
2340 optional android.bluetooth.hci.EventEnum hci_event = 4;
2341 // HCI command status code if this is triggerred by hci_cmd
2342 // Default: STATUS_UNKNOWN
2343 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2344 // HCI reason code associated with this event
2345 // Default: STATUS_UNKNOWN
2346 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002347 // A status value related to this specific event
2348 // Default: 0
2349 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002350}
2351
2352/**
2353 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2354 *
2355 * Logged from:
2356 * system/bt
2357 */
2358message BluetoothSmpPairingEventReported {
2359 // An identifier that can be used to match events for this device.
2360 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2361 // Salt: Randomly generated 256 bit value
2362 // Hash algorithm: HMAC-SHA256
2363 // Size: 32 byte
2364 // Default: null or empty if the device identifier is not known
2365 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2366 // SMP command sent or received over L2CAP
2367 // Default: CMD_UNKNOWN
2368 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2369 // Whether this command is sent or received
2370 // Default: DIRECTION_UNKNOWN
2371 optional android.bluetooth.DirectionEnum direction = 3;
2372 // SMP failure reason code
2373 // Default: PAIRING_FAIL_REASON_DEFAULT
2374 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2375}
2376
2377/**
Jack He815cdba2019-01-30 17:24:55 -08002378 * Logs when a Bluetooth socket’s connection state changed
2379 *
2380 * Logged from:
2381 * system/bt
2382 */
2383message BluetoothSocketConnectionStateChanged {
2384 // An identifier that can be used to match events for this device.
2385 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2386 // Salt: Randomly generated 256 bit value
2387 // Hash algorithm: HMAC-SHA256
2388 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002389 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002390 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002391 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002392 // Default 0 when unknown or don't care
2393 optional int32 port = 2;
2394 // Socket type as mentioned in
2395 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2396 // Default: SOCKET_TYPE_UNKNOWN
2397 optional android.bluetooth.SocketTypeEnum type = 3;
2398 // Socket connection state
2399 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2400 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2401 // Number of bytes sent to remote device during this connection
2402 optional int64 tx_bytes = 5;
2403 // Number of bytes received from remote device during this connection
2404 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002405 // Socket owner's UID
2406 optional int32 uid = 7 [(is_uid) = true];
2407 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2408 // |port| must be spawned by |server_port|
2409 // Default 0 when unknown or don't care
2410 optional int32 server_port = 8;
2411 // Whether this is a server listener socket
2412 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002413}
2414
2415/**
Jack He71426802019-04-02 13:32:52 -07002416 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2417 *
2418 * Logged from:
2419 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2420 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2421 *
2422 */
2423message BluetoothClassOfDeviceReported {
2424 // An identifier that can be used to match events for this device.
2425 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2426 // Salt: Randomly generated 256 bit value
2427 // Hash algorithm: HMAC-SHA256
2428 // Size: 32 byte
2429 // Default: null or empty if this is a server listener socket
2430 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2431 // Class of Device (CoD) value including both Major, Minor device class and service class
2432 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2433 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2434 // Default: 0
2435 optional int32 class_of_device = 2;
2436}
2437
2438/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002439 * Logs when something is plugged into or removed from the USB-C connector.
2440 *
2441 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002442 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002443 */
2444message UsbConnectorStateChanged {
2445 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002446 STATE_DISCONNECTED = 0;
2447 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002448 }
2449 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002450 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002451 // Last active session in ms.
2452 // 0 when the port is in connected state.
2453 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002454}
2455
2456/**
2457 * Logs the reported speaker impedance.
2458 *
2459 * Logged from:
2460 * Vendor audio implementation.
2461 */
2462message SpeakerImpedanceReported {
2463 optional int32 speaker_location = 1;
2464 optional int32 impedance = 2;
2465}
2466
2467/**
2468 * Logs the report of a failed hardware.
2469 *
2470 * Logged from:
2471 * Vendor HALs.
2472 *
2473 */
2474message HardwareFailed {
2475 enum HardwareType {
2476 HARDWARE_FAILED_UNKNOWN = 0;
2477 HARDWARE_FAILED_MICROPHONE = 1;
2478 HARDWARE_FAILED_CODEC = 2;
2479 HARDWARE_FAILED_SPEAKER = 3;
2480 HARDWARE_FAILED_FINGERPRINT = 4;
2481 }
2482 optional HardwareType hardware_type = 1;
2483
Maggie White6dcd8572019-01-31 14:11:50 -08002484 /**
2485 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002486 * the same hardware_type. The specific locations are vendor defined integers,
2487 * referring to board-specific numbering schemes.
2488 */
2489 optional int32 hardware_location = 2;
2490
Maggie White6dcd8572019-01-31 14:11:50 -08002491 /**
2492 * failure_code is specific to the HardwareType of the failed hardware.
2493 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002494 */
Maggie White6dcd8572019-01-31 14:11:50 -08002495 enum HardwareErrorCode {
2496 UNKNOWN = 0;
2497 COMPLETE = 1;
2498 SPEAKER_HIGH_Z = 2;
2499 SPEAKER_SHORT = 3;
2500 FINGERPRINT_SENSOR_BROKEN = 4;
2501 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002502 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002503 }
2504 optional int32 failure_code = 3;
2505}
2506
2507/**
2508 * Log an event when the device has been physically dropped.
2509 * Reported from the /vendor partition.
2510 */
2511message PhysicalDropDetected {
2512 // Confidence that the event was actually a drop, 0 -> 100
2513 optional int32 confidence_pctg = 1;
2514 // Peak acceleration of the drop, in 1/1000s of a g.
2515 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002516 // Duration of freefall in ms
2517 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002518}
2519
2520/**
2521 * Log bucketed battery charge cycles.
2522 *
2523 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002524 * a given charge point. For example, if 10 cycle buckets are
2525 * initialized, bucket 1 is the lowest 1/10th of the battery,
2526 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002527 *
2528 * Logged from:
2529 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2530 */
2531message ChargeCyclesReported {
2532 optional int32 cycle_bucket_1 = 1;
2533 optional int32 cycle_bucket_2 = 2;
2534 optional int32 cycle_bucket_3 = 3;
2535 optional int32 cycle_bucket_4 = 4;
2536 optional int32 cycle_bucket_5 = 5;
2537 optional int32 cycle_bucket_6 = 6;
2538 optional int32 cycle_bucket_7 = 7;
2539 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002540 optional int32 cycle_bucket_9 = 9;
2541 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002542}
2543
2544/**
Howard Roa46b6582018-09-18 16:45:02 -07002545 * Log battery health snapshot.
2546 *
2547 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2548 * are snapshotted periodically over 24hrs.
2549 */
2550message BatteryHealthSnapshot {
2551 enum BatterySnapshotType {
2552 UNKNOWN = 0;
2553 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2554 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2555 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2556 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2557 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2558 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2559 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2560 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2561 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2562 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2563 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2564 }
2565 optional BatterySnapshotType type = 1;
2566 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002567 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002568 // Voltage Battery Voltage, in microVolts.
2569 optional int32 voltage_micro_volt = 3;
2570 // Current Battery current, in microAmps.
2571 optional int32 current_micro_amps = 4;
2572 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2573 optional int32 open_circuit_micro_volt = 5;
2574 // Resistance Battery Resistance, in microOhms.
2575 optional int32 resistance_micro_ohm = 6;
2576 // Level Battery Level, as % of full.
2577 optional int32 level_percent = 7;
2578}
2579
2580/**
2581 * Log slow I/O operations on the primary storage.
2582 */
2583message SlowIo {
2584 // Classifications of IO Operations.
2585 enum IoOperation {
2586 UNKNOWN = 0;
2587 READ = 1;
2588 WRITE = 2;
2589 UNMAP = 3;
2590 SYNC = 4;
2591 }
2592 optional IoOperation operation = 1;
2593
2594 // The number of slow IO operations of this type over 24 hours.
2595 optional int32 count = 2;
2596}
2597
2598/**
2599 * Log battery caused shutdown with the last recorded voltage.
2600 */
2601message BatteryCausedShutdown {
2602 // The last recorded battery voltage prior to shutdown.
2603 optional int32 last_recorded_micro_volt = 1;
2604}
2605
2606/**
Tej Singha72344992019-04-17 18:55:08 -07002607 * Logs when ThermalService receives throttling events.
2608 *
2609 * Logged from:
2610 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2611 */
2612message ThermalThrottlingSeverityStateChanged {
2613 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2614 optional android.os.TemperatureTypeEnum sensor_type = 1;
2615
2616 // The name of the temperature source. Eg. CPU0
2617 optional string sensor_name = 2;
2618
2619 // Temperature in tenths of a degree C.
2620 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2621 optional int32 temperature_deci_celsius = 3;
2622
2623 // Relative severity of the throttling, see enum definition.
2624 optional android.os.ThrottlingSeverityEnum severity = 4;
2625}
2626
2627/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002628 * Logs the duration of a davey (jank of >=700ms) when it occurs
2629 *
2630 * Logged from:
2631 * frameworks/base/libs/hwui/JankTracker.cpp
2632 */
2633message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002634 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002635 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002636
Tej Singhbb8554a2018-01-26 11:59:14 -08002637 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002638 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002639}
2640
2641/**
Bookatze5885242017-10-24 20:10:31 -07002642 * Logs phone signal strength changes.
2643 *
2644 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002645 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002646 */
2647message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002648 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2649 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002650}
2651
Yangster4ccebea2018-10-09 17:09:02 -07002652
2653/**
2654 * Logs when the phone state, sim state or signal strength changes
2655 *
2656 * Logged from:
2657 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2658 */
2659message PhoneServiceStateChanged {
2660 optional android.telephony.ServiceStateEnum state = 1;
2661 optional android.telephony.SimStateEnum sim_state = 2;
2662 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2663}
2664
2665/**
2666 * Logs when the phone becomes on or off.
2667 *
2668 * Logged from:
2669 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2670 */
2671message PhoneStateChanged {
2672 enum State {
2673 OFF = 0;
2674 ON = 1;
2675 }
2676 optional State state = 1;
2677}
2678
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002679message BackGesture {
2680 enum BackType {
2681 DEFAULT_BACK_TYPE = 0;
2682 COMPLETED = 1;
2683 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2684 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2685 INCOMPLETE = 4;
2686 }
2687 optional BackType type = 1;
2688
2689 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2690 enum WindowHorizontalLocation {
2691 DEFAULT_LOCATION = 0;
2692 LEFT = 1;
2693 RIGHT = 2;
2694 }
2695 optional WindowHorizontalLocation x_location = 3;
2696}
2697
2698message ExclusionRectStateChanged {
2699 optional string component_name = 1; // if not available, simply packageName
2700 optional int32 requested_height = 2; // px
2701 optional int32 rejected_height = 3; // px
2702
2703 enum WindowHorizontalLocation {
2704 DEFAULT_LOCATION = 0;
2705 LEFT = 1;
2706 RIGHT = 2;
2707 }
2708 optional WindowHorizontalLocation x_location = 4;
2709 optional bool landscape = 5;
2710 optional bool splitscreen = 6;
2711 optional int32 duration_millis = 7;
2712}
2713
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002714message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002715 optional android.stats.launcher.LauncherAction action = 1;
2716 optional android.stats.launcher.LauncherState src_state = 2;
2717 optional android.stats.launcher.LauncherState dst_state = 3;
2718 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002719 optional bool is_swipe_up_enabled = 5;
2720}
2721
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002722message StyleUIChanged {
2723 optional android.stats.style.Action action = 1;
2724 optional int32 color_package_hash = 2;
2725 optional int32 font_package_hash = 3;
2726 optional int32 shape_package_hash = 4;
2727 optional int32 clock_package_hash = 5;
2728 optional int32 launcher_grid = 6;
2729 optional int32 wallpaper_category_hash = 7;
2730 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002731 optional int32 color_preference = 9;
2732 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002733}
2734
David Chenc28b2bb2017-10-24 12:52:52 -07002735/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002736 * Logs when Settings UI has changed.
2737 *
2738 * Logged from:
2739 * packages/apps/Settings
2740 */
2741message SettingsUIChanged {
2742 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002743 * Where this SettingsUIChange event comes from. For example, if
2744 * it's a PAGE_VISIBLE event, where the page is opened from.
2745 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002746 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002747
2748 /**
2749 * What the UI action is.
2750 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002751 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002752
2753 /**
2754 * Where the action is happening
2755 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002756 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002757
2758 /**
2759 * What preference changed in this event.
2760 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002761 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002762
2763 /**
2764 * The new value of the changed preference.
2765 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002766 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002767}
2768
2769/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002770 * Logs basic timing information about touch events.
2771 * Reported at most every 5 minutes while device is being interacted with.
2772 *
2773 * Logged from:
2774 * frameworks/native/services/inputflinger
2775 */
2776message TouchEventReported {
2777 /**
2778 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002779 * and the standard deviation of the time spent processing touchscreen events
2780 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002781 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002782 * On supported devices, the starting point is taken during the hard interrupt inside the
2783 * kernel touch driver. On all other devices, the starting point is taken inside
2784 * the kernel's input event subsystem upon receipt of the input event.
2785 * The ending point is taken inside InputDispatcher, just after the input event
2786 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002787 */
2788 // Minimum value
2789 optional float latency_min_micros = 1;
2790 // Maximum value
2791 optional float latency_max_micros = 2;
2792 // Average value
2793 optional float latency_mean_micros = 3;
2794 // Standard deviation
2795 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002796 // Number of touch events (input_event) in this report
2797 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002798}
2799
2800/**
Philip Quinn0eded622019-01-29 12:46:28 -08002801 * Logs gesture classification and timing information for touch events.
2802 *
2803 * Logged from:
2804 * frameworks/base/core/java/android/view/GestureDetector.java
2805 * frameworks/base/core/java/android/view/View.java
2806 */
2807message TouchGestureClassified {
2808 // The source of the classification (e.g. Java class name).
2809 optional string source = 1;
2810
2811 enum Classification {
2812 UNKNOWN_CLASSIFICATION = 0;
2813 SINGLE_TAP = 1;
2814 DOUBLE_TAP = 2;
2815 LONG_PRESS = 3;
2816 DEEP_PRESS = 4;
2817 SCROLL = 5;
2818 }
2819 // The classification of the gesture.
2820 optional Classification classification = 2;
2821
2822 // The interval from the start of a touch event stream until the
2823 // classification was made.
2824 optional int32 latency_millis = 3;
2825
2826 // The distance from the location of the first touch event to the
2827 // location of the touch event when the classification was made.
2828 optional float displacement_px = 4;
2829}
2830
2831/**
David Chenc28b2bb2017-10-24 12:52:52 -07002832 * Logs that a setting was updated.
2833 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002834 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002835 * The tag and is_default allow resetting of settings to default values based on the specified
2836 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2837 */
2838message SettingChanged {
2839 // The name of the setting.
2840 optional string setting = 1;
2841
2842 // The change being imposed on this setting. May represent a number, eg "3".
2843 optional string value = 2;
2844
2845 // The new value of this setting. For most settings, this is same as value. For some settings,
2846 // value is +X or -X where X represents an element in a set. For example, if the previous value
2847 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2848 // The +/- feature is currently only used for location_providers_allowed.
2849 optional string new_value = 3;
2850
2851 // The previous value of this setting.
2852 optional string prev_value = 4;
2853
2854 // The tag used with the is_default for resetting sets of settings. This is generally null.
2855 optional string tag = 5;
2856
Bookatz90867622018-01-31 15:05:57 -08002857 // True if this setting with tag should be resettable.
2858 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002859
David Chenbd789912018-03-16 17:19:55 -07002860 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002861 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002862
2863 enum ChangeReason {
2864 UPDATED = 1; // Updated can be an insertion or an update.
2865 DELETED = 2;
2866 }
2867 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002868}
Chenjie Yub3dda412017-10-24 13:41:59 -07002869
Chenjie Yu05013b32017-11-21 10:21:41 -08002870/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002871 * Logs activity going to foreground or background
2872 *
2873 * Logged from:
2874 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2875 */
2876message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002877 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002878 optional string pkg_name = 2;
2879 optional string class_name = 3;
2880
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002881 enum State {
2882 BACKGROUND = 0;
2883 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002884 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002885 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002886}
David Chenc8a43242017-10-17 16:23:28 -07002887
2888/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002889 * Logs when a volume entered low Storage state.
2890 * Logged from:
2891 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2892 */
2893message LowStorageStateChanged {
2894 // Volume that ran out of storage.
2895 optional string volume_description = 1;
2896
2897 enum State {
2898 UNKNOWN = 0;
2899 OFF = 1;
2900 ON = 2;
2901 }
2902 optional State state = 2;
2903}
2904
2905/**
2906 * Logs when an app is downgraded.
2907 * Logged from:
2908 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2909 */
2910message AppDowngraded {
2911 optional string package_name = 1;
2912 // Size of the package (all data) before being downgraded.
2913 optional int64 size_in_bytes_before = 2;
2914 // Size of the package (all data) after being downgraded.
2915 optional int64 size_in_bytes_after = 3;
2916
2917 optional bool aggressive = 4;
2918}
2919
2920/**
2921 * Logs when an app is optimized after being downgraded.
2922 * Logged from:
2923 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2924 */
2925message AppOptimizedAfterDowngraded {
2926 optional string package_name = 1;
2927}
2928
2929/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002930 * Logs whenever an app is installed on external storage.
2931 * Logged from:
2932 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2933 */
2934message AppInstallOnExternalStorageReported {
2935 // The type of external storage.
2936 optional android.stats.storage.ExternalStorageType storage_type = 1;
2937 // The name of the package that is installed on the sd card.
2938 optional string package_name = 2;
2939}
2940
2941/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002942 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002943 * Logged from:
2944 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2945 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002946message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002947 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002948
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002949 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002950
2951 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002952 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002953 optional string process_name = 3;
2954
2955 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002956 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002957
2958 optional string package_name = 5;
2959
2960 enum InstantApp {
2961 UNAVAILABLE = 0;
2962 FALSE = 1;
2963 TRUE = 2;
2964 }
2965 optional InstantApp is_instant_app = 6;
2966
2967 enum ForegroundState {
2968 UNKNOWN = 0;
2969 BACKGROUND = 1;
2970 FOREGROUND = 2;
2971 }
2972 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002973
2974 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002975}
David Chen9e3808c2017-11-20 17:25:34 -08002976
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002977/**
2978 * Logs when a WTF (What a Terrible Failure) happened.
2979 * Logged from:
2980 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2981 */
2982message WTFOccurred {
2983 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002984
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002985 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002986
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002987 // The name of the process.
2988 // system_server if it is not by an app
2989 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002990
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002991 // The pid if available. -1 means not available.
2992 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002993
2994 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002995}
2996
2997/**
2998 * Logs when system server reports low memory.
2999 * Logged from:
3000 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3001 */
3002message LowMemReported {
3003}
3004
3005/**
3006 * Logs when an app ANR (App Not Responding) occurs.
3007 * Logged from:
3008 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3009 */
3010message ANROccurred {
3011 optional int32 uid = 1 [(is_uid) = true];
3012
3013 optional string process_name = 2;
3014
3015 optional string short_component_name = 3;
3016
3017 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003018
3019 enum InstantApp {
3020 UNAVAILABLE = 0;
3021 FALSE = 1;
3022 TRUE = 2;
3023 }
3024 optional InstantApp is_instant_app = 5;
3025
3026 enum ForegroundState {
3027 UNKNOWN = 0;
3028 BACKGROUND = 1;
3029 FOREGROUND = 2;
3030 }
3031 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003032
3033 optional android.server.ErrorSource error_source = 7;
3034
3035 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003036}
3037
Bookatza7020bd2018-08-28 16:29:35 -07003038/**
3039 * Logs when the vibrator state changes.
3040 * Logged from:
3041 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3042 */
3043message VibratorStateChanged {
3044 repeated AttributionNode attribution_node = 1;
3045
3046 enum State {
3047 OFF = 0;
3048 ON = 1;
3049 }
3050 optional State state = 2;
3051
3052 // Duration (in milliseconds) requested to keep the vibrator on.
3053 // Only applicable for State == ON.
3054 optional int64 duration_millis = 3;
3055}
3056
David Chen0a368b22017-12-06 16:28:16 -08003057/*
3058 * Allows other apps to push events into statsd.
3059 * Logged from:
3060 * frameworks/base/core/java/android/util/StatsLog.java
3061 */
David Chen0b5c90c2018-01-25 16:51:49 -08003062message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003063 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003064 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003065
3066 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3067 optional int32 label = 2;
3068
3069 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3070 // predicates for the metrics).
3071 enum State {
3072 UNKNOWN = 0;
3073 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3074 STOP = 2;
3075 START = 3;
3076 }
3077 optional State state = 3;
3078}
3079
David Chen9e3808c2017-11-20 17:25:34 -08003080/**
Bookatz7948c872018-09-04 12:58:33 -07003081 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3082 * For example, this could be due to the user manually changing the time.
3083 *
3084 * Logged from:
3085 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3086 */
3087message WallClockTimeShifted {
3088 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3089 optional int64 wall_clock_timestamp_millis = 1;
3090}
3091
3092/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003093 * Logs when statsd detects an anomaly.
3094 *
3095 * Logged from:
3096 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3097 */
3098message AnomalyDetected {
3099 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003100 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003101
Yangster-mac94e197c2018-01-02 16:03:03 -08003102 // Id of the config whose anomaly detection alert fired.
3103 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003104
Yangster-mac94e197c2018-01-02 16:03:03 -08003105 // Id of the alert (i.e. name of the anomaly that was detected).
3106 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003107}
3108
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003109message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003110 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003111 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003112
3113 // The app package name.
3114 optional string pkg_name = 2;
3115
3116 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003117 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003118 WARM = 1;
3119 HOT = 2;
3120 COLD = 3;
3121 }
3122 // The transition type.
3123 optional TransitionType type = 3;
3124
3125 // The activity name.
3126 optional string activity_name = 4;
3127
3128 // The name of the calling app. Empty if not set.
3129 optional string calling_pkg_name = 5;
3130
3131 // Whether the app is an instant app.
3132 optional bool is_instant_app = 6;
3133
3134 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003135 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003136
Bookatz80d11a02018-01-16 10:46:35 -08003137 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003138
David Chen0b5c90c2018-01-25 16:51:49 -08003139 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003140 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003141 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003142 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003143 optional int32 bind_application_delay_millis = 11;
3144 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003145
3146 // Empty if not set.
3147 optional string launch_token = 13;
3148
Calin Juravle759fbda2018-02-20 19:52:30 +00003149 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003150 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003151
3152 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003153 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003154}
3155
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003156message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003157 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003158 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003159
3160 // The app package name.
3161 optional string pkg_name = 2;
3162
3163 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003164 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003165 WARM = 1;
3166 HOT = 2;
3167 COLD = 3;
3168 }
3169 // The transition type.
3170 optional TransitionType type = 3;
3171
3172 // The activity name.
3173 optional string activity_name = 4;
3174}
3175
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003176message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003177 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003178 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003179
3180 // The app package name.
3181 optional string pkg_name = 2;
3182
3183 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003184 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185 WITH_BUNDLE = 1;
3186 WITHOUT_BUNDLE = 2;
3187 }
3188 // The transition type.
3189 optional TransitionType type = 3;
3190
3191 // The activity name.
3192 optional string activity_name = 4;
3193
3194 optional bool transition_process_running = 5;
3195
3196 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003197 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198}
3199
Bookatz8fcd09a2017-12-18 13:01:10 -08003200/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003201 * Logs a picture-in-picture action
3202 * Logged from:
3203 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3204 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3205 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3206 */
3207message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003208 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003209 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003210
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003211 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003212
Chenjie Yu52cacc62017-12-08 18:11:45 -08003213 enum State {
3214 ENTERED = 1;
3215 EXPANDED_TO_FULL_SCREEN = 2;
3216 MINIMIZED = 3;
3217 DISMISSED = 4;
3218 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003219 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003220}
3221
3222/**
Chenjie Yue8904192017-12-08 19:12:57 -08003223 * Logs overlay action
3224 * Logged from:
3225 * services/core/java/com/android/server/wm/Session.java
3226 */
3227message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003228 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003229
tsaichristine10978642019-09-10 14:12:49 -07003230 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003231
3232 optional bool using_alert_window = 3;
3233
3234 enum State {
3235 ENTERED = 1;
3236 EXITED = 2;
3237 }
tsaichristine10978642019-09-10 14:12:49 -07003238 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003239}
3240
Chenjie Yuccfe6452018-01-30 11:33:21 -08003241/*
3242 * Logs foreground service starts and stops.
3243 * Note that this is not when a service starts or stops, but when it is
3244 * considered foreground.
3245 * Logged from
3246 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3247 */
3248message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003249 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003250 // package_name + "/" + class_name
3251 optional string short_name = 2;
3252
3253 enum State {
3254 ENTER = 1;
3255 EXIT = 2;
3256 }
3257 optional State state = 3;
3258}
3259
Chenjie Yue8904192017-12-08 19:12:57 -08003260/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003261 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3262 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3263 * attributed back to the parent (host) uid. One example is Chrome.
3264 *
3265 * Logged from:
3266 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3267 */
3268message IsolatedUidChanged {
3269 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003270 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003271 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003272 optional int32 parent_uid = 1;
3273
3274 optional int32 isolated_uid = 2;
3275
3276 // We expect an isolated uid to be removed before if it's used for another parent uid.
3277 enum Event {
3278 REMOVED = 0;
3279 CREATED = 1;
3280 }
3281 optional Event event = 3;
3282}
3283
3284/*
3285 * Logs the reception of an incoming network packet causing the main system to wake up for
3286 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3287 * and processed by WakeupController.cpp.
3288 */
3289message PacketWakeupOccurred {
3290 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3291 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003292 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003293 // The interface name on which the packet was received.
3294 optional string iface = 2;
3295 // The ethertype value of the packet.
3296 optional int32 ethertype = 3;
3297 // String representation of the destination MAC address of the packet.
3298 optional string destination_hardware_address = 4;
3299 // String representation of the source address of the packet if this was an IP packet.
3300 optional string source_ip = 5;
3301 // String representation of the destination address of the packet if this was an IP packet.
3302 optional string destination_ip = 6;
3303 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3304 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3305 // families.
3306 optional int32 ip_next_header = 7;
3307 // The source port if this was a TCP or UDP packet.
3308 optional int32 source_port = 8;
3309 // The destination port if this was a TCP or UDP packet.
3310 optional int32 destination_port = 9;
3311}
3312
3313/*
3314 * Logs the memory stats for an app on startup.
3315 * Logged from:
3316 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3317 */
3318message AppStartMemoryStateCaptured {
3319 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003320 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003321
3322 // The process name.
3323 optional string process_name = 2;
3324
3325 // The activity name.
3326 optional string activity_name = 3;
3327
3328 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003329 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003330
3331 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003332 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003333
3334 // RSS
3335 optional int64 rss_in_bytes = 6;
3336
3337 // CACHE
3338 optional int64 cache_in_bytes = 7;
3339
3340 // SWAP
3341 optional int64 swap_in_bytes = 8;
3342}
3343
3344/*
3345 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3346 * for LMK event.
3347 * Logged from:
3348 * system/core/lmkd/lmkd.c
3349 */
3350message LmkStateChanged {
3351 enum State {
3352 UNKNOWN = 0;
3353 START = 1;
3354 STOP = 2;
3355 }
3356 optional State state = 1;
3357}
3358
3359/*
3360 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3361 * Logged from:
3362 * system/core/lmkd/lmkd.c
3363 */
3364message LmkKillOccurred {
3365 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003366 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003367
3368 // The process name.
3369 optional string process_name = 2;
3370
3371 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003372 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003373
3374 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003375 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003376
3377 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003378 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003379
3380 // RSS
3381 optional int64 rss_in_bytes = 6;
3382
3383 // CACHE
3384 optional int64 cache_in_bytes = 7;
3385
3386 // SWAP
3387 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003388
3389 // The elapsed real time of start of the process.
3390 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003391
3392 // Min oom adj score considered by lmkd.
3393 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003394}
3395
Rajeev Kumar51b54602018-03-01 12:18:26 -08003396/*
3397 * Logs when the ActivityManagerService detects that an app died.
3398 *
3399 * Logged from:
3400 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3401 */
3402message AppDied {
3403 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003404 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003405}
3406
Howard Ro21a039c2018-08-06 14:55:47 -07003407/**
3408 * An atom for generic metrics logging. Available from Android Q.
3409 */
3410message GenericAtom {
3411 // The uid of the application that sent this custom atom.
3412 optional int32 uid = 1 [(is_uid) = true];
3413
3414 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003415 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003416}
3417
Tej Singhd6d6d772018-09-05 17:41:25 -07003418/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003419 * Atom for simple logging of user interaction and impression events, such as "the user touched
3420 * this button" or "this dialog was displayed".
3421 * Keep the UI event stream clean: don't use for system or background events.
3422 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003423 *
3424 * Logged from:
3425 * frameworks/base/services/core/java/com/android/server/
3426 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003427 */
3428message UiEventReported {
3429 // The event_id.
3430 optional int32 event_id = 1;
3431 // The event's source or target uid and package, if applicable.
3432 // For example, the package posting a notification, or the destination package of a share.
3433 optional int32 uid = 2 [(is_uid) = true];
3434 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003435 // An identifier used to disambiguate which logs refer to a particular instance of some
3436 // UI element. Useful when there might be multiple instances simultaneously active.
3437 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003438}
3439
3440/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003441 * Reports a notification was created or updated.
3442 *
3443 * Logged from:
3444 * frameworks/base/services/core/java/com/android/server/notification/
3445 */
3446message NotificationReported {
3447 // The event_id (as for UiEventReported).
3448 optional int32 event_id = 1;
3449 // The notifying app's uid and package.
3450 optional int32 uid = 2 [(is_uid) = true];
3451 optional string package_name = 3;
3452 // A small system-assigned identifier for the notification.
3453 // Locally probably-unique, but expect collisions across users and/or days.
3454 optional int32 instance_id = 4;
3455 // The app-assigned notification ID and tag
3456 optional int32 notification_id = 5;
3457 optional string notification_tag = 6;
3458 optional string channel_id = 7; // App-assigned channel ID
3459
3460 // Grouping information
3461 optional string group_id = 8; // Group the notification currently belongs to
3462 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3463 optional bool is_group_summary = 10; // Tags the group-summary notification
3464
3465 // Attributes
3466 optional string category = 11; // App-assigned notification category (API-defined strings)
3467 optional int32 style = 12; // App-assigned notification style
3468 optional int32 num_people = 13; // Number of Person records attached to the notification
3469
3470 // Ordering, importance and interruptiveness
3471
3472 optional int32 position = 14; // Position in NotificationManager's list
3473
3474 optional android.stats.sysui.NotificationImportance importance = 15;
3475 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3476
3477 enum NotificationImportanceExplanation {
3478 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3479 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3480 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3481 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3482 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3483 // Like _APP, but based on pre-channels priority signal.
3484 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3485 }
3486
3487 optional NotificationImportanceExplanation importance_source = 17;
3488 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3489 optional NotificationImportanceExplanation importance_initial_source = 19;
3490 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3491 optional int32 assistant_hash = 21;
3492 optional float assistant_ranking_score = 22;
3493}
3494
3495message Notification {
3496 // The notifying app's uid and package.
3497 optional int32 uid = 1 [(is_uid) = true];
3498 optional string package_name = 2;
3499 // A small system-assigned identifier for the notification.
3500 optional int32 instance_id = 3;
3501
3502 // Grouping information.
3503 optional int32 group_instance_id = 4;
3504 optional bool is_group_summary = 5;
3505
3506 // The section of the shade that the notification is in.
3507 // See NotificationSectionsManager.PriorityBucket.
3508 enum NotificationSection {
3509 SECTION_UNKNOWN = 0;
3510 SECTION_PEOPLE = 1;
3511 SECTION_ALERTING = 2;
3512 SECTION_SILENT = 3;
3513 }
3514 optional NotificationSection section = 6;
3515}
3516
3517message NotificationList {
3518 repeated Notification notifications = 1; // An ordered sequence of notifications.
3519}
3520
3521/**
3522 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3523 *
3524 * Logged from:
3525 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3526 */
3527message NotificationPanelReported {
3528 // The event_id (as for UiEventReported).
3529 optional int32 event_id = 1;
3530 optional int32 num_notifications = 2;
3531 // The notifications in the panel, in the order that they appear there.
3532 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3533}
3534
3535/**
3536 * Reports a notification channel, or channel group, was created, updated, or deleted.
3537 *
3538 * Logged from:
3539 * frameworks/base/services/core/java/com/android/server/notification/
3540 */
3541message NotificationChannelModified {
3542 // The event_id (as for UiEventReported).
3543 optional int32 event_id = 1;
3544 // The notifying app's uid and package.
3545 optional int32 uid = 2 [(is_uid) = true];
3546 optional string package_name = 3;
3547 // App-assigned notification channel ID or channel-group ID
3548 optional string channel_id = 4;
3549 // Previous importance setting, if applicable
3550 optional android.stats.sysui.NotificationImportance old_importance = 5;
3551 // New importance setting
3552 optional android.stats.sysui.NotificationImportance importance = 6;
3553}
3554
3555
3556/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003557 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003558 *
3559 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003560 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003561 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003562message BiometricAcquired {
3563 // Biometric modality that was acquired.
3564 optional android.hardware.biometrics.ModalityEnum modality = 1;
3565 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3566 optional int32 user = 2;
3567 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3568 optional bool is_crypto = 3;
3569 // Action that the device is performing. Acquired messages are only expected for enroll and
3570 // authenticate. Other actions may indicate an error.
3571 optional android.hardware.biometrics.ActionEnum action = 4;
3572 // The client that this acquisition was received for.
3573 optional android.hardware.biometrics.ClientEnum client = 5;
3574 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3575 optional int32 acquire_info = 6;
3576 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3577 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003578 // Dictates if this message should trigger additional debugging.
3579 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003580}
3581
3582/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003583 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003584 *
3585 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003586 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003587 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003588message BiometricAuthenticated {
3589 // Biometric modality that was used.
3590 optional android.hardware.biometrics.ModalityEnum modality = 1;
3591 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3592 optional int32 user = 2;
3593 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3594 // storage.
3595 optional bool is_crypto = 3;
3596 // The client that this acquisition was received for.
3597 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003598 // If authentication requires user confirmation. See BiometricPrompt's
3599 // setRequireConfirmation(bool) method.
3600 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003601
Kevin Chyn1741a072019-01-17 11:54:40 -08003602 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003603 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003604 REJECTED = 1;
3605 PENDING_CONFIRMATION = 2;
3606 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003607 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003608
3609 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003610 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003611 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3612 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3613 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3614 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003615 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003616 // Dictates if this message should trigger additional debugging.
3617 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003618}
3619
3620/**
3621 * Logs when a biometric error occurs.
3622 *
3623 * Logged from:
3624 * frameworks/base/services/core/java/com/android/server/biometrics
3625 */
3626message BiometricErrorOccurred {
3627 // Biometric modality that was used.
3628 optional android.hardware.biometrics.ModalityEnum modality = 1;
3629 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3630 optional int32 user = 2;
3631 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3632 optional bool is_crypto = 3;
3633 // Action that the device is performing.
3634 optional android.hardware.biometrics.ActionEnum action = 4;
3635 // The client that this acquisition was received for.
3636 optional android.hardware.biometrics.ClientEnum client = 5;
3637 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3638 // are unique to modality.
3639 optional int32 error_info = 6;
3640 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3641 // by the vendor and not specified by the HIDL interface.
3642 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003643 // Dictates if this message should trigger additional debugging.
3644 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003645 // Time spent during the authentication attempt.
3646 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003647}
3648
3649/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003650 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003651 * Logged from:
3652 * frameworks/base/services/core/java/com/android/server/biometrics
3653 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003654message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003655 // Biometric modality.
3656 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003657 // Type of issue detected.
3658 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003659 // Dictates if this message should trigger additional debugging.
3660 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003661}
Howard Ro688ae182018-09-25 00:09:36 -07003662
joshmccloskey6f952b22019-03-25 20:59:35 -07003663/**
3664 * Logs when a biometric enrollment occurs.
3665 *
3666 * Logged from:
3667 * frameworks/base/services/core/java/com/android/server/biometrics
3668 */
3669message BiometricEnrolled {
3670 // Biometric modality that was used.
3671 optional android.hardware.biometrics.ModalityEnum modality = 1;
3672 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3673 optional int32 user = 2;
3674 // The amount of time the enrollment took in milliseconds.
3675 optional int64 latency_millis = 3;
3676 // Whether or not the enrollment was successful.
3677 optional bool success = 4;
3678}
3679
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003680/*
Tej Singh0d176952019-01-16 19:10:54 -08003681 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003682 */
Tej Singh0d176952019-01-16 19:10:54 -08003683message FlagFlipUpdateOccurred {
3684 // If the event is from a flag config package, specify the package name.
3685 optional string flag_flip_package_name = 1;
3686
3687 // The order id of the package
3688 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003689}
3690
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003691/**
3692 * Potential experiment ids that goes with a train install.
3693 */
3694message TrainExperimentIds {
3695 repeated int64 experiment_id = 1;
3696}
3697
Yangster-macb89807e2018-11-15 21:10:57 -08003698/*
3699 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003700 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003701 */
3702message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003703 // Name of the train.
3704 optional string train_name = 1;
3705 // Version code for a "train" of packages that need to be installed atomically
3706 optional int64 train_version_code = 2;
3707 // After installation of this package, device requires a restart.
3708 optional bool requires_staging = 3;
3709 // Rollback should be enabled for this install.
3710 optional bool rollback_enabled = 4;
3711 // Requires low latency monitoring if possible.
3712 optional bool requires_low_latency_monitor = 5;
3713
Yangster-macb89807e2018-11-15 21:10:57 -08003714 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003715 UNKNOWN = 0;
3716 INSTALL_REQUESTED = 1;
3717 INSTALL_STARTED = 2;
3718 INSTALL_STAGED_NOT_READY = 3;
3719 INSTALL_STAGED_READY = 4;
3720 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003721 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3722 // and INSTALL_FAILURE_COMMIT.
3723 INSTALL_FAILURE = 6 [deprecated = true];
3724 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003725 INSTALL_CANCELLED = 7;
3726 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003727 INSTALLER_ROLLBACK_INITIATED = 9;
3728 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3729 INSTALLER_ROLLBACK_STAGED = 11;
3730 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3731 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3732 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3733 INSTALLER_ROLLBACK_SUCCESS = 15;
3734 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003735 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3736 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3737 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3738 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3739 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3740 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003741 INSTALL_FAILURE_DOWNLOAD = 23;
3742 INSTALL_FAILURE_STATE_MISMATCH = 24;
3743 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003744 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003745 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003746 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003747 // Possible experiment ids for monitoring this push.
3748 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3749 // user id
3750 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003751 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003752}
3753
Tej Singhc9203082019-05-03 13:42:23 -07003754/* Test atom, is not logged anywhere */
3755message TestAtomReported {
3756 repeated AttributionNode attribution_node = 1;
3757 optional int32 int_field = 2;
3758 optional int64 long_field = 3;
3759 optional float float_field = 4;
3760 optional string string_field = 5;
3761 optional bool boolean_field = 6;
3762 enum State {
3763 UNKNOWN = 0;
3764 OFF = 1;
3765 ON = 2;
3766 }
3767 optional State state = 7;
3768 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3769}
3770
Maggie Whitefc1aa592018-11-28 21:55:23 -08003771/** Represents USB port overheat event. */
3772message UsbPortOverheatEvent {
3773 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3774 optional int32 plug_temperature_deci_c = 1;
3775
3776 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3777 optional int32 max_temperature_deci_c = 2;
3778
3779 /* Time between USB plug event and overheat threshold trip, in seconds. */
3780 optional int32 time_to_overheat_secs = 3;
3781
3782 /* Time between overheat threshold trip and hysteresis, in seconds. */
3783 optional int32 time_to_hysteresis_secs = 4;
3784
3785 /* Time between hysteresis and active mitigation ending, in seconds. */
3786 optional int32 time_to_inactive_secs = 5;
3787};
3788
Maggie White8735b852019-01-18 11:40:49 -08003789/**
3790 * Logs total effective full charge and discharge cycles on a battery.
3791 * Here are some examples of one effective cycle:
3792 * 1) the battery charges from 0% to 100% and drains back to 0%,
3793 * 2) charging from 50% to 100% and draining back to 50% twice.
3794 * Pulled from:
3795 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3796 */
3797message BatteryCycleCount {
3798 /* Number of total charge and discharge cycles on the system battery. */
3799 optional int32 cycle_count = 1;
3800}
3801
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003802/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003803 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3804 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003805 * Pulled from:
3806 * StatsCompanionService
3807 */
3808
Carmen Agimof12dec122019-03-06 16:14:38 +00003809message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003810
Carmen Agimof12dec122019-03-06 16:14:38 +00003811 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003812 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003813 PUBLIC = 1;
3814 PRIVATE = 2;
3815 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003816 }
3817
Carmen Agimof12dec122019-03-06 16:14:38 +00003818 // The type of external storage.
3819 optional android.stats.storage.ExternalStorageType storage_type = 1;
3820 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3821 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003822 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003823 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003824}
3825
Yangster-macb89807e2018-11-15 21:10:57 -08003826/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003827 * Logs when a connection becomes available and lost.
3828 * Logged in StatsCompanionService.java
3829 */
3830message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003831 // Id of the network.
3832 optional int32 net_id = 1;
3833
3834 enum State {
3835 UNKNOWN = 0;
3836 CONNECTED = 1;
3837 DISCONNECTED = 2;
3838 }
3839 // Connected state of a network.
3840 optional State state = 2;
3841}
3842
3843/**
3844 * Logs when a service starts and stops.
3845 * Logged from:
3846 * services/core/java/com/android/server/am/ActiveServices.java
3847 */
3848message ServiceStateChanged {
3849
3850 optional int32 uid = 1 [(is_uid) = true];
3851
3852 optional string package_name = 2;
3853
3854 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003855
3856 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003857 START = 1;
3858 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003859 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003860
3861 optional State state = 4;
3862}
3863
3864/**
3865 * Logs when a service is launched.
3866 * Logged from:
3867 * services/core/java/com/android/server/am/ActiveServices.java
3868 */
3869message ServiceLaunchReported {
3870
3871 optional int32 uid = 1 [(is_uid) = true];
3872
3873 optional string package_name = 2;
3874
3875 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003876}
Howard Ro688ae182018-09-25 00:09:36 -07003877
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003878/**
3879 * Logs when a hidden API is used.
3880 *
3881 * Logged from:
3882 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3883 */
3884message HiddenApiUsed {
3885 // The uid of the app making the hidden access.
3886 optional int32 uid = 1 [(is_uid) = true];
3887
3888 // Signature of the method or field accessed.
3889 optional string signature = 2;
3890
3891 enum AccessMethod {
3892 NONE = 0;
3893 REFLECTION = 1;
3894 JNI = 2;
3895 LINKING = 3;
3896 }
3897
3898 // Type of access.
3899 optional AccessMethod access_method = 3;
3900
3901 // Whether the access was prevented or not.
3902 optional bool access_denied = 4;
3903}
3904
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003905/**
3906 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3907 * - When user sees privacy chip
3908 * - When user clicks privacy chip
3909 * - How does the user exit the Privacy Dialog
3910 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003911 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3912 */
3913message PrivacyIndicatorsInteracted {
3914
3915 enum Type {
3916 UNKNOWN = 0;
3917 CHIP_VIEWED = 1;
3918 CHIP_CLICKED = 2;
3919 DIALOG_PRIVACY_SETTINGS = 3;
3920 DIALOG_DISMISS = 4;
3921 DIALOG_LINE_ITEM = 5;
3922 }
3923
3924 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3925
3926 // Used if the type is LINE_ITEM
3927 optional string package_name = 2;
3928}
3929
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003930/**
3931 * Logs information about a package that is moved from the internal to external storage and vice
3932 * versa.
3933 * It logs the package name, the type of the external storage where the package is installed
3934 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3935 * and the move type: if it's from internal to external or the other way around.
3936 *
3937 * Logged from:
3938 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3939 */
3940message AppMovedStorageReported {
3941 enum MoveType {
3942 UNKNOWN = 0;
3943 TO_EXTERNAL = 1;
3944 TO_INTERNAL = 2;
3945 }
3946 // The type of the external storage.
3947 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3948 // The type of move.
3949 optional MoveType move_type = 2;
3950 // The name of the package that was moved.
3951 optional string package_name = 3;
3952}
3953
jianjin8f2dee02019-03-29 14:03:08 -07003954/**
3955 * Logs when system server watchdog occurs.
3956 * Logged from:
3957 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3958 */
3959message SystemServerWatchdogOccurred {
3960 optional string subject = 1;
3961}
3962
3963/**
3964 * Logs when new file added to tombstones.
3965 * Logged from:
3966 * frameworks/base/core/java/com/android/server/BootReceiver.java
3967 */
3968message TombStoneOccurred {
3969}
3970
Hai Zhang5d3328d2019-04-13 21:25:06 +08003971/*
3972 * Information about a role request
3973 *
3974 * Logged from:
3975 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3976 */
3977message RoleRequestResultReported {
3978 // UID of application requesting the role
3979 optional int32 requesting_uid = 1;
3980
3981 // Package name of application requesting the role
3982 optional string requesting_package_name = 2;
3983
3984 // The role to be granted
3985 optional string role_name = 3;
3986
3987 // The count of applications qualifying for the role
3988 optional int32 qualifying_count = 4;
3989
3990 // UID of application current granted the role
3991 optional int32 current_uid = 5;
3992
3993 // Package name of application current granted the role
3994 optional string current_package_name = 6;
3995
3996 // UID of another application that user chose to grant the role to, instead of the requesting
3997 // application
3998 optional int32 granted_another_uid = 7;
3999
4000 // Package name of another application that user chose to grant the role to, instead of the
4001 // requesting application
4002 optional string granted_another_package_name = 8;
4003
4004 enum Result {
4005 UNDEFINED = 0;
4006 // role request was ignored
4007 IGNORED = 1;
4008 // role request was ignored because it's already granted
4009 IGNORED_ALREADY_GRANTED = 2;
4010 // role request was ignored because the application isn't qualified
4011 IGNORED_NOT_QUALIFIED = 3;
4012 // role request was ignored because user said it should be always denied
4013 IGNORED_USER_ALWAYS_DENIED = 4;
4014 // role was granted by user action
4015 USER_GRANTED = 5;
4016 // role was denied by user action
4017 USER_DENIED = 6;
4018 // role was denied by user granting another application the role
4019 USER_DENIED_GRANTED_ANOTHER = 7;
4020 // role was denied and set to be always denied by the user
4021 USER_DENIED_WITH_ALWAYS = 8;
4022 }
4023 // The result of the role request
4024 optional Result result = 9;
4025}
4026
Mark Tabrya824a642019-11-05 12:26:12 -08004027/**
4028 * Logs when a Vehicle Maps Service client's connection state has changed
4029 *
4030 * Logged from:
4031 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4032 */
4033message VmsClientConnectionStateChanged {
4034 // The UID of the VMS client app
4035 optional int32 uid = 1 [(is_uid) = true];
4036
4037 enum State {
4038 UNKNOWN = 0;
4039 // Attempting to connect to the client
4040 CONNECTING = 1;
4041 // Client connection established
4042 CONNECTED = 2;
4043 // Client connection closed unexpectedly
4044 DISCONNECTED = 3;
4045 // Client connection closed by VMS
4046 TERMINATED = 4;
4047 // Error establishing the client connection
4048 CONNECTION_ERROR = 5;
4049 }
4050
4051 optional State state = 2;
4052}
4053
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004054/**
4055 * Logs when MediaProvider has successfully finished scanning a storage volume.
4056 *
4057 * Logged from:
4058 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4059 */
4060message MediaProviderScanEvent {
4061 enum Reason {
4062 // Scan triggered due to unknown reason
4063 UNKNOWN = 0;
4064 // Scan triggered due to storage volume being mounted
4065 MOUNTED = 1;
4066 // Scan triggered due to explicit user action or app request
4067 DEMAND = 2;
4068 // Scan triggered due to idle maintenance
4069 IDLE = 3;
4070 }
4071
4072 // Volume type that this event pertains to
4073 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4074 // Reason why this scan was triggered
4075 optional Reason reason = 2;
4076 // Total number of files scanned
4077 optional int64 item_count = 3;
4078 // Duration of scan, normalized per file
4079 optional float normalized_duration_millis = 4;
4080 // Number of database inserts, normalized per file
4081 optional float normalized_insert_count = 5;
4082 // Number of database updates, normalized per file
4083 optional float normalized_update_count = 6;
4084 // Number of database deletes, normalized per file
4085 optional float normalized_delete_count = 7;
4086}
4087
4088/**
4089 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4090 *
4091 * Logged from:
4092 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4093 */
4094message MediaProviderDeletionEvent {
4095 // Volume type that this event pertains to
4096 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4097 // Device timestamp when this deletion event occurred
4098 optional int64 timestamp_millis = 2;
4099 // App that requested deletion
4100 optional string package_name = 3;
4101 // Number of items that were deleted
4102 optional int32 item_count = 4;
4103}
4104
4105/**
4106 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4107 *
4108 * Logged from:
4109 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4110 */
4111message MediaProviderPermissionEvent {
4112 enum Result {
4113 UNKNOWN = 0;
4114 USER_GRANTED = 1;
4115 AUTO_GRANTED = 2;
4116 USER_DENIED = 3;
4117 USER_DENIED_WITH_PREJUDICE = 4;
4118 AUTO_DENIED = 5;
4119 }
4120
4121 // Volume type that this event pertains to
4122 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4123 // Device timestamp when this permission event occurred
4124 optional int64 timestamp_millis = 2;
4125 // App that requested permission
4126 optional string package_name = 3;
4127 // Number of items that were requested
4128 optional int32 item_count = 4;
4129 // Result of this request
4130 optional Result result = 5;
4131}
4132
4133/**
4134 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4135 *
4136 * Logged from:
4137 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4138 */
4139message MediaProviderSchemaChange {
4140 // Volume type that this event pertains to
4141 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4142 // Old database version code
4143 optional int32 version_from = 2;
4144 // New database version code
4145 optional int32 version_to = 3;
4146 // Total number of files in database
4147 optional int64 item_count = 4;
4148 // Duration of schema change, normalized per file
4149 optional float normalized_duration_millis = 5;
4150}
4151
4152/**
4153 * Logs when MediaProvider has finished an idle maintenance job.
4154 *
4155 * Logged from:
4156 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4157 */
4158message MediaProviderIdleMaintenance {
4159 // Volume type that this event pertains to
4160 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4161
4162 // Total number of files in database
4163 optional int64 item_count = 2;
4164 // Duration of idle maintenance, normalized per file
4165 optional float normalized_duration_millis = 3;
4166 // Number of thumbnails found to be stale, normalized per file
4167 optional float normalized_stale_thumbnails = 4;
4168 // Number of items found to be expired, normalized per file
4169 optional float normalized_expired_media = 5;
4170}
4171
Keun young Park3e033cb2019-12-18 11:27:35 -08004172/**
4173 * Represents boot time event with duration in ms.
4174 *
4175 * Logged from: bootstat and various system server components. Check each enums for details.
4176 */
4177message BootTimeEventDuration {
4178 enum DurationEvent {
4179 UNKNOWN = 0;
4180 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4181 ABSOLUTE_BOOT_TIME = 1;
4182 // Bootloader's 1st stage execution time.
4183 // Logged from bootstat.
4184 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4185 // Bootloader's 1st stage loading time.
4186 // Logged from bootstat.
4187 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4188 // Bootloader's kernel loading time.
4189 // Logged from bootstat.
4190 BOOTLOADER_KERNEL_LOAD = 4;
4191 // Bootloader's 2nd stage execution time.
4192 // Logged from bootstat.
4193 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4194 // Bootloader's 2nd stage loading time.
4195 // Logged from bootstat.
4196 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4197 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4198 // for locked device.
4199 // Logged from bootstat.
4200 BOOTLOADER_UI_WAIT = 7;
4201 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4202 // Logged from bootstat.
4203 BOOTLOADER_TOTAL = 8;
4204 // Shutdown duration inside init for the reboot before the current boot up.
4205 // Logged from f/b/services/.../BootReceiver.java.
4206 SHUTDOWN_DURATION = 9;
4207 // Total time for mounting of disk devices during bootup.
4208 // Logged from f/b/services/.../BootReceiver.java.
4209 MOUNT_DEFAULT_DURATION = 10;
4210 // Total time for early stage mounting of disk devices during bootup.
4211 // Logged from f/b/services/.../BootReceiver.java.
4212 MOUNT_EARLY_DURATION = 11;
4213 // Total time for late stage mounting of disk devices during bootup.
4214 // Logged from f/b/services/.../BootReceiver.java.
4215 MOUNT_LATE_DURATION = 12;
4216 // Average time to scan non-system app after OTA
4217 // Logged from f/b/services/.../PackageManagerService.java
4218 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4219 // Time to initialize Package manager after OTA
4220 // Logged from f/b/services/.../PackageManagerService.java
4221 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4222 // Time to scan all system app from Package manager after OTA
4223 // Logged from f/b/services/.../PackageManagerService.java
4224 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4225 // Init's total time for cold boot stage.
4226 // Logged from bootstat.
4227 COLDBOOT_WAIT = 16;
4228 // Init's total time for initializing selinux.
4229 // Logged from bootstat.
4230 SELINUX_INIT = 17;
4231 // Time since last factory reset.
4232 // Logged from bootstat.
4233 FACTORY_RESET_TIME_SINCE_RESET = 18;
4234 }
4235
4236 // Type of the event.
4237 optional DurationEvent event = 1;
4238 // Duration of the event in ms.
4239 optional int64 duration_millis = 2;
4240}
4241
4242/**
4243 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4244 * since boot-up.
4245 *
4246 * Logged from: bootstat and various system server components. Check each enums for details.
4247 */
4248message BootTimeEventElapsedTime {
4249 enum ElapsedTimeEvent {
4250 UNKNOWN = 0;
4251 // Time when init starts 1st stage. Logged from bootstat.
4252 ANDROID_INIT_STAGE_1 = 1;
4253 // Time when sys.boot_completed prop is set.
4254 // Logged from bootstat.
4255 BOOT_COMPLETE = 2;
4256 // BOOT_COMPLETE for encrypted device.
4257 BOOT_COMPLETE_ENCRYPTION = 3;
4258 // BOOT_COMPLETE for device with no encryption.
4259 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4260 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4261 BOOT_COMPLETE_POST_DESCRYPT = 5;
4262 // BOOT_COMPLETE after factory reset.
4263 FACTORY_RESET_BOOT_COMPLETE = 6;
4264 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4265 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4266 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4267 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4268 // BOOT_COMPLETE after OTA.
4269 OTA_BOOT_COMPLETE = 9;
4270 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4271 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4272 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4273 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4274 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4275 // Logged from f/b/services/.../UserController.java
4276 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4277 // Time when the system starts sending BOOT_COMPLETED broadcast.
4278 // Logged from f/b/services/.../UserController.java
4279 FRAMEWORK_BOOT_COMPLETED = 13;
4280 // Time when the package manager starts init.
4281 // Logged from f/b/services/.../SystemServer.java
4282 PACKAGE_MANAGER_INIT_START = 14;
4283 // Time when package manager is ready
4284 // Logged from f/b/services/.../SystemServer.java
4285 PACKAGE_MANAGER_INIT_READY = 15;
4286 // Represents the time when user has entered unlock credential for system with user pin.
4287 // Logged from bootstat.
4288 POST_DECRYPT = 16;
4289 // Represents the start of zygote's init.
4290 // Logged from zygote itself.
4291 ZYGOTE_INIT_START = 17;
4292 // Represents the start of secondary zygote's init.
4293 // TODO: add logging to zygote
4294 SECONDARY_ZYGOTE_INIT_START = 18;
4295 // Represents the start of system server's init.
4296 // Logged from f/b/services/.../SystemServer.java
4297 SYSTEM_SERVER_INIT_START = 19;
4298 // Represents the completion of system server's init.
4299 // Logged from f/b/services/.../SystemServer.java
4300 SYSTEM_SERVER_READY = 20;
4301 // Represents the start of launcher during boot-up.
4302 // TODO: add logging
4303 LAUNCHER_START = 21;
4304 // Represents the completion of launcher's initial rendering. User can use other apps from
4305 // launcher from this point.
4306 // TODO: add logging
4307 LAUNCHER_SHOWN = 22;
4308 }
4309
4310 // Type of the event.
4311 optional ElapsedTimeEvent event = 1;
4312 // Time since bootup for the event.
4313 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4314 optional int64 time_millis = 2;
4315}
4316
4317/**
4318 * Boot time events with UTC time.
4319 *
4320 * Logged from: bootstat and various system server components. Check each enums for details.
4321 */
4322message BootTimeEventUtcTime {
4323 enum UtcTimeEvent {
4324 UNKNOWN = 0;
4325 // Time of the bootstat's marking of 1st boot after the last factory reset.
4326 // Logged from bootstat.
4327 FACTORY_RESET_RESET_TIME = 1;
4328 // The time when bootstat records FACTORY_RESET_* events. This is close to
4329 // BOOT_COMPLETE time for the current bootup.
4330 // Logged from bootstat.
4331 FACTORY_RESET_CURRENT_TIME = 2;
4332 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4333 // Logged from bootstat.
4334 FACTORY_RESET_RECORD_VALUE = 3;
4335 }
4336
4337 // Type of the event.
4338 optional UtcTimeEvent event = 1;
4339 // UTC time for the event.
4340 optional int64 utc_time_secs = 2;
4341}
4342
4343/**
4344 * Boot time events representing specific error code during bootup.
4345 * Meaning of error code can be different per each event type.
4346 *
4347 * Logged from: bootstat and various system server components. Check each enums for details.
4348 */
4349message BootTimeEventErrorCode {
4350 enum ErrorCodeEvent {
4351 UNKNOWN = 0;
4352 // Linux error code for time() call to get the current UTC time.
4353 // Logged from bootstat.
4354 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4355 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4356 // as UMOUNT_STAT_* from init/reboot.cpp.
4357 // Logged from f/b/services/.../BootReceiver.java.
4358 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004359 // Reprepsents fie system mounting error code of /data partition for the current boot.
4360 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004361 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004362 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004363 }
4364
4365 // Type of the event.
4366 optional ErrorCodeEvent event = 1;
4367 // error code defined per each event type.
4368 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4369 // FS_MGR_FS_STAT.
4370 optional int32 error_code = 2;
4371}
4372
Chenjie Yubbcbc602018-02-05 16:51:52 -08004373//////////////////////////////////////////////////////////////////////
4374// Pulled atoms below this line //
4375//////////////////////////////////////////////////////////////////////
4376
4377/**
David Chenc8a43242017-10-17 16:23:28 -07004378 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4379 *
4380 * Pulled from:
4381 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4382 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004383message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004384 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004385
4386 optional int64 rx_bytes = 2;
4387
4388 optional int64 rx_packets = 3;
4389
4390 optional int64 tx_bytes = 4;
4391
4392 optional int64 tx_packets = 5;
4393}
4394
4395/**
4396 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4397 *
4398 * Pulled from:
4399 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4400 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004401message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004402 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004403
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004404 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4405 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004406
4407 optional int64 rx_bytes = 3;
4408
4409 optional int64 rx_packets = 4;
4410
4411 optional int64 tx_bytes = 5;
4412
4413 optional int64 tx_packets = 6;
4414}
4415
4416/**
4417 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4418 *
4419 * Pulled from:
4420 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4421 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004422message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004423 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004424
4425 optional int64 rx_bytes = 2;
4426
4427 optional int64 rx_packets = 3;
4428
4429 optional int64 tx_bytes = 4;
4430
4431 optional int64 tx_packets = 5;
4432}
4433
4434/**
4435 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4436 *
4437 * Pulled from:
4438 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4439 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004440message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004441 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004442
Yao Chenc40a19d2018-03-15 16:48:25 -07004443 // 1 denotes foreground and 0 denotes background. This is called Set in
4444 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004445 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004446
4447 optional int64 rx_bytes = 3;
4448
4449 optional int64 rx_packets = 4;
4450
4451 optional int64 tx_bytes = 5;
4452
4453 optional int64 tx_packets = 6;
4454}
4455
4456/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004457 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4458 *
4459 * Pulled from:
4460 * StatsCompanionService
4461 */
4462message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004463 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004464
4465 optional int64 rx_bytes = 2;
4466
4467 optional int64 tx_bytes = 3;
4468}
4469
4470/**
David Chenc8a43242017-10-17 16:23:28 -07004471 * Pulls the kernel wakelock durations. This atom is adapted from
4472 * android/internal/os/KernelWakelockStats.java
4473 *
4474 * Pulled from:
4475 * StatsCompanionService using KernelWakelockReader.
4476 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004477message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004478 optional string name = 1;
4479
4480 optional int32 count = 2;
4481
4482 optional int32 version = 3;
4483
Yangster-maca8a30442018-10-13 23:46:34 -07004484 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004485}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004486
Chenjie Yu05013b32017-11-21 10:21:41 -08004487/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004488 * Pulls low power state information. If power.stats HAL is not available, this
4489 * includes platform and subsystem sleep state information,
4490 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4491 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004492 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004493 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004494 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4495 * as defined in:
4496 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004497 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004498message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004499 // Subsystem name
4500 optional string subsystem_name = 1;
4501 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4502 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004503 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4504 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004505 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004506 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004507 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004508 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004509 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004510}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004511
Chenjie Yu05013b32017-11-21 10:21:41 -08004512/**
Bookatz92da2832018-11-01 18:10:03 -07004513 * Pulls on-device power measurement information.
4514 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4515 * Pulled from:
4516 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4517 */
4518message OnDevicePowerMeasurement {
4519 // Name of the subsystem (to which the rail belongs).
4520 optional string subsystem_name = 1;
4521
4522 // Rail name. The rail lies within the subsystem.
4523 optional string rail_name = 2;
4524
4525 // Time (in ms since boot) at which the rail energy value was measured.
4526 // This may differ slightly from the time that statsd logs this information.
4527 optional uint64 measurement_timestamp_millis = 3;
4528
4529 // Accumulated energy used via the rail since device boot in uWs.
4530 optional uint64 energy_microwatt_secs = 4;
4531}
4532
4533/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004534 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004535 * Pulls the time the cpu spend on the frequency index. Frequency index
4536 * starts from highest to lowest. The value should be monotonically
4537 * increasing since boot. However, if there is a cpu
4538 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004539 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004540message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004541 optional uint32 cluster = 1;
4542 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004543 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004544}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004545
Chenjie Yu05013b32017-11-21 10:21:41 -08004546/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004547 * Pulls Cpu Time Per Uid.
4548 * Note that isolated process uid time should be attributed to host uids.
4549 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004550message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004551 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004552 optional uint64 user_time_micros = 2;
4553 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004554}
4555
4556/**
4557 * Pulls Cpu Time Per Uid per frequency.
4558 * Note that isolated process uid time should be attributed to host uids.
4559 * For each uid, we order the time by descending frequencies.
4560 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004561message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004562 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004563 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004564 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004565}
Hugo Benichi884970e2017-11-14 22:42:46 +09004566
Chenjie Yu05013b32017-11-21 10:21:41 -08004567/**
4568 * Pulls Wifi Controller Activity Energy Info
4569 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004570message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004571 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004572 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004573 // stack reported state
4574 // TODO: replace this with proto enum
4575 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004576 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004577 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004578 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004579 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004580 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004581 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004582 // product of current(mA), voltage(V) and time(ms)
4583 optional uint64 controller_energy_used = 6;
4584}
4585
4586/**
4587 * Pulls Modem Activity Energy Info
4588 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004589message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004590 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004591 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004592 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004593 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004594 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004595 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004596 /**
4597 * Tx power index
4598 * index 0 = tx_power < 0dBm
4599 * index 1 = 0dBm < tx_power < 5dBm
4600 * index 2 = 5dBm < tx_power < 15dBm
4601 * index 3 = 15dBm < tx_power < 20dBm
4602 * index 4 = tx_power > 20dBm
4603 */
4604 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004605 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004606 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004607 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004608 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004609 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004610 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004611 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004612 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004613 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004614 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004615 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004616 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004617 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004618}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004619
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004620/**
4621 * Pulls Bluetooth Activity Energy Info
4622 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4623 */
4624message BluetoothActivityInfo {
4625 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004626 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004627 // bluetooth stack state
4628 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004629 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004630 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004631 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004632 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004633 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004634 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004635 // product of current(mA), voltage(V) and time(ms)
4636 optional uint64 energy_used = 6;
4637}
4638
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004639/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004640 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004641 *
4642 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004643 */
4644message ProcessMemoryState {
4645 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004646 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004647
4648 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004649 // Usually package name, "system" for system server.
4650 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004651 optional string process_name = 2;
4652
Rafal Slawikda51b932018-12-13 16:31:33 +00004653 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004654 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004655
4656 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004657 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004658
4659 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004660 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004661
Rajeev Kumar90235992018-01-29 11:06:48 -08004662 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004663 // Value is read from memory.stat, field total_rss if per-app memory
4664 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004665 optional int64 rss_in_bytes = 6;
4666
4667 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004668 // Value is read from memory.stat, field total_cache if per-app memory
4669 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004670 optional int64 cache_in_bytes = 7;
4671
4672 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004673 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004674 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004675 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004676
Rafal Slawik203c3db2019-09-25 19:53:01 +01004677 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004678 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004679
Rafal Slawik203c3db2019-09-25 19:53:01 +01004680 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4681 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004682
Rafal Slawik203c3db2019-09-25 19:53:01 +01004683 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4684 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004685}
4686
4687/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004688 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004689 *
4690 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4691 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004692 *
4693 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004694 */
4695message ProcessMemoryHighWaterMark {
4696 // The uid if available. -1 means not available.
4697 optional int32 uid = 1 [(is_uid) = true];
4698
Rafal Slawikda51b932018-12-13 16:31:33 +00004699 // The process name.
4700 // Usually package name or process cmdline.
4701 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004702 optional string process_name = 2;
4703
Rafal Slawik239b6802019-09-09 18:46:01 +01004704 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4705 // computed by converting kilobytes to bytes.
4706 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4707
Rafal Slawik3bea8952018-11-15 12:39:33 +00004708 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4709 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004710 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004711}
4712
4713/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004714 * Logs the memory stats for a process.
4715 *
4716 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4717 * and for selected native processes.
4718 */
4719message ProcessMemorySnapshot {
4720 // The uid if available. -1 means not available.
4721 optional int32 uid = 1 [(is_uid) = true];
4722
4723 // The process name.
4724 // Usually package name or process cmdline.
4725 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4726 optional string process_name = 2;
4727
4728 // The pid of the process.
4729 // Allows to disambiguate instances of the process.
4730 optional int32 pid = 3;
4731
4732 // The current OOM score adjustment value.
4733 // Read from ProcessRecord for managed processes.
4734 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4735 optional int32 oom_score_adj = 4;
4736
4737 // The current RSS of the process.
4738 // VmRSS from /proc/pid/status.
4739 optional int32 rss_in_kilobytes = 5;
4740
4741 // The current anon RSS of the process.
4742 // RssAnon from /proc/pid/status.
4743 optional int32 anon_rss_in_kilobytes = 6;
4744
4745 // The current swap size of the process.
4746 // VmSwap from /proc/pid/status.
4747 optional int32 swap_in_kilobytes = 7;
4748
4749 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4750 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4751}
4752
4753/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004754 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004755 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004756message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004757 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004758}
4759
4760/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004761 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004762 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004763message SystemUptime {
4764 // Milliseconds since the system was booted.
4765 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4766 // for external input).
4767 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004768 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004769}
4770
4771/*
4772 * Reads from /proc/uid_concurrent_active_time which has the format:
4773 * active: X (X is # cores)
4774 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4775 * [uid1]: [time-0] [time-1] [time-2] ... ...
4776 * ...
4777 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4778 * The file contains a monotonically increasing count of time for a single boot.
4779 */
4780message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004781 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004782 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004783}
4784
4785/**
4786 * Reads from /proc/uid_concurrent_policy_time which has the format:
4787 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4788 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4789 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4790 * ...
4791 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4792 * The file contains a monotonically increasing count of time for a single boot.
4793 */
4794message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004795 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004796 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004797 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004798}
4799
4800/*
4801 * Pulls free disk space, for data, system partition and temporary directory.
4802 */
4803message DiskSpace {
4804 // available bytes in data partition
4805 optional uint64 data_available_bytes = 1;
4806 // available bytes in system partition
4807 optional uint64 system_available_bytes = 2;
4808 // available bytes in download cache or temp directories
4809 optional uint64 temp_available_bytes = 3;
4810}
Tej Singhbf972d92018-01-10 20:51:13 -08004811
4812/**
4813 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004814 *
4815 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004816 */
4817message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004818 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004819}
4820
4821/**
4822 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004823 * Pulled from:
4824 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004825 */
4826message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004827 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004828}
4829
4830/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004831 * Pulls battery voltage.
4832 * Pulled from:
4833 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4834 */
4835message BatteryVoltage {
4836 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004837 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004838}
4839
4840/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004841 * Pulls battery level (percent full, from 0 to 100).
4842 *
4843 * Pulled from:
4844 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4845 */
4846message BatteryLevel {
4847 // Battery level. Should be in [0, 100].
4848 optional int32 battery_level = 1;
4849}
4850
4851/**
Tej Singhd89137e2018-03-26 14:51:40 -07004852 * Pulls the temperature of various parts of the device.
4853 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004854 *
Maggie White442b6312019-04-05 16:26:44 -07004855 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004856 */
4857message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004858 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004859 optional android.os.TemperatureTypeEnum sensor_location = 1;
4860
4861 // The name of the temperature source. Eg. CPU0
4862 optional string sensor_name = 2;
4863
Tej Singhd89137e2018-03-26 14:51:40 -07004864 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004865 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004866 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004867
4868 // Relative severity of the throttling, see enum definition.
4869 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004870}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004871
4872/**
4873 * Pulls the statistics of calls to Binder.
4874 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004875 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4876 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004877 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004878 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004879 */
4880message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004881 // UID of the process responsible for the binder transaction. It will be set if the process
4882 // executing the binder transaction attribute the transaction to another uid using
4883 // Binder.setThreadWorkSource().
4884 //
4885 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004886 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004887 // UID of the process executing the binder transaction.
4888 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004889 // Fully qualified class name of the API call.
4890 //
4891 // This is a system server class name.
4892 //
4893 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4894 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4895 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4896 // commonly used APIs.
4897 optional string service_class_name = 2;
4898 // Method name of the API call. It can also be a transaction code if we cannot
4899 // resolve it to a name. See Binder#getTransactionName.
4900 //
4901 // This is a system server method name.
4902 optional string service_method_name = 3;
4903 // Total number of API calls.
4904 optional int64 call_count = 4;
4905 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4906 optional bool screen_interactive = 13;
4907 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4908 // call_count will be equal to recorded_call_count.
4909 //
4910 // If recorded_call_count is different than call_count, it means data collection has been
4911 // sampled. All the fields below will be sampled in this case.
4912 optional int64 recorded_call_count = 12;
4913 // Number of exceptions thrown by the API.
4914 optional int64 recorded_exception_count = 5;
4915 // Total latency of all API calls.
4916 // Average can be computed using total_latency_micros / recorded_call_count.
4917 optional int64 recorded_total_latency_micros = 6;
4918 // Maximum latency of one API call.
4919 optional int64 recorded_max_latency_micros = 7;
4920 // Total CPU usage of all API calls.
4921 // Average can be computed using total_cpu_micros / recorded_call_count.
4922 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4923 optional int64 recorded_total_cpu_micros = 8;
4924 // Maximum CPU usage of one API call.
4925 optional int64 recorded_max_cpu_micros = 9;
4926 // Maximum parcel reply size of one API call.
4927 optional int64 recorded_max_reply_size_bytes = 10;
4928 // Maximum parcel request size of one API call.
4929 optional int64 recorded_max_request_size_bytes = 11;
4930}
4931
4932/**
4933 * Pulls the statistics of exceptions during calls to Binder.
4934 *
4935 * Binder stats are cumulative from boot unless somebody reset the data using
4936 * > adb shell dumpsys binder_calls_stats --reset
4937 */
4938message BinderCallsExceptions {
4939 // Exception class name, e.g. java.lang.IllegalArgumentException.
4940 //
4941 // This is an exception class name thrown by the system server.
4942 optional string exception_class_name = 1;
4943 // Total number of exceptions.
4944 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004945}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004946
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004947/**
4948 * Pulls the statistics of message dispatching on HandlerThreads.
4949 *
4950 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4951 * config on the device.
4952 *
4953 * Next tag: 11
4954 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004955message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004956 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004957 optional int32 uid = 1 [(is_uid) = true];
4958
4959 // Fully qualified class name of the handler target class.
4960 //
4961 // This field does not contain PII. This is a system server class name.
4962 optional string handler_class_name = 2;
4963
4964 // The name of the thread that runs the Looper.
4965 //
4966 // This field does not contain PII. This is a system server thread name.
4967 optional string looper_thread_name = 3;
4968
4969 // The name of the dispatched message.
4970 //
4971 // This field does not contain PII. This is a system server constant or class
4972 // name.
4973 optional string message_name = 4;
4974
4975 // Total number of successfully dispatched messages.
4976 optional int64 message_count = 5;
4977
4978 // Total number of messages that failed dispatching.
4979 optional int64 exception_count = 6;
4980
4981 // Total number of processed messages we have data recorded for. If we
4982 // collected data for all the messages, message_count will be equal to
4983 // recorded_message_count.
4984 //
4985 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004986 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004987 optional int64 recorded_message_count = 7;
4988
4989 // Total latency of all processed messages.
4990 // Average can be computed using recorded_total_latency_micros /
4991 // recorded_message_count.
4992 optional int64 recorded_total_latency_micros = 8;
4993
4994 // Total CPU usage of all processed message.
4995 // Average can be computed using recorded_total_cpu_micros /
4996 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004997 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004998 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004999
5000 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5001 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005002
5003 // Max recorded CPU usage of all processed messages.
5004 optional int64 recorded_max_cpu_micros = 11;
5005
5006 // Max recorded latency of all processed messages.
5007 optional int64 recorded_max_latency_micros = 12;
5008
5009 // Total number of messages we tracked the dispatching delay for. If we
5010 // collected data for all the messages, message_count will be equal to
5011 // recorded_delay_message_count.
5012 //
5013 // If recorded_delay_message_count is different than message_count, it means data
5014 // collection has been sampled or/and not all messages specified the target dispatch time.
5015 // The fields below will be sampled in this case.
5016 optional int64 recorded_delay_message_count = 13;
5017
5018 // Total dispatching delay of all processed messages.
5019 // Calculated as a difference between the target dispatching time (Message.when)
5020 // and the actual dispatching time.
5021 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5022 optional int64 recorded_total_delay_millis = 14;
5023
5024 // Max dispatching delay of all processed messages.
5025 // Calculated as a difference between the target dispatching time (Message.when)
5026 // and the actual dispatching time.
5027 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005028}
Tej Singh86dc9db2018-09-06 00:39:57 +00005029
5030/**
5031 * Pulls disk information, such as write speed and latency.
5032 */
5033message DiskStats {
5034 // Time taken to open, write 512B to, and close a file.
5035 // -1 if error performing the check.
5036 optional int64 data_write_latency_millis = 1;
5037
5038 optional bool file_based_encryption = 2;
5039
5040 // Recent disk write speed in kB/s.
5041 // -1 if error querying storageed.
5042 // 0 if data is unavailable.
5043 optional int32 recent_disk_write_speed = 3;
5044}
5045
5046
5047/**
5048 * Free and total bytes of the Data, Cache, and System partition.
5049 */
5050message DirectoryUsage {
5051 enum Directory {
5052 UNKNOWN = 0;
5053 DATA = 1;
5054 CACHE = 2;
5055 SYSTEM = 3;
5056 }
5057 optional Directory directory = 1;
5058 optional int64 free_bytes = 2;
5059 optional int64 total_bytes = 3;
5060}
5061
5062
5063/**
5064 * Size of an application: apk size, data size, and cache size.
5065 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5066 * Information is only reported for apps with the primary user (user 0).
5067 * Sizes are aggregated by package name.
5068 */
5069message AppSize {
5070 // Including uids will involve modifying diskstats logic.
5071 optional string package_name = 1;
5072 // App size in bytes. -1 if unavailable.
5073 optional int64 app_size_bytes = 2;
5074 // App data size in bytes. -1 if unavailable.
5075 optional int64 app_data_size_bytes = 3;
5076 // App cache size in bytes. -1 if unavailable.
5077 optional int64 app_cache_size_bytes = 4;
5078 // Time that the cache file was produced.
5079 // Uses System.currentTimeMillis(), which is wall clock time.
5080 optional int64 cache_time_millis = 5;
5081}
5082
5083
5084/**
5085 * Size of a particular category. Eg: photos, videos.
5086 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5087 */
5088message CategorySize {
5089 enum Category {
5090 UNKNOWN = 0;
5091 APP_SIZE = 1;
5092 APP_DATA_SIZE = 2;
5093 APP_CACHE_SIZE = 3;
5094 PHOTOS = 4;
5095 VIDEOS = 5;
5096 AUDIO = 6;
5097 DOWNLOADS = 7;
5098 SYSTEM = 8;
5099 OTHER = 9;
5100 }
5101 optional Category category = 1;
5102 // Category size in bytes.
5103 optional int64 size_bytes = 2;
5104 // Time that the cache file was produced.
5105 // Uses System.currentTimeMillis(), which is wall clock time.
5106 optional int64 cache_time_millis = 3;
5107}
Tej Singhd6d6d772018-09-05 17:41:25 -07005108
5109/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005110 * Pulls per uid I/O stats. The stats are cumulative since boot.
5111 *
5112 * Read/write bytes are I/O events from a storage device
5113 * Read/write chars are data requested by read/write syscalls, and can be
5114 * satisfied by caching.
5115 *
5116 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5117 */
5118message DiskIo {
5119 optional int32 uid = 1 [(is_uid) = true];
5120 optional int64 fg_chars_read = 2;
5121 optional int64 fg_chars_write = 3;
5122 optional int64 fg_bytes_read = 4;
5123 optional int64 fg_bytes_write = 5;
5124 optional int64 bg_chars_read = 6;
5125 optional int64 bg_chars_write = 7;
5126 optional int64 bg_bytes_read = 8;
5127 optional int64 bg_bytes_write = 9;
5128 optional int64 fg_fsync = 10;
5129 optional int64 bg_fsync= 11;
5130}
5131
5132
5133/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005134 * Pulls the number of fingerprints for each user.
5135 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005136 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005137 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005138message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005139 // The associated user. Eg: 0 for owners, 10+ for others.
5140 // Defined in android/os/UserHandle.java
5141 optional int32 user = 1;
5142 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005143 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005144}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005145
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005146/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005147 * Pulls the number of faces for each user.
5148 *
5149 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5150 */
5151message NumFacesEnrolled {
5152 // The associated user. Eg: 0 for owners, 10+ for others.
5153 // Defined in android/os/UserHandle.java
5154 optional int32 user = 1;
5155 // Number of faces registered to that user.
5156 optional int32 num_faces_enrolled = 2;
5157}
5158/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005159 * A mapping of role holder -> role
5160 */
5161message RoleHolder {
5162 // uid of the role holder
5163 optional int32 uid = 1 [(is_uid) = true];
5164
5165 // package name of the role holder
5166 optional string package_name = 2;
5167
5168 // the role held
5169 optional string role = 3;
5170}
5171
Yangsteraf9aee72018-10-12 09:26:16 -07005172message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005173 // These are all in byte resolution.
5174 optional int64 min = 1 [deprecated = true];
5175 optional int64 average = 2 [deprecated = true];
5176 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005177
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005178 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5179 // int64 fields.
5180 optional int32 mean_kb = 4;
5181 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005182}
5183
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005184// A reduced subset of process states; reducing the number of possible states allows more
5185// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5186enum ProcessStateAggregated {
5187 PROCESS_STATE_UNKNOWN = 0;
5188 // Persistent system process.
5189 PROCESS_STATE_PERSISTENT = 1;
5190 // Top activity; actually any visible activity.
5191 PROCESS_STATE_TOP = 2;
5192 // Process binding to top or a foreground service.
5193 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5194 // Processing running a foreground service.
5195 PROCESS_STATE_FGS = 4;
5196 // Important foreground process (ime, wallpaper, etc).
5197 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5198 // Important background process.
5199 PROCESS_STATE_BACKGROUND = 6;
5200 // Process running a receiver.
5201 PROCESS_STATE_RECEIVER = 7;
5202 // All kinds of cached processes.
5203 PROCESS_STATE_CACHED = 8;
5204}
5205
5206// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005207message ProcessStatsStateProto {
5208 optional android.service.procstats.ScreenState screen_state = 1;
5209
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005210 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005211
5212 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5213 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005214 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5215
5216 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005217
5218 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005219 optional int64 duration_millis = 4 [deprecated = true];
5220 // Same as above, but with minute resolution so it fits into an int32.
5221 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005222
5223 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005224 optional int64 realtime_duration_millis = 9 [deprecated = true];
5225 // Same as above, but with minute resolution so it fits into an int32.
5226 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005227
5228 // # of samples taken
5229 optional int32 sample_size = 5;
5230
5231 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005232 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005233
5234 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005235 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005236
5237 // RSS is memory resident for this process
5238 optional AggStats rss = 8;
5239}
5240
5241// Next Tag: 7
5242message ProcessStatsProto {
5243 // Name of process.
5244 optional string process = 1;
5245
5246 // Uid of the process.
5247 optional int32 uid = 2;
5248
5249 // Information about how often kills occurred
5250 message Kill {
5251 // Count of excessive CPU kills
5252 optional int32 cpu = 1;
5253
5254 // Count of kills when cached
5255 optional int32 cached = 2;
5256
5257 // PSS stats during cached kill
5258 optional AggStats cached_pss = 3;
5259 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005260 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005261
5262 // Time and memory spent in various states.
5263 repeated ProcessStatsStateProto states = 5;
5264
5265 // Total time process has been running... screen_state, memory_state, and process_state
5266 // will not be set.
5267 optional ProcessStatsStateProto total_running_state = 6;
5268}
5269
5270message PackageServiceOperationStatsProto {
5271 // Operate enum: Started, Foreground, Bound, Executing
5272 optional android.service.procstats.ServiceOperationState operation = 1;
5273
5274 // Number of times the service was in this operation.
5275 optional int32 count = 2;
5276
5277 // Information about a state the service can be in.
5278 message StateStats {
5279 // Screen state enum.
5280 optional android.service.procstats.ScreenState screen_state = 1;
5281 // Memory state enum.
5282 optional android.service.procstats.MemoryState memory_state = 2;
5283
5284 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005285 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005286 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005287 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005288 }
5289 repeated StateStats state_stats = 3;
5290}
5291
5292message PackageServiceStatsProto {
5293 // Name of service component.
5294 optional string service_name = 1;
5295
5296 // The operation stats.
5297 // The package_name, package_uid, package_version, service_name will not be set to save space.
5298 repeated PackageServiceOperationStatsProto operation_stats = 2;
5299}
5300
5301message PackageAssociationSourceProcessStatsProto {
5302 // Uid of the process.
5303 optional int32 process_uid = 1;
5304 // Process name.
5305 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005306 // Package name.
5307 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005308 // Total count of the times this association appeared.
5309 optional int32 total_count = 3;
5310
5311 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005312 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005313
5314 // Total count of the times this association became actively impacting its target process.
5315 optional int32 active_count = 5;
5316
5317 // Information on one source in this association.
5318 message StateStats {
5319 // Process state enum.
5320 optional android.service.procstats.ProcessState process_state = 1;
5321 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005322 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005323 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005324 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005325 }
5326 repeated StateStats active_state_stats = 6;
5327}
5328
5329message PackageAssociationProcessStatsProto {
5330 // Name of the target component.
5331 optional string component_name = 1;
5332 // Information on one source in this association.
5333 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5334}
5335
5336
5337message ProcessStatsPackageProto {
5338 // Name of package.
5339 optional string package = 1;
5340
5341 // Uid of the package.
5342 optional int32 uid = 2;
5343
5344 // Version of the package.
5345 optional int64 version = 3;
5346
5347 // Stats for each process running with the package loaded in to it.
5348 repeated ProcessStatsProto process_stats = 4;
5349
5350 // Stats for each of the package's services.
5351 repeated PackageServiceStatsProto service_stats = 5;
5352
5353 // Stats for each association with the package.
5354 repeated PackageAssociationProcessStatsProto association_stats = 6;
5355}
5356
5357message ProcessStatsSectionProto {
5358 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005359 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005360
5361 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005362 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005363
5364 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005365 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005366
5367 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005368 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005369
5370 // System runtime library. e.g. "libdvm.so", "libart.so".
5371 optional string runtime = 5;
5372
5373 // whether kernel reports swapped pss.
5374 optional bool has_swapped_pss = 6;
5375
5376 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5377 enum Status {
5378 STATUS_UNKNOWN = 0;
5379 STATUS_COMPLETE = 1;
5380 STATUS_PARTIAL = 2;
5381 STATUS_SHUTDOWN = 3;
5382 STATUS_SYSPROPS = 4;
5383 }
5384 repeated Status status = 7;
5385
Chenjie Yub2ecc792019-01-17 10:27:26 -08005386 // Number of pages available of various types and sizes, representation fragmentation.
5387 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5388
Yangsteraf9aee72018-10-12 09:26:16 -07005389 // Stats for each process.
5390 repeated ProcessStatsProto process_stats = 8;
5391
5392 // Stats for each package.
5393 repeated ProcessStatsPackageProto package_stats = 9;
5394}
5395
Chenjie Yub2ecc792019-01-17 10:27:26 -08005396message ProcessStatsAvailablePagesProto {
5397 // Node these pages are in (as per /proc/pagetypeinfo)
5398 optional int32 node = 1;
5399
5400 // Zone these pages are in (as per /proc/pagetypeinfo)
5401 optional string zone = 2;
5402
5403 // Label for the type of these pages (as per /proc/pagetypeinfo)
5404 optional string label = 3;
5405
5406 // Distribution of number of pages available by order size. First entry in array is
5407 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5408 repeated int32 pages_per_order = 4;
5409}
5410
Chenjie Yu12e5e672018-09-14 15:54:59 -07005411/**
5412 * Pulled from ProcessStatsService.java
5413 */
5414message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005415 optional ProcessStatsSectionProto proc_stats_section = 1;
5416}
5417
Chenjie Yuf910b7802019-01-11 16:08:20 -08005418/**
5419 * Pulled from ProcessStatsService.java
5420 */
5421message ProcStatsPkgProc {
5422 optional ProcessStatsSectionProto proc_stats_section = 1;
5423}
5424
Chris Wrencdea3b72019-11-22 16:58:17 -05005425// Next Tag: 2
5426message PackageRemoteViewInfoProto {
5427 optional string package_name = 1;
5428 // add per-package additional info here (like channels)
5429}
5430
5431// Next Tag: 2
5432message NotificationRemoteViewsProto {
5433 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5434}
5435
5436/**
5437 * Pulled from NotificationManagerService.java
5438 */
5439message NotificationRemoteViews {
5440 optional NotificationRemoteViewsProto notification_remote_views = 1;
5441}
5442
Yangsteraf9aee72018-10-12 09:26:16 -07005443message PowerProfileProto {
5444 optional double cpu_suspend = 1;
5445
5446 optional double cpu_idle = 2;
5447
5448 optional double cpu_active = 3;
5449
5450 message CpuCluster {
5451 optional int32 id = 1;
5452 optional double cluster_power = 2;
5453 optional int32 cores = 3;
5454 repeated int64 speed = 4;
5455 repeated double core_power = 5;
5456 }
5457
5458 repeated CpuCluster cpu_cluster = 40;
5459
5460 optional double wifi_scan = 4;
5461
5462 optional double wifi_on = 5;
5463
5464 optional double wifi_active = 6;
5465
5466 optional double wifi_controller_idle = 7;
5467
5468 optional double wifi_controller_rx = 8;
5469
5470 optional double wifi_controller_tx = 9;
5471
5472 repeated double wifi_controller_tx_levels = 10;
5473
5474 optional double wifi_controller_operating_voltage = 11;
5475
5476 optional double bluetooth_controller_idle = 12;
5477
5478 optional double bluetooth_controller_rx = 13;
5479
5480 optional double bluetooth_controller_tx = 14;
5481
5482 optional double bluetooth_controller_operating_voltage = 15;
5483
5484 optional double modem_controller_sleep = 16;
5485
5486 optional double modem_controller_idle = 17;
5487
5488 optional double modem_controller_rx = 18;
5489
5490 repeated double modem_controller_tx = 19;
5491
5492 optional double modem_controller_operating_voltage = 20;
5493
5494 optional double gps_on = 21;
5495
5496 repeated double gps_signal_quality_based = 22;
5497
5498 optional double gps_operating_voltage = 23;
5499
5500 optional double bluetooth_on = 24;
5501
5502 optional double bluetooth_active = 25;
5503
5504 optional double bluetooth_at_cmd = 26;
5505
5506 optional double ambient_display = 27;
5507
5508 optional double screen_on = 28;
5509
5510 optional double radio_on = 29;
5511
5512 optional double radio_scanning = 30;
5513
5514 optional double radio_active = 31;
5515
5516 optional double screen_full = 32;
5517
5518 optional double audio = 33;
5519
5520 optional double video = 34;
5521
5522 optional double flashlight = 35;
5523
5524 optional double memory = 36;
5525
5526 optional double camera = 37;
5527
5528 optional double wifi_batched_scan = 38;
5529
5530 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005531}
Chenjie Yuab530202018-09-26 12:39:20 -07005532
5533/**
5534 * power_profile.xml and other constants for power model calculations.
5535 * Pulled from PowerProfile.java
5536 */
5537message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005538 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005539}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005540
5541/**
arangelovd5db50e2018-10-12 20:24:39 +01005542 * Logs when a user restriction was added or removed.
5543 *
5544 * Logged from:
5545 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5546 */
5547message UserRestrictionChanged {
5548 // The raw string of the user restriction as defined in UserManager.
5549 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5550 optional string restriction = 1;
5551 // Whether the restriction is enabled or disabled.
5552 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005553}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005554
5555/**
5556 * Pulls process user time and system time. Puller takes a snapshot of all pids
5557 * in the system and returns cpu stats for those that are working at the time.
5558 * Dead pids will be dropped. Kernel processes are excluded.
5559 * Min cool-down is 5 sec.
5560 */
5561message ProcessCpuTime {
5562 optional int32 uid = 1 [(is_uid) = true];
5563
5564 optional string process_name = 2;
5565 // Process cpu time in user space, cumulative from boot/process start
5566 optional int64 user_time_millis = 3;
5567 // Process cpu time in system space, cumulative from boot/process start
5568 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005569}
Misha Wagner5a51e002018-10-03 15:04:09 +01005570
5571/**
5572 * Pulls the CPU usage for each thread.
5573 *
5574 * Read from /proc/$PID/task/$TID/time_in_state files.
5575 *
5576 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5577 * time_in_state files not being present on some phones, have not been addressed. These should be
5578 * considered before a public release.
5579 */
5580message CpuTimePerThreadFreq {
5581 // UID that owns the process.
5582 optional int32 uid = 1 [(is_uid) = true];
5583 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005584 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005585 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005586 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005587 // Name of the process taken from `/proc/$PID/cmdline`.
5588 optional string process_name = 4;
5589 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5590 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005591
5592 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5593 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5594 // frequencies are given here as the alternative is sending eight separate atoms. This method
5595 // significantly reduces the amount of data created
5596 optional int32 frequency1_khz = 6;
5597 optional int32 time1_millis = 7;
5598 optional int32 frequency2_khz = 8;
5599 optional int32 time2_millis = 9;
5600 optional int32 frequency3_khz = 10;
5601 optional int32 time3_millis = 11;
5602 optional int32 frequency4_khz = 12;
5603 optional int32 time4_millis = 13;
5604 optional int32 frequency5_khz = 14;
5605 optional int32 time5_millis = 15;
5606 optional int32 frequency6_khz = 16;
5607 optional int32 time6_millis = 17;
5608 optional int32 frequency7_khz = 18;
5609 optional int32 time7_millis = 19;
5610 optional int32 frequency8_khz = 20;
5611 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005612}
Bookatz75ee6042018-11-09 12:27:37 -08005613
5614/**
Bookatz366a4432018-11-20 09:42:33 -08005615 * Pulls information about the device's build.
5616 */
5617message BuildInformation {
5618 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5619 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5620 optional string fingerprint = 1;
5621
5622 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5623 optional string brand = 2;
5624
5625 // Build.PRODUCT. The name of the overall product.
5626 optional string product = 3;
5627
5628 // Build.DEVICE. The name of the industrial design.
5629 optional string device = 4;
5630
5631 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5632 optional string version_release = 5;
5633
5634 // Build.ID. E.g. a label like "M4-rc20".
5635 optional string id = 6;
5636
5637 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5638 // represent this build.
5639 optional string version_incremental = 7;
5640
5641 // Build.TYPE. The type of build, like "user" or "eng".
5642 optional string type = 8;
5643
5644 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5645 optional string tags = 9;
5646}
5647
5648/**
Adam He420947c2019-01-23 15:59:09 -08005649 * Logs information about mismatched caller for content capture.
5650 *
5651 * Logged from:
5652 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5653 */
5654message ContentCaptureCallerMismatchReported {
5655 optional string intended_package = 1;
5656 optional string calling_package = 2;
5657}
5658
5659/**
5660 * Logs information about content capture service events.
5661 *
5662 * Logged from:
5663 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5664 */
5665message ContentCaptureServiceEvents {
5666 // The type of event.
5667 enum Event {
5668 UNKNOWN = 0;
5669 ON_CONNECTED = 1;
5670 ON_DISCONNECTED = 2;
5671 SET_WHITELIST = 3;
5672 SET_DISABLED = 4;
5673 ON_USER_DATA_REMOVED = 5;
5674 }
5675 optional Event event = 1;
5676 // component/package of content capture service.
5677 optional string service_info = 2;
5678 // component/package of target.
5679 // it's a concatenated list of component/package for SET_WHITELIST event
5680 // separated by " ".
5681 optional string target_info = 3;
5682}
5683
5684/**
5685 * Logs information about content capture session events.
5686 *
5687 * Logged from:
5688 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5689 */
5690message ContentCaptureSessionEvents {
5691 // The type of event.
5692 enum Event {
5693 UNKNOWN = 0;
5694 ON_SESSION_STARTED = 1;
5695 ON_SESSION_FINISHED = 2;
5696 SESSION_NOT_CREATED = 3;
5697 }
5698 optional int32 session_id = 1;
5699 optional Event event = 2;
5700 // (n/a on session finished)
5701 optional int32 state_flags = 3;
5702 // component/package of content capture service.
5703 optional string service_info = 4;
5704 // component/package of app.
5705 // (n/a on session finished)
5706 optional string app_info = 5;
5707 optional bool is_child_session = 6;
5708}
5709
5710/**
5711 * Logs information about session being flushed.
5712 *
5713 * Logged from:
5714 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5715 */
5716message ContentCaptureFlushed {
5717 optional int32 session_id = 1;
5718 // component/package of content capture service.
5719 optional string service_info = 2;
5720 // component/package of app.
5721 optional string app_info = 3;
5722 // session start/finish events
5723 optional int32 child_session_started = 4;
5724 optional int32 child_session_finished = 5;
5725 // count of view events.
5726 optional int32 view_appeared_count = 6;
5727 optional int32 view_disappeared_count = 7;
5728 optional int32 view_text_changed_count = 8;
5729
5730 // Flush stats.
5731 optional int32 max_events = 9;
5732 optional int32 idle_flush_freq = 10;
5733 optional int32 text_flush_freq = 11;
5734 optional int32 flush_reason = 12;
5735}
5736
5737/**
Bookatz75ee6042018-11-09 12:27:37 -08005738 * Pulls on-device BatteryStats power use calculations for the overall device.
5739 */
5740message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005741 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5742 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5743 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5744 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005745}
5746
5747/**
5748 * Pulls on-device BatteryStats power use calculations broken down by uid.
5749 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5750 * that is attributed to non-uid items. They must all be included to get the total power use.
5751 */
5752message DeviceCalculatedPowerBlameUid {
5753 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5754 optional int32 uid = 1 [(is_uid) = true];
5755
Bookatz3dbc13a2018-12-21 12:16:51 -08005756 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5757 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5758 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005759}
5760
5761/**
5762 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5763 * drain type.
5764 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5765 * is attributed uids. They must all be included to get the total power use.
5766 */
5767message DeviceCalculatedPowerBlameOther {
5768 // The type of item whose power use is being reported.
5769 enum DrainType {
5770 AMBIENT_DISPLAY = 0;
5771 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5772 BLUETOOTH = 2;
5773 CAMERA = 3;
5774 // Cell-standby
5775 CELL = 4;
5776 FLASHLIGHT = 5;
5777 IDLE = 6;
5778 MEMORY = 7;
5779 // Amount that total computed drain exceeded the drain estimated using the
5780 // battery level changes and capacity.
5781 OVERCOUNTED = 8;
5782 PHONE = 9;
5783 SCREEN = 10;
5784 // Amount that total computed drain was below the drain estimated using the
5785 // battery level changes and capacity.
5786 UNACCOUNTED = 11;
5787 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5788 WIFI = 13;
5789 }
5790 optional DrainType drain_type = 1;
5791
Bookatz3dbc13a2018-12-21 12:16:51 -08005792 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5793 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5794 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005795}
arangelov4e994062018-11-13 16:12:38 +00005796
5797/**
5798 * Logs device policy features.
5799 *
5800 * Logged from:
5801 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5802 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5803 */
5804message DevicePolicyEvent {
5805 // The event id - unique for each event.
5806 optional android.stats.devicepolicy.EventId event_id = 1;
5807 // The admin package name.
5808 optional string admin_package_name = 2;
5809 // A generic integer parameter.
5810 optional int32 integer_value = 3;
5811 // A generic boolean parameter.
5812 optional bool boolean_value = 4;
5813 // A parameter specifying a time period in milliseconds.
5814 optional uint64 time_period_millis = 5;
5815 // A parameter specifying a list of package names, bundle extras or string parameters.
5816 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5817}
shawnlinea5b66b2018-11-13 15:05:29 +08005818
5819/**
5820 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5821 *
5822 * Logged from:
5823 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5824 */
5825message DocsUILaunchReported {
5826 optional android.stats.docsui.LaunchAction launch_action = 1;
5827 optional bool has_initial_uri = 2;
5828 optional android.stats.docsui.MimeType mime_type = 3;
5829 optional android.stats.docsui.Root initial_root = 4;
5830}
5831
5832/**
5833 * Logs root/app visited event in file managers/picker. Call this when the user
5834 * taps on root/app in hamburger menu.
5835 *
5836 * Logged from:
5837 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5838 */
5839message DocsUIRootVisitedReported {
5840 optional android.stats.docsui.ContextScope scope = 1;
5841 optional android.stats.docsui.Root root = 2;
5842}
5843
5844/**
5845 * Logs file operation stats. Call this when a file operation has completed.
5846 *
5847 * Logged from:
5848 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5849 */
5850message DocsUIFileOperationReported {
5851 optional android.stats.docsui.Provider provider = 1;
5852 optional android.stats.docsui.FileOperation file_op = 2;
5853}
5854
5855/**
5856 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5857 * mode.
5858 *
5859 * Logged from:
5860 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5861 */
5862message DocsUIFileOperationCopyMoveModeReported {
5863 optional android.stats.docsui.FileOperation file_op = 1;
5864 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5865}
5866
5867
5868/**
5869 * Logs file sub operation stats. Call this when a file operation has failed.
5870 *
5871 * Logged from:
5872 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5873 */
5874message DocsUIFileOperationFailureReported {
5875 optional android.stats.docsui.Authority authority = 1;
5876 optional android.stats.docsui.SubFileOperation sub_op = 2;
5877}
5878
5879/**
5880* Logs the cancellation of a file operation. Call this when a job is canceled
5881*
5882* Logged from:
5883* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5884*/
5885message DocsUIFileOperationCanceledReported {
5886 optional android.stats.docsui.FileOperation file_op = 1;
5887}
5888
5889/**
5890 * Logs startup time in milliseconds.
5891 *
5892 * Logged from:
5893 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5894 */
5895message DocsUIStartupMsReported {
5896 optional int32 startup_millis = 1;
5897}
5898
5899/**
5900 * Logs the action that was started by user.
5901 *
5902 * Logged from:
5903 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5904 */
5905message DocsUIUserActionReported {
5906 optional android.stats.docsui.UserAction action = 1;
5907}
5908
5909/**
5910 * Logs the invalid type when invalid scoped access is requested.
5911 *
5912 * Logged from:
5913 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5914 */
5915message DocsUIInvalidScopedAccessRequestReported {
5916 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005917}
Ben Murdochbab399f2018-12-06 11:01:38 +00005918
5919/**
shawnlina75e82d2019-01-07 10:31:12 +08005920 * Logs the package name that launches docsui picker mode.
5921 *
5922 * Logged from:
5923 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5924 */
5925message DocsUIPickerLaunchedFromReported {
5926 optional string package_name = 1;
5927}
5928
5929/**
5930 * Logs the search type.
5931 *
5932 * Logged from:
5933 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5934 */
5935message DocsUISearchTypeReported {
5936 optional android.stats.docsui.SearchType search_type = 1;
5937}
5938
5939/**
5940 * Logs the search mode.
5941 *
5942 * Logged from:
5943 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5944 */
5945message DocsUISearchModeReported {
5946 optional android.stats.docsui.SearchMode search_mode = 1;
5947}
5948
5949/**
5950 * Logs the pick result information.
5951 *
5952 * Logged from:
5953 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5954 */
5955message DocsUIPickResultReported {
5956 optional int32 total_action_count = 1;
5957 optional int64 duration_millis = 2;
5958 optional int32 file_count= 3;
5959 optional bool is_searching = 4;
5960 optional android.stats.docsui.Root picked_from = 5;
5961 optional android.stats.docsui.MimeType mime_type = 6;
5962 optional int32 repeatedly_pick_times = 7;
5963}
5964
5965/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005966 * Logs when an app's memory is compacted.
5967 *
5968 * Logged from:
5969 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5970 */
5971message AppCompacted {
5972 // The pid of the process being compacted.
5973 optional int32 pid = 1;
5974
5975 // The name of the process being compacted.
5976 optional string process_name = 2;
5977
5978 // The type of compaction.
5979 enum Action {
5980 UNKNOWN = 0;
5981 SOME = 1;
5982 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005983 PERSISTENT = 3;
5984 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005985 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005986 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005987
5988 // Total RSS in kilobytes consumed by the process prior to compaction.
5989 optional int64 before_rss_total_kilobytes = 4;
5990
5991 // File RSS in kilobytes consumed by the process prior to compaction.
5992 optional int64 before_rss_file_kilobytes = 5;
5993
5994 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5995 optional int64 before_rss_anon_kilobytes = 6;
5996
5997 // Swap in kilobytes consumed by the process prior to compaction.
5998 optional int64 before_swap_kilobytes = 7;
5999
6000 // Total RSS in kilobytes consumed by the process after compaction.
6001 optional int64 after_rss_total_kilobytes = 8;
6002
6003 // File RSS in kilobytes consumed by the process after compaction.
6004 optional int64 after_rss_file_kilobytes = 9;
6005
6006 // Anonymous RSS in kilobytes consumed by the process after compaction.
6007 optional int64 after_rss_anon_kilobytes = 10;
6008
6009 // Swap in kilobytes consumed by the process after compaction.
6010 optional int64 after_swap_kilobytes = 11;
6011
6012 // The time taken to perform compaction in milliseconds.
6013 optional int64 time_to_compact_millis = 12;
6014
6015 // The last compaction action performed for this app.
6016 optional Action last_action = 13;
6017
Ben Murdoch01720b82018-12-19 18:03:44 +00006018 // The last time that compaction was attempted on this process in milliseconds
6019 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6020 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006021
Ben Murdoch885c21b2019-03-15 18:02:04 +00006022 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006023 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006024
6025 // The process state at the time of compaction.
6026 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006027
6028 // Free ZRAM in kilobytes before compaction.
6029 optional int64 before_zram_free_kilobytes = 17;
6030
6031 // Free ZRAM in kilobytes after compaction.
6032 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006033}
lifr157fc552018-12-12 16:38:04 +08006034
6035/**
lifrb6b90b62019-03-29 00:40:17 +08006036 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6037 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6038 *
lifr1f74b052019-04-16 22:16:30 +08006039 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6040 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6041 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6042 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006043 */
6044message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006045 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006046
lifr1f74b052019-04-16 22:16:30 +08006047 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006048
6049 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006050 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006051
lifr1f74b052019-04-16 22:16:30 +08006052 // Only valid for event_type = EVENT_GETADDRINFO.
6053 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006054
lifr1f74b052019-04-16 22:16:30 +08006055 // Flags passed to android_res_nsend() defined in multinetwork.h
6056 // Only valid for event_type = EVENT_RESNSEND.
6057 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006058
lifrad9becc2019-05-20 11:04:41 +08006059 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006060
6061 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006062 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006063
6064 // Additional pass-through fields opaque to statsd.
6065 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006066 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006067
6068 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6069 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006070}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006071
6072/**
6073 * Logs when a data stall event occurs.
6074 *
6075 * Log from:
6076 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6077 */
6078message DataStallEvent {
6079 // Data stall evaluation type.
6080 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6081 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6082 optional int32 evaluation_type = 1;
6083 // See definition in data_stall_event.proto.
6084 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6085 // See definition in data_stall_event.proto.
6086 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6087 // See definition in data_stall_event.proto.
6088 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6089 // See definition in data_stall_event.proto.
6090 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6091 // See definition in data_stall_event.proto.
6092 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6093}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006094
6095/*
6096 * Logs when RescueParty resets some set of experiment flags.
6097 *
6098 * Logged from:
6099 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6100 */
6101message RescuePartyResetReported {
6102 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6103 optional int32 rescue_level = 1;
6104}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006105
6106/**
6107 * Logs when signed config is received from an APK, and if that config was applied successfully.
6108 * Logged from:
6109 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6110 */
6111message SignedConfigReported {
6112 enum Type {
6113 UNKNOWN_TYPE = 0;
6114 GLOBAL_SETTINGS = 1;
6115 }
6116 optional Type type = 1;
6117
6118 // The final status of the signed config received.
6119 enum Status {
6120 UNKNOWN_STATUS = 0;
6121 APPLIED = 1;
6122 BASE64_FAILURE_CONFIG = 2;
6123 BASE64_FAILURE_SIGNATURE = 3;
6124 SECURITY_EXCEPTION = 4;
6125 INVALID_CONFIG = 5;
6126 OLD_CONFIG = 6;
6127 SIGNATURE_CHECK_FAILED = 7;
6128 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006129 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006130 }
6131 optional Status status = 2;
6132
6133 // The version of the signed config processed.
6134 optional int32 version = 3;
6135
6136 // The package name that the config was extracted from.
6137 optional string from_package = 4;
6138
6139 enum Key {
6140 NO_KEY = 0;
6141 DEBUG = 1;
6142 PRODUCTION = 2;
6143 }
6144 // Which key was used to verify the config.
6145 optional Key verified_with = 5;
6146}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006147
6148/*
6149 * Logs GNSS Network-Initiated (NI) location events.
6150 *
6151 * Logged from:
6152 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6153 */
6154message GnssNiEventReported {
6155 // The type of GnssNiEvent.
6156 enum EventType {
6157 UNKNOWN = 0;
6158 NI_REQUEST = 1;
6159 NI_RESPONSE = 2;
6160 }
6161 optional EventType event_type = 1;
6162
6163 // An ID generated by HAL to associate NI notifications and UI responses.
6164 optional int32 notification_id = 2;
6165
6166 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006167 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006168
6169 // NI requires notification.
6170 optional bool need_notify = 4;
6171
6172 // NI requires verification.
6173 optional bool need_verify = 5;
6174
6175 // NI requires privacy override, no notification/minimal trace.
6176 optional bool privacy_override = 6;
6177
6178 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6179 // seconds.
6180 optional int32 timeout = 7;
6181
6182 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006183 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006184
6185 // String representing the requester of the network inititated location request.
6186 optional string requestor_id = 9;
6187
6188 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6189 // network initiated location request.
6190 optional string text = 10;
6191
6192 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006193 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006194
6195 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006196 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006197
6198 // True if SUPL ES is enabled.
6199 optional bool is_supl_es_enabled = 13;
6200
6201 // True if GNSS location is enabled.
6202 optional bool is_location_enabled = 14;
6203
6204 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006205 optional android.server.location.GnssUserResponseType user_response = 15;
6206}
6207
6208/**
6209 * Logs GNSS non-framework (NFW) location notification.
6210 *
6211 * Logged from:
6212 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6213 */
6214message GnssNfwNotificationReported {
6215 // Package name of the Android proxy application representing the non-framework entity that
6216 // requested location. Set to empty string if unknown.
6217 optional string proxy_app_package_name = 1;
6218
6219 // Protocol stack that initiated the non-framework location request.
6220 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6221
6222 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6223 // set to empty string. This field is opaque to the framework and used for logging purposes.
6224 optional string other_protocol_stack_name = 3;
6225
6226 // Source initiating/receiving the location information.
6227 optional android.server.location.NfwRequestor requestor = 4;
6228
6229 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6230 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6231 // and used for logging purposes.
6232 optional string requestor_id = 5;
6233
6234 // Indicates whether location information was provided for this request.
6235 optional android.server.location.NfwResponseType response_type = 6;
6236
6237 // True if the device is in user initiated emergency session.
6238 optional bool in_emergency_mode = 7;
6239
6240 // True if cached location is provided.
6241 optional bool is_cached_location = 8;
6242
6243 // True if proxy app permission mismatch between framework and GNSS HAL.
6244 optional bool is_permission_mismatched = 9;
6245}
6246
6247/**
6248 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6249 *
6250 * Logged from:
6251 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6252 */
6253message GnssConfigurationReported {
6254 // SUPL host name.
6255 optional string supl_host = 1;
6256
6257 // SUPL port number.
6258 optional int32 supl_port = 2;
6259
6260 // C2K host name.
6261 optional string c2k_host = 3;
6262
6263 // C2K port number.
6264 optional int32 c2k_port = 4;
6265
6266 // The SUPL version requested by Carrier.
6267 optional int32 supl_ver = 5;
6268
6269 // The SUPL mode.
6270 optional android.server.location.SuplMode supl_mode = 6;
6271
6272 // True if NI emergency SUPL restrictions is enabled.
6273 optional bool supl_es = 7;
6274
6275 // LTE Positioning Profile settings
6276 optional android.server.location.LppProfile lpp_profile = 8;
6277
6278 // Positioning protocol on A-Glonass system.
6279 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6280
6281 // True if emergency PDN is used. Otherwise, regular PDN is used.
6282 optional bool use_emergency_pdn_for_emergency_supl= 10;
6283
6284 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6285 optional android.server.location.GpsLock gps_lock = 11;
6286
6287 // Number of seconds to extend the emergency session duration post emergency call.
6288 optional int32 es_extension_sec = 12;
6289
6290 // The full list of package names of proxy Android applications representing the non-framework
6291 // location access entities (on/off the device) for which the framework user has granted
6292 // non-framework location access permission. The package names are concatenated in one string
6293 // with spaces as separators.
6294 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006295}
Jack Yu95b64f32018-12-13 18:26:11 +08006296
6297/**
6298 * Logs when a NFC device's error occurred.
6299 * Logged from:
6300 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6301 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6302 */
6303message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006304 enum Type {
6305 UNKNOWN = 0;
6306 CMD_TIMEOUT = 1;
6307 ERROR_NOTIFICATION = 2;
6308 AID_OVERFLOW = 3;
6309 }
6310 optional Type type = 1;
6311 // If it's nci cmd timeout, log the timeout command.
6312 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006313
Alex Salod7c3eef2019-01-25 14:43:27 -08006314 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006315}
6316
6317/**
6318 * Logs when a NFC device's state changed event
6319 * Logged from:
6320 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6321 */
6322message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006323 enum State {
6324 UNKNOWN = 0;
6325 OFF = 1;
6326 ON = 2;
6327 ON_LOCKED = 3; // Secure Nfc enabled.
6328 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6329 }
6330 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006331}
6332
6333/**
6334 * Logs when a NFC Beam Transaction occurred.
6335 * Logged from:
6336 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6337 */
6338message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006339 enum Operation {
6340 UNKNOWN = 0;
6341 SEND = 1;
6342 RECEIVE = 2;
6343 }
6344 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006345}
6346
6347/**
6348 * Logs when a NFC Card Emulation Transaction occurred.
6349 * Logged from:
6350 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6351 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6352 */
6353message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006354 enum Category {
6355 UNKNOWN = 0;
6356 HCE_PAYMENT = 1;
6357 HCE_OTHER = 2;
6358 OFFHOST = 3;
6359 }
6360 // Transaction belongs to HCE payment or HCE other category, or offhost.
6361 optional Category category = 1;
6362 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6363 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006364}
6365
6366/**
6367 * Logs when a NFC Tag event occurred.
6368 * Logged from:
6369 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6370 */
6371message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006372 enum Type {
6373 UNKNOWN = 0;
6374 URL = 1;
6375 BT_PAIRING = 2;
6376 PROVISION = 3;
6377 WIFI_CONNECT = 4;
6378 APP_LAUNCH = 5;
6379 OTHERS = 6;
6380 }
6381 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006382}
6383
6384/**
6385 * Logs when Hce transaction triggered
6386 * Logged from:
6387 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6388 */
6389message NfcHceTransactionOccurred {
6390 // The latency period(in microseconds) it took for the first HCE data
6391 // exchange.
6392 optional uint32 latency_micros = 1;
6393}
6394
6395/**
6396 * Logs when SecureElement state event changed
6397 * Logged from:
6398 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6399 */
6400message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006401 enum State {
6402 UNKNOWN = 0;
6403 INITIALIZED = 1;
6404 DISCONNECTED = 2;
6405 CONNECTED = 3;
6406 HALCRASH = 4;
6407 }
6408 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006409
Alex Salod7c3eef2019-01-25 14:43:27 -08006410 optional string state_change_reason = 2;
6411 // SIMx or eSEx.
6412 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006413}
6414
6415/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006416 * Information about a permission grant request
6417 */
6418message PermissionGrantRequestResultReported {
6419 // unique value identifying an API call. A API call might result in multiple of these atoms
6420 optional int64 request_id = 1;
6421
6422 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006423 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006424
6425 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006426 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006427
6428 // The permission to be granted
6429 optional string permission_name = 4;
6430
6431 // If the permission was explicitly requested via the API or added by the system
6432 optional bool is_implicit = 5;
6433
6434 enum Result {
6435 UNDEFINED = 0;
6436 // permission request was ignored
6437 IGNORED = 1;
6438 // permission request was ignored because it was user fixed
6439 IGNORED_USER_FIXED = 2;
6440 // permission request was ignored because it was policy fixed
6441 IGNORED_POLICY_FIXED = 3;
6442 // permission was granted by user action
6443 USER_GRANTED = 4;
6444 // permission was automatically granted
6445 AUTO_GRANTED = 5;
6446 // permission was denied by user action
6447 USER_DENIED = 6;
6448 // permission was denied with prejudice by the user
6449 USER_DENIED_WITH_PREJUDICE = 7;
6450 // permission was automatically denied
6451 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006452 // permission request was ignored because permission is restricted
6453 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006454 // one time permission was granted by user action
6455 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006456 // user ignored request by leaving the request screen without choosing any option
6457 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006458 // user granted the permission after being linked to settings
6459 USER_GRANTED_IN_SETTINGS = 12;
6460 // user denied the permission after being linked to settings
6461 USER_DENIED_IN_SETTINGS = 13;
6462 // user denied the permission with prejudice after being linked to settings
6463 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6464 // permission was automatically revoked after one-time permission expired
6465 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006466 }
6467 // The result of the permission grant
6468 optional Result result = 6;
6469}
6470
6471/**
Jack Yu95b64f32018-12-13 18:26:11 +08006472 * Logs when Omapi API used
6473 * Logged from:
6474 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6475 */
6476message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006477 enum Operation {
6478 UNKNOWN = 0;
6479 OPEN_CHANNEL = 1;
6480 }
6481 optional Operation operation = 1;
6482 // SIMx or eSEx.
6483 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006484
Alex Salod7c3eef2019-01-25 14:43:27 -08006485 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006486}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006487
6488/**
Alex Saloa060aee2019-01-21 14:36:41 -08006489 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6490 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006491 * Logged from:
6492 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6493 */
6494message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006495 optional int64 dispatch_latency_millis = 1;
6496}
6497
6498/**
6499 * Logs AttentionManagerService attention check result.
6500 *
6501 * Logged from:
6502 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6503 */
6504message AttentionManagerServiceResultReported {
6505 // See core/java/android/service/attention/AttentionService.java
6506 enum AttentionCheckResult {
6507 UNKNOWN = 20;
6508 ATTENTION_SUCCESS_ABSENT = 0;
6509 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006510 ATTENTION_FAILURE_UNKNOWN = 2;
6511 ATTENTION_FAILURE_CANCELLED = 3;
6512 ATTENTION_FAILURE_PREEMPTED = 4;
6513 ATTENTION_FAILURE_TIMED_OUT = 5;
6514 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006515 }
6516 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006517}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006518
6519/**
6520 * Logs when an adb connection changes state.
6521 *
6522 * Logged from:
6523 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6524 */
6525message AdbConnectionChanged {
6526 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6527 // previously selected for this system.
6528 optional int64 last_connection_time_millis = 1;
6529
6530 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6531 // to reconnect via adb without user interaction.
6532 optional int64 auth_window_millis = 2;
6533
6534 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6535 optional android.debug.AdbConnectionStateEnum state = 3;
6536
6537 // True if the 'always allow' option was selected for this system.
6538 optional bool always_allow = 4;
6539}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006540
6541/*
6542 * Logs the reported speech DSP status.
6543 *
6544 * Logged from:
6545 * Vendor audio implementation.
6546 */
6547message SpeechDspStatReported {
6548 // The total Speech DSP uptime in milliseconds.
6549 optional int32 total_uptime_millis = 1;
6550 // The total Speech DSP downtime in milliseconds.
6551 optional int32 total_downtime_millis = 2;
6552 optional int32 total_crash_count = 3;
6553 optional int32 total_recover_count = 4;
6554}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006555
6556/**
6557 * Logs USB connector contaminant status.
6558 *
6559 * Logged from: USB Service.
6560 */
6561message UsbContaminantReported {
6562 optional string id = 1;
6563 optional android.service.usb.ContaminantPresenceStatus status = 2;
6564}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006565
6566/**
6567 * This atom is for debugging purpose.
6568 */
6569message DebugElapsedClock {
6570 // Monotically increasing value for each pull.
6571 optional int64 pull_count = 1;
6572 // Time from System.elapsedRealtime.
6573 optional int64 elapsed_clock_millis = 2;
6574 // Time from System.elapsedRealtime.
6575 optional int64 same_elapsed_clock_millis = 3;
6576 // Diff between current elapsed time and elapsed time from previous pull.
6577 optional int64 elapsed_clock_diff_millis = 4;
6578
6579 enum Type {
6580 TYPE_UNKNOWN = 0;
6581 ALWAYS_PRESENT = 1;
6582 PRESENT_ON_ODD_PULLS = 2;
6583 }
6584 // Type of behavior for the pulled data.
6585 optional Type type = 5;
6586}
6587
6588/**
6589 * This atom is for debugging purpose.
6590 */
6591message DebugFailingElapsedClock {
6592 // Monotically increasing value for each pull.
6593 optional int64 pull_count = 1;
6594 // Time from System.elapsedRealtime.
6595 optional int64 elapsed_clock_millis = 2;
6596 // Time from System.elapsedRealtime.
6597 optional int64 same_elapsed_clock_millis = 3;
6598 // Diff between current elapsed time and elapsed time from previous pull.
6599 optional int64 elapsed_clock_diff_millis = 4;
6600}
Steven Wuacef6bb2019-01-23 14:21:17 -05006601
6602/** Logs System UI bubbles event changed.
6603 *
6604 * Logged from:
6605 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6606 */
6607message BubbleUIChanged {
6608
6609 // The app package that is posting the bubble.
6610 optional string package_name = 1;
6611
6612 // The notification channel that is posting the bubble.
6613 optional string notification_channel = 2;
6614
6615 // The notification id associated with the posted bubble.
6616 optional int32 notification_id = 3;
6617
6618 // The position of the bubble within the bubble stack.
6619 optional int32 position = 4;
6620
6621 // The total number of bubbles within the bubble stack.
6622 optional int32 total_number = 5;
6623
6624 // User interactions with the bubble.
6625 enum Action {
6626 UNKNOWN = 0;
6627 POSTED = 1;
6628 UPDATED = 2;
6629 EXPANDED = 3;
6630 COLLAPSED = 4;
6631 DISMISSED = 5;
6632 STACK_DISMISSED = 6;
6633 STACK_MOVED = 7;
6634 HEADER_GO_TO_APP = 8;
6635 HEADER_GO_TO_SETTINGS = 9;
6636 PERMISSION_OPT_IN = 10;
6637 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006638 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006639 SWIPE_LEFT = 13;
6640 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006641 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006642 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006643 }
6644 optional Action action = 6;
6645
6646 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6647 optional float normalized_x_position = 7;
6648 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006649
6650 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6651 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006652
6653 // Whether the bubble is an on-going one.
6654 optional bool is_ongoing = 10;
6655
6656 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006657 // This is deprecated and the value should be ignored.
6658 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006659}
Kweku Adams8845d012018-12-11 20:06:45 -08006660
6661/**
Steven Wu552f63f2019-02-05 13:41:36 -05006662 * Logs System UI bubbles developer errors.
6663 *
6664 * Logged from:
6665 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6666 */
6667message BubbleDeveloperErrorReported {
6668
6669 // The app package that is posting the bubble.
6670 optional string package_name = 1;
6671
6672 // Bubble developer error type enums.
6673 enum Error {
6674 UNKNOWN = 0;
6675 ACTIVITY_INFO_MISSING = 1;
6676 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6677 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6678 }
6679 optional Error error = 2 [default = UNKNOWN];
6680}
6681
6682/**
Kweku Adams8845d012018-12-11 20:06:45 -08006683 * Logs that a constraint for a scheduled job has changed.
6684 *
6685 * Logged from:
6686 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6687 */
6688message ScheduledJobConstraintChanged {
6689 repeated AttributionNode attribution_node = 1;
6690
6691 // Name of the job.
6692 optional string job_name = 2;
6693
6694 optional com.android.server.job.ConstraintEnum constraint = 3;
6695
6696 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006697 UNKNOWN = 0;
6698 UNSATISFIED = 1;
6699 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006700 }
6701 optional State state = 4;
6702}
Alex Salod7c3eef2019-01-25 14:43:27 -08006703
6704/**
6705 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6706 * returns true.
6707 *
6708 * Logged from:
6709 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6710 */
6711message ScreenTimeoutExtensionReported {
6712 // Describes how many times in a row did the power manager reset the screen off timeout.
6713 optional uint32 consecutive_timeout_extended_count = 1;
6714}
Hui Yu885aca12019-01-10 17:11:34 -08006715
6716/*
6717* Logs number of milliseconds it takes to start a process.
6718* The definition of app process start time is from the app launch time to
6719* the time that Zygote finished forking the app process and loaded the
6720* application package's java classes.
6721
6722* This metric is different from AppStartOccurred which is for foreground
6723* activity only.
6724
6725* ProcessStartTime can report all processes (both foreground and background)
6726* start time.
6727*
6728* Logged from:
6729* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6730*/
6731message ProcessStartTime {
6732 // The uid of the ProcessRecord.
6733 optional int32 uid = 1 [(is_uid) = true];
6734
6735 // The process pid.
6736 optional int32 pid = 2;
6737
6738 // The process name.
6739 // Usually package name, "system" for system server.
6740 // Provided by ActivityManagerService.
6741 optional string process_name = 3;
6742
6743 enum StartType {
6744 UNKNOWN = 0;
6745 WARM = 1;
6746 HOT = 2;
6747 COLD = 3;
6748 }
6749
6750 // The start type.
6751 optional StartType type = 4;
6752
6753 // The elapsed realtime at the start of the process.
6754 optional int64 process_start_time_millis = 5;
6755
6756 // Number of milliseconds it takes to reach bind application.
6757 optional int32 bind_application_delay_millis = 6;
6758
6759 // Number of milliseconds it takes to finish start of the process.
6760 optional int32 process_start_delay_millis = 7;
6761
6762 // hostingType field in ProcessRecord, the component type such as "activity",
6763 // "service", "content provider", "broadcast" or other strings.
6764 optional string hosting_type = 8;
6765
6766 // hostingNameStr field in ProcessRecord. The component class name that runs
6767 // in this process.
6768 optional string hosting_name = 9;
6769}
6770
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006771/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006772 * Track Media Codec usage
6773 * Logged from:
6774 * frameworks/av/media/libstagefright/MediaCodec.cpp
6775 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6776 */
6777message MediametricsCodecReported {
6778 optional int64 timestamp_nanos = 1;
6779 optional string package_name = 2;
6780 optional int64 package_version_code = 3;
6781 optional int64 media_apex_version = 4;
6782
6783 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6784}
6785
6786/**
6787 * Track Media Extractor (pulling video/audio streams out of containers) usage
6788 * Logged from:
6789 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6790 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6791 */
6792message MediametricsExtractorReported {
6793 optional int64 timestamp_nanos = 1;
6794 optional string package_name = 2;
6795 optional int64 package_version_code = 3;
6796 optional int64 media_apex_version = 4;
6797
6798 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6799}
6800
6801/**
6802 * Track how we arbitrate between microphone/input requests.
6803 * Logged from
6804 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6805 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6806 */
6807message MediametricsAudiopolicyReported {
6808 optional int64 timestamp_nanos = 1;
6809 optional string package_name = 2;
6810 optional int64 package_version_code = 3;
6811 optional int64 media_apex_version = 4;
6812
6813 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6814}
6815
6816/**
6817 * Track how we arbitrate between microphone requests.
6818 * Logged from
6819 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6820 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6821 */
6822message MediametricsAudiorecordReported {
6823 optional int64 timestamp_nanos = 1;
6824 optional string package_name = 2;
6825 optional int64 package_version_code = 3;
6826 optional int64 media_apex_version = 4;
6827
6828 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6829}
6830
6831/**
6832 * Track how we arbitrate between microphone/input requests.
6833 * Logged from
6834 * frameworks/av/media/libnblog/ReportPerformance.cpp
6835 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6836 */
6837message MediametricsAudiothreadReported {
6838 optional int64 timestamp_nanos = 1;
6839 optional string package_name = 2;
6840 optional int64 package_version_code = 3;
6841 optional int64 media_apex_version = 4;
6842
6843 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6844}
6845
6846/**
6847 * Track how we arbitrate between microphone/input requests.
6848 * Logged from
6849 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6850 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6851 */
6852message MediametricsAudiotrackReported {
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 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6859}
6860
6861/**
6862 * Track information about DRM framework performance
6863 * Logged from
6864 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6865 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6866 */
6867message MediametricsMediadrmReported {
6868 optional int64 timestamp_nanos = 1;
6869 optional string package_name = 2;
6870 optional int64 package_version_code = 3;
6871 optional int64 media_apex_version = 4;
6872
6873 // vendor+description tell about which DRM plugin is in use on this device
6874 optional string vendor = 5;
6875 optional string description = 6;
6876 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6877 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6878}
6879
6880/**
6881 * Track information about the widevine DRM plugin performance
6882 * Logged from
6883 * vendor/widevine/libwvdrmengine/cdm/metrics
6884 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6885 */
6886message MediametricsDrmWidevineReported {
6887 optional int64 timestamp_nanos = 1;
6888 optional string package_name = 2;
6889 optional int64 package_version_code = 3;
6890 optional int64 media_apex_version = 4;
6891
6892 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6893}
6894
6895/**
6896 * Track information about recordings (e.g. camcorder)
6897 * Logged from
6898 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6899 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6900 */
6901message MediametricsRecorderReported {
6902 optional int64 timestamp_nanos = 1;
6903 optional string package_name = 2;
6904 optional int64 package_version_code = 3;
6905 optional int64 media_apex_version = 4;
6906
6907 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6908}
6909
6910/**
6911 * Track Media Player usage
6912 * Logged from:
6913 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6914 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6915 */
6916message MediametricsNuPlayerReported {
6917 optional int64 timestamp_nanos = 1;
6918 optional string package_name = 2;
6919 optional int64 package_version_code = 3;
6920 optional int64 media_apex_version = 4;
6921
6922 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6923}
6924
6925/**
Robert Shiha4beed32019-08-19 14:15:23 -07006926 * Track Legacy DRM usage
6927 * Logged from
6928 * frameworks/av/drm/drmserver/DrmManager.cpp
6929 */
6930message MediametricsDrmManagerReported {
6931 optional int64 timestamp_nanos = 1;
6932 optional string package_name = 2;
6933 optional int64 package_version_code = 3;
6934 optional int64 media_apex_version = 4;
6935
6936 enum Method {
6937 METHOD_NOT_FOUND = -1;
6938 GET_CONSTRAINTS = 0;
6939 GET_METADATA = 1;
6940 CAN_HANDLE = 2;
6941 PROCESS_DRM_INFO = 3;
6942 ACQUIRE_DRM_INFO = 4;
6943 SAVE_RIGHTS = 5;
6944 GET_ORIGINAL_MIME_TYPE = 6;
6945 GET_DRM_OBJECT_TYPE = 7;
6946 CHECK_RIGHTS_STATUS = 8;
6947 REMOVE_RIGHTS = 9;
6948 REMOVE_ALL_RIGHTS = 10;
6949 OPEN_CONVERT_SESSION = 11;
6950 OPEN_DECRYPT_SESSION = 12;
6951 }
6952
6953 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6954 optional string plugin_id = 5;
6955 optional string description = 6;
6956 optional Method method = 7;
6957 optional string mime_types = 8;
6958}
6959
6960/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006961 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006962 * Pulled from: StatsCompanionService
6963*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006964message DangerousPermissionState {
6965 // Name of the permission
6966 optional string permission_name = 1;
6967
6968 // Uid of the package
6969 optional int32 uid = 2 [(is_uid) = true];
6970
6971 // Package requesting the permission
6972 optional string package_name = 3;
6973
6974 // If the permission is granted to the uid
6975 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006976
6977 // Permission flags as per android.content.pm.PermissionFlags
6978 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006979}
6980
Michael Groover4a0ca942019-01-24 17:41:25 -08006981/**
6982 * Logs when a package is denied access to a device identifier based on the new access requirements.
6983 *
6984 * Logged from:
6985 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6986 */
6987message DeviceIdentifierAccessDenied {
6988 // The name of the package denied access to the requested device identifier.
6989 optional string package_name = 1;
6990
6991 // The name of the device identifier method the package attempted to invoke.
6992 optional string method_name = 2;
6993
6994 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08006995 // Starting from Android 11, this boolean is not set and will always be false.
6996 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006997
6998 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006999 // Starting from Android 11, this boolean is not set and will always be false.
7000 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007001}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007002
7003/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007004 * Pulls the ongoing mainline install train version code.
7005 * Pulled from StatsCompanionService
7006 */
7007message TrainInfo {
7008 optional int64 train_version_code = 1;
7009
7010 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007011
7012 optional string train_name = 3;
7013
7014 enum Status {
7015 UNKNOWN = 0;
7016 INSTALL_REQUESTED = 1;
7017 INSTALL_STARTED = 2;
7018 INSTALL_STAGED_NOT_READY = 3;
7019 INSTALL_STAGED_READY = 4;
7020 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007021 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7022 // and INSTALL_FAILURE_COMMIT.
7023 INSTALL_FAILURE = 6 [deprecated = true];
7024 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007025 INSTALL_CANCELLED = 7;
7026 INSTALLER_ROLLBACK_REQUESTED = 8;
7027 INSTALLER_ROLLBACK_INITIATED = 9;
7028 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7029 INSTALLER_ROLLBACK_STAGED = 11;
7030 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7031 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7032 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7033 INSTALLER_ROLLBACK_SUCCESS = 15;
7034 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007035 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7036 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7037 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7038 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7039 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7040 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007041 INSTALL_FAILURE_DOWNLOAD = 23;
7042 INSTALL_FAILURE_STATE_MISMATCH = 24;
7043 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007044 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007045 }
7046 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007047}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007048
7049/**
7050 * Logs the gesture stage changed event.
7051 *
7052 * Logged from:
7053 * frameworks/base/packages/SystemUI/
7054 */
7055message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007056 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007057}
7058
7059/**
7060 * Logs the feedback type.
7061 *
7062 * Logged from:
7063 * frameworks/base/packages/SystemUI/
7064 */
7065message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007066 // Whether or not the gesture was used.
7067 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007068}
7069
7070/**
7071 * Logs the progress.
7072 *
7073 * Logged from:
7074 * frameworks/base/packages/SystemUI/
7075 */
7076message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007077 // [0,100] progress for the assist gesture.
7078 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007079}
Neil Fullerdb14b482019-02-05 19:44:44 +00007080
7081/*
7082 * Information about the time zone data on a device.
7083 */
7084message TimeZoneDataInfo {
7085 // A version identifier for the data set on device. e.g. "2018i"
7086 optional string tzdb_version = 1;
7087}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007088
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007089/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007090 * Logs the GPU stats global health information.
7091 *
7092 * Logged from:
7093 * frameworks/native/services/gpuservice/gpustats/
7094 */
7095message GpuStatsGlobalInfo {
7096 // Package name of the gpu driver.
7097 optional string driver_package_name = 1;
7098
7099 // Version name of the gpu driver.
7100 optional string driver_version_name = 2;
7101
7102 // Version code of the gpu driver.
7103 optional int64 driver_version_code = 3;
7104
7105 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7106 optional int64 driver_build_time = 4;
7107
7108 // Total count of the gl driver gets loaded.
7109 optional int64 gl_loading_count = 5;
7110
7111 // Total count of the gl driver fails to be loaded.
7112 optional int64 gl_loading_failure_count = 6;
7113
7114 // Total count of the Vulkan driver gets loaded.
7115 optional int64 vk_loading_count = 7;
7116
7117 // Total count of the Vulkan driver fails to be loaded.
7118 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007119
7120 // Api version of the system Vulkan driver.
7121 optional int32 vulkan_version = 9;
7122
7123 // Api version of the system CPU Vulkan driver.
7124 optional int32 cpu_vulkan_version = 10;
7125
7126 // Api version of the system GLES driver.
7127 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007128
7129 // Total count of the angle driver gets loaded.
7130 optional int64 angle_loading_count = 12;
7131
7132 // Total count of the angle driver fails to be loaded.
7133 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007134}
7135
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007136/**
7137 * GPU driver loading time info.
7138 */
7139message GpuDriverLoadingTime {
7140 // List of all the driver loading times for this app. The list size is
7141 // capped at 50.
7142 repeated int64 driver_loading_time = 1;
7143}
7144
7145/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007146 * Logs the GPU stats per app health information.
7147 *
7148 * Logged from:
7149 * frameworks/native/services/gpuservice/gpustats/
7150 */
7151message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007152 // Package name of the application that loads the gpu driver. Total number
7153 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007154 optional string app_package_name = 1;
7155
7156 // Version code of the gpu driver this app loads.
7157 optional int64 driver_version_code = 2;
7158
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007159 // gl driver loading time info.
7160 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7161 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007162
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007163 // Vulkan driver loading time info.
7164 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7165 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007166
7167 // Angle driver loading time info.
7168 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7169 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007170
7171 // CPU Vulkan implementation is in use.
7172 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007173
7174 // App is not doing pre-rotation correctly.
7175 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007176
7177 // App creates GLESv1 context.
7178 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007179}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007180
7181/*
7182 * Logs the size of the system ion heap.
7183 *
7184 * Pulled from StatsCompanionService.
7185 */
7186message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007187 // Deprecated due to limited support of ion stats in debugfs.
7188 // Use `IonHeapSize` instead.
7189 option deprecated = true;
7190
Rafal Slawikd4e87572019-03-12 13:08:38 +00007191 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007192 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007193 optional int64 size_in_bytes = 1;
7194}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007195
Rafal Slawik77987ed2019-06-17 12:28:23 +01007196/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007197 * Logs the total size of the ion heap.
7198 *
7199 * Pulled from StatsCompanionService.
7200 */
7201message IonHeapSize {
7202 // Total size of all ion heaps in kilobytes.
7203 // Read from: /sys/kernel/ion/total_heaps_kb.
7204 optional int32 total_size_kb = 1;
7205}
7206
7207/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007208 * Logs the per-process size of the system ion heap.
7209 *
7210 * Pulled from StatsCompanionService.
7211 */
7212message ProcessSystemIonHeapSize {
7213 // The uid if available. -1 means not available.
7214 optional int32 uid = 1 [(is_uid) = true];
7215
7216 // The process name (from /proc/PID/cmdline).
7217 optional string process_name = 2;
7218
7219 // Sum of sizes of all allocations.
7220 optional int32 total_size_in_kilobytes = 3;
7221
7222 // Number of allocations.
7223 optional int32 allocation_count = 4;
7224
7225 // Size of the largest allocation.
7226 optional int32 max_size_in_kilobytes = 5;
7227}
7228
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007229/**
7230 * Push network stack events.
7231 *
7232 * Log from:
7233 * frameworks/base/packages/NetworkStack/
7234 */
7235message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007236 // The id that indicates the event reported from NetworkStack.
7237 optional int32 event_id = 1;
7238 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007239 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7240}
Carmen Agimofa769c152019-03-04 14:39:14 +00007241
7242/**
7243 * Logs the apps that are installed on the external storage.
7244 * Pulled from:
7245 * StatsCompanionService
7246 */
7247message AppsOnExternalStorageInfo {
7248 // The type of the external storage.
7249 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7250 // The name of the package that is installed on the external storage.
7251 optional string package_name = 2;
7252}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007253
7254/**
7255 * Logs the settings related to Face.
7256 * Logged from:
7257 * frameworks/base/services/core/java/com/android/server/stats
7258 */
7259message FaceSettings {
7260 // Whether or not face unlock is allowed on Keyguard.
7261 optional bool unlock_keyguard_enabled = 1;
7262 // Whether or not face unlock dismisses the Keyguard.
7263 optional bool unlock_dismisses_keyguard = 2;
7264 // Whether or not face unlock requires attention.
7265 optional bool unlock_attention_required = 3;
7266 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7267 optional bool unlock_app_enabled = 4;
7268 // Whether or not face unlock always requires user confirmation.
7269 optional bool unlock_always_require_confirmation = 5;
7270 // Whether or not a diverse set of poses are required during enrollment.
7271 optional bool unlock_diversity_required = 6;
7272}
Maggie White442b6312019-04-05 16:26:44 -07007273
7274/**
7275 * Logs cooling devices maintained by the kernel.
7276 *
7277 * Pulled from StatsCompanionService.java
7278 */
7279message CoolingDevice {
7280 // The type of cooling device being reported. Eg. CPU, GPU...
7281 optional android.os.CoolingTypeEnum device_location = 1;
7282 // The name of the cooling device source. Eg. CPU0
7283 optional string device_name = 2;
7284 // Current throttle state of the cooling device. The value can any unsigned
7285 // integer between 0 and max_state defined in its driver. 0 means device is
7286 // not in throttling, higher value means deeper throttling.
7287 optional int32 state = 3;
7288}
Ben Blount763a5d52019-04-10 11:48:58 -07007289
7290/**
7291 * Intelligence has several counter-type events that don't warrant a
7292 * full separate atom. These are primarily API call counters but also include
7293 * counters for feature usage and specific failure modes.
7294 *
7295 * Logged from the Intelligence mainline module.
7296 */
7297message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007298 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007299 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007300 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007301 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007302 // How many times the event occured (to report a batch of high frequency events).
7303 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007304 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007305 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007306}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007307
7308/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007309 * Logs when Car Power state changed.
7310 *
7311 * Logged from:
7312 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7313 */
7314message CarPowerStateChanged {
7315 // States come from CpmsState in CarPowerManagementService.java.
7316 enum State {
7317 WAIT_FOR_VHAL = 0;
7318 ON = 1;
7319 SHUTDOWN_PREPARE = 2;
7320 WAIT_FOR_FINISH = 3;
7321 SUSPEND = 4;
7322 SIMULATE_SLEEP = 5;
7323 }
7324 optional State state = 1;
7325}
7326
7327/**
7328 * Logs whether GarageMode is entered.
7329 *
7330 * Logged from:
7331 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7332 */
7333message GarageModeInfo {
7334 // Whether GarageMode is entered.
7335 optional bool is_garage_mode = 1;
7336}
Martijn Coenencd95d462019-04-25 17:09:45 +02007337
7338/**
7339 * Historical app ops data per package.
7340 */
7341message AppOps {
7342 // Uid of the package requesting the op
7343 optional int32 uid = 1 [(is_uid) = true];
7344
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007345 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007346 optional string package_name = 2;
7347
7348 // operation id; maps to the OP_* constants in AppOpsManager.java
7349 optional int32 op_id = 3;
7350
7351 // The number of times the op was granted while the app was in the
7352 // foreground (only for trusted requests)
7353 optional int64 trusted_foreground_granted_count = 4;
7354
7355 // The number of times the op was granted while the app was in the
7356 // background (only for trusted requests)
7357 optional int64 trusted_background_granted_count = 5;
7358
7359 // The number of times the op was rejected while the app was in the
7360 // foreground (only for trusted requests)
7361 optional int64 trusted_foreground_rejected_count = 6;
7362
7363 // The number of times the op was rejected while the app was in the
7364 // background (only for trusted requests)
7365 optional int64 trusted_background_rejected_count = 7;
7366
7367 // For long-running operations, total duration of the operation
7368 // while the app was in the foreground (only for trusted requests)
7369 optional int64 trusted_foreground_duration_millis = 8;
7370
7371 // For long-running operations, total duration of the operation
7372 // while the app was in the background (only for trusted requests)
7373 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007374
7375 // Whether AppOps is guarded by Runtime permission
7376 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007377}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007378
7379/**
7380 * Location Manager API Usage information(e.g. API under usage,
7381 * API call's parameters).
7382 * Logged from:
7383 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7384 */
7385message LocationManagerApiUsageReported {
7386
7387 // Indicating if usage starts or usage ends.
7388 optional android.stats.location.UsageState state = 1;
7389
7390 // LocationManagerService's API in use.
7391 // We can identify which API from LocationManager is
7392 // invoking current LMS API by the combination of
7393 // API parameter(e.g. is_listener_null, is_intent_null,
7394 // is_location_request_null)
7395 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7396
7397 // Name of the package calling the API.
7398 optional string calling_package_name = 3;
7399
7400 // Type of the location provider.
7401 optional android.stats.location.ProviderType provider = 4;
7402
7403 // Quality of the location request
7404 optional android.stats.location.LocationRequestQuality quality = 5;
7405
7406 // The desired interval for active location updates, in milliseconds.
7407 // Bucketized to reduce cardinality.
7408 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7409
7410 // Minimum distance between location updates, in meters.
7411 // Bucketized to reduce cardinality.
7412 optional android.stats.location.SmallestDisplacementBucket
7413 bucketized_smallest_displacement = 7;
7414
7415 // The number of location updates.
7416 optional int64 num_updates = 8;
7417
7418 // The request expiration time, in millisecond since boot.
7419 // Bucketized to reduce cardinality.
7420 optional android.stats.location.ExpirationBucket
7421 bucketized_expire_in = 9;
7422
7423 // Type of Callback passed in for this API.
7424 optional android.stats.location.CallbackType callback_type = 10;
7425
7426 // The radius of the central point of the alert
7427 // region, in meters. Only for API REQUEST_GEOFENCE.
7428 // Bucketized to reduce cardinality.
7429 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7430
7431 // Activity Importance of API caller.
7432 // Categorized to 3 types that are interesting from location's perspective.
7433 optional android.stats.location.ActivityImportance activiy_importance = 12;
7434}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007435
7436/**
7437 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7438 */
7439message ReviewPermissionsFragmentResultReported {
7440 // unique value identifying a permission group change. A permission group change might result
7441 // in multiple of these atoms
7442 optional int64 change_id = 1;
7443
7444 // UID of package the permission belongs to
7445 optional int32 uid = 2 [(is_uid) = true];
7446
7447 // Name of package the permission belongs to
7448 optional string package_name = 3;
7449
7450 // The permission to be granted
7451 optional string permission_name = 4;
7452
7453 // The result of the permission grant
7454 optional bool permission_granted = 5;
7455}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007456
7457/**
7458* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7459* Logged from: RuntimePermissionUpdgradeController
7460*/
7461message RuntimePermissionsUpgradeResult {
7462 // Permission granted as result of upgrade
7463 optional string permission_name = 1;
7464
7465 // UID of package granted permission
7466 optional int32 uid = 2 [(is_uid) = true];
7467
7468 // Name of package granted permission
7469 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007470}
7471
7472/**
7473* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7474*/
7475message GrantPermissionsActivityButtonActions {
7476 // Permission granted as result of upgrade
7477 optional string permission_group_name = 1;
7478
7479 // UID of package granted permission
7480 optional int32 uid = 2 [(is_uid) = true];
7481
7482 // Name of package requesting permission
7483 optional string package_name = 3;
7484
7485 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7486 // LABEL_ constants in GrantPermissionActivity.java
7487 optional int32 buttons_presented = 4;
7488
7489 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7490 optional int32 button_clicked = 5;
7491}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007492
7493/**
7494 * Information about LocationAccessCheck notification presented to user
7495 */
7496message LocationAccessCheckNotificationAction {
7497
7498 // id which identifies single session of user interacting with permission controller
7499 optional int64 session_id = 1;
7500
7501 // Uid of package for which location access check is presented
7502 optional int32 package_uid = 2;
7503
7504 // Name of package for which location access check is presented
7505 optional string package_name = 3;
7506
7507 enum Result {
7508 UNDEFINED = 0;
7509 // notification was presented to the user
7510 NOTIFICATION_PRESENTED = 1;
7511 // notification was declined by the user
7512 NOTIFICATION_DECLINED = 2;
7513 // notification was clicked by the user
7514 NOTIFICATION_CLICKED = 3;
7515 }
7516
7517 // View / interaction recorded
7518 optional Result result = 4;
7519}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007520
7521/**
7522 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7523 */
7524message AppPermissionFragmentActionReported {
7525 // id which identifies single session of user interacting with permission controller
7526 optional int64 session_id = 1;
7527
7528 // unique value identifying a permission group change. A permission group change might result
7529 // in multiple of these atoms
7530 optional int64 change_id = 2;
7531
7532 // UID of package the permission belongs to
7533 optional int32 uid = 3 [(is_uid) = true];
7534
7535 // Name of package the permission belongs to
7536 optional string package_name = 4;
7537
7538 // The permission to be granted
7539 optional string permission_name = 5;
7540
7541 // The result of the permission grant
7542 optional bool permission_granted = 6;
7543}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007544
7545/**
7546* Information about a AppPermissionFragment viewed by user
7547*/
7548message AppPermissionFragmentViewed {
7549 // id which identifies single session of user interacting with permission controller
7550 optional int64 session_id = 1;
7551
7552 // UID of package for which permissions are viewed
7553 optional int32 uid = 2 [(is_uid) = true];
7554
7555 // Name of package for which permissions are viewed
7556 optional string package_name = 3;
7557
7558 // Permission group viewed
7559 optional string permission_group_name = 4;
7560}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007561
7562/**
7563* Information about a AppPermissionsFragment viewed by user
7564*/
7565message AppPermissionsFragmentViewed {
7566 // id which identifies single session of user interacting with permission controller
7567 optional int64 session_id = 1;
7568
7569 // id which identifies single view as every view might have several logging records
7570 // with different package information attached
7571 optional int64 view_id = 2;
7572
7573 // Permission group viewed
7574 optional string permission_group_name = 3;
7575
7576 // UID of package for which permissions are viewed
7577 optional int32 uid = 4 [(is_uid) = true];
7578
7579 // Name of package for which permissions are viewed
7580 optional string package_name = 5;
7581
7582 // Category in which permission is included
7583 enum Category {
7584 UNDEFINED = 0;
7585 ALLOWED = 1;
7586 ALLOWED_FOREGROUND = 2;
7587 DENIED = 3;
7588 }
7589 optional Category category = 6;
7590}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007591
7592/**
7593* Information about a PermissionAppsFragment viewed by user.
7594* Logged from ui/handheld/PermissionAppsFragment.java
7595*/
7596message PermissionAppsFragmentViewed {
7597 // id which identifies single session of user interacting with permission controller
7598 optional int64 session_id = 1;
7599
7600 // id which identifies single view as every view might have several logging records
7601 // with different package information attached
7602 optional int64 view_id = 2;
7603
7604 // Permission group viewed
7605 optional string permission_group_name = 3;
7606
7607 // UID of package for which permissions are viewed
7608 optional int32 uid = 4 [(is_uid) = true];
7609
7610 // Name of package for which permissions are viewed
7611 optional string package_name = 5;
7612
7613 // Category in which app is included
7614 enum Category {
7615 UNDEFINED = 0;
7616 ALLOWED = 1;
7617 ALLOWED_FOREGROUND = 2;
7618 DENIED = 3;
7619 }
7620 optional Category category = 6;
7621}
Tony Make2b1b672019-07-29 16:59:47 +01007622
7623/**
7624 * Logs when there is a smart selection related event.
7625 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7626 * Logged from: TextClassifierEventLogger.java
7627 */
7628message TextSelectionEvent {
7629 // A session ID.
7630 optional string session_id = 1;
7631
7632 // Event type of this event.
7633 optional android.stats.textclassifier.EventType event_type = 2;
7634
Tony Mak9c84bd22019-12-09 07:27:25 +00007635 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007636 optional string model_name = 3;
7637
7638 // Type of widget that was involved in triggering this event.
7639 optional android.stats.textclassifier.WidgetType widget_type = 4;
7640
7641 // Index of this event in a session.
7642 optional int32 event_index = 5;
7643
7644 // Entity type that is involved.
7645 optional string entity_type = 6;
7646
7647 // Relative word index of the start of the selection.
7648 optional int32 relative_word_start_index = 7;
7649
7650 // Relative word (exclusive) index of the end of the selection.
7651 optional int32 relative_word_end_index = 8;
7652
7653 // Relative word index of the start of the smart selection.
7654 optional int32 relative_suggested_word_start_index = 9;
7655
7656 // Relative word (exclusive) index of the end of the smart selection.
7657 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007658
7659 // Name of source package.
7660 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007661}
7662
7663/**
7664 * Logs when there is a smart linkify related event.
7665 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7666 * Logged from: TextClassifierEventLogger.java
7667 */
7668message TextLinkifyEvent {
7669 // A session ID.
7670 optional string session_id = 1;
7671
7672 // Event type of this event.
7673 optional android.stats.textclassifier.EventType event_type = 2;
7674
Tony Mak9c84bd22019-12-09 07:27:25 +00007675 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007676 optional string model_name = 3;
7677
7678 // Type of widget that was involved in triggering this event.
7679 optional android.stats.textclassifier.WidgetType widget_type = 4;
7680
7681 // Index of this event in a session.
7682 optional int32 event_index = 5;
7683
7684 // Entity type that is involved.
7685 optional string entity_type = 6;
7686
7687 // Number of links detected.
7688 optional int32 num_links = 7;
7689
7690 // The total length of all links.
7691 optional int32 linked_text_length = 8;
7692
7693 // Length of input text.
7694 optional int32 text_length = 9;
7695
7696 // Time spent on generating links in ms.
7697 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007698
7699 // Name of source package.
7700 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007701}
7702
7703/**
7704 * Logs when there is a conversation actions related event.
7705 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7706 * Logged from: TextClassifierEventLogger.java
7707 */
7708message ConversationActionsEvent {
7709 // A session ID.
7710 optional string session_id = 1;
7711
7712 // Event type of this event.
7713 optional android.stats.textclassifier.EventType event_type = 2;
7714
Tony Mak9c84bd22019-12-09 07:27:25 +00007715 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007716 optional string model_name = 3;
7717
7718 // Type of widget that was involved in triggering this event.
7719 optional android.stats.textclassifier.WidgetType widget_type = 4;
7720
7721 // The first entity type that is involved.
7722 optional string first_entity_type = 5;
7723
7724 // The second entity type that is involved.
7725 optional string second_entity_type = 6;
7726
7727 // The third entity type that is involved.
7728 optional string third_entity_type = 7;
7729
7730 // The score of the first entity type.
7731 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007732
7733 // Name of source package.
7734 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007735
7736 // Name of the annotator model that is involved in this event.
7737 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007738}
7739
7740/**
7741 * Logs when there is a language detection related event.
7742 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7743 * Logged from: TextClassifierEventLogger.java
7744 */
7745message LanguageDetectionEvent {
7746 // A session ID.
7747 optional string session_id = 1;
7748
7749 // Event type of this event.
7750 optional android.stats.textclassifier.EventType event_type = 2;
7751
Tony Mak9c84bd22019-12-09 07:27:25 +00007752 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007753 optional string model_name = 3;
7754
7755 // Type of widget that was involved in triggering this event.
7756 optional android.stats.textclassifier.WidgetType widget_type = 4;
7757
7758 // Detected language.
7759 optional string language_tag = 5;
7760
7761 // Score of the detected language.
7762 optional float score = 6;
7763
7764 // Position of this action.
7765 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007766
7767 // Name of source package.
7768 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007769}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007770
7771/**
7772 * Information about an OTA update attempt by update_engine.
7773 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7774 */
7775message UpdateEngineUpdateAttemptReported {
7776 // The number of attempts for the update engine to apply a given payload.
7777 optional int32 attempt_number = 1;
7778
7779 optional android.stats.otaupdate.PayloadType payload_type = 2;
7780
7781 // The total time in minutes for the update engine to apply a given payload.
7782 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7783 // it's increased when the system is sleeping.
7784 optional int32 duration_boottime_in_minutes = 3;
7785
7786 // The total time in minutes for the update engine to apply a given payload.
7787 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7788 // and it's not increased when the system is sleeping.
7789 optional int32 duration_monotonic_in_minutes = 4;
7790
7791 // The size of the payload in MiBs.
7792 optional int32 payload_size_mib = 5;
7793
7794 // The attempt result reported by the update engine for an OTA update.
7795 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7796
7797 // The error code reported by the update engine after an OTA update attempt
7798 // on A/B devices.
7799 optional android.stats.otaupdate.ErrorCode error_code = 7;
7800
7801 // The build fingerprint of the source system. The value is read from a
7802 // system property when the device takes the update. e.g.
7803 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7804 optional string source_fingerprint = 8;
7805}
7806
7807/**
7808 * Information about all the attempts the device make before finishing the
7809 * successful update.
7810 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7811 */
7812message UpdateEngineSuccessfulUpdateReported {
7813 // The number of attempts for the update engine to apply the payload for a
7814 // successful update.
7815 optional int32 attempt_count = 1;
7816
7817 optional android.stats.otaupdate.PayloadType payload_type = 2;
7818
7819 optional int32 payload_size_mib = 3;
7820
7821 // The total number of bytes downloaded by update_engine since the last
7822 // successful update.
7823 optional int32 total_bytes_downloaded_mib = 4;
7824
7825 // The ratio in percentage of the over-downloaded bytes compared to the
7826 // total bytes needed to successfully install the update. e.g. 200 if we
7827 // download 200MiB in total for a 100MiB package.
7828 optional int32 download_overhead_percentage = 5;
7829
7830 // The total time in minutes for the update engine to apply the payload for a
7831 // successful update.
7832 optional int32 total_duration_minutes = 6;
7833
7834 // The number of reboot of the device during a successful update.
7835 optional int32 reboot_count = 7;
7836}
Alec Mourie088e762019-07-02 13:10:55 -07007837
7838/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007839 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7840 * key to indicate whether it was successful or not.
7841 *
7842 * Logged from:
7843 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7844 */
7845message RebootEscrowRecoveryReported {
7846 optional bool successful = 1;
7847}
7848
7849/**
Alec Mourie088e762019-07-02 13:10:55 -07007850 * Global display pipeline metrics reported by SurfaceFlinger.
7851 * Pulled from:
7852 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7853 */
7854message SurfaceflingerStatsGlobalInfo {
7855 // Total number of frames presented during the tracing period
7856 optional int64 total_frames = 1;
7857 // Total number of frames missed
7858 optional int64 missed_frames = 2;
7859 // Total number of frames that fell back to client composition
7860 optional int64 client_composition_frames = 3;
7861 // Total time the display was turned on
7862 optional int64 display_on_millis = 4;
7863 // Total time that was spent performing animations.
7864 // This is derived from the present-to-present layer histogram
7865 optional int64 animation_millis = 5;
7866}
7867
7868/**
7869 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7870 * The number of layers uploaded will be restricted due to size limitations.
7871 * Pulled from:
7872 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7873 */
7874message SurfaceflingerStatsLayerInfo {
7875 // The layer for this set of metrics
7876 // For now we can infer that the package name is included in the layer
7877 // name.
7878 optional string layer_name = 1;
7879 // Total number of frames presented
7880 optional int64 total_frames = 2;
7881 // Total number of dropped frames while latching a buffer for this layer.
7882 optional int64 dropped_frames = 3;
7883 // Set of timings measured between successive presentation timestamps.
7884 optional FrameTimingHistogram present_to_present = 4
7885 [(android.os.statsd.log_mode) = MODE_BYTES];
7886 // Set of timings measured from when an app queued a buffer for
7887 // presentation, until the buffer was actually presented to the
7888 // display.
7889 optional FrameTimingHistogram post_to_present = 5
7890 [(android.os.statsd.log_mode) = MODE_BYTES];
7891 // Set of timings measured from when a buffer is ready to be presented,
7892 // until the buffer was actually presented to the display.
7893 optional FrameTimingHistogram acquire_to_present = 6
7894 [(android.os.statsd.log_mode) = MODE_BYTES];
7895 // Set of timings measured from when a buffer was latched by
7896 // SurfaceFlinger, until the buffer was presented to the display
7897 optional FrameTimingHistogram latch_to_present = 7
7898 [(android.os.statsd.log_mode) = MODE_BYTES];
7899 // Set of timings measured from the desired presentation to the actual
7900 // presentation time
7901 optional FrameTimingHistogram desired_to_present = 8
7902 [(android.os.statsd.log_mode) = MODE_BYTES];
7903 // Set of timings measured from when an app queued a buffer for
7904 // presentation, until the buffer was ready to be presented.
7905 optional FrameTimingHistogram post_to_acquire = 9
7906 [(android.os.statsd.log_mode) = MODE_BYTES];
7907}
7908
7909/**
7910 * Histogram of frame counts bucketed by time in milliseconds.
7911 * Because of size limitations, we hard-cap the number of buckets, with
7912 * buckets for corresponding to larger milliseconds being less precise.
7913 */
7914message FrameTimingHistogram {
7915 // Timings in milliseconds that describes a set of histogram buckets
7916 repeated int32 time_millis_buckets = 1;
7917 // Number of frames that match to each time_millis, i.e. the bucket
7918 // contents
7919 // It's required that len(time_millis) == len(frame_count)
7920 repeated int64 frame_counts = 2;
7921}
Emilian Peev6729f372019-08-29 09:14:09 -07007922
Emilian Peev6729f372019-08-29 09:14:09 -07007923/**
7924 * Information about camera facing and API level usage.
7925 * Logged from:
7926 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7927 */
7928message CameraActionEvent {
7929 // Camera session duration
7930 optional int64 duration = 1;
7931
7932 // Camera API level used
7933 optional int32 api_level = 2;
7934
7935 // Name of client package
7936 optional string package_name = 3;
7937
7938 // Camera facing
7939 enum Facing {
7940 UNKNOWN = 0;
7941 BACK = 1;
7942 FRONT = 2;
7943 EXTERNAL = 3;
7944 }
7945 optional Facing facing = 4;
7946}
atrost01a20932019-08-28 15:40:37 +01007947
7948/**
7949 * Logs when a compatibility change is affecting an app.
7950 *
7951 * Logged from:
7952 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7953 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7954 */
7955message AppCompatibilityChangeReported {
7956 // The UID of the app being affected by the compatibilty change.
7957 optional int32 uid = 1 [(is_uid) = true];
7958
7959 // The ID of the change affecting the app.
7960 optional int64 change_id = 2;
7961
7962 enum State {
7963 UNKNOWN_STATE = 0;
7964 ENABLED = 1;
7965 DISABLED = 2;
7966 LOGGED = 3;
7967 }
7968
7969 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7970 // logged otherwise.
7971 optional State state = 3;
7972
7973 enum Source {
7974 UNKNOWN_SOURCE = 0;
7975 APP_PROCESS = 1;
7976 SYSTEM_SERVER = 2;
7977 }
7978
7979 // Where it was logged from.
7980 optional Source source = 4;
7981
7982}
Hector Dearman40579f62019-11-01 13:19:30 +00007983
7984/**
7985 * Logged from
7986 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7987 */
7988message PerfettoUploaded {
7989 enum Event {
7990 PERFETTO_UNDEFINED = 0;
7991 PERFETTO_TRACE_BEGIN = 1;
7992 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7993 PERFETTO_ON_CONNECT = 3;
7994 PERFETTO_ON_TRACING_DISABLED = 4;
7995 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7996 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7997 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7998 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7999 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8000 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8001 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8002 PERFETTO_TRIGGER_BEGIN = 12;
8003 PERFETTO_TRIGGER_SUCCESS = 13;
8004 PERFETTO_TRIGGER_FAILURE = 14;
8005 PERFETTO_HIT_GUARDRAILS = 15;
8006 PERFETTO_ON_TIMEOUT = 16;
8007 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8008 }
8009
8010 // Which stage of the pipeline we are reporting from.
8011 optional Event event = 1;
8012
8013 // UUID matching the one set inside the SystemInfo trace packet.
8014 optional int64 trace_uuid_lsb = 2;
8015 optional int64 trace_uuid_msb = 3;
8016}
Mark Tabrya824a642019-11-05 12:26:12 -08008017
8018/**
8019 * Pulls client metrics on data transferred via Vehicle Maps Service.
8020 * Metrics are keyed by uid + layer.
8021 *
8022 * Pulled from:
8023 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8024 */
8025message VmsClientStats {
8026 // UID of the VMS client app
8027 optional int32 uid = 1 [(is_uid) = true];
8028
8029 // VMS layer definition
8030 optional int32 layer_type = 2;
8031 optional int32 layer_channel = 3;
8032 optional int32 layer_version = 4;
8033
8034 // Bytes and packets sent by the client for the layer
8035 optional int64 tx_bytes = 5;
8036 optional int64 tx_packets = 6;
8037
8038 // Bytes and packets received by the client for the layer
8039 optional int64 rx_bytes = 7;
8040 optional int64 rx_packets = 8;
8041
8042 // Bytes and packets dropped due to client error
8043 optional int64 dropped_bytes = 9;
8044 optional int64 dropped_packets = 10;
8045}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008046
8047/**
8048 * State of a dangerous permission requested by a package - sampled
8049 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8050*/
8051message DangerousPermissionStateSampled {
8052 // Name of the permission
8053 optional string permission_name = 1;
8054
8055 // Uid of the package
8056 optional int32 uid = 2 [(is_uid) = true];
8057
8058 // If the permission is granted to the uid
8059 optional bool is_granted = 3;
8060
8061 // Permission flags as per android.content.pm.PermissionFlags
8062 optional int32 permission_flags = 4;
8063}
8064
Stan Iliev637ba5e2019-08-16 13:43:08 -04008065/**
8066 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8067 */
8068enum PipelineType {
8069 GL = 0;
8070 VULKAN = 1;
8071}
8072
8073/**
8074 * HWUI stats for a given app.
8075 */
8076message GraphicsStats {
8077 // The package name of the app
8078 optional string package_name = 1;
8079
8080 // The version code of the app
8081 optional int64 version_code = 2;
8082
8083 // The start & end timestamps in UTC as
8084 // milliseconds since January 1, 1970
8085 // Compatible with java.util.Date#setTime()
8086 optional int64 stats_start = 3;
8087
8088 optional int64 stats_end = 4;
8089
8090 // HWUI renders pipeline type: GL or Vulkan.
8091 optional PipelineType pipeline = 5;
8092
8093 // Distinct frame count.
8094 optional int32 total_frames = 6;
8095
8096 // Number of "missed vsync" events.
8097 optional int32 missed_vsync_count = 7;
8098
8099 // Number of frames in triple-buffering scenario (high input latency)
8100 optional int32 high_input_latency_count = 8;
8101
8102 // Number of "slow UI thread" events.
8103 optional int32 slow_ui_thread_count = 9;
8104
8105 // Number of "slow bitmap upload" events.
8106 optional int32 slow_bitmap_upload_count = 10;
8107
8108 // Number of "slow draw" events.
8109 optional int32 slow_draw_count = 11;
8110
8111 // Number of frames that missed their deadline (aka, visibly janked)
8112 optional int32 missed_deadline_count = 12;
8113
8114 // The frame time histogram for the package
8115 optional FrameTimingHistogram cpu_histogram = 13
8116 [(android.os.statsd.log_mode) = MODE_BYTES];
8117
8118 // The gpu frame time histogram for the package
8119 optional FrameTimingHistogram gpu_histogram = 14
8120 [(android.os.statsd.log_mode) = MODE_BYTES];
8121
8122 // UI mainline module version.
8123 optional int64 version_ui_module = 15;
8124
8125 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8126 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8127 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8128 // more apps are running / rendering.
8129 optional bool is_today = 16;
8130}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008131
8132/**
8133 * Message related to dangerous (runtime) app ops access
8134 */
Kenny Root6c218db2020-02-02 17:43:44 +00008135message RuntimeAppOpsAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008136 // Uid of the package accessing app op
8137 optional int32 uid = 1 [(is_uid) = true];
8138
8139 // Name of the package accessing app op
8140 optional string package_name = 2;
8141
Kenny Root6c218db2020-02-02 17:43:44 +00008142 // operation id; maps to the OP_* constants in AppOpsManager.java
8143 optional int32 op_id = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008144
8145 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8146 // Features must be provided through manifest using <feature> tag available in R and above.
8147 optional string feature_id = 4;
8148
8149 // message related to app op access, limited to 600 chars by API
8150 optional string message = 5;
8151
8152 enum SamplingStrategy {
8153 DEFAULT = 0;
8154 UNIFORM = 1;
8155 RARELY_USED = 2;
8156 }
8157
8158 // sampling strategy used to collect this message
8159 optional SamplingStrategy sampling_strategy = 6;
8160}
8161
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008162/*
8163 * Logs userspace reboot outcome and duration.
8164 *
8165 * Logged from:
8166 * frameworks/base/core/java/com/android/server/BootReceiver.java
8167 */
8168message UserspaceRebootReported {
8169 // Possible outcomes of userspace reboot.
8170 enum Outcome {
8171 // Default value in case platform failed to determine the outcome.
8172 OUTCOME_UNKNOWN = 0;
8173 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8174 SUCCESS = 1;
8175 // Userspace reboot shutdown sequence was aborted.
8176 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8177 // Remounting userdata into checkpointing mode failed.
8178 FAILED_USERDATA_REMOUNT = 3;
8179 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8180 // reboot.
8181 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8182 }
8183 // Outcome of userspace reboot. Always set.
8184 optional Outcome outcome = 1;
8185 // Duration of userspace reboot in case it has a successful outcome.
8186 // Duration is measured as time between userspace reboot was initiated and until boot completed
8187 // (e.g. sys.boot_completed=1).
8188 optional int64 duration_millis = 2;
8189 // State of primary user's (user0) credential encryption storage.
8190 enum UserEncryptionState {
8191 // Default value.
8192 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8193 // Credential encrypted storage is unlocked.
8194 UNLOCKED = 1;
8195 // Credential encrypted storage is locked.
8196 LOCKED = 2;
8197 }
8198 // State of primary user's encryption storage at the moment boot completed. Always set.
8199 optional UserEncryptionState user_encryption_state = 3;
8200}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008201
8202/*
8203 * Logs integrity check information during each install.
8204 *
8205 * Logged from:
8206 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8207 */
8208message IntegrityCheckResultReported {
8209 optional string package_name = 1;
8210 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008211 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008212 optional string installer_package_name = 4;
8213 enum Response {
8214 UNKNOWN = 0;
8215 ALLOWED = 1;
8216 REJECTED = 2;
8217 FORCE_ALLOWED = 3;
8218 }
8219 optional Response response = 5;
8220 // An estimate on the cause of the response. This will only be populated for
8221 // REJECTED and FORCE_ALLOWED
8222 optional bool caused_by_app_cert_rule = 6;
8223 optional bool caused_by_installer_rule = 7;
8224}
8225
8226/**
8227 * Logs the information about the rules and the provider whenever rules are
8228 * pushed into AppIntegrityManager.
8229 *
8230 * Logged from:
8231 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8232 */
8233message IntegrityRulesPushed {
8234 optional bool success = 1;
8235 // Package name of the app that pushed the rules.
8236 optional string rule_provider = 2;
8237 // Version string of arbitrary format provided by the rule provider to
8238 // identify the rules.
8239 optional string rule_version = 3;
8240}
Jordan Liubedfa702019-12-20 15:08:45 -08008241
8242/**
8243 * Logs when a cell broadcast message is received on the device.
8244 *
8245 * Logged from CellBroadcastService module:
8246 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8247 */
8248message CellBroadcastMessageReported {
8249 // The type of Cell Broadcast message
8250 enum CbType {
8251 UNKNOWN_TYPE = 0;
8252 GSM = 1;
8253 CDMA = 2;
8254 CDMA_SPC = 3;
8255 }
8256
8257 // GSM, CDMA, CDMA-SCP
8258 optional CbType type = 1;
8259}
8260
8261/**
8262 * Logs when an error occurs while handling a cell broadcast message;
8263 *
8264 * Logged from CellBroadcastService module:
8265 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8266 */
8267message CellBroadcastMessageError {
8268 // The type of error raised when trying to handle a cell broadcast message
8269 enum ErrorType {
8270 UNKNOWN_TYPE = 0;
8271 CDMA_DECODING_ERROR = 1;
8272 CDMA_SCP_EMPTY = 2;
8273 CDMA_SCP_HANDLING_ERROR = 3;
8274 GSM_INVALID_HEADER_LENGTH = 4;
8275 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8276 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8277 GSM_INVALID_PDU = 7;
8278 GSM_INVALID_GEO_FENCING_DATA = 8;
8279 GSM_UMTS_INVALID_WAC = 9;
8280 FAILED_TO_INSERT_TO_DB = 10;
8281 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8282 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8283 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8284 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8285 }
8286
8287 // What kind of error occurred
8288 optional ErrorType type = 1;
8289
8290 // Exception message (or log message) associated with the error (max 1000 chars)
8291 optional string exception_message = 2;
8292}