blob: bf6afe7f2c0f4fde1d858f1df9a4a41ab4ca79b7 [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 =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800130 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 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"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 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"];
tsaichristinececebdc2020-02-04 14:05:56 -0800205 WifiRunningStateChanged wifi_running_state_changed = 114
206 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800210 117 [(module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
214 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
216 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
217 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
219 125 [(module) = "bluetooth"];
220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
221 126 [(module) = "bluetooth"];
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
223 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
228 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800230 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
231 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
232 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
234 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800236 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
237 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
239 142 [(module) = "framework"];
240 AttentionManagerServiceResultReported attention_manager_service_result_reported =
241 143 [(module) = "framework"];
242 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"];
246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
247 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800248 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800249 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
250 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800251 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
252 151 [(module) = "bluetooth"];
253 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
254 152 [(module) = "bluetooth"];
255 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
256 153 [(module) = "bluetooth"];
257 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
258 154 [(module) = "bluetooth"];
259 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
260 155 [(module) = "bluetooth"];
261 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
262 156 [(module) = "bluetooth"];
263 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
264 157 [(module) = "bluetooth"];
265 BluetoothDeviceFailedContactCounterReported
266 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
267 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
268 159 [(module) = "bluetooth"];
269 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
270 160 [(module) = "bluetooth"];
271 BluetoothQualityReportReported bluetooth_quality_report_reported =
272 161 [(module) = "bluetooth"];
273 BluetoothDeviceInfoReported bluetooth_device_info_reported =
274 162 [(module) = "bluetooth"];
275 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
276 163 [(module) = "bluetooth"];
277 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
278 164 [(module) = "bluetooth"];
279 BluetoothBondStateChanged bluetooth_bond_state_changed =
280 165 [(module) = "bluetooth"];
281 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
282 166 [(module) = "bluetooth"];
283 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
284 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800285 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
286 168 [(module) = "framework"];
287 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700288 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800289 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800290 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800291 DeviceIdentifierAccessDenied device_identifier_access_denied =
292 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800293 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800294 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
295 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
296 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800297 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
298 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800299 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700300 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800301 180 [(module) = "permissioncontroller"];
302 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
303 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
306 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
307 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
308 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800309 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
310 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700311 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 188 [(module) = "intelligence"];
313 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
314 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800315 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800317 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
318 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
319 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
320 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
321 MediametricsCodecReported mediametrics_codec_reported = 195;
322 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
323 MediametricsExtractorReported mediametrics_extractor_reported = 197;
324 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
325 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
326 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700327 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800328 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
329 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800330 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
332 206 [(module) = "framework"];
333 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
334 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
335 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
336 LocationManagerApiUsageReported location_manager_api_usage_reported =
337 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100338 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800339 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100340 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800341 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100342 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800343 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100344 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800345 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100346 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800347 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100348 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800349 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100350 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100352 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800354 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
355 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
356 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
357 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800359 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700360 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
361 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100363 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800365 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800366 VmsClientConnectionStateChanged vms_client_connection_state_changed =
367 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800368 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
369 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700370 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 235 [(module) = "mediaprovider"];
372 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700373 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
376 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
377 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
378 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800379 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800380 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000381 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800382 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman079fdaa2020-01-12 16:45:03 -0500383 NotificationPanelReported notification_panel_reported = 245;
Will Brockman492be332020-02-12 16:46:04 -0500384 NotificationChannelModified notification_channel_modified = 246;
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800385 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
386 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800387 CellBroadcastMessageReported cb_message_reported =
388 249 [(module) = "cellbroadcast"];
389 CellBroadcastMessageError cb_message_error =
390 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700391 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
392 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
393 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800394 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000395 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 }
David Chenc8a43242017-10-17 16:23:28 -0700397
David Chen6e3e6cb2018-01-03 16:14:06 -0800398 // Pulled events will start at field 10000.
Yotam Aron74299972020-01-16 16:20:58 +0200399 // Next: 10074
David Chenc8a43242017-10-17 16:23:28 -0700400 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
402 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
403 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
404 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
405 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
406 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800407 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800408 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
409 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
410 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
411 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
412 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
413 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
414 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
415 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
416 SystemUptime system_uptime = 10015 [(module) = "framework"];
417 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
418 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000419 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800420 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
421 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800422 Temperature temperature = 10021 [(module) = "framework"];
423 BinderCalls binder_calls = 10022 [(module) = "framework"];
424 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
425 LooperStats looper_stats = 10024 [(module) = "framework"];
426 DiskStats disk_stats = 10025 [(module) = "framework"];
427 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
428 AppSize app_size = 10027 [(module) = "framework"];
429 CategorySize category_size = 10028 [(module) = "framework"];
430 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800431 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
433 DiskIo disk_io = 10032 [(module) = "framework"];
434 PowerProfile power_profile = 10033 [(module) = "framework"];
435 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
436 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
437 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700438 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
440 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
441 10040 [(module) = "framework"];
442 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
443 10041 [(module) = "framework"];
444 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800445 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
449 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
450 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
451 RoleHolder role_holder = 10049 [(module) = "framework"];
452 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800453 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
455 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800456 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
457 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
459 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
460 FaceSettings face_settings = 10058 [(module) = "framework"];
461 CoolingDevice cooling_device = 10059 [(module) = "framework"];
462 AppOps app_ops = 10060 [(module) = "framework"];
463 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700464 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
465 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800467 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
469 DangerousPermissionStateSampled dangerous_permission_state_sampled =
470 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400471 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000472 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000473 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200474 PackageNotificationPreferences package_notification_preferences =
475 10071 [(module) = "framework"];
476 PackageNotificationChannelPreferences package_notification_channel_preferences =
477 10072 [(module) = "framework"];
478 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
479 10073 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700480 }
yroa1fe77c2018-02-26 14:22:54 -0800481
Bookatz76aafcf2018-09-17 16:17:10 -0700482 // DO NOT USE field numbers above 100,000 in AOSP.
483 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
484 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100485
486 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700487}
488
Yao Chend54f9dd2017-10-17 17:37:48 +0000489/**
Yangster-mac20877162017-12-22 17:19:39 -0800490 * This proto represents a node of an attribution chain.
491 * Note: All attribution chains are represented as a repeated field of type
492 * AttributionNode. It is understood that in such arrays, the order is that
493 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000494 */
Yangster-mac20877162017-12-22 17:19:39 -0800495message AttributionNode {
496 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800497 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800498
Yangster-mac20877162017-12-22 17:19:39 -0800499 // The (optional) string tag for an element in the attribution chain. If the
500 // element has no tag, it is encoded as an empty string.
501 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700502}
503
Yangster-mac48b3d622018-08-18 12:38:11 -0700504message KeyValuePair {
505 optional int32 key = 1;
506 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700507 int32 value_int = 2;
508 int64 value_long = 3;
509 string value_str = 4;
510 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700511 }
512}
513
514message KeyValuePairsAtom {
515 optional int32 uid = 1;
516 repeated KeyValuePair pairs = 2;
517}
518
Yao Chend54f9dd2017-10-17 17:37:48 +0000519/*
520 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800521 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000522 *
523 * RULES:
524 * - The field ids for each atom must start at 1, and count upwards by 1.
525 * Skipping field ids is not allowed.
526 * - These form an API, so renaming, renumbering or removing fields is
527 * not allowed between android releases. (This is not currently enforced,
528 * but there will be a tool to enforce this restriction).
529 * - The types must be built-in protocol buffer types, namely, no sub-messages
530 * are allowed (yet). The bytes type is also not allowed.
531 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800532 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000533 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800534 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 * - A field that is a uid should be a string field, tagged with the [xxx]
536 * annotation. The generated code on android will be represented by UIDs,
537 * and those UIDs will be translated in xxx to those strings.
538 *
539 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700540 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000541 * - If there is a UID, it goes first. Think in an object-oriented fashion.
542 * *****************************************************************************
543 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700544
Yao Chend54f9dd2017-10-17 17:37:48 +0000545/**
Tej Singha72344992019-04-17 18:55:08 -0700546 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700547 * Logs when the Thermal service HAL notifies the throttling start/stop events.
548 *
549 * Logged from:
550 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
551 */
552message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700553 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700554 optional android.os.TemperatureTypeEnum sensor_type = 1;
555
Maggie White442b6312019-04-05 16:26:44 -0700556 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700557 enum State {
558 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700559 START = 1; // START indicated that throttling was triggered.
560 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700561 }
Yangster-mace16189a2018-08-26 12:20:16 -0700562 optional State state = 2;
563
564 optional float temperature = 3;
565}
566
567/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000568 * Logs when the screen state changes.
569 *
570 * Logged from:
571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
572 */
573message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800574 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800575 optional android.view.DisplayStateEnum state = 1
576 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700577}
Yao Chend54f9dd2017-10-17 17:37:48 +0000578
579/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700580 * Logs that the process state of the uid, as determined by ActivityManager
581 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
585 */
Bookatzc1a050a2017-10-10 15:49:28 -0700586message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800587 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000588
Bookatzdb026a22018-01-10 19:01:56 -0800589 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800590 optional android.app.ProcessStateEnum state = 2
591 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000592}
593
594/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700595 * Logs process state change of a process, as per the activity manager.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
599 */
600message ProcessStateChanged {
601 optional int32 uid = 1;
602 optional string process_name = 2;
603 optional string package_name = 3;
604 // TODO: remove this when validation is done
605 optional int64 version = 5;
606 // The state, from frameworks/base/core/proto/android/app/enums.proto.
607 optional android.app.ProcessStateEnum state = 4;
608}
609
610/**
611 * Logs when ActivityManagerService sleep state is changed.
612 *
613 * Logged from:
614 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
615 */
616message ActivityManagerSleepStateChanged {
617 // TODO: import frameworks proto
618 enum State {
619 UNKNOWN = 0;
620 ASLEEP = 1;
621 AWAKE = 2;
622 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800623 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700624}
625
626/**
627 * Logs when system memory state changes.
628 *
629 * Logged from:
630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
631 */
632message MemoryFactorStateChanged {
633 // TODO: import frameworks proto
634 enum State {
635 MEMORY_UNKNOWN = 0;
636 NORMAL = 1; // normal.
637 MODERATE = 2; // moderate memory pressure.
638 LOW = 3; // low memory.
639 CRITICAL = 4; // critical memory.
640
641 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800642 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700643}
644
645/**
646 * Logs when app is using too much cpu, according to ActivityManagerService.
647 *
648 * Logged from:
649 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
650 */
651message ExcessiveCpuUsageReported {
652 optional int32 uid = 1;
653 optional string process_name = 2;
654 optional string package_name = 3;
655 // package version. TODO: remove this when validation is done
656 optional int64 version = 4;
657}
658
659/**
660 * Logs when a cached process is killed, along with its pss.
661 *
662 * Logged from:
663 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
664 */
665message CachedKillReported {
666 optional int32 uid = 1;
667 optional string process_name = 2;
668 optional string package_name = 3;
669 // TODO: remove this when validation is done
670 optional int64 version = 5;
671 optional int64 pss = 4;
672}
673
674/**
xshu2c3d9e42019-09-26 17:54:02 -0700675 * Logs the change in wifi health.
676 *
677 * Logged from:
678 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
679 */
680message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800681 enum Band {
682 UNKNOWN = 0;
683 // All of 2.4GHz band
684 BAND_2G = 1;
685 // Frequencies in the range of [5150, 5250) GHz
686 BAND_5G_LOW = 2;
687 // Frequencies in the range of [5250, 5725) GHz
688 BAND_5G_MIDDLE = 3;
689 // Frequencies in the range of [5725, 5850) GHz
690 BAND_5G_HIGH = 4;
691 // Frequencies in the range of [5925, 6425) GHz
692 BAND_6G_LOW = 5;
693 // Frequencies in the range of [6425, 6875) GHz
694 BAND_6G_MIDDLE = 6;
695 // Frequencies in the range of [6875, 7125) GHz
696 BAND_6G_HIGH = 7;
697 }
xshu2c3d9e42019-09-26 17:54:02 -0700698 // duration this stat is obtained over in milliseconds
699 optional int32 duration_millis = 1;
700 // whether wifi is classified as sufficient for the user's data traffic, determined
701 // by whether the calculated throughput exceeds the average demand within |duration_millis|
702 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700703 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800704 optional bool is_cell_data_available = 3;
705 // the Band bucket the connected network is on
706 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700707}
708
709/**
710 * Logged when wifi detects a significant change in connection failure rate.
711 *
712 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
713 *
714 */
715message WifiFailureStatReported {
716 enum AbnormalityType {
717 UNKNOWN = 0;
718 SIGNIFICANT_INCREASE = 1;
719 SIGNIFICANT_DECREASE = 2;
720 SIMPLY_HIGH = 3;
721 }
722 enum FailureType {
723 FAILURE_UNKNOWN = 0;
724 FAILURE_CONNECTION = 1;
725 FAILURE_ASSOCIATION_REJECTION = 2;
726 FAILURE_ASSOCIATION_TIMEOUT = 3;
727 FAILURE_AUTHENTICATION = 4;
728 FAILURE_NON_LOCAL_DISCONNECTION = 5;
729 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
730 }
731 // Reason for uploading this stat
732 optional AbnormalityType abnormality_type = 1;
733 // The particular type of failure
734 optional FailureType failure_type = 2;
735 // How many times we have encountered this combination of AbnormalityType and FailureType
736 optional int32 failure_count = 3;
737}
738
739/**
740 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
741 *
742 * Logged from:
743 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
744 */
745message WifiConnectionResultReported {
746 enum FailureCode {
747 FAILURE_UNKNOWN = 0;
748 FAILURE_ASSOCIATION_TIMEOUT = 1;
749 FAILURE_ASSOCIATION_REJECTION = 2;
750 FAILURE_AUTHENTICATION_GENERAL = 3;
751 FAILURE_AUTHENTICATION_EAP = 4;
752 FAILURE_DHCP = 5;
753 FAILURE_NETWORK_DISCONNECTION = 6;
754 FAILURE_ROAM_TIMEOUT = 7;
755 }
756 // true represents a successful connection
757 optional bool connection_result = 1;
758 // reason for the connection failure
759 optional FailureCode failure_code = 2;
760 // scan rssi before the connection attempt
761 optional int32 rssi = 3;
762}
763
764/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700765 * Logs when memory stats of a process is reported.
766 *
767 * Logged from:
768 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
769 */
770message ProcessMemoryStatReported {
771 optional int32 uid = 1;
772 optional string process_name = 2;
773 optional string package_name = 3;
774 //TODO: remove this when validation is done
775 optional int64 version = 9;
776 optional int64 pss = 4;
777 optional int64 uss = 5;
778 optional int64 rss = 6;
779 enum Type {
780 ADD_PSS_INTERNAL_SINGLE = 0;
781 ADD_PSS_INTERNAL_ALL_MEM = 1;
782 ADD_PSS_INTERNAL_ALL_POLL = 2;
783 ADD_PSS_EXTERNAL = 3;
784 ADD_PSS_EXTERNAL_SLOW = 4;
785 }
786 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800787 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700788}
789
790/**
Bookatzc1a050a2017-10-10 15:49:28 -0700791 * Logs that a process started, finished, crashed, or ANRed.
792 *
793 * Logged from:
794 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
795 */
796message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700797 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700798
David Chen0b5c90c2018-01-25 16:51:49 -0800799 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800800 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700801
Bookatzddccf0a2017-11-28 16:48:14 -0800802 // What lifecycle state the process changed to.
803 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800804 enum State {
805 FINISHED = 0;
806 STARTED = 1;
807 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800808 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800809 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700810}
811
Bookatzc1a050a2017-10-10 15:49:28 -0700812/**
813 * Logs when the ble scan state changes.
814 *
815 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700816 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700817 */
818message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800819 repeated AttributionNode attribution_node = 1
820 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700821
822 enum State {
823 OFF = 0;
824 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700825 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
826 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700827 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800828 optional State state = 2 [
829 (state_field_option).option = EXCLUSIVE_STATE,
830 (state_field_option).default_state_value = 0 /* State.OFF */,
831 (state_field_option).reset_state_value = 2 /* State.RESET */,
832 (state_field_option).nested = true
833 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700834
Bookatze5ec0b42018-03-26 13:34:56 -0700835 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800836 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700837 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800838 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700839 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800840 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700841}
842
843/**
844 * Logs reporting of a ble scan finding results.
845 *
846 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700847 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700848 */
Bookatzae6738e2018-09-13 11:38:56 -0700849// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700850message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800851 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700852
853 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800854 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700855}
856
857/**
858 * Logs when a sensor state changes.
859 *
860 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700861 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700862 */
863message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800864 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700865
Bookatzc1a050a2017-10-10 15:49:28 -0700866 // The id (int) of the sensor.
867 optional int32 sensor_id = 2;
868
869 enum State {
870 OFF = 0;
871 ON = 1;
872 }
873 optional State state = 3;
874}
875
Bookatzc1a050a2017-10-10 15:49:28 -0700876/**
877 * Logs when GPS state changes.
878 *
879 * Logged from:
880 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
881 */
882message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800883 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700884
885 enum State {
886 OFF = 0;
887 ON = 1;
888 }
889 optional State state = 2;
890}
891
Bookatz48d362e2018-11-06 15:49:08 -0800892/**
893 * Logs when GPS signal quality.
894 *
895 * Logged from:
896 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
897 */
898message GpsSignalQualityChanged {
899 optional android.server.location.GpsSignalQualityEnum level = 1;
900}
901
Bookatzc1a050a2017-10-10 15:49:28 -0700902
903/**
904 * Logs when a sync manager sync state changes.
905 *
906 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700907 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700908 */
909message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800910 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700911
David Chen0b5c90c2018-01-25 16:51:49 -0800912 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800913 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 3;
920}
921
Yangster-mac96353002018-09-05 11:18:55 -0700922/*
923 * Deferred job stats.
924 *
925 * Logged from:
926 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
927*/
928message DeferredJobStatsReported {
929 repeated AttributionNode attribution_node = 1;
930
931 // Number of jobs deferred.
932 optional int32 num_jobs_deferred = 2;
933
934 // Time since the last job runs.
935 optional int64 time_since_last_job_millis = 3;
936}
937
Bookatzc1a050a2017-10-10 15:49:28 -0700938/**
939 * Logs when a job scheduler job state changes.
940 *
941 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700942 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700943 */
944message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800945 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700946
947 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800948 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700949
950 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800951 FINISHED = 0;
952 STARTED = 1;
953 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700954 }
955 optional State state = 3;
956
Tej Singh33a412b2018-03-16 18:43:59 -0700957 // The reason a job has stopped.
958 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700959 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700960 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100961
962 // The standby bucket of the app that scheduled the job. These match the framework constants
963 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
964 // already assigned 0.
965 enum Bucket {
966 UNKNOWN = -1;
967 ACTIVE = 0;
968 WORKING_SET = 1;
969 FREQUENT = 2;
970 RARE = 3;
971 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800972 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100973 }
974 optional Bucket standby_bucket = 5 [default = UNKNOWN];
975
976 // The job id (as assigned by the app).
977 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700978}
979
980/**
981 * Logs when the audio state changes.
982 *
983 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700984 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700985 */
986message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800987 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700988
989 enum State {
990 OFF = 0;
991 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700992 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
993 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700994 }
995 optional State state = 2;
996}
997
998/**
999 * Logs when the video codec state changes.
1000 *
1001 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001002 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001003 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001004message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001005 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001006
1007 enum State {
1008 OFF = 0;
1009 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001010 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1011 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001012 }
1013 optional State state = 2;
1014}
1015
1016/**
1017 * Logs when the flashlight state changes.
1018 *
1019 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001020 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001021 */
1022message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001023 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001024
1025 enum State {
1026 OFF = 0;
1027 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001028 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1029 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001030 }
1031 optional State state = 2;
1032}
1033
1034/**
1035 * Logs when the camera state changes.
1036 *
1037 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001038 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001039 */
1040message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001041 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001042
1043 enum State {
1044 OFF = 0;
1045 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001046 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1047 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001048 }
1049 optional State state = 2;
1050}
1051
1052/**
1053 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001054 *
1055 * Logged from:
1056 * TODO
1057 */
Bookatzd6746242017-10-24 18:39:35 -07001058message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001059 repeated AttributionNode attribution_node = 1
1060 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001061
Bookatz1a1b0462018-01-12 11:47:03 -08001062 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1063 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001064 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001065 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001066
1067 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001068 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001071 RELEASE = 0;
1072 ACQUIRE = 1;
1073 CHANGE_RELEASE = 2;
1074 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001075 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001076 optional State state = 4 [
1077 (state_field_option).option = EXCLUSIVE_STATE,
1078 (state_field_option).default_state_value = 0,
1079 (state_field_option).nested = true
1080 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001081}
1082
1083/**
Bookatzc1a050a2017-10-10 15:49:28 -07001084 * Logs when a partial wakelock is considered 'long' (over 1 min).
1085 *
1086 * Logged from:
1087 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1088 */
1089message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001090 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001091
Yao Chend54f9dd2017-10-17 17:37:48 +00001092 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1093 optional string tag = 2;
1094
Bookatzc1a050a2017-10-10 15:49:28 -07001095 // TODO: I have no idea what this is.
1096 optional string history_tag = 3;
1097
1098 enum State {
1099 OFF = 0;
1100 ON = 1;
1101 }
1102 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001103}
1104
Bookatzc1a050a2017-10-10 15:49:28 -07001105/**
Bookatza66083f2018-09-20 17:24:00 -07001106 * Logs when the device is interactive, according to the PowerManager Notifier.
1107 *
1108 * Logged from:
1109 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1110 */
1111message InteractiveStateChanged {
1112 enum State {
1113 OFF = 0;
1114 ON = 1;
1115 }
1116 optional State state = 1;
1117}
1118
1119/**
Bookatzc1a050a2017-10-10 15:49:28 -07001120 * Logs Battery Saver state change.
1121 *
1122 * Logged from:
1123 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1124 */
1125message BatterySaverModeStateChanged {
1126 enum State {
1127 OFF = 0;
1128 ON = 1;
1129 }
1130 optional State state = 1;
1131}
1132
1133/**
1134 * Logs Doze mode state change.
1135 *
1136 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001137 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001138 */
1139message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001140 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001141}
1142
1143
1144/**
1145 * Logs state change of Doze mode including maintenance windows.
1146 *
1147 * Logged from:
1148 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1149 */
1150message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001151 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001152}
1153
1154/**
1155 * Logs screen brightness level.
1156 *
1157 * Logged from:
1158 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1159 */
1160message ScreenBrightnessChanged {
1161 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1162 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001163}
1164
1165/**
1166 * Logs battery level (percent full, from 0 to 100).
1167 *
1168 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001169 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001170 */
1171message BatteryLevelChanged {
1172 // Battery level. Should be in [0, 100].
1173 optional int32 battery_level = 1;
1174}
1175
1176/**
1177 * Logs change in charging status of the device.
1178 *
1179 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001180 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001181 */
1182message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001183 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1184 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001185}
1186
1187/**
1188 * Logs whether the device is plugged in, and what power source it is using.
1189 *
1190 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001191 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001192 */
1193message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001194 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1195 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001196}
1197
Bookatz8c6571b2017-10-24 15:04:41 -07001198/**
1199 * Logs when an app's wakeup alarm fires.
1200 *
1201 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001202 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001203 */
1204message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001205 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001206
1207 // Name of the wakeup alarm.
1208 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001209
1210 // Name of source package (for historical reasons, since BatteryStats tracked it).
1211 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001212
1213 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1214 enum Bucket {
1215 UNKNOWN = 0;
1216 EXEMPTED = 5;
1217 ACTIVE = 10;
1218 WORKING_SET = 20;
1219 FREQUENT = 30;
1220 RARE = 40;
1221 NEVER = 50;
1222 }
1223 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1224 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001225}
1226
1227/**
1228 * Logs when an an app causes the mobile radio to change state.
1229 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1230 *
1231 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001232 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001233 */
1234message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001235 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001236
Bookatz1a1b0462018-01-12 11:47:03 -08001237 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1238 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001239}
1240
1241/**
1242 * Logs when an an app causes the wifi radio to change state.
1243 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1244 *
1245 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001246 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001247 */
1248message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001249 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001250
Bookatz1a1b0462018-01-12 11:47:03 -08001251 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1252 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001253}
1254
1255/**
1256 * Logs kernel wakeup reasons and aborts.
1257 *
1258 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001259 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001260 */
1261message KernelWakeupReported {
1262 // Name of the kernel wakeup reason (or abort).
1263 optional string wakeup_reason_name = 1;
1264
1265 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001266 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001267}
1268
1269/**
Bookatzda1798c2018-12-13 14:16:00 -08001270 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001271 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001272 *
1273 * Logged from:
1274 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1275 */
1276message WifiEnabledStateChanged {
1277 enum State {
1278 OFF = 0;
1279 ON = 1;
1280 }
1281 optional State state = 1;
1282}
1283
1284/**
tsaichristinececebdc2020-02-04 14:05:56 -08001285 * This atom is deprecated starting in R.
1286 *
Bookatzda1798c2018-12-13 14:16:00 -08001287 * 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 -08001288 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1289 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001290 *
1291 * Logged from:
1292 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1293 */
1294message WifiRunningStateChanged {
1295 repeated AttributionNode attribution_node = 1;
1296
1297 enum State {
1298 OFF = 0;
1299 ON = 1;
1300 }
1301 optional State state = 2;
1302}
1303
1304/**
Bookatze5885242017-10-24 20:10:31 -07001305 * Logs wifi locks held by an app.
1306 *
1307 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001308 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001309 */
1310message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001311 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001312
1313 enum State {
1314 OFF = 0;
1315 ON = 1;
1316 }
1317 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001318
1319 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1320 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001321}
1322
1323/**
1324 * Logs wifi signal strength changes.
1325 *
1326 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001327 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001328 */
1329message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001330 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1331 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001332}
1333
1334/**
1335 * Logs wifi scans performed by an app.
1336 *
1337 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001338 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001339 */
1340message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001341 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001342
1343 enum State {
1344 OFF = 0;
1345 ON = 1;
1346 }
1347 optional State state = 2;
1348}
1349
1350/**
Tej Singh4503e102018-01-04 14:35:01 -08001351 * Logs wifi multicast locks held by an app
1352 *
1353 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001354 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001355 */
1356message WifiMulticastLockStateChanged {
1357 repeated AttributionNode attribution_node = 1;
1358
1359 enum State {
1360 OFF = 0;
1361 ON = 1;
1362 }
1363 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001364
1365 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001366}
1367
1368/**
Tej Singh1ea42892018-01-19 09:27:00 -08001369 * Logs shutdown reason and duration on next boot.
1370 *
1371 * Logged from:
1372 * frameworks/base/core/java/com/android/server/BootReceiver.java
1373 */
1374message ShutdownSequenceReported {
1375 // True if shutdown is for a reboot. Default: false if we do not know.
1376 optional bool reboot = 1;
1377
1378 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1379 optional string reason = 2;
1380
1381 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1382 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001383 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001384
1385 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001386 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001387}
1388
Tej Singh6483ea42018-01-25 17:45:49 -08001389
1390/**
1391 * Logs boot reason and duration.
1392 *
1393 * Logged from:
1394 * system/core/bootstat/bootstat.cpp
1395 */
1396message BootSequenceReported {
1397 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1398 // Default: "<EMPTY>" if not available.
1399 optional string bootloader_reason = 1;
1400
1401 // Reason for system boot. Eg. bootloader, reboot,userrequested
1402 // Default: "<EMPTY>" if not available.
1403 optional string system_reason = 2;
1404
1405 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001406 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001407
1408 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001409 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001410
1411 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001412 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001413
1414 // Time since last boot in ms. Default: 0 if not available.
1415 optional int64 time_since_last_boot = 6;
1416}
1417
Tej Singhc477d9c2018-02-05 18:31:39 -08001418
1419/**
1420 * Logs call state and disconnect cause (if applicable).
1421 *
1422 * Logged from:
1423 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1424 */
1425message CallStateChanged {
1426 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1427 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1428 optional android.telecom.CallStateEnum call_state = 1;
1429
1430 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1431 // This value is only applicable when the call_state is DISCONNECTED, and
1432 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1433 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1434 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1435
1436 // True if the call is self-managed, which are apps that use the
1437 // telecom infrastructure to make their own calls.
1438 optional bool self_managed = 3;
1439
1440 // True if call is external. External calls are calls on connected Wear
1441 // devices but show up in Telecom so the user can pull them onto the device.
1442 optional bool external_call = 4;
1443}
1444
Tej Singh1ea42892018-01-19 09:27:00 -08001445/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001446 * Logs keyguard state. The keyguard is the lock screen.
1447 *
1448 * Logged from:
1449 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1450 */
1451message KeyguardStateChanged {
1452 enum State {
1453 UNKNOWN = 0;
1454 // The keyguard is hidden when the phone is unlocked.
1455 HIDDEN = 1;
1456 // The keyguard is shown when the phone is locked (screen turns off).
1457 SHOWN= 2;
1458 // The keyguard is occluded when something is overlaying the keyguard.
1459 // Eg. Opening the camera while on the lock screen.
1460 OCCLUDED = 3;
1461 }
1462 optional State state = 1;
1463}
1464
1465/**
1466 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1467 * prompts the user to enter a password (pattern, pin, etc).
1468 *
1469 * Logged from:
1470 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1471 */
1472
1473message KeyguardBouncerStateChanged {
1474 enum State {
1475 UNKNOWN = 0;
1476 // Bouncer is hidden, either as a result of successfully entering the
1477 // password, screen timing out, or user going back to lock screen.
1478 HIDDEN = 1;
1479 // This is when the user is being prompted to enter the password.
1480 SHOWN = 2;
1481 }
1482 optional State state = 1;
1483}
1484
1485/**
1486 * Logs the result of entering a password into the keyguard bouncer.
1487 *
1488 * Logged from:
1489 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1490 */
1491message KeyguardBouncerPasswordEntered {
1492 enum BouncerResult {
1493 UNKNOWN = 0;
1494 // The password entered was incorrect.
1495 FAILURE = 1;
1496 // The password entered was correct.
1497 SUCCESS = 2;
1498 }
1499 optional BouncerResult result = 1;
1500}
1501
Tej Singha883b372018-02-15 11:30:01 -08001502/*
1503 * Logs changes to the configuration of the device. The configuration is defined
1504 * in frameworks/base/core/java/android/content/res/Configuration.java
1505 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1506 * Please go there to interpret the possible values each field can be.
1507 *
1508 * Logged from:
1509 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1510 */
1511message ResourceConfigurationChanged {
1512 // Bit mask of color capabilities of the screen.
1513 // Contains information about the color gamut and hdr mode of the screen.
1514 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001515 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001516
1517 // The target screen density being rendered to.
1518 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001519 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001520
1521 // Current user preference for the scaling factor for fonts,
1522 // relative to the base density scaling.
1523 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001524 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001525
1526 // Flag indicating whether the hard keyboard is hidden.
1527 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001528 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001529
1530 // The type of keyboard attached to the device.
1531 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1532 optional int32 keyboard = 5;
1533
1534 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1535 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001536 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001537
1538 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1539 // 0 if undefined.
1540 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1541 optional int32 mcc = 7;
1542
1543 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1544 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1545 // MNC_ZERO symbol defined in Configuration.java.
1546 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1547 optional int32 mnc = 8;
1548
1549 // The kind of navigation available on the device.
1550 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1551 optional int32 navigation = 9;
1552
1553 // Flag indicating whether the navigation is available.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001555 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001556
1557 // Overall orientation of the screen.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1559 optional int32 orientation = 11;
1560
1561 // The current height of the available screen space, in dp units.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // Bit mask of overall layout of the screen.
1566 // Contains information about screen size, whether the screen is wider/taller
1567 // than normal, whether the screen layout is right-tl-left or left-to-right,
1568 // and whether the screen has a rounded shape.
1569 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001570 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001571
1572 // Current width of the available screen space, in dp units.
1573 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001574 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001575
1576 // The smallest screen size an application will see in normal operation.
1577 // This is the smallest value of both screenWidthDp and screenHeightDp
1578 // in portrait and landscape.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // The type of touch screen attached to the device.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1584 optional int32 touchscreen = 16;
1585
1586 // Bit mask of the ui mode.
1587 // Contains information about the overall ui mode of the device.
1588 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1589 // Also contains information about whether the device is in night mode.
1590 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001591 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001592}
1593
Tej Singheee317b2018-03-07 19:28:05 -08001594
1595/**
1596 * Logs changes in the connection state of the mobile radio.
1597 *
1598 * Logged from:
1599 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1600 */
1601message MobileConnectionStateChanged {
1602 // States are from the state machine DataConnection.java.
1603 enum State {
1604 UNKNOWN = 0;
1605 // The connection is inactive, or disconnected.
1606 INACTIVE = 1;
1607 // The connection is being activated, or connecting.
1608 ACTIVATING = 2;
1609 // The connection is active, or connected.
1610 ACTIVE = 3;
1611 // The connection is disconnecting.
1612 DISCONNECTING = 4;
1613 // The connection is disconnecting after creating a connection.
1614 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1615 }
1616 optional State state = 1;
1617 // For multi-sim phones, this distinguishes between the sim cards.
1618 optional int32 sim_slot_index = 2;
1619 // Used to identify the connection. Starts at 0 and increments by 1 for
1620 // every new network created. Resets whenever the device reboots.
1621 optional int32 data_connection_id = 3;
1622 // A bitmask for the capabilities of this connection.
1623 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1624 // Default value (if we have no information): 0
1625 optional int64 capabilities = 4;
1626 // If this connection has internet.
1627 // This just checks if the DEFAULT bit of capabilities is set.
1628 optional bool has_internet = 5;
1629}
1630
1631/**
1632 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1633 *
1634 * Logged from:
1635 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1636 */
1637message MobileRadioTechnologyChanged {
1638 optional android.telephony.NetworkTypeEnum state = 1;
1639 // For multi-sim phones, this distinguishes between the sim cards.
1640 optional int32 sim_slot_index = 2;
1641}
1642
Andrew Chantb56388b2018-03-22 21:07:33 -07001643/**
1644 * Logs the VID and PID of any connected USB devices.
1645 *
1646 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1647 *
1648 * Logged by Vendor.
1649 */
1650message UsbDeviceAttached {
1651 optional int32 vid = 1;
1652 optional int32 pid = 2;
1653 optional bool has_audio = 3;
1654 optional bool has_hid = 4;
1655 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001656 enum State {
1657 STATE_DISCONNECTED = 0;
1658 STATE_CONNECTED = 1;
1659 }
1660 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001661 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001662}
1663
Tej Singheee317b2018-03-07 19:28:05 -08001664
Tej Singhdd7bd352018-02-09 19:33:15 -08001665/**
Tej Singh5d991e12018-03-09 19:48:11 -08001666 * Logs when Bluetooth is enabled and disabled.
1667 *
1668 * Logged from:
1669 * services/core/java/com/android/server/BluetoothManagerService.java
1670 */
1671message BluetoothEnabledStateChanged {
1672 repeated AttributionNode attribution_node = 1;
1673 // Whether or not bluetooth is enabled on the device.
1674 enum State {
1675 UNKNOWN = 0;
1676 ENABLED = 1;
1677 DISABLED = 2;
1678 }
1679 optional State state = 2;
1680 // The reason for being enabled/disabled.
1681 // Eg. Airplane mode, crash, application request.
1682 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1683 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001684 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001685}
1686
1687/**
Jack Hed9837c82019-01-09 01:19:13 -08001688 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001689 *
1690 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001691 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1692 *
1693 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001694 */
1695message BluetoothConnectionStateChanged {
1696 // The state of the connection.
1697 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1698 optional android.bluetooth.ConnectionStateEnum state = 1;
1699 // An identifier that can be used to match connect and disconnect events.
1700 // Currently is last two bytes of a hash of a device level ID and
1701 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001702 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001703 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001704 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1705 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001706 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001707 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001708 // An identifier that can be used to match events for this device.
1709 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1710 // Salt: Randomly generated 256 bit value
1711 // Hash algorithm: HMAC-SHA256
1712 // Size: 32 byte
1713 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001714 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001715}
1716
1717/**
1718 * Logs when a Bluetooth device connects and disconnects over ACL
1719 *
1720 * Logged from:
1721 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1722 *
1723 * Next Tag: 3
1724 */
1725message BluetoothAclConnectionStateChanged {
1726 // An identifier that can be used to match events for this device.
1727 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1728 // Salt: Randomly generated 256 bit value
1729 // Hash algorithm: HMAC-SHA256
1730 // Size: 32 byte
1731 // Default: null or empty if the device identifier is not known
1732 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1733 // The state of the connection.
1734 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1735 optional android.bluetooth.ConnectionStateEnum state = 2;
1736}
1737
1738/**
1739 * Logs when a Bluetooth device connects and disconnects over SCO
1740 *
1741 * Logged from:
1742 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1743 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1744 *
1745 * Next Tag: 4
1746 */
1747message BluetoothScoConnectionStateChanged {
1748 // An identifier that can be used to match events for this device.
1749 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1750 // Salt: Randomly generated 256 bit value
1751 // Hash algorithm: HMAC-SHA256
1752 // Size: 32 byte
1753 // Default: null or empty if the device identifier is not known
1754 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1755 // The state of the connection.
1756 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1757 optional android.bluetooth.ConnectionStateEnum state = 2;
1758 // Codec used for this SCO connection
1759 // Default: UNKNOWN
1760 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001761}
1762
Jack Hec27040a2019-01-09 20:54:41 -08001763/**
1764 * Logged when active device of a profile changes
1765 *
1766 * Logged from:
1767 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1768 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1769 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1770 */
1771message BluetoothActiveDeviceChanged {
1772 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1773 // From android.bluetooth.BluetoothProfile
1774 optional int32 bt_profile = 1;
1775 // An identifier that can be used to match events for this new active device.
1776 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1777 // Salt: Randomly generated 256 bit value
1778 // Hash algorithm: HMAC-SHA256
1779 // Size: 32 byte
1780 // Default: null or empty if there is no active device for this profile
1781 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1782}
1783
Jack Heab86dbd22018-12-18 15:43:27 -08001784// Logs when there is an event affecting Bluetooth device's link layer connection.
1785// - This event is triggered when there is a related HCI command or event
1786// - Users of this metrics can deduce Bluetooth device's connection state from these events
1787// - HCI commands are logged before the command is sent, after receiving command status, and after
1788// receiving command complete
1789// - HCI events are logged when they arrive
1790//
1791// Low level log from system/bt
1792//
1793// Bluetooth classic commands:
1794// - CMD_CREATE_CONNECTION
1795// - CMD_DISCONNECT
1796// - CMD_CREATE_CONNECTION_CANCEL
1797// - CMD_ACCEPT_CONNECTION_REQUEST
1798// - CMD_REJECT_CONNECTION_REQUEST
1799// - CMD_SETUP_ESCO_CONNECTION
1800// - CMD_ACCEPT_ESCO_CONNECTION
1801// - CMD_REJECT_ESCO_CONNECTION
1802// - CMD_ENH_SETUP_ESCO_CONNECTION
1803// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1804//
1805// Bluetooth low energy commands:
1806// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1807// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1808// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1809// - CMD_BLE_CLEAR_WHITE_LIST
1810// - CMD_BLE_ADD_WHITE_LIST
1811// - CMD_BLE_REMOVE_WHITE_LIST
1812//
1813// Bluetooth classic events:
1814// - EVT_CONNECTION_COMP
1815// - EVT_CONNECTION_REQUEST
1816// - EVT_DISCONNECTION_COMP
1817// - EVT_ESCO_CONNECTION_COMP
1818// - EVT_ESCO_CONNECTION_CHANGED
1819//
1820// Bluetooth low energy meta events:
1821// - BLE_EVT_CONN_COMPLETE_EVT
1822// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1823//
1824// Next tag: 10
1825message BluetoothLinkLayerConnectionEvent {
1826 // An identifier that can be used to match events for this device.
1827 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1828 // Salt: Randomly generated 256 bit value
1829 // Hash algorithm: HMAC-SHA256
1830 // Size: 32 byte
1831 // Default: null or empty if the device identifier is not known
1832 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1833 // Connection handle of this connection if available
1834 // Range: 0x0000 - 0x0EFF (12 bits)
1835 // Default: 0xFFFF if the handle is unknown
1836 optional int32 connection_handle = 2;
1837 // Direction of the link
1838 // Default: DIRECTION_UNKNOWN
1839 optional android.bluetooth.DirectionEnum direction = 3;
1840 // Type of this link
1841 // Default: LINK_TYPE_UNKNOWN
1842 optional android.bluetooth.LinkTypeEnum type = 4;
1843
1844 // Reason metadata for this link layer connection event, rules for interpretation:
1845 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1846 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1847 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1848 // set and valid, ignore hci_ble_event
1849
1850 // HCI command associated with this event
1851 // Default: CMD_UNKNOWN
1852 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1853 // HCI event associated with this event
1854 // Default: EVT_UNKNOWN
1855 optional android.bluetooth.hci.EventEnum hci_event = 6;
1856 // HCI BLE meta event associated with this event
1857 // Default: BLE_EVT_UNKNOWN
1858 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1859 // HCI command status code if this is triggerred by hci_cmd
1860 // Default: STATUS_UNKNOWN
1861 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1862 // HCI reason code associated with this event
1863 // Default: STATUS_UNKNOWN
1864 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1865}
1866
Howard Roe103fe22019-01-17 16:52:16 -08001867/**
1868 * Logs when a module is rolled back by Watchdog.
1869 *
1870 * Logged from: Rollback Manager
1871 */
1872message WatchdogRollbackOccurred {
1873 enum RollbackType {
1874 UNKNOWN = 0;
1875 ROLLBACK_INITIATE = 1;
1876 ROLLBACK_SUCCESS = 2;
1877 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001878 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001879 }
1880 optional RollbackType rollback_type = 1;
1881
1882 optional string package_name = 2;
1883
1884 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001885
1886 enum RollbackReasonType {
1887 REASON_UNKNOWN = 0;
1888 REASON_NATIVE_CRASH = 1;
1889 REASON_EXPLICIT_HEALTH_CHECK = 2;
1890 REASON_APP_CRASH = 3;
1891 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001892 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001893 }
1894 optional RollbackReasonType rollback_reason = 4;
1895
1896 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1897 // is initiated. Empty if the package is unknown.
1898 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001899
1900 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001901}
1902
Jack Hec27040a2019-01-09 20:54:41 -08001903/**
1904 * Logs when there is a change in Bluetooth A2DP playback state
1905 *
1906 * Logged from:
1907 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1908 */
1909message BluetoothA2dpPlaybackStateChanged {
1910 // An identifier that can be used to match events for this device.
1911 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1912 // Salt: Randomly generated 256 bit value
1913 // Hash algorithm: HMAC-SHA256
1914 // Size: 32 byte
1915 // Default: null or empty if the device identifier is not known
1916 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1917 // Current playback state
1918 // Default: PLAYBACK_STATE_UNKNOWN
1919 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1920 // Current audio coding mode
1921 // Default: AUDIO_CODING_MODE_UNKNOWN
1922 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1923}
1924
1925/**
1926 * Logs when there is a change in A2DP codec config for a particular remote device
1927 *
1928 * Logged from:
1929 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1930 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1931 */
1932message BluetoothA2dpCodecConfigChanged {
1933 // An identifier that can be used to match events for this device.
1934 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1935 // Salt: Randomly generated 256 bit value
1936 // Hash algorithm: HMAC-SHA256
1937 // Size: 32 byte
1938 // Default: null or empty if the device identifier is not known
1939 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1940 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1941 // Default SOURCE_CODEC_TYPE_INVALID
1942 optional int32 codec_type = 2;
1943 // Codec priroity, the higher the more preferred, -1 for disabled
1944 // Default: CODEC_PRIORITY_DEFAULT
1945 optional int32 codec_priority = 3;
1946 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1947 // Default: SAMPLE_RATE_NONE
1948 optional int32 sample_rate = 4;
1949 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1950 // Default: BITS_PER_SAMPLE_NONE
1951 optional int32 bits_per_sample = 5;
1952 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1953 // Default: CHANNEL_MODE_NONE
1954 optional int32 channel_mode = 6;
1955 // Codec specific values
1956 // Default 0
1957 optional int64 codec_specific_1 = 7;
1958 optional int64 codec_specific_2 = 8;
1959 optional int64 codec_specific_3 = 9;
1960 optional int64 codec_specific_4 = 10;
1961}
1962
1963/**
1964 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1965 * Each codec's capability is logged separately due to statsd restriction
1966 *
1967 * Logged from:
1968 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1969 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1970 */
1971message BluetoothA2dpCodecCapabilityChanged {
1972 // An identifier that can be used to match events for this device.
1973 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1974 // Salt: Randomly generated 256 bit value
1975 // Hash algorithm: HMAC-SHA256
1976 // Size: 32 byte
1977 // Default: null or empty if the device identifier is not known
1978 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1979 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1980 // Default SOURCE_CODEC_TYPE_INVALID
1981 optional int32 codec_type = 2;
1982 // Codec priroity, the higher the more preferred, -1 for disabled
1983 // Default: CODEC_PRIORITY_DEFAULT
1984 optional int32 codec_priority = 3;
1985 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1986 // in BluetoothCodecConfig
1987 // Default: empty and SAMPLE_RATE_NONE for individual item
1988 optional int32 sample_rate = 4;
1989 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1990 // in BluetoothCodecConfig
1991 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1992 optional int32 bits_per_sample = 5;
1993 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1994 // BluetoothCodecConfig
1995 // Default: empty and CHANNEL_MODE_NONE for individual item
1996 optional int32 channel_mode = 6;
1997 // Codec specific values
1998 // Default 0
1999 optional int64 codec_specific_1 = 7;
2000 optional int64 codec_specific_2 = 8;
2001 optional int64 codec_specific_3 = 9;
2002 optional int64 codec_specific_4 = 10;
2003}
2004
2005/**
2006 * Logs when A2DP failed to read from PCM source.
2007 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2008 *
2009 * Logged from:
2010 * system/bt
2011 */
2012message BluetoothA2dpAudioUnderrunReported {
2013 // An identifier that can be used to match events for this device.
2014 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2015 // Salt: Randomly generated 256 bit value
2016 // Hash algorithm: HMAC-SHA256
2017 // Size: 32 byte
2018 // Default: null or empty if the device identifier is not known
2019 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2020 // Encoding interval in nanoseconds
2021 // Default: 0
2022 optional int64 encoding_interval_nanos = 2;
2023 // Number of bytes of PCM data that could not be read from the source
2024 // Default: 0
2025 optional int32 num_missing_pcm_bytes = 3;
2026}
2027
2028/**
2029 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2030 * buffer queue is full and we have to drop data
2031 *
2032 * Logged from:
2033 * system/bt
2034 */
2035message BluetoothA2dpAudioOverrunReported {
2036 // An identifier that can be used to match events for this device.
2037 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2038 // Salt: Randomly generated 256 bit value
2039 // Hash algorithm: HMAC-SHA256
2040 // Size: 32 byte
2041 // Default: null or empty if the device identifier is not known
2042 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2043 // Encoding interval in nanoseconds
2044 // Default: 0
2045 optional int64 encoding_interval_nanos = 2;
2046 // Number of buffers dropped in this event
2047 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2048 // Default: 0
2049 optional int32 num_dropped_buffers = 3;
2050 // Number of encoded buffers dropped in this event
2051 // Default 0
2052 optional int32 num_dropped_encoded_frames = 4;
2053 // Number of encoded bytes dropped in this event
2054 // Default: 0
2055 optional int32 num_dropped_encoded_bytes = 5;
2056}
2057
2058/**
2059 * Logs when we receive reports regarding a device's RSSI value
2060 *
2061 * Logged from:
2062 * system/bt
2063 */
2064message BluetoothDeviceRssiReported {
2065 // An identifier that can be used to match events for this device.
2066 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2067 // Salt: Randomly generated 256 bit value
2068 // Hash algorithm: HMAC-SHA256
2069 // Size: 32 byte
2070 // Default: null or empty if the device identifier is not known
2071 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2072 // Connection handle of this connection if available
2073 // Range: 0x0000 - 0x0EFF (12 bits)
2074 // Default: 0xFFFF if the handle is unknown
2075 optional int32 connection_handle = 2;
2076 // HCI command status code if this is triggerred by hci_cmd
2077 // Default: STATUS_UNKNOWN
2078 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2079 // BR/EDR
2080 // Range: -128 ≤ N ≤ 127 (signed integer)
2081 // Units: dB
2082 // LE:
2083 // Range: -127 to 20, 127 (signed integer)
2084 // Units: dBm
2085 // Invalid when an out of range value is reported
2086 optional int32 rssi = 4;
2087}
2088
2089/**
2090 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2091 *
2092 * Logged from:
2093 * system/bt
2094 */
2095message BluetoothDeviceFailedContactCounterReported {
2096 // An identifier that can be used to match events for this device.
2097 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2098 // Salt: Randomly generated 256 bit value
2099 // Hash algorithm: HMAC-SHA256
2100 // Size: 32 byte
2101 // Default: null or empty if the device identifier is not known
2102 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2103 // Connection handle of this connection if available
2104 // Range: 0x0000 - 0x0EFF (12 bits)
2105 // Default: 0xFFFF if the handle is unknown
2106 optional int32 connection_handle = 2;
2107 // HCI command status code if this is triggerred by hci_cmd
2108 // Default: STATUS_UNKNOWN
2109 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2110 // Number of consecutive failed contacts for a connection corresponding to the Handle
2111 // Range: uint16_t, 0-0xFFFF
2112 // Default: 0xFFFFF
2113 optional int32 failed_contact_counter = 4;
2114}
2115
2116/**
2117 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2118 *
2119 * Logged from:
2120 * system/bt
2121 */
2122message BluetoothDeviceTxPowerLevelReported {
2123 // An identifier that can be used to match events for this device.
2124 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2125 // Salt: Randomly generated 256 bit value
2126 // Hash algorithm: HMAC-SHA256
2127 // Size: 32 byte
2128 // Default: null or empty if the device identifier is not known
2129 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2130 // Connection handle of this connection if available
2131 // Range: 0x0000 - 0x0EFF (12 bits)
2132 // Default: 0xFFFF if the handle is unknown
2133 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002134 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002135 // Default: STATUS_UNKNOWN
2136 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2137 // Range: -30 ≤ N ≤ 20
2138 // Units: dBm
2139 // Invalid when an out of range value is reported
2140 optional int32 transmit_power_level = 4;
2141}
Jack Heab86dbd22018-12-18 15:43:27 -08002142
Tej Singh5d991e12018-03-09 19:48:11 -08002143/**
Jack He1021a612019-01-20 21:22:46 -08002144 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2145 * receiving an HCI command from the host
2146 *
2147 * Logged from: system/bt
2148 */
2149message BluetoothHciTimeoutReported {
2150 // HCI command associated with this event
2151 // Default: CMD_UNKNOWN
2152 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2153}
2154
2155/**
2156 * Logs when we receive Bluetooth Link Quality Report event from the controller
2157 * See Android Bluetooth HCI specification for more details
2158 *
2159 * Note: all count and bytes field are counted since last event
2160 *
2161 * Logged from: system/bt
2162 */
2163message BluetoothQualityReportReported {
2164 // Quality report ID
2165 // Original type: uint8_t
2166 // Default: BQR_ID_UNKNOWN
2167 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2168 // Packet type of the connection
2169 // Original type: uint8_t
2170 // Default: BQR_PACKET_TYPE_UNKNOWN
2171 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2172 // Connection handle of the connection
2173 // Original type: uint16_t
2174 optional int32 connection_handle = 3;
2175 // Performing Role for the connection
2176 // Original type: uint8_t
2177 optional int32 connection_role = 4;
2178 // Current Transmit Power Level for the connection. This value is the same as the controller's
2179 // response to the HCI_Read_Transmit_Power_Level HCI command
2180 // Original type: uint8_t
2181 optional int32 tx_power_level = 5;
2182 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2183 // absolute receiver signal strength value
2184 // Original type: int8_t
2185 optional int32 rssi = 6;
2186 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2187 // channels used by the link currently
2188 // Original type: uint8_t
2189 optional int32 snr = 7;
2190 // Indicates the number of unused channels in AFH_channel_map
2191 // Original type: uint8_t
2192 optional int32 unused_afh_channel_count = 8;
2193 // Indicates the number of the channels which are interfered and quality is bad but are still
2194 // selected for AFH
2195 // Original type: uint8_t
2196 optional int32 afh_select_unideal_channel_count = 9;
2197 // Current Link Supervision Timeout Setting
2198 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2199 // Original type: uint16_t
2200 optional int32 lsto = 10;
2201 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2202 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2203 // 0x01 (Piconet Clock)
2204 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2205 // Original type: uint32_t
2206 optional int64 connection_piconet_clock = 11;
2207 // The count of retransmission
2208 // Original type: uint32_t
2209 optional int64 retransmission_count = 12;
2210 // The count of no RX
2211 // Original type: uint32_t
2212 optional int64 no_rx_count = 13;
2213 // The count of NAK (Negative Acknowledge)
2214 // Original type: uint32_t
2215 optional int64 nak_count = 14;
2216 // Controller timestamp of last TX ACK
2217 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2218 // Original type: uint32_t
2219 optional int64 last_tx_ack_timestamp = 15;
2220 // The count of Flow-off (STOP)
2221 // Original type: uint32_t
2222 optional int64 flow_off_count = 16;
2223 // Controller timestamp of last Flow-on (GO)
2224 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2225 // Original type: uint32_t
2226 optional int64 last_flow_on_timestamp = 17;
2227 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2228 // Original type: uint32_t
2229 optional int64 buffer_overflow_bytes = 18;
2230 // Buffer underflow count (in byte) since last event
2231 // Original type: uint32_t
2232 optional int64 buffer_underflow_bytes = 19;
2233}
2234
2235/**
2236 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2237 *
2238 * Notes:
2239 * - Each event can be partially filled as we might learn different pieces of device
2240 * information at different time
2241 * - Multiple device info events can be combined to give more complete picture
2242 * - When multiple device info events tries to describe the same information, the
2243 * later one wins
2244 *
2245 * Logged from:
2246 * packages/apps/Bluetooth
2247 */
Jack Heaea26982019-04-04 11:19:48 -07002248message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002249 // An identifier that can be used to match events for this device.
2250 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2251 // Salt: Randomly generated 256 bit value
2252 // Hash algorithm: HMAC-SHA256
2253 // Size: 32 byte
2254 // Default: null or empty if the device identifier is not known
2255 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2256 // Where is this device info obtained from
2257 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2258 // Name of the data source
2259 // For EXTERNAL: package name of the data source
2260 // For INTERNAL: null for general case, component name otherwise
2261 optional string source_name = 3;
2262 // Name of the manufacturer of this device
2263 optional string manufacturer = 4;
2264 // Model of this device
2265 optional string model = 5;
2266 // Hardware version of this device
2267 optional string hardware_version = 6;
2268 // Software version of this device
2269 optional string software_version = 7;
2270}
2271
2272/**
2273 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2274 * device, as documented by the Bluetooth Core HCI specification
2275 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2276 * Vol 2, Part E, Page 1118
2277 *
2278 * Logged from:
2279 * system/bt
2280 */
2281message BluetoothRemoteVersionInfoReported {
2282 // Connection handle of the connection
2283 // Original type: uint16_t
2284 optional int32 connection_handle = 1;
2285 // HCI command status code
2286 // Default: STATUS_UNKNOWN
2287 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2288 // 1 byte Version of current LMP in the remote controller
2289 optional int32 lmp_version = 3;
2290 // 2 bytes LMP manufacturer code of the remote controller
2291 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2292 optional int32 lmp_manufacturer_code = 4;
2293 // 4 bytes subversion of the LMP in the remote controller
2294 optional int32 lmp_subversion = 5;
2295}
2296
2297/**
2298 * Logs when certain Bluetooth SDP attributes are discovered
2299 * Constant definitions are from:
2300 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2301 *
2302 * Current logged attributes:
2303 * - BluetoothProfileDescriptorList
2304 * - Supported Features Bitmask
2305 *
2306 * Logged from:
2307 * system/bt
2308 */
2309message BluetoothSdpAttributeReported {
2310 // An identifier that can be used to match events for this device.
2311 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2312 // Salt: Randomly generated 256 bit value
2313 // Hash algorithm: HMAC-SHA256
2314 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2315 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2316 // Original type: uint16_t
2317 optional int32 protocol_uuid = 2;
2318 // Short form UUIDs used to identify Bluetooth SDP attribute types
2319 // Original type: uint16_t
2320 optional int32 attribute_id = 3;
2321 // Attribute value for the particular attribute
2322 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2323}
2324
2325/**
2326 * Logs when bond state of a Bluetooth device changes
2327 *
2328 * Logged from:
2329 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2330 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2331 */
2332message BluetoothBondStateChanged {
2333 // An identifier that can be used to match events for this device.
2334 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2335 // Salt: Randomly generated 256 bit value
2336 // Hash algorithm: HMAC-SHA256
2337 // Size: 32 byte
2338 // Default: null or empty if the device identifier is not known
2339 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2340 // Preferred transport type to remote dual mode device
2341 // Default: TRANSPORT_AUTO means no preference
2342 optional android.bluetooth.TransportTypeEnum transport = 2;
2343 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2344 // Default: UNKNOWN
2345 optional android.bluetooth.DeviceTypeEnum type = 3;
2346 // Current bond state (NONE, BONDING, BONDED)
2347 // Default: BOND_STATE_UNKNOWN
2348 optional android.bluetooth.BondStateEnum bond_state = 4;
2349 // Bonding sub state
2350 // Default: BOND_SUB_STATE_UNKNOWN
2351 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2352 // Unbond Reason
2353 // Default: UNBOND_REASON_UNKNOWN
2354 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2355}
2356
2357/**
2358 * Logs there is an event related Bluetooth classic pairing
2359 *
2360 * Logged from:
2361 * system/bt
2362 */
2363message BluetoothClassicPairingEventReported {
2364 // An identifier that can be used to match events for this device.
2365 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2366 // Salt: Randomly generated 256 bit value
2367 // Hash algorithm: HMAC-SHA256
2368 // Size: 32 byte
2369 // Default: null or empty if the device identifier is not known
2370 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2371 // Connection handle of this connection if available
2372 // Range: 0x0000 - 0x0EFF (12 bits)
2373 // Default: 0xFFFF if the handle is unknown
2374 optional int32 connection_handle = 2;
2375 // HCI command associated with this event
2376 // Default: CMD_UNKNOWN
2377 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2378 // HCI event associated with this event
2379 // Default: EVT_UNKNOWN
2380 optional android.bluetooth.hci.EventEnum hci_event = 4;
2381 // HCI command status code if this is triggerred by hci_cmd
2382 // Default: STATUS_UNKNOWN
2383 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2384 // HCI reason code associated with this event
2385 // Default: STATUS_UNKNOWN
2386 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002387 // A status value related to this specific event
2388 // Default: 0
2389 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002390}
2391
2392/**
2393 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2394 *
2395 * Logged from:
2396 * system/bt
2397 */
2398message BluetoothSmpPairingEventReported {
2399 // An identifier that can be used to match events for this device.
2400 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2401 // Salt: Randomly generated 256 bit value
2402 // Hash algorithm: HMAC-SHA256
2403 // Size: 32 byte
2404 // Default: null or empty if the device identifier is not known
2405 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2406 // SMP command sent or received over L2CAP
2407 // Default: CMD_UNKNOWN
2408 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2409 // Whether this command is sent or received
2410 // Default: DIRECTION_UNKNOWN
2411 optional android.bluetooth.DirectionEnum direction = 3;
2412 // SMP failure reason code
2413 // Default: PAIRING_FAIL_REASON_DEFAULT
2414 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2415}
2416
2417/**
Jack He815cdba2019-01-30 17:24:55 -08002418 * Logs when a Bluetooth socket’s connection state changed
2419 *
2420 * Logged from:
2421 * system/bt
2422 */
2423message BluetoothSocketConnectionStateChanged {
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
Jack Hee4ae0e72019-02-07 13:52:45 -08002429 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002430 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002431 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002432 // Default 0 when unknown or don't care
2433 optional int32 port = 2;
2434 // Socket type as mentioned in
2435 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2436 // Default: SOCKET_TYPE_UNKNOWN
2437 optional android.bluetooth.SocketTypeEnum type = 3;
2438 // Socket connection state
2439 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2440 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2441 // Number of bytes sent to remote device during this connection
2442 optional int64 tx_bytes = 5;
2443 // Number of bytes received from remote device during this connection
2444 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002445 // Socket owner's UID
2446 optional int32 uid = 7 [(is_uid) = true];
2447 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2448 // |port| must be spawned by |server_port|
2449 // Default 0 when unknown or don't care
2450 optional int32 server_port = 8;
2451 // Whether this is a server listener socket
2452 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002453}
2454
2455/**
Jack He71426802019-04-02 13:32:52 -07002456 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2457 *
2458 * Logged from:
2459 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2460 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2461 *
2462 */
2463message BluetoothClassOfDeviceReported {
2464 // An identifier that can be used to match events for this device.
2465 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2466 // Salt: Randomly generated 256 bit value
2467 // Hash algorithm: HMAC-SHA256
2468 // Size: 32 byte
2469 // Default: null or empty if this is a server listener socket
2470 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2471 // Class of Device (CoD) value including both Major, Minor device class and service class
2472 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2473 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2474 // Default: 0
2475 optional int32 class_of_device = 2;
2476}
2477
2478/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002479 * Logs when something is plugged into or removed from the USB-C connector.
2480 *
2481 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002482 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002483 */
2484message UsbConnectorStateChanged {
2485 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002486 STATE_DISCONNECTED = 0;
2487 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002488 }
2489 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002490 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002491 // Last active session in ms.
2492 // 0 when the port is in connected state.
2493 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002494}
2495
2496/**
2497 * Logs the reported speaker impedance.
2498 *
2499 * Logged from:
2500 * Vendor audio implementation.
2501 */
2502message SpeakerImpedanceReported {
2503 optional int32 speaker_location = 1;
2504 optional int32 impedance = 2;
2505}
2506
2507/**
2508 * Logs the report of a failed hardware.
2509 *
2510 * Logged from:
2511 * Vendor HALs.
2512 *
2513 */
2514message HardwareFailed {
2515 enum HardwareType {
2516 HARDWARE_FAILED_UNKNOWN = 0;
2517 HARDWARE_FAILED_MICROPHONE = 1;
2518 HARDWARE_FAILED_CODEC = 2;
2519 HARDWARE_FAILED_SPEAKER = 3;
2520 HARDWARE_FAILED_FINGERPRINT = 4;
2521 }
2522 optional HardwareType hardware_type = 1;
2523
Maggie White6dcd8572019-01-31 14:11:50 -08002524 /**
2525 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002526 * the same hardware_type. The specific locations are vendor defined integers,
2527 * referring to board-specific numbering schemes.
2528 */
2529 optional int32 hardware_location = 2;
2530
Maggie White6dcd8572019-01-31 14:11:50 -08002531 /**
2532 * failure_code is specific to the HardwareType of the failed hardware.
2533 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002534 */
Maggie White6dcd8572019-01-31 14:11:50 -08002535 enum HardwareErrorCode {
2536 UNKNOWN = 0;
2537 COMPLETE = 1;
2538 SPEAKER_HIGH_Z = 2;
2539 SPEAKER_SHORT = 3;
2540 FINGERPRINT_SENSOR_BROKEN = 4;
2541 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002542 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002543 }
2544 optional int32 failure_code = 3;
2545}
2546
2547/**
2548 * Log an event when the device has been physically dropped.
2549 * Reported from the /vendor partition.
2550 */
2551message PhysicalDropDetected {
2552 // Confidence that the event was actually a drop, 0 -> 100
2553 optional int32 confidence_pctg = 1;
2554 // Peak acceleration of the drop, in 1/1000s of a g.
2555 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002556 // Duration of freefall in ms
2557 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002558}
2559
2560/**
2561 * Log bucketed battery charge cycles.
2562 *
2563 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002564 * a given charge point. For example, if 10 cycle buckets are
2565 * initialized, bucket 1 is the lowest 1/10th of the battery,
2566 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002567 *
2568 * Logged from:
2569 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2570 */
2571message ChargeCyclesReported {
2572 optional int32 cycle_bucket_1 = 1;
2573 optional int32 cycle_bucket_2 = 2;
2574 optional int32 cycle_bucket_3 = 3;
2575 optional int32 cycle_bucket_4 = 4;
2576 optional int32 cycle_bucket_5 = 5;
2577 optional int32 cycle_bucket_6 = 6;
2578 optional int32 cycle_bucket_7 = 7;
2579 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002580 optional int32 cycle_bucket_9 = 9;
2581 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002582}
2583
2584/**
Howard Roa46b6582018-09-18 16:45:02 -07002585 * Log battery health snapshot.
2586 *
2587 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2588 * are snapshotted periodically over 24hrs.
2589 */
2590message BatteryHealthSnapshot {
2591 enum BatterySnapshotType {
2592 UNKNOWN = 0;
2593 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2594 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2595 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2596 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2597 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2598 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2599 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2600 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2601 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2602 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2603 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2604 }
2605 optional BatterySnapshotType type = 1;
2606 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002607 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002608 // Voltage Battery Voltage, in microVolts.
2609 optional int32 voltage_micro_volt = 3;
2610 // Current Battery current, in microAmps.
2611 optional int32 current_micro_amps = 4;
2612 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2613 optional int32 open_circuit_micro_volt = 5;
2614 // Resistance Battery Resistance, in microOhms.
2615 optional int32 resistance_micro_ohm = 6;
2616 // Level Battery Level, as % of full.
2617 optional int32 level_percent = 7;
2618}
2619
2620/**
2621 * Log slow I/O operations on the primary storage.
2622 */
2623message SlowIo {
2624 // Classifications of IO Operations.
2625 enum IoOperation {
2626 UNKNOWN = 0;
2627 READ = 1;
2628 WRITE = 2;
2629 UNMAP = 3;
2630 SYNC = 4;
2631 }
2632 optional IoOperation operation = 1;
2633
2634 // The number of slow IO operations of this type over 24 hours.
2635 optional int32 count = 2;
2636}
2637
2638/**
2639 * Log battery caused shutdown with the last recorded voltage.
2640 */
2641message BatteryCausedShutdown {
2642 // The last recorded battery voltage prior to shutdown.
2643 optional int32 last_recorded_micro_volt = 1;
2644}
2645
2646/**
Tej Singha72344992019-04-17 18:55:08 -07002647 * Logs when ThermalService receives throttling events.
2648 *
2649 * Logged from:
2650 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2651 */
2652message ThermalThrottlingSeverityStateChanged {
2653 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2654 optional android.os.TemperatureTypeEnum sensor_type = 1;
2655
2656 // The name of the temperature source. Eg. CPU0
2657 optional string sensor_name = 2;
2658
2659 // Temperature in tenths of a degree C.
2660 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2661 optional int32 temperature_deci_celsius = 3;
2662
2663 // Relative severity of the throttling, see enum definition.
2664 optional android.os.ThrottlingSeverityEnum severity = 4;
2665}
2666
2667/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002668 * Logs the duration of a davey (jank of >=700ms) when it occurs
2669 *
2670 * Logged from:
2671 * frameworks/base/libs/hwui/JankTracker.cpp
2672 */
2673message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002674 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002675 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002676
Tej Singhbb8554a2018-01-26 11:59:14 -08002677 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002678 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002679}
2680
2681/**
Bookatze5885242017-10-24 20:10:31 -07002682 * Logs phone signal strength changes.
2683 *
2684 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002685 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002686 */
2687message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002688 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2689 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002690}
2691
Yangster4ccebea2018-10-09 17:09:02 -07002692
2693/**
2694 * Logs when the phone state, sim state or signal strength changes
2695 *
2696 * Logged from:
2697 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2698 */
2699message PhoneServiceStateChanged {
2700 optional android.telephony.ServiceStateEnum state = 1;
2701 optional android.telephony.SimStateEnum sim_state = 2;
2702 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2703}
2704
2705/**
2706 * Logs when the phone becomes on or off.
2707 *
2708 * Logged from:
2709 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2710 */
2711message PhoneStateChanged {
2712 enum State {
2713 OFF = 0;
2714 ON = 1;
2715 }
2716 optional State state = 1;
2717}
2718
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002719message BackGesture {
2720 enum BackType {
2721 DEFAULT_BACK_TYPE = 0;
2722 COMPLETED = 1;
2723 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2724 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2725 INCOMPLETE = 4;
2726 }
2727 optional BackType type = 1;
2728
2729 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2730 enum WindowHorizontalLocation {
2731 DEFAULT_LOCATION = 0;
2732 LEFT = 1;
2733 RIGHT = 2;
2734 }
2735 optional WindowHorizontalLocation x_location = 3;
2736}
2737
2738message ExclusionRectStateChanged {
2739 optional string component_name = 1; // if not available, simply packageName
2740 optional int32 requested_height = 2; // px
2741 optional int32 rejected_height = 3; // px
2742
2743 enum WindowHorizontalLocation {
2744 DEFAULT_LOCATION = 0;
2745 LEFT = 1;
2746 RIGHT = 2;
2747 }
2748 optional WindowHorizontalLocation x_location = 4;
2749 optional bool landscape = 5;
2750 optional bool splitscreen = 6;
2751 optional int32 duration_millis = 7;
2752}
2753
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002754message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002755 optional android.stats.launcher.LauncherAction action = 1;
2756 optional android.stats.launcher.LauncherState src_state = 2;
2757 optional android.stats.launcher.LauncherState dst_state = 3;
2758 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002759 optional bool is_swipe_up_enabled = 5;
2760}
2761
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002762message StyleUIChanged {
2763 optional android.stats.style.Action action = 1;
2764 optional int32 color_package_hash = 2;
2765 optional int32 font_package_hash = 3;
2766 optional int32 shape_package_hash = 4;
2767 optional int32 clock_package_hash = 5;
2768 optional int32 launcher_grid = 6;
2769 optional int32 wallpaper_category_hash = 7;
2770 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002771 optional int32 color_preference = 9;
2772 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002773}
2774
David Chenc28b2bb2017-10-24 12:52:52 -07002775/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002776 * Logs when Settings UI has changed.
2777 *
2778 * Logged from:
2779 * packages/apps/Settings
2780 */
2781message SettingsUIChanged {
2782 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002783 * Where this SettingsUIChange event comes from. For example, if
2784 * it's a PAGE_VISIBLE event, where the page is opened from.
2785 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002786 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002787
2788 /**
2789 * What the UI action is.
2790 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002791 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002792
2793 /**
2794 * Where the action is happening
2795 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002796 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002797
2798 /**
2799 * What preference changed in this event.
2800 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002801 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002802
2803 /**
2804 * The new value of the changed preference.
2805 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002806 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002807}
2808
2809/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002810 * Logs basic timing information about touch events.
2811 * Reported at most every 5 minutes while device is being interacted with.
2812 *
2813 * Logged from:
2814 * frameworks/native/services/inputflinger
2815 */
2816message TouchEventReported {
2817 /**
2818 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002819 * and the standard deviation of the time spent processing touchscreen events
2820 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002821 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002822 * On supported devices, the starting point is taken during the hard interrupt inside the
2823 * kernel touch driver. On all other devices, the starting point is taken inside
2824 * the kernel's input event subsystem upon receipt of the input event.
2825 * The ending point is taken inside InputDispatcher, just after the input event
2826 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002827 */
2828 // Minimum value
2829 optional float latency_min_micros = 1;
2830 // Maximum value
2831 optional float latency_max_micros = 2;
2832 // Average value
2833 optional float latency_mean_micros = 3;
2834 // Standard deviation
2835 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002836 // Number of touch events (input_event) in this report
2837 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002838}
2839
2840/**
Philip Quinn0eded622019-01-29 12:46:28 -08002841 * Logs gesture classification and timing information for touch events.
2842 *
2843 * Logged from:
2844 * frameworks/base/core/java/android/view/GestureDetector.java
2845 * frameworks/base/core/java/android/view/View.java
2846 */
2847message TouchGestureClassified {
2848 // The source of the classification (e.g. Java class name).
2849 optional string source = 1;
2850
2851 enum Classification {
2852 UNKNOWN_CLASSIFICATION = 0;
2853 SINGLE_TAP = 1;
2854 DOUBLE_TAP = 2;
2855 LONG_PRESS = 3;
2856 DEEP_PRESS = 4;
2857 SCROLL = 5;
2858 }
2859 // The classification of the gesture.
2860 optional Classification classification = 2;
2861
2862 // The interval from the start of a touch event stream until the
2863 // classification was made.
2864 optional int32 latency_millis = 3;
2865
2866 // The distance from the location of the first touch event to the
2867 // location of the touch event when the classification was made.
2868 optional float displacement_px = 4;
2869}
2870
2871/**
David Chenc28b2bb2017-10-24 12:52:52 -07002872 * Logs that a setting was updated.
2873 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002874 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002875 * The tag and is_default allow resetting of settings to default values based on the specified
2876 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2877 */
2878message SettingChanged {
2879 // The name of the setting.
2880 optional string setting = 1;
2881
2882 // The change being imposed on this setting. May represent a number, eg "3".
2883 optional string value = 2;
2884
2885 // The new value of this setting. For most settings, this is same as value. For some settings,
2886 // value is +X or -X where X represents an element in a set. For example, if the previous value
2887 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2888 // The +/- feature is currently only used for location_providers_allowed.
2889 optional string new_value = 3;
2890
2891 // The previous value of this setting.
2892 optional string prev_value = 4;
2893
2894 // The tag used with the is_default for resetting sets of settings. This is generally null.
2895 optional string tag = 5;
2896
Bookatz90867622018-01-31 15:05:57 -08002897 // True if this setting with tag should be resettable.
2898 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002899
David Chenbd789912018-03-16 17:19:55 -07002900 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002901 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002902
2903 enum ChangeReason {
2904 UPDATED = 1; // Updated can be an insertion or an update.
2905 DELETED = 2;
2906 }
2907 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002908}
Chenjie Yub3dda412017-10-24 13:41:59 -07002909
Chenjie Yu05013b32017-11-21 10:21:41 -08002910/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002911 * Logs activity going to foreground or background
2912 *
2913 * Logged from:
2914 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2915 */
2916message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002917 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002918 optional string pkg_name = 2;
2919 optional string class_name = 3;
2920
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002921 enum State {
2922 BACKGROUND = 0;
2923 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002924 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002925 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002926}
David Chenc8a43242017-10-17 16:23:28 -07002927
2928/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002929 * Logs when a volume entered low Storage state.
2930 * Logged from:
2931 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2932 */
2933message LowStorageStateChanged {
2934 // Volume that ran out of storage.
2935 optional string volume_description = 1;
2936
2937 enum State {
2938 UNKNOWN = 0;
2939 OFF = 1;
2940 ON = 2;
2941 }
2942 optional State state = 2;
2943}
2944
2945/**
2946 * Logs when an app is downgraded.
2947 * Logged from:
2948 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2949 */
2950message AppDowngraded {
2951 optional string package_name = 1;
2952 // Size of the package (all data) before being downgraded.
2953 optional int64 size_in_bytes_before = 2;
2954 // Size of the package (all data) after being downgraded.
2955 optional int64 size_in_bytes_after = 3;
2956
2957 optional bool aggressive = 4;
2958}
2959
2960/**
2961 * Logs when an app is optimized after being downgraded.
2962 * Logged from:
2963 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2964 */
2965message AppOptimizedAfterDowngraded {
2966 optional string package_name = 1;
2967}
2968
2969/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002970 * Logs whenever an app is installed on external storage.
2971 * Logged from:
2972 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2973 */
2974message AppInstallOnExternalStorageReported {
2975 // The type of external storage.
2976 optional android.stats.storage.ExternalStorageType storage_type = 1;
2977 // The name of the package that is installed on the sd card.
2978 optional string package_name = 2;
2979}
2980
2981/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002982 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002983 * Logged from:
2984 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2985 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002986message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002987 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002988
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002989 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002990
2991 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002993 optional string process_name = 3;
2994
2995 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002996 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002997
2998 optional string package_name = 5;
2999
3000 enum InstantApp {
3001 UNAVAILABLE = 0;
3002 FALSE = 1;
3003 TRUE = 2;
3004 }
3005 optional InstantApp is_instant_app = 6;
3006
3007 enum ForegroundState {
3008 UNKNOWN = 0;
3009 BACKGROUND = 1;
3010 FOREGROUND = 2;
3011 }
3012 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003013
3014 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003015}
David Chen9e3808c2017-11-20 17:25:34 -08003016
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003017/**
3018 * Logs when a WTF (What a Terrible Failure) happened.
3019 * Logged from:
3020 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3021 */
3022message WTFOccurred {
3023 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003024
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003025 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003026
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003027 // The name of the process.
3028 // system_server if it is not by an app
3029 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003030
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031 // The pid if available. -1 means not available.
3032 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003033
3034 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035}
3036
3037/**
3038 * Logs when system server reports low memory.
3039 * Logged from:
3040 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3041 */
3042message LowMemReported {
3043}
3044
3045/**
3046 * Logs when an app ANR (App Not Responding) occurs.
3047 * Logged from:
3048 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3049 */
3050message ANROccurred {
3051 optional int32 uid = 1 [(is_uid) = true];
3052
3053 optional string process_name = 2;
3054
3055 optional string short_component_name = 3;
3056
3057 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003058
3059 enum InstantApp {
3060 UNAVAILABLE = 0;
3061 FALSE = 1;
3062 TRUE = 2;
3063 }
3064 optional InstantApp is_instant_app = 5;
3065
3066 enum ForegroundState {
3067 UNKNOWN = 0;
3068 BACKGROUND = 1;
3069 FOREGROUND = 2;
3070 }
3071 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003072
3073 optional android.server.ErrorSource error_source = 7;
3074
3075 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003076}
3077
Bookatza7020bd2018-08-28 16:29:35 -07003078/**
3079 * Logs when the vibrator state changes.
3080 * Logged from:
3081 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3082 */
3083message VibratorStateChanged {
3084 repeated AttributionNode attribution_node = 1;
3085
3086 enum State {
3087 OFF = 0;
3088 ON = 1;
3089 }
3090 optional State state = 2;
3091
3092 // Duration (in milliseconds) requested to keep the vibrator on.
3093 // Only applicable for State == ON.
3094 optional int64 duration_millis = 3;
3095}
3096
David Chen0a368b22017-12-06 16:28:16 -08003097/*
3098 * Allows other apps to push events into statsd.
3099 * Logged from:
3100 * frameworks/base/core/java/android/util/StatsLog.java
3101 */
David Chen0b5c90c2018-01-25 16:51:49 -08003102message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003103 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003104 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003105
3106 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3107 optional int32 label = 2;
3108
3109 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3110 // predicates for the metrics).
3111 enum State {
3112 UNKNOWN = 0;
3113 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3114 STOP = 2;
3115 START = 3;
3116 }
3117 optional State state = 3;
3118}
3119
David Chen9e3808c2017-11-20 17:25:34 -08003120/**
Bookatz7948c872018-09-04 12:58:33 -07003121 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3122 * For example, this could be due to the user manually changing the time.
3123 *
3124 * Logged from:
3125 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3126 */
3127message WallClockTimeShifted {
3128 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3129 optional int64 wall_clock_timestamp_millis = 1;
3130}
3131
3132/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003133 * Logs when statsd detects an anomaly.
3134 *
3135 * Logged from:
3136 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3137 */
3138message AnomalyDetected {
3139 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003140 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003141
Yangster-mac94e197c2018-01-02 16:03:03 -08003142 // Id of the config whose anomaly detection alert fired.
3143 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003144
Yangster-mac94e197c2018-01-02 16:03:03 -08003145 // Id of the alert (i.e. name of the anomaly that was detected).
3146 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003147}
3148
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003149message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003150 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003151 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003152
3153 // The app package name.
3154 optional string pkg_name = 2;
3155
3156 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003157 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003158 WARM = 1;
3159 HOT = 2;
3160 COLD = 3;
3161 }
3162 // The transition type.
3163 optional TransitionType type = 3;
3164
3165 // The activity name.
3166 optional string activity_name = 4;
3167
3168 // The name of the calling app. Empty if not set.
3169 optional string calling_pkg_name = 5;
3170
3171 // Whether the app is an instant app.
3172 optional bool is_instant_app = 6;
3173
3174 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003175 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003176
Bookatz80d11a02018-01-16 10:46:35 -08003177 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003178
David Chen0b5c90c2018-01-25 16:51:49 -08003179 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003180 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003181 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003182 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003183 optional int32 bind_application_delay_millis = 11;
3184 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185
3186 // Empty if not set.
3187 optional string launch_token = 13;
3188
Calin Juravle759fbda2018-02-20 19:52:30 +00003189 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003190 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003191
3192 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003193 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003194}
3195
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003196message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003197 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003198 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003199
3200 // The app package name.
3201 optional string pkg_name = 2;
3202
3203 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003204 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205 WARM = 1;
3206 HOT = 2;
3207 COLD = 3;
3208 }
3209 // The transition type.
3210 optional TransitionType type = 3;
3211
3212 // The activity name.
3213 optional string activity_name = 4;
3214}
3215
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003216message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003217 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003218 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003219
3220 // The app package name.
3221 optional string pkg_name = 2;
3222
3223 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003224 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003225 WITH_BUNDLE = 1;
3226 WITHOUT_BUNDLE = 2;
3227 }
3228 // The transition type.
3229 optional TransitionType type = 3;
3230
3231 // The activity name.
3232 optional string activity_name = 4;
3233
3234 optional bool transition_process_running = 5;
3235
3236 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003237 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003238}
3239
Bookatz8fcd09a2017-12-18 13:01:10 -08003240/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003241 * Logs a picture-in-picture action
3242 * Logged from:
3243 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3244 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3245 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3246 */
3247message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003248 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003249 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003250
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003251 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003252
Chenjie Yu52cacc62017-12-08 18:11:45 -08003253 enum State {
3254 ENTERED = 1;
3255 EXPANDED_TO_FULL_SCREEN = 2;
3256 MINIMIZED = 3;
3257 DISMISSED = 4;
3258 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003259 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003260}
3261
3262/**
Chenjie Yue8904192017-12-08 19:12:57 -08003263 * Logs overlay action
3264 * Logged from:
3265 * services/core/java/com/android/server/wm/Session.java
3266 */
3267message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003268 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003269
tsaichristine5adc7e02020-01-14 17:07:39 -08003270 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003271
3272 optional bool using_alert_window = 3;
3273
3274 enum State {
3275 ENTERED = 1;
3276 EXITED = 2;
3277 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003278 optional State state = 4 [
3279 (state_field_option).option = EXCLUSIVE_STATE,
3280 (state_field_option).nested = false,
3281 (state_field_option).default_state_value = 2
3282 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003283}
3284
Chenjie Yuccfe6452018-01-30 11:33:21 -08003285/*
3286 * Logs foreground service starts and stops.
3287 * Note that this is not when a service starts or stops, but when it is
3288 * considered foreground.
3289 * Logged from
3290 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3291 */
3292message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003293 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003294 // package_name + "/" + class_name
3295 optional string short_name = 2;
3296
3297 enum State {
3298 ENTER = 1;
3299 EXIT = 2;
3300 }
3301 optional State state = 3;
3302}
3303
Chenjie Yue8904192017-12-08 19:12:57 -08003304/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003305 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3306 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3307 * attributed back to the parent (host) uid. One example is Chrome.
3308 *
3309 * Logged from:
3310 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3311 */
3312message IsolatedUidChanged {
3313 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003314 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003315 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003316 optional int32 parent_uid = 1;
3317
3318 optional int32 isolated_uid = 2;
3319
3320 // We expect an isolated uid to be removed before if it's used for another parent uid.
3321 enum Event {
3322 REMOVED = 0;
3323 CREATED = 1;
3324 }
3325 optional Event event = 3;
3326}
3327
3328/*
3329 * Logs the reception of an incoming network packet causing the main system to wake up for
3330 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3331 * and processed by WakeupController.cpp.
3332 */
3333message PacketWakeupOccurred {
3334 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3335 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003336 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003337 // The interface name on which the packet was received.
3338 optional string iface = 2;
3339 // The ethertype value of the packet.
3340 optional int32 ethertype = 3;
3341 // String representation of the destination MAC address of the packet.
3342 optional string destination_hardware_address = 4;
3343 // String representation of the source address of the packet if this was an IP packet.
3344 optional string source_ip = 5;
3345 // String representation of the destination address of the packet if this was an IP packet.
3346 optional string destination_ip = 6;
3347 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3348 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3349 // families.
3350 optional int32 ip_next_header = 7;
3351 // The source port if this was a TCP or UDP packet.
3352 optional int32 source_port = 8;
3353 // The destination port if this was a TCP or UDP packet.
3354 optional int32 destination_port = 9;
3355}
3356
3357/*
3358 * Logs the memory stats for an app on startup.
3359 * Logged from:
3360 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3361 */
3362message AppStartMemoryStateCaptured {
3363 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003364 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003365
3366 // The process name.
3367 optional string process_name = 2;
3368
3369 // The activity name.
3370 optional string activity_name = 3;
3371
3372 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003373 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003374
3375 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003376 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003377
3378 // RSS
3379 optional int64 rss_in_bytes = 6;
3380
3381 // CACHE
3382 optional int64 cache_in_bytes = 7;
3383
3384 // SWAP
3385 optional int64 swap_in_bytes = 8;
3386}
3387
3388/*
3389 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3390 * for LMK event.
3391 * Logged from:
3392 * system/core/lmkd/lmkd.c
3393 */
3394message LmkStateChanged {
3395 enum State {
3396 UNKNOWN = 0;
3397 START = 1;
3398 STOP = 2;
3399 }
3400 optional State state = 1;
3401}
3402
3403/*
3404 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3405 * Logged from:
3406 * system/core/lmkd/lmkd.c
3407 */
3408message LmkKillOccurred {
3409 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003410 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003411
3412 // The process name.
3413 optional string process_name = 2;
3414
3415 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003416 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003417
3418 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003419 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003420
3421 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003422 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003423
3424 // RSS
3425 optional int64 rss_in_bytes = 6;
3426
3427 // CACHE
3428 optional int64 cache_in_bytes = 7;
3429
3430 // SWAP
3431 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003432
3433 // The elapsed real time of start of the process.
3434 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003435
3436 // Min oom adj score considered by lmkd.
3437 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003438}
3439
Rajeev Kumar51b54602018-03-01 12:18:26 -08003440/*
3441 * Logs when the ActivityManagerService detects that an app died.
3442 *
3443 * Logged from:
3444 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3445 */
3446message AppDied {
3447 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003448 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003449}
3450
Howard Ro21a039c2018-08-06 14:55:47 -07003451/**
3452 * An atom for generic metrics logging. Available from Android Q.
3453 */
3454message GenericAtom {
3455 // The uid of the application that sent this custom atom.
3456 optional int32 uid = 1 [(is_uid) = true];
3457
3458 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003459 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003460}
3461
Tej Singhd6d6d772018-09-05 17:41:25 -07003462/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003463 * Atom for simple logging of user interaction and impression events, such as "the user touched
3464 * this button" or "this dialog was displayed".
3465 * Keep the UI event stream clean: don't use for system or background events.
3466 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003467 *
3468 * Logged from:
3469 * frameworks/base/services/core/java/com/android/server/
3470 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003471 */
3472message UiEventReported {
3473 // The event_id.
3474 optional int32 event_id = 1;
3475 // The event's source or target uid and package, if applicable.
3476 // For example, the package posting a notification, or the destination package of a share.
3477 optional int32 uid = 2 [(is_uid) = true];
3478 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003479 // An identifier used to disambiguate which logs refer to a particular instance of some
3480 // UI element. Useful when there might be multiple instances simultaneously active.
3481 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003482}
3483
3484/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003485 * Reports a notification was created or updated.
3486 *
3487 * Logged from:
3488 * frameworks/base/services/core/java/com/android/server/notification/
3489 */
3490message NotificationReported {
3491 // The event_id (as for UiEventReported).
3492 optional int32 event_id = 1;
3493 // The notifying app's uid and package.
3494 optional int32 uid = 2 [(is_uid) = true];
3495 optional string package_name = 3;
3496 // A small system-assigned identifier for the notification.
3497 // Locally probably-unique, but expect collisions across users and/or days.
3498 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003499 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3500 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003501
3502 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003503 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3504 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3505 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003506
3507 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003508 optional string category = 10; // App-assigned notification category (API-defined strings)
3509 optional int32 style = 11; // App-assigned notification style
3510 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003511
3512 // Ordering, importance and interruptiveness
3513
Will Brockman7614f6962020-02-10 19:43:03 -05003514 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003515
Will Brockman7614f6962020-02-10 19:43:03 -05003516 optional android.stats.sysui.NotificationImportance importance = 14;
3517 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003518
3519 enum NotificationImportanceExplanation {
3520 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3521 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3522 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3523 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3524 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3525 // Like _APP, but based on pre-channels priority signal.
3526 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3527 }
3528
Will Brockman7614f6962020-02-10 19:43:03 -05003529 optional NotificationImportanceExplanation importance_source = 16;
3530 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3531 optional NotificationImportanceExplanation importance_initial_source = 18;
3532 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3533 optional int32 assistant_hash = 20;
3534 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003535}
3536
3537message Notification {
3538 // The notifying app's uid and package.
3539 optional int32 uid = 1 [(is_uid) = true];
3540 optional string package_name = 2;
3541 // A small system-assigned identifier for the notification.
3542 optional int32 instance_id = 3;
3543
3544 // Grouping information.
3545 optional int32 group_instance_id = 4;
3546 optional bool is_group_summary = 5;
3547
3548 // The section of the shade that the notification is in.
3549 // See NotificationSectionsManager.PriorityBucket.
3550 enum NotificationSection {
3551 SECTION_UNKNOWN = 0;
3552 SECTION_PEOPLE = 1;
3553 SECTION_ALERTING = 2;
3554 SECTION_SILENT = 3;
3555 }
3556 optional NotificationSection section = 6;
3557}
3558
3559message NotificationList {
3560 repeated Notification notifications = 1; // An ordered sequence of notifications.
3561}
3562
3563/**
3564 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3565 *
3566 * Logged from:
3567 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3568 */
3569message NotificationPanelReported {
3570 // The event_id (as for UiEventReported).
3571 optional int32 event_id = 1;
3572 optional int32 num_notifications = 2;
3573 // The notifications in the panel, in the order that they appear there.
3574 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3575}
3576
3577/**
3578 * Reports a notification channel, or channel group, was created, updated, or deleted.
3579 *
3580 * Logged from:
3581 * frameworks/base/services/core/java/com/android/server/notification/
3582 */
3583message NotificationChannelModified {
3584 // The event_id (as for UiEventReported).
3585 optional int32 event_id = 1;
3586 // The notifying app's uid and package.
3587 optional int32 uid = 2 [(is_uid) = true];
3588 optional string package_name = 3;
3589 // App-assigned notification channel ID or channel-group ID
3590 optional string channel_id = 4;
3591 // Previous importance setting, if applicable
3592 optional android.stats.sysui.NotificationImportance old_importance = 5;
3593 // New importance setting
3594 optional android.stats.sysui.NotificationImportance importance = 6;
3595}
3596
3597
3598/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003599 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003600 *
3601 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003602 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003603 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003604message BiometricAcquired {
3605 // Biometric modality that was acquired.
3606 optional android.hardware.biometrics.ModalityEnum modality = 1;
3607 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3608 optional int32 user = 2;
3609 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3610 optional bool is_crypto = 3;
3611 // Action that the device is performing. Acquired messages are only expected for enroll and
3612 // authenticate. Other actions may indicate an error.
3613 optional android.hardware.biometrics.ActionEnum action = 4;
3614 // The client that this acquisition was received for.
3615 optional android.hardware.biometrics.ClientEnum client = 5;
3616 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3617 optional int32 acquire_info = 6;
3618 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3619 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003620 // Dictates if this message should trigger additional debugging.
3621 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003622}
3623
3624/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003625 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003626 *
3627 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003628 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003629 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003630message BiometricAuthenticated {
3631 // Biometric modality that was used.
3632 optional android.hardware.biometrics.ModalityEnum modality = 1;
3633 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3634 optional int32 user = 2;
3635 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3636 // storage.
3637 optional bool is_crypto = 3;
3638 // The client that this acquisition was received for.
3639 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003640 // If authentication requires user confirmation. See BiometricPrompt's
3641 // setRequireConfirmation(bool) method.
3642 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003643
Kevin Chyn1741a072019-01-17 11:54:40 -08003644 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003645 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003646 REJECTED = 1;
3647 PENDING_CONFIRMATION = 2;
3648 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003649 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003650
3651 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003652 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003653 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3654 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3655 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3656 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003657 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003658 // Dictates if this message should trigger additional debugging.
3659 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003660}
3661
3662/**
3663 * Logs when a biometric error occurs.
3664 *
3665 * Logged from:
3666 * frameworks/base/services/core/java/com/android/server/biometrics
3667 */
3668message BiometricErrorOccurred {
3669 // Biometric modality that was used.
3670 optional android.hardware.biometrics.ModalityEnum modality = 1;
3671 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3672 optional int32 user = 2;
3673 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3674 optional bool is_crypto = 3;
3675 // Action that the device is performing.
3676 optional android.hardware.biometrics.ActionEnum action = 4;
3677 // The client that this acquisition was received for.
3678 optional android.hardware.biometrics.ClientEnum client = 5;
3679 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3680 // are unique to modality.
3681 optional int32 error_info = 6;
3682 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3683 // by the vendor and not specified by the HIDL interface.
3684 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003685 // Dictates if this message should trigger additional debugging.
3686 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003687 // Time spent during the authentication attempt.
3688 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003689}
3690
3691/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003692 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003693 * Logged from:
3694 * frameworks/base/services/core/java/com/android/server/biometrics
3695 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003696message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003697 // Biometric modality.
3698 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003699 // Type of issue detected.
3700 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003701 // Dictates if this message should trigger additional debugging.
3702 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003703}
Howard Ro688ae182018-09-25 00:09:36 -07003704
joshmccloskey6f952b22019-03-25 20:59:35 -07003705/**
3706 * Logs when a biometric enrollment occurs.
3707 *
3708 * Logged from:
3709 * frameworks/base/services/core/java/com/android/server/biometrics
3710 */
3711message BiometricEnrolled {
3712 // Biometric modality that was used.
3713 optional android.hardware.biometrics.ModalityEnum modality = 1;
3714 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3715 optional int32 user = 2;
3716 // The amount of time the enrollment took in milliseconds.
3717 optional int64 latency_millis = 3;
3718 // Whether or not the enrollment was successful.
3719 optional bool success = 4;
3720}
3721
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003722/*
Tej Singh0d176952019-01-16 19:10:54 -08003723 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003724 */
Tej Singh0d176952019-01-16 19:10:54 -08003725message FlagFlipUpdateOccurred {
3726 // If the event is from a flag config package, specify the package name.
3727 optional string flag_flip_package_name = 1;
3728
3729 // The order id of the package
3730 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003731}
3732
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003733/**
3734 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003735 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003736 */
3737message TrainExperimentIds {
3738 repeated int64 experiment_id = 1;
3739}
3740
Yangster-macb89807e2018-11-15 21:10:57 -08003741/*
3742 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003743 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003744 */
3745message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003746 // Name of the train.
3747 optional string train_name = 1;
3748 // Version code for a "train" of packages that need to be installed atomically
3749 optional int64 train_version_code = 2;
3750 // After installation of this package, device requires a restart.
3751 optional bool requires_staging = 3;
3752 // Rollback should be enabled for this install.
3753 optional bool rollback_enabled = 4;
3754 // Requires low latency monitoring if possible.
3755 optional bool requires_low_latency_monitor = 5;
3756
Yangster-macb89807e2018-11-15 21:10:57 -08003757 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003758 UNKNOWN = 0;
3759 INSTALL_REQUESTED = 1;
3760 INSTALL_STARTED = 2;
3761 INSTALL_STAGED_NOT_READY = 3;
3762 INSTALL_STAGED_READY = 4;
3763 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003764 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3765 // and INSTALL_FAILURE_COMMIT.
3766 INSTALL_FAILURE = 6 [deprecated = true];
3767 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003768 INSTALL_CANCELLED = 7;
3769 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003770 INSTALLER_ROLLBACK_INITIATED = 9;
3771 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3772 INSTALLER_ROLLBACK_STAGED = 11;
3773 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3774 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3775 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3776 INSTALLER_ROLLBACK_SUCCESS = 15;
3777 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003778 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3779 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3780 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3781 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3782 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3783 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003784 INSTALL_FAILURE_DOWNLOAD = 23;
3785 INSTALL_FAILURE_STATE_MISMATCH = 24;
3786 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003787 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003788 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003789 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003790 // Possible experiment ids for monitoring this push.
3791 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3792 // user id
3793 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003794 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003795 // Whether or not this is a rollback event
3796 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003797}
3798
Tej Singhc9203082019-05-03 13:42:23 -07003799/* Test atom, is not logged anywhere */
3800message TestAtomReported {
3801 repeated AttributionNode attribution_node = 1;
3802 optional int32 int_field = 2;
3803 optional int64 long_field = 3;
3804 optional float float_field = 4;
3805 optional string string_field = 5;
3806 optional bool boolean_field = 6;
3807 enum State {
3808 UNKNOWN = 0;
3809 OFF = 1;
3810 ON = 2;
3811 }
3812 optional State state = 7;
3813 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3814}
3815
Maggie Whitefc1aa592018-11-28 21:55:23 -08003816/** Represents USB port overheat event. */
3817message UsbPortOverheatEvent {
3818 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3819 optional int32 plug_temperature_deci_c = 1;
3820
3821 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3822 optional int32 max_temperature_deci_c = 2;
3823
3824 /* Time between USB plug event and overheat threshold trip, in seconds. */
3825 optional int32 time_to_overheat_secs = 3;
3826
3827 /* Time between overheat threshold trip and hysteresis, in seconds. */
3828 optional int32 time_to_hysteresis_secs = 4;
3829
3830 /* Time between hysteresis and active mitigation ending, in seconds. */
3831 optional int32 time_to_inactive_secs = 5;
3832};
3833
Maggie White8735b852019-01-18 11:40:49 -08003834/**
3835 * Logs total effective full charge and discharge cycles on a battery.
3836 * Here are some examples of one effective cycle:
3837 * 1) the battery charges from 0% to 100% and drains back to 0%,
3838 * 2) charging from 50% to 100% and draining back to 50% twice.
3839 * Pulled from:
3840 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3841 */
3842message BatteryCycleCount {
3843 /* Number of total charge and discharge cycles on the system battery. */
3844 optional int32 cycle_count = 1;
3845}
3846
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003847/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003848 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3849 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003850 * Pulled from:
3851 * StatsCompanionService
3852 */
3853
Carmen Agimof12dec122019-03-06 16:14:38 +00003854message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003855
Carmen Agimof12dec122019-03-06 16:14:38 +00003856 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003857 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003858 PUBLIC = 1;
3859 PRIVATE = 2;
3860 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003861 }
3862
Carmen Agimof12dec122019-03-06 16:14:38 +00003863 // The type of external storage.
3864 optional android.stats.storage.ExternalStorageType storage_type = 1;
3865 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3866 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003867 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003868 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003869}
3870
Yangster-macb89807e2018-11-15 21:10:57 -08003871/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003872 * Logs when a connection becomes available and lost.
3873 * Logged in StatsCompanionService.java
3874 */
3875message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003876 // Id of the network.
3877 optional int32 net_id = 1;
3878
3879 enum State {
3880 UNKNOWN = 0;
3881 CONNECTED = 1;
3882 DISCONNECTED = 2;
3883 }
3884 // Connected state of a network.
3885 optional State state = 2;
3886}
3887
3888/**
3889 * Logs when a service starts and stops.
3890 * Logged from:
3891 * services/core/java/com/android/server/am/ActiveServices.java
3892 */
3893message ServiceStateChanged {
3894
3895 optional int32 uid = 1 [(is_uid) = true];
3896
3897 optional string package_name = 2;
3898
3899 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003900
3901 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003902 START = 1;
3903 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003904 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003905
3906 optional State state = 4;
3907}
3908
3909/**
3910 * Logs when a service is launched.
3911 * Logged from:
3912 * services/core/java/com/android/server/am/ActiveServices.java
3913 */
3914message ServiceLaunchReported {
3915
3916 optional int32 uid = 1 [(is_uid) = true];
3917
3918 optional string package_name = 2;
3919
3920 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003921}
Howard Ro688ae182018-09-25 00:09:36 -07003922
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003923/**
3924 * Logs when a hidden API is used.
3925 *
3926 * Logged from:
3927 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3928 */
3929message HiddenApiUsed {
3930 // The uid of the app making the hidden access.
3931 optional int32 uid = 1 [(is_uid) = true];
3932
3933 // Signature of the method or field accessed.
3934 optional string signature = 2;
3935
3936 enum AccessMethod {
3937 NONE = 0;
3938 REFLECTION = 1;
3939 JNI = 2;
3940 LINKING = 3;
3941 }
3942
3943 // Type of access.
3944 optional AccessMethod access_method = 3;
3945
3946 // Whether the access was prevented or not.
3947 optional bool access_denied = 4;
3948}
3949
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003950/**
3951 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3952 * - When user sees privacy chip
3953 * - When user clicks privacy chip
3954 * - How does the user exit the Privacy Dialog
3955 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003956 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3957 */
3958message PrivacyIndicatorsInteracted {
3959
3960 enum Type {
3961 UNKNOWN = 0;
3962 CHIP_VIEWED = 1;
3963 CHIP_CLICKED = 2;
3964 DIALOG_PRIVACY_SETTINGS = 3;
3965 DIALOG_DISMISS = 4;
3966 DIALOG_LINE_ITEM = 5;
3967 }
3968
tsaichristine5adc7e02020-01-14 17:07:39 -08003969 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003970
3971 // Used if the type is LINE_ITEM
3972 optional string package_name = 2;
3973}
3974
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003975/**
3976 * Logs information about a package that is moved from the internal to external storage and vice
3977 * versa.
3978 * It logs the package name, the type of the external storage where the package is installed
3979 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3980 * and the move type: if it's from internal to external or the other way around.
3981 *
3982 * Logged from:
3983 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3984 */
3985message AppMovedStorageReported {
3986 enum MoveType {
3987 UNKNOWN = 0;
3988 TO_EXTERNAL = 1;
3989 TO_INTERNAL = 2;
3990 }
3991 // The type of the external storage.
3992 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3993 // The type of move.
3994 optional MoveType move_type = 2;
3995 // The name of the package that was moved.
3996 optional string package_name = 3;
3997}
3998
jianjin8f2dee02019-03-29 14:03:08 -07003999/**
4000 * Logs when system server watchdog occurs.
4001 * Logged from:
4002 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4003 */
4004message SystemServerWatchdogOccurred {
4005 optional string subject = 1;
4006}
4007
4008/**
4009 * Logs when new file added to tombstones.
4010 * Logged from:
4011 * frameworks/base/core/java/com/android/server/BootReceiver.java
4012 */
4013message TombStoneOccurred {
4014}
4015
Hai Zhang5d3328d2019-04-13 21:25:06 +08004016/*
4017 * Information about a role request
4018 *
4019 * Logged from:
4020 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4021 */
4022message RoleRequestResultReported {
4023 // UID of application requesting the role
4024 optional int32 requesting_uid = 1;
4025
4026 // Package name of application requesting the role
4027 optional string requesting_package_name = 2;
4028
4029 // The role to be granted
4030 optional string role_name = 3;
4031
4032 // The count of applications qualifying for the role
4033 optional int32 qualifying_count = 4;
4034
4035 // UID of application current granted the role
4036 optional int32 current_uid = 5;
4037
4038 // Package name of application current granted the role
4039 optional string current_package_name = 6;
4040
4041 // UID of another application that user chose to grant the role to, instead of the requesting
4042 // application
4043 optional int32 granted_another_uid = 7;
4044
4045 // Package name of another application that user chose to grant the role to, instead of the
4046 // requesting application
4047 optional string granted_another_package_name = 8;
4048
4049 enum Result {
4050 UNDEFINED = 0;
4051 // role request was ignored
4052 IGNORED = 1;
4053 // role request was ignored because it's already granted
4054 IGNORED_ALREADY_GRANTED = 2;
4055 // role request was ignored because the application isn't qualified
4056 IGNORED_NOT_QUALIFIED = 3;
4057 // role request was ignored because user said it should be always denied
4058 IGNORED_USER_ALWAYS_DENIED = 4;
4059 // role was granted by user action
4060 USER_GRANTED = 5;
4061 // role was denied by user action
4062 USER_DENIED = 6;
4063 // role was denied by user granting another application the role
4064 USER_DENIED_GRANTED_ANOTHER = 7;
4065 // role was denied and set to be always denied by the user
4066 USER_DENIED_WITH_ALWAYS = 8;
4067 }
4068 // The result of the role request
4069 optional Result result = 9;
4070}
4071
Mark Tabrya824a642019-11-05 12:26:12 -08004072/**
4073 * Logs when a Vehicle Maps Service client's connection state has changed
4074 *
4075 * Logged from:
4076 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4077 */
4078message VmsClientConnectionStateChanged {
4079 // The UID of the VMS client app
4080 optional int32 uid = 1 [(is_uid) = true];
4081
4082 enum State {
4083 UNKNOWN = 0;
4084 // Attempting to connect to the client
4085 CONNECTING = 1;
4086 // Client connection established
4087 CONNECTED = 2;
4088 // Client connection closed unexpectedly
4089 DISCONNECTED = 3;
4090 // Client connection closed by VMS
4091 TERMINATED = 4;
4092 // Error establishing the client connection
4093 CONNECTION_ERROR = 5;
4094 }
4095
4096 optional State state = 2;
4097}
4098
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004099/**
4100 * Logs when MediaProvider has successfully finished scanning a storage volume.
4101 *
4102 * Logged from:
4103 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4104 */
4105message MediaProviderScanEvent {
4106 enum Reason {
4107 // Scan triggered due to unknown reason
4108 UNKNOWN = 0;
4109 // Scan triggered due to storage volume being mounted
4110 MOUNTED = 1;
4111 // Scan triggered due to explicit user action or app request
4112 DEMAND = 2;
4113 // Scan triggered due to idle maintenance
4114 IDLE = 3;
4115 }
4116
4117 // Volume type that this event pertains to
4118 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4119 // Reason why this scan was triggered
4120 optional Reason reason = 2;
4121 // Total number of files scanned
4122 optional int64 item_count = 3;
4123 // Duration of scan, normalized per file
4124 optional float normalized_duration_millis = 4;
4125 // Number of database inserts, normalized per file
4126 optional float normalized_insert_count = 5;
4127 // Number of database updates, normalized per file
4128 optional float normalized_update_count = 6;
4129 // Number of database deletes, normalized per file
4130 optional float normalized_delete_count = 7;
4131}
4132
4133/**
4134 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4135 *
4136 * Logged from:
4137 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4138 */
4139message MediaProviderDeletionEvent {
4140 // Volume type that this event pertains to
4141 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4142 // Device timestamp when this deletion event occurred
4143 optional int64 timestamp_millis = 2;
4144 // App that requested deletion
4145 optional string package_name = 3;
4146 // Number of items that were deleted
4147 optional int32 item_count = 4;
4148}
4149
4150/**
4151 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4152 *
4153 * Logged from:
4154 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4155 */
4156message MediaProviderPermissionEvent {
4157 enum Result {
4158 UNKNOWN = 0;
4159 USER_GRANTED = 1;
4160 AUTO_GRANTED = 2;
4161 USER_DENIED = 3;
4162 USER_DENIED_WITH_PREJUDICE = 4;
4163 AUTO_DENIED = 5;
4164 }
4165
4166 // Volume type that this event pertains to
4167 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4168 // Device timestamp when this permission event occurred
4169 optional int64 timestamp_millis = 2;
4170 // App that requested permission
4171 optional string package_name = 3;
4172 // Number of items that were requested
4173 optional int32 item_count = 4;
4174 // Result of this request
4175 optional Result result = 5;
4176}
4177
4178/**
4179 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4180 *
4181 * Logged from:
4182 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4183 */
4184message MediaProviderSchemaChange {
4185 // Volume type that this event pertains to
4186 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4187 // Old database version code
4188 optional int32 version_from = 2;
4189 // New database version code
4190 optional int32 version_to = 3;
4191 // Total number of files in database
4192 optional int64 item_count = 4;
4193 // Duration of schema change, normalized per file
4194 optional float normalized_duration_millis = 5;
4195}
4196
4197/**
4198 * Logs when MediaProvider has finished an idle maintenance job.
4199 *
4200 * Logged from:
4201 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4202 */
4203message MediaProviderIdleMaintenance {
4204 // Volume type that this event pertains to
4205 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4206
4207 // Total number of files in database
4208 optional int64 item_count = 2;
4209 // Duration of idle maintenance, normalized per file
4210 optional float normalized_duration_millis = 3;
4211 // Number of thumbnails found to be stale, normalized per file
4212 optional float normalized_stale_thumbnails = 4;
4213 // Number of items found to be expired, normalized per file
4214 optional float normalized_expired_media = 5;
4215}
4216
Keun young Park3e033cb2019-12-18 11:27:35 -08004217/**
4218 * Represents boot time event with duration in ms.
4219 *
4220 * Logged from: bootstat and various system server components. Check each enums for details.
4221 */
4222message BootTimeEventDuration {
4223 enum DurationEvent {
4224 UNKNOWN = 0;
4225 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4226 ABSOLUTE_BOOT_TIME = 1;
4227 // Bootloader's 1st stage execution time.
4228 // Logged from bootstat.
4229 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4230 // Bootloader's 1st stage loading time.
4231 // Logged from bootstat.
4232 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4233 // Bootloader's kernel loading time.
4234 // Logged from bootstat.
4235 BOOTLOADER_KERNEL_LOAD = 4;
4236 // Bootloader's 2nd stage execution time.
4237 // Logged from bootstat.
4238 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4239 // Bootloader's 2nd stage loading time.
4240 // Logged from bootstat.
4241 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4242 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4243 // for locked device.
4244 // Logged from bootstat.
4245 BOOTLOADER_UI_WAIT = 7;
4246 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4247 // Logged from bootstat.
4248 BOOTLOADER_TOTAL = 8;
4249 // Shutdown duration inside init for the reboot before the current boot up.
4250 // Logged from f/b/services/.../BootReceiver.java.
4251 SHUTDOWN_DURATION = 9;
4252 // Total time for mounting of disk devices during bootup.
4253 // Logged from f/b/services/.../BootReceiver.java.
4254 MOUNT_DEFAULT_DURATION = 10;
4255 // Total time for early stage mounting of disk devices during bootup.
4256 // Logged from f/b/services/.../BootReceiver.java.
4257 MOUNT_EARLY_DURATION = 11;
4258 // Total time for late stage mounting of disk devices during bootup.
4259 // Logged from f/b/services/.../BootReceiver.java.
4260 MOUNT_LATE_DURATION = 12;
4261 // Average time to scan non-system app after OTA
4262 // Logged from f/b/services/.../PackageManagerService.java
4263 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4264 // Time to initialize Package manager after OTA
4265 // Logged from f/b/services/.../PackageManagerService.java
4266 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4267 // Time to scan all system app from Package manager after OTA
4268 // Logged from f/b/services/.../PackageManagerService.java
4269 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4270 // Init's total time for cold boot stage.
4271 // Logged from bootstat.
4272 COLDBOOT_WAIT = 16;
4273 // Init's total time for initializing selinux.
4274 // Logged from bootstat.
4275 SELINUX_INIT = 17;
4276 // Time since last factory reset.
4277 // Logged from bootstat.
4278 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004279 // Init's total time spent for completing the 1st stage.
4280 // Logged from bootstat.
4281 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004282 }
4283
4284 // Type of the event.
4285 optional DurationEvent event = 1;
4286 // Duration of the event in ms.
4287 optional int64 duration_millis = 2;
4288}
4289
4290/**
4291 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4292 * since boot-up.
4293 *
4294 * Logged from: bootstat and various system server components. Check each enums for details.
4295 */
4296message BootTimeEventElapsedTime {
4297 enum ElapsedTimeEvent {
4298 UNKNOWN = 0;
4299 // Time when init starts 1st stage. Logged from bootstat.
4300 ANDROID_INIT_STAGE_1 = 1;
4301 // Time when sys.boot_completed prop is set.
4302 // Logged from bootstat.
4303 BOOT_COMPLETE = 2;
4304 // BOOT_COMPLETE for encrypted device.
4305 BOOT_COMPLETE_ENCRYPTION = 3;
4306 // BOOT_COMPLETE for device with no encryption.
4307 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4308 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004309 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004310 // BOOT_COMPLETE after factory reset.
4311 FACTORY_RESET_BOOT_COMPLETE = 6;
4312 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4313 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004314 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4315 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004316 // BOOT_COMPLETE after OTA.
4317 OTA_BOOT_COMPLETE = 9;
4318 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4319 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004320 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4321 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004322 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4323 // Logged from f/b/services/.../UserController.java
4324 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4325 // Time when the system starts sending BOOT_COMPLETED broadcast.
4326 // Logged from f/b/services/.../UserController.java
4327 FRAMEWORK_BOOT_COMPLETED = 13;
4328 // Time when the package manager starts init.
4329 // Logged from f/b/services/.../SystemServer.java
4330 PACKAGE_MANAGER_INIT_START = 14;
4331 // Time when package manager is ready
4332 // Logged from f/b/services/.../SystemServer.java
4333 PACKAGE_MANAGER_INIT_READY = 15;
4334 // Represents the time when user has entered unlock credential for system with user pin.
4335 // Logged from bootstat.
4336 POST_DECRYPT = 16;
4337 // Represents the start of zygote's init.
4338 // Logged from zygote itself.
4339 ZYGOTE_INIT_START = 17;
4340 // Represents the start of secondary zygote's init.
4341 // TODO: add logging to zygote
4342 SECONDARY_ZYGOTE_INIT_START = 18;
4343 // Represents the start of system server's init.
4344 // Logged from f/b/services/.../SystemServer.java
4345 SYSTEM_SERVER_INIT_START = 19;
4346 // Represents the completion of system server's init.
4347 // Logged from f/b/services/.../SystemServer.java
4348 SYSTEM_SERVER_READY = 20;
4349 // Represents the start of launcher during boot-up.
4350 // TODO: add logging
4351 LAUNCHER_START = 21;
4352 // Represents the completion of launcher's initial rendering. User can use other apps from
4353 // launcher from this point.
4354 // TODO: add logging
4355 LAUNCHER_SHOWN = 22;
4356 }
4357
4358 // Type of the event.
4359 optional ElapsedTimeEvent event = 1;
4360 // Time since bootup for the event.
4361 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4362 optional int64 time_millis = 2;
4363}
4364
4365/**
4366 * Boot time events with UTC time.
4367 *
4368 * Logged from: bootstat and various system server components. Check each enums for details.
4369 */
4370message BootTimeEventUtcTime {
4371 enum UtcTimeEvent {
4372 UNKNOWN = 0;
4373 // Time of the bootstat's marking of 1st boot after the last factory reset.
4374 // Logged from bootstat.
4375 FACTORY_RESET_RESET_TIME = 1;
4376 // The time when bootstat records FACTORY_RESET_* events. This is close to
4377 // BOOT_COMPLETE time for the current bootup.
4378 // Logged from bootstat.
4379 FACTORY_RESET_CURRENT_TIME = 2;
4380 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4381 // Logged from bootstat.
4382 FACTORY_RESET_RECORD_VALUE = 3;
4383 }
4384
4385 // Type of the event.
4386 optional UtcTimeEvent event = 1;
4387 // UTC time for the event.
4388 optional int64 utc_time_secs = 2;
4389}
4390
4391/**
4392 * Boot time events representing specific error code during bootup.
4393 * Meaning of error code can be different per each event type.
4394 *
4395 * Logged from: bootstat and various system server components. Check each enums for details.
4396 */
4397message BootTimeEventErrorCode {
4398 enum ErrorCodeEvent {
4399 UNKNOWN = 0;
4400 // Linux error code for time() call to get the current UTC time.
4401 // Logged from bootstat.
4402 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4403 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4404 // as UMOUNT_STAT_* from init/reboot.cpp.
4405 // Logged from f/b/services/.../BootReceiver.java.
4406 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004407 // Reprepsents fie system mounting error code of /data partition for the current boot.
4408 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004409 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004410 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004411 }
4412
4413 // Type of the event.
4414 optional ErrorCodeEvent event = 1;
4415 // error code defined per each event type.
4416 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4417 // FS_MGR_FS_STAT.
4418 optional int32 error_code = 2;
4419}
4420
Chenjie Yubbcbc602018-02-05 16:51:52 -08004421//////////////////////////////////////////////////////////////////////
4422// Pulled atoms below this line //
4423//////////////////////////////////////////////////////////////////////
4424
4425/**
David Chenc8a43242017-10-17 16:23:28 -07004426 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4427 *
4428 * Pulled from:
4429 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4430 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004431message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004432 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004433
4434 optional int64 rx_bytes = 2;
4435
4436 optional int64 rx_packets = 3;
4437
4438 optional int64 tx_bytes = 4;
4439
4440 optional int64 tx_packets = 5;
4441}
4442
4443/**
4444 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4445 *
4446 * Pulled from:
4447 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4448 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004449message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004450 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004451
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004452 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4453 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004454
4455 optional int64 rx_bytes = 3;
4456
4457 optional int64 rx_packets = 4;
4458
4459 optional int64 tx_bytes = 5;
4460
4461 optional int64 tx_packets = 6;
4462}
4463
4464/**
4465 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4466 *
4467 * Pulled from:
4468 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4469 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004470message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004471 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004472
4473 optional int64 rx_bytes = 2;
4474
4475 optional int64 rx_packets = 3;
4476
4477 optional int64 tx_bytes = 4;
4478
4479 optional int64 tx_packets = 5;
4480}
4481
4482/**
4483 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4484 *
4485 * Pulled from:
4486 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4487 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004488message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004489 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004490
Yao Chenc40a19d2018-03-15 16:48:25 -07004491 // 1 denotes foreground and 0 denotes background. This is called Set in
4492 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004493 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004494
4495 optional int64 rx_bytes = 3;
4496
4497 optional int64 rx_packets = 4;
4498
4499 optional int64 tx_bytes = 5;
4500
4501 optional int64 tx_packets = 6;
4502}
4503
4504/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004505 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4506 *
4507 * Pulled from:
4508 * StatsCompanionService
4509 */
4510message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004511 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004512
4513 optional int64 rx_bytes = 2;
4514
4515 optional int64 tx_bytes = 3;
4516}
4517
4518/**
David Chenc8a43242017-10-17 16:23:28 -07004519 * Pulls the kernel wakelock durations. This atom is adapted from
4520 * android/internal/os/KernelWakelockStats.java
4521 *
4522 * Pulled from:
4523 * StatsCompanionService using KernelWakelockReader.
4524 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004525message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004526 optional string name = 1;
4527
4528 optional int32 count = 2;
4529
4530 optional int32 version = 3;
4531
Yangster-maca8a30442018-10-13 23:46:34 -07004532 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004533}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004534
Chenjie Yu05013b32017-11-21 10:21:41 -08004535/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004536 * Pulls low power state information. If power.stats HAL is not available, this
4537 * includes platform and subsystem sleep state information,
4538 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4539 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004540 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004541 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004542 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4543 * as defined in:
4544 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004546message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004547 // Subsystem name
4548 optional string subsystem_name = 1;
4549 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4550 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004551 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4552 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004553 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004554 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004555 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004556 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004557 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004558}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004559
Chenjie Yu05013b32017-11-21 10:21:41 -08004560/**
Bookatz92da2832018-11-01 18:10:03 -07004561 * Pulls on-device power measurement information.
4562 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4563 * Pulled from:
4564 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4565 */
4566message OnDevicePowerMeasurement {
4567 // Name of the subsystem (to which the rail belongs).
4568 optional string subsystem_name = 1;
4569
4570 // Rail name. The rail lies within the subsystem.
4571 optional string rail_name = 2;
4572
4573 // Time (in ms since boot) at which the rail energy value was measured.
4574 // This may differ slightly from the time that statsd logs this information.
4575 optional uint64 measurement_timestamp_millis = 3;
4576
4577 // Accumulated energy used via the rail since device boot in uWs.
4578 optional uint64 energy_microwatt_secs = 4;
4579}
4580
4581/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004582 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004583 * Pulls the time the cpu spend on the frequency index. Frequency index
4584 * starts from highest to lowest. The value should be monotonically
4585 * increasing since boot. However, if there is a cpu
4586 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004588message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004589 optional uint32 cluster = 1;
4590 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004591 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004592}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004593
Chenjie Yu05013b32017-11-21 10:21:41 -08004594/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004595 * Pulls Cpu Time Per Uid.
4596 * Note that isolated process uid time should be attributed to host uids.
4597 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004598message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004599 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004600 optional uint64 user_time_micros = 2;
4601 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004602}
4603
4604/**
4605 * Pulls Cpu Time Per Uid per frequency.
4606 * Note that isolated process uid time should be attributed to host uids.
4607 * For each uid, we order the time by descending frequencies.
4608 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004609message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004610 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004611 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004612 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004613}
Hugo Benichi884970e2017-11-14 22:42:46 +09004614
Chenjie Yu05013b32017-11-21 10:21:41 -08004615/**
4616 * Pulls Wifi Controller Activity Energy Info
4617 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004618message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004619 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004620 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004621 // stack reported state
4622 // TODO: replace this with proto enum
4623 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004624 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004625 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004626 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004627 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004628 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004629 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004630 // product of current(mA), voltage(V) and time(ms)
4631 optional uint64 controller_energy_used = 6;
4632}
4633
4634/**
4635 * Pulls Modem Activity Energy Info
4636 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004637message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004638 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004639 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004640 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004641 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004642 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004643 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004644 /**
4645 * Tx power index
4646 * index 0 = tx_power < 0dBm
4647 * index 1 = 0dBm < tx_power < 5dBm
4648 * index 2 = 5dBm < tx_power < 15dBm
4649 * index 3 = 15dBm < tx_power < 20dBm
4650 * index 4 = tx_power > 20dBm
4651 */
4652 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004653 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004654 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004655 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004656 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004657 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004658 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004659 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004660 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004661 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004662 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004663 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004664 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004665 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004666}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004667
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004668/**
4669 * Pulls Bluetooth Activity Energy Info
4670 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4671 */
4672message BluetoothActivityInfo {
4673 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004674 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004675 // bluetooth stack state
4676 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004677 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004678 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004679 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004680 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004681 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004682 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004683 // product of current(mA), voltage(V) and time(ms)
4684 optional uint64 energy_used = 6;
4685}
4686
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004687/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004688 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004689 *
4690 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004691 */
4692message ProcessMemoryState {
4693 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004694 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004695
4696 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004697 // Usually package name, "system" for system server.
4698 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004699 optional string process_name = 2;
4700
Rafal Slawikda51b932018-12-13 16:31:33 +00004701 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004702 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004703
4704 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004705 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004706
4707 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004708 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004709
Rajeev Kumar90235992018-01-29 11:06:48 -08004710 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004711 // Value is read from memory.stat, field total_rss if per-app memory
4712 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004713 optional int64 rss_in_bytes = 6;
4714
4715 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004716 // Value is read from memory.stat, field total_cache if per-app memory
4717 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004718 optional int64 cache_in_bytes = 7;
4719
4720 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004721 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004722 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004723 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004724
Rafal Slawik203c3db2019-09-25 19:53:01 +01004725 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004726 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004727
Rafal Slawik203c3db2019-09-25 19:53:01 +01004728 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4729 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004730
Rafal Slawik203c3db2019-09-25 19:53:01 +01004731 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4732 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004733}
4734
4735/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004736 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004737 *
4738 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4739 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004740 *
4741 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004742 */
4743message ProcessMemoryHighWaterMark {
4744 // The uid if available. -1 means not available.
4745 optional int32 uid = 1 [(is_uid) = true];
4746
Rafal Slawikda51b932018-12-13 16:31:33 +00004747 // The process name.
4748 // Usually package name or process cmdline.
4749 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004750 optional string process_name = 2;
4751
Rafal Slawik239b6802019-09-09 18:46:01 +01004752 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4753 // computed by converting kilobytes to bytes.
4754 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4755
Rafal Slawik3bea8952018-11-15 12:39:33 +00004756 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4757 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004758 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004759}
4760
4761/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004762 * Logs the memory stats for a process.
4763 *
4764 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4765 * and for selected native processes.
4766 */
4767message ProcessMemorySnapshot {
4768 // The uid if available. -1 means not available.
4769 optional int32 uid = 1 [(is_uid) = true];
4770
4771 // The process name.
4772 // Usually package name or process cmdline.
4773 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4774 optional string process_name = 2;
4775
4776 // The pid of the process.
4777 // Allows to disambiguate instances of the process.
4778 optional int32 pid = 3;
4779
4780 // The current OOM score adjustment value.
4781 // Read from ProcessRecord for managed processes.
4782 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4783 optional int32 oom_score_adj = 4;
4784
4785 // The current RSS of the process.
4786 // VmRSS from /proc/pid/status.
4787 optional int32 rss_in_kilobytes = 5;
4788
4789 // The current anon RSS of the process.
4790 // RssAnon from /proc/pid/status.
4791 optional int32 anon_rss_in_kilobytes = 6;
4792
4793 // The current swap size of the process.
4794 // VmSwap from /proc/pid/status.
4795 optional int32 swap_in_kilobytes = 7;
4796
4797 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4798 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4799}
4800
4801/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004802 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004803 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004804message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004805 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004806}
4807
4808/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004809 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004810 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004811message SystemUptime {
4812 // Milliseconds since the system was booted.
4813 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4814 // for external input).
4815 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004816 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004817}
4818
4819/*
4820 * Reads from /proc/uid_concurrent_active_time which has the format:
4821 * active: X (X is # cores)
4822 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4823 * [uid1]: [time-0] [time-1] [time-2] ... ...
4824 * ...
4825 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4826 * The file contains a monotonically increasing count of time for a single boot.
4827 */
4828message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004829 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004830 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004831}
4832
4833/**
4834 * Reads from /proc/uid_concurrent_policy_time which has the format:
4835 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4836 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4837 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4838 * ...
4839 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4840 * The file contains a monotonically increasing count of time for a single boot.
4841 */
4842message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004843 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004844 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004845 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004846}
4847
4848/*
4849 * Pulls free disk space, for data, system partition and temporary directory.
4850 */
4851message DiskSpace {
4852 // available bytes in data partition
4853 optional uint64 data_available_bytes = 1;
4854 // available bytes in system partition
4855 optional uint64 system_available_bytes = 2;
4856 // available bytes in download cache or temp directories
4857 optional uint64 temp_available_bytes = 3;
4858}
Tej Singhbf972d92018-01-10 20:51:13 -08004859
4860/**
4861 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004862 *
4863 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004864 */
4865message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004866 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004867}
4868
4869/**
4870 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004871 * Pulled from:
4872 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004873 */
4874message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004875 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004876}
4877
4878/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004879 * Pulls battery voltage.
4880 * Pulled from:
4881 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4882 */
4883message BatteryVoltage {
4884 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004885 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004886}
4887
4888/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004889 * Pulls battery level (percent full, from 0 to 100).
4890 *
4891 * Pulled from:
4892 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4893 */
4894message BatteryLevel {
4895 // Battery level. Should be in [0, 100].
4896 optional int32 battery_level = 1;
4897}
4898
4899/**
Tej Singhd89137e2018-03-26 14:51:40 -07004900 * Pulls the temperature of various parts of the device.
4901 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004902 *
Maggie White442b6312019-04-05 16:26:44 -07004903 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004904 */
4905message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004906 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004907 optional android.os.TemperatureTypeEnum sensor_location = 1;
4908
4909 // The name of the temperature source. Eg. CPU0
4910 optional string sensor_name = 2;
4911
Tej Singhd89137e2018-03-26 14:51:40 -07004912 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004913 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004914 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004915
4916 // Relative severity of the throttling, see enum definition.
4917 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004918}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004919
4920/**
4921 * Pulls the statistics of calls to Binder.
4922 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004923 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4924 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004925 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004926 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004927 */
4928message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004929 // UID of the process responsible for the binder transaction. It will be set if the process
4930 // executing the binder transaction attribute the transaction to another uid using
4931 // Binder.setThreadWorkSource().
4932 //
4933 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004934 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004935 // UID of the process executing the binder transaction.
4936 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004937 // Fully qualified class name of the API call.
4938 //
4939 // This is a system server class name.
4940 //
4941 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4942 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4943 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4944 // commonly used APIs.
4945 optional string service_class_name = 2;
4946 // Method name of the API call. It can also be a transaction code if we cannot
4947 // resolve it to a name. See Binder#getTransactionName.
4948 //
4949 // This is a system server method name.
4950 optional string service_method_name = 3;
4951 // Total number of API calls.
4952 optional int64 call_count = 4;
4953 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4954 optional bool screen_interactive = 13;
4955 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4956 // call_count will be equal to recorded_call_count.
4957 //
4958 // If recorded_call_count is different than call_count, it means data collection has been
4959 // sampled. All the fields below will be sampled in this case.
4960 optional int64 recorded_call_count = 12;
4961 // Number of exceptions thrown by the API.
4962 optional int64 recorded_exception_count = 5;
4963 // Total latency of all API calls.
4964 // Average can be computed using total_latency_micros / recorded_call_count.
4965 optional int64 recorded_total_latency_micros = 6;
4966 // Maximum latency of one API call.
4967 optional int64 recorded_max_latency_micros = 7;
4968 // Total CPU usage of all API calls.
4969 // Average can be computed using total_cpu_micros / recorded_call_count.
4970 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4971 optional int64 recorded_total_cpu_micros = 8;
4972 // Maximum CPU usage of one API call.
4973 optional int64 recorded_max_cpu_micros = 9;
4974 // Maximum parcel reply size of one API call.
4975 optional int64 recorded_max_reply_size_bytes = 10;
4976 // Maximum parcel request size of one API call.
4977 optional int64 recorded_max_request_size_bytes = 11;
4978}
4979
4980/**
4981 * Pulls the statistics of exceptions during calls to Binder.
4982 *
4983 * Binder stats are cumulative from boot unless somebody reset the data using
4984 * > adb shell dumpsys binder_calls_stats --reset
4985 */
4986message BinderCallsExceptions {
4987 // Exception class name, e.g. java.lang.IllegalArgumentException.
4988 //
4989 // This is an exception class name thrown by the system server.
4990 optional string exception_class_name = 1;
4991 // Total number of exceptions.
4992 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004993}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004994
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004995/**
4996 * Pulls the statistics of message dispatching on HandlerThreads.
4997 *
4998 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4999 * config on the device.
5000 *
5001 * Next tag: 11
5002 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005003message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005004 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005005 optional int32 uid = 1 [(is_uid) = true];
5006
5007 // Fully qualified class name of the handler target class.
5008 //
5009 // This field does not contain PII. This is a system server class name.
5010 optional string handler_class_name = 2;
5011
5012 // The name of the thread that runs the Looper.
5013 //
5014 // This field does not contain PII. This is a system server thread name.
5015 optional string looper_thread_name = 3;
5016
5017 // The name of the dispatched message.
5018 //
5019 // This field does not contain PII. This is a system server constant or class
5020 // name.
5021 optional string message_name = 4;
5022
5023 // Total number of successfully dispatched messages.
5024 optional int64 message_count = 5;
5025
5026 // Total number of messages that failed dispatching.
5027 optional int64 exception_count = 6;
5028
5029 // Total number of processed messages we have data recorded for. If we
5030 // collected data for all the messages, message_count will be equal to
5031 // recorded_message_count.
5032 //
5033 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005034 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005035 optional int64 recorded_message_count = 7;
5036
5037 // Total latency of all processed messages.
5038 // Average can be computed using recorded_total_latency_micros /
5039 // recorded_message_count.
5040 optional int64 recorded_total_latency_micros = 8;
5041
5042 // Total CPU usage of all processed message.
5043 // Average can be computed using recorded_total_cpu_micros /
5044 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005045 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005046 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005047
5048 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5049 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005050
5051 // Max recorded CPU usage of all processed messages.
5052 optional int64 recorded_max_cpu_micros = 11;
5053
5054 // Max recorded latency of all processed messages.
5055 optional int64 recorded_max_latency_micros = 12;
5056
5057 // Total number of messages we tracked the dispatching delay for. If we
5058 // collected data for all the messages, message_count will be equal to
5059 // recorded_delay_message_count.
5060 //
5061 // If recorded_delay_message_count is different than message_count, it means data
5062 // collection has been sampled or/and not all messages specified the target dispatch time.
5063 // The fields below will be sampled in this case.
5064 optional int64 recorded_delay_message_count = 13;
5065
5066 // Total dispatching delay of all processed messages.
5067 // Calculated as a difference between the target dispatching time (Message.when)
5068 // and the actual dispatching time.
5069 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5070 optional int64 recorded_total_delay_millis = 14;
5071
5072 // Max dispatching delay of all processed messages.
5073 // Calculated as a difference between the target dispatching time (Message.when)
5074 // and the actual dispatching time.
5075 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005076}
Tej Singh86dc9db2018-09-06 00:39:57 +00005077
5078/**
5079 * Pulls disk information, such as write speed and latency.
5080 */
5081message DiskStats {
5082 // Time taken to open, write 512B to, and close a file.
5083 // -1 if error performing the check.
5084 optional int64 data_write_latency_millis = 1;
5085
5086 optional bool file_based_encryption = 2;
5087
5088 // Recent disk write speed in kB/s.
5089 // -1 if error querying storageed.
5090 // 0 if data is unavailable.
5091 optional int32 recent_disk_write_speed = 3;
5092}
5093
5094
5095/**
5096 * Free and total bytes of the Data, Cache, and System partition.
5097 */
5098message DirectoryUsage {
5099 enum Directory {
5100 UNKNOWN = 0;
5101 DATA = 1;
5102 CACHE = 2;
5103 SYSTEM = 3;
5104 }
5105 optional Directory directory = 1;
5106 optional int64 free_bytes = 2;
5107 optional int64 total_bytes = 3;
5108}
5109
5110
5111/**
5112 * Size of an application: apk size, data size, and cache size.
5113 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5114 * Information is only reported for apps with the primary user (user 0).
5115 * Sizes are aggregated by package name.
5116 */
5117message AppSize {
5118 // Including uids will involve modifying diskstats logic.
5119 optional string package_name = 1;
5120 // App size in bytes. -1 if unavailable.
5121 optional int64 app_size_bytes = 2;
5122 // App data size in bytes. -1 if unavailable.
5123 optional int64 app_data_size_bytes = 3;
5124 // App cache size in bytes. -1 if unavailable.
5125 optional int64 app_cache_size_bytes = 4;
5126 // Time that the cache file was produced.
5127 // Uses System.currentTimeMillis(), which is wall clock time.
5128 optional int64 cache_time_millis = 5;
5129}
5130
5131
5132/**
5133 * Size of a particular category. Eg: photos, videos.
5134 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5135 */
5136message CategorySize {
5137 enum Category {
5138 UNKNOWN = 0;
5139 APP_SIZE = 1;
5140 APP_DATA_SIZE = 2;
5141 APP_CACHE_SIZE = 3;
5142 PHOTOS = 4;
5143 VIDEOS = 5;
5144 AUDIO = 6;
5145 DOWNLOADS = 7;
5146 SYSTEM = 8;
5147 OTHER = 9;
5148 }
5149 optional Category category = 1;
5150 // Category size in bytes.
5151 optional int64 size_bytes = 2;
5152 // Time that the cache file was produced.
5153 // Uses System.currentTimeMillis(), which is wall clock time.
5154 optional int64 cache_time_millis = 3;
5155}
Tej Singhd6d6d772018-09-05 17:41:25 -07005156
5157/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005158 * Pulls per uid I/O stats. The stats are cumulative since boot.
5159 *
5160 * Read/write bytes are I/O events from a storage device
5161 * Read/write chars are data requested by read/write syscalls, and can be
5162 * satisfied by caching.
5163 *
5164 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5165 */
5166message DiskIo {
5167 optional int32 uid = 1 [(is_uid) = true];
5168 optional int64 fg_chars_read = 2;
5169 optional int64 fg_chars_write = 3;
5170 optional int64 fg_bytes_read = 4;
5171 optional int64 fg_bytes_write = 5;
5172 optional int64 bg_chars_read = 6;
5173 optional int64 bg_chars_write = 7;
5174 optional int64 bg_bytes_read = 8;
5175 optional int64 bg_bytes_write = 9;
5176 optional int64 fg_fsync = 10;
5177 optional int64 bg_fsync= 11;
5178}
5179
5180
5181/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005182 * Pulls the number of fingerprints for each user.
5183 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005184 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005185 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005186message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005187 // The associated user. Eg: 0 for owners, 10+ for others.
5188 // Defined in android/os/UserHandle.java
5189 optional int32 user = 1;
5190 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005191 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005192}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005193
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005194/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005195 * Pulls the number of faces for each user.
5196 *
5197 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5198 */
5199message NumFacesEnrolled {
5200 // The associated user. Eg: 0 for owners, 10+ for others.
5201 // Defined in android/os/UserHandle.java
5202 optional int32 user = 1;
5203 // Number of faces registered to that user.
5204 optional int32 num_faces_enrolled = 2;
5205}
5206/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005207 * A mapping of role holder -> role
5208 */
5209message RoleHolder {
5210 // uid of the role holder
5211 optional int32 uid = 1 [(is_uid) = true];
5212
5213 // package name of the role holder
5214 optional string package_name = 2;
5215
5216 // the role held
5217 optional string role = 3;
5218}
5219
Yangsteraf9aee72018-10-12 09:26:16 -07005220message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005221 // These are all in byte resolution.
5222 optional int64 min = 1 [deprecated = true];
5223 optional int64 average = 2 [deprecated = true];
5224 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005225
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005226 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5227 // int64 fields.
5228 optional int32 mean_kb = 4;
5229 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005230}
5231
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005232// A reduced subset of process states; reducing the number of possible states allows more
5233// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5234enum ProcessStateAggregated {
5235 PROCESS_STATE_UNKNOWN = 0;
5236 // Persistent system process.
5237 PROCESS_STATE_PERSISTENT = 1;
5238 // Top activity; actually any visible activity.
5239 PROCESS_STATE_TOP = 2;
5240 // Process binding to top or a foreground service.
5241 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5242 // Processing running a foreground service.
5243 PROCESS_STATE_FGS = 4;
5244 // Important foreground process (ime, wallpaper, etc).
5245 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5246 // Important background process.
5247 PROCESS_STATE_BACKGROUND = 6;
5248 // Process running a receiver.
5249 PROCESS_STATE_RECEIVER = 7;
5250 // All kinds of cached processes.
5251 PROCESS_STATE_CACHED = 8;
5252}
5253
5254// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005255message ProcessStatsStateProto {
5256 optional android.service.procstats.ScreenState screen_state = 1;
5257
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005258 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005259
5260 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5261 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005262 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5263
5264 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005265
5266 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005267 optional int64 duration_millis = 4 [deprecated = true];
5268 // Same as above, but with minute resolution so it fits into an int32.
5269 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005270
5271 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005272 optional int64 realtime_duration_millis = 9 [deprecated = true];
5273 // Same as above, but with minute resolution so it fits into an int32.
5274 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005275
5276 // # of samples taken
5277 optional int32 sample_size = 5;
5278
5279 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005280 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005281
5282 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005283 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005284
5285 // RSS is memory resident for this process
5286 optional AggStats rss = 8;
5287}
5288
5289// Next Tag: 7
5290message ProcessStatsProto {
5291 // Name of process.
5292 optional string process = 1;
5293
5294 // Uid of the process.
5295 optional int32 uid = 2;
5296
5297 // Information about how often kills occurred
5298 message Kill {
5299 // Count of excessive CPU kills
5300 optional int32 cpu = 1;
5301
5302 // Count of kills when cached
5303 optional int32 cached = 2;
5304
5305 // PSS stats during cached kill
5306 optional AggStats cached_pss = 3;
5307 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005308 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005309
5310 // Time and memory spent in various states.
5311 repeated ProcessStatsStateProto states = 5;
5312
5313 // Total time process has been running... screen_state, memory_state, and process_state
5314 // will not be set.
5315 optional ProcessStatsStateProto total_running_state = 6;
5316}
5317
5318message PackageServiceOperationStatsProto {
5319 // Operate enum: Started, Foreground, Bound, Executing
5320 optional android.service.procstats.ServiceOperationState operation = 1;
5321
5322 // Number of times the service was in this operation.
5323 optional int32 count = 2;
5324
5325 // Information about a state the service can be in.
5326 message StateStats {
5327 // Screen state enum.
5328 optional android.service.procstats.ScreenState screen_state = 1;
5329 // Memory state enum.
5330 optional android.service.procstats.MemoryState memory_state = 2;
5331
5332 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005333 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005334 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005335 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005336 }
5337 repeated StateStats state_stats = 3;
5338}
5339
5340message PackageServiceStatsProto {
5341 // Name of service component.
5342 optional string service_name = 1;
5343
5344 // The operation stats.
5345 // The package_name, package_uid, package_version, service_name will not be set to save space.
5346 repeated PackageServiceOperationStatsProto operation_stats = 2;
5347}
5348
5349message PackageAssociationSourceProcessStatsProto {
5350 // Uid of the process.
5351 optional int32 process_uid = 1;
5352 // Process name.
5353 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005354 // Package name.
5355 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005356 // Total count of the times this association appeared.
5357 optional int32 total_count = 3;
5358
5359 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005360 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005361
5362 // Total count of the times this association became actively impacting its target process.
5363 optional int32 active_count = 5;
5364
5365 // Information on one source in this association.
5366 message StateStats {
5367 // Process state enum.
5368 optional android.service.procstats.ProcessState process_state = 1;
5369 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005370 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005371 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005372 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005373 }
5374 repeated StateStats active_state_stats = 6;
5375}
5376
5377message PackageAssociationProcessStatsProto {
5378 // Name of the target component.
5379 optional string component_name = 1;
5380 // Information on one source in this association.
5381 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5382}
5383
5384
5385message ProcessStatsPackageProto {
5386 // Name of package.
5387 optional string package = 1;
5388
5389 // Uid of the package.
5390 optional int32 uid = 2;
5391
5392 // Version of the package.
5393 optional int64 version = 3;
5394
5395 // Stats for each process running with the package loaded in to it.
5396 repeated ProcessStatsProto process_stats = 4;
5397
5398 // Stats for each of the package's services.
5399 repeated PackageServiceStatsProto service_stats = 5;
5400
5401 // Stats for each association with the package.
5402 repeated PackageAssociationProcessStatsProto association_stats = 6;
5403}
5404
5405message ProcessStatsSectionProto {
5406 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005407 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005408
5409 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005410 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005411
5412 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005413 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005414
5415 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005416 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005417
5418 // System runtime library. e.g. "libdvm.so", "libart.so".
5419 optional string runtime = 5;
5420
5421 // whether kernel reports swapped pss.
5422 optional bool has_swapped_pss = 6;
5423
5424 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5425 enum Status {
5426 STATUS_UNKNOWN = 0;
5427 STATUS_COMPLETE = 1;
5428 STATUS_PARTIAL = 2;
5429 STATUS_SHUTDOWN = 3;
5430 STATUS_SYSPROPS = 4;
5431 }
5432 repeated Status status = 7;
5433
Chenjie Yub2ecc792019-01-17 10:27:26 -08005434 // Number of pages available of various types and sizes, representation fragmentation.
5435 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5436
Yangsteraf9aee72018-10-12 09:26:16 -07005437 // Stats for each process.
5438 repeated ProcessStatsProto process_stats = 8;
5439
5440 // Stats for each package.
5441 repeated ProcessStatsPackageProto package_stats = 9;
5442}
5443
Chenjie Yub2ecc792019-01-17 10:27:26 -08005444message ProcessStatsAvailablePagesProto {
5445 // Node these pages are in (as per /proc/pagetypeinfo)
5446 optional int32 node = 1;
5447
5448 // Zone these pages are in (as per /proc/pagetypeinfo)
5449 optional string zone = 2;
5450
5451 // Label for the type of these pages (as per /proc/pagetypeinfo)
5452 optional string label = 3;
5453
5454 // Distribution of number of pages available by order size. First entry in array is
5455 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5456 repeated int32 pages_per_order = 4;
5457}
5458
Chenjie Yu12e5e672018-09-14 15:54:59 -07005459/**
5460 * Pulled from ProcessStatsService.java
5461 */
5462message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005463 optional ProcessStatsSectionProto proc_stats_section = 1;
5464}
5465
Chenjie Yuf910b7802019-01-11 16:08:20 -08005466/**
5467 * Pulled from ProcessStatsService.java
5468 */
5469message ProcStatsPkgProc {
5470 optional ProcessStatsSectionProto proc_stats_section = 1;
5471}
5472
Chris Wrencdea3b72019-11-22 16:58:17 -05005473// Next Tag: 2
5474message PackageRemoteViewInfoProto {
5475 optional string package_name = 1;
5476 // add per-package additional info here (like channels)
5477}
5478
5479// Next Tag: 2
5480message NotificationRemoteViewsProto {
5481 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5482}
5483
5484/**
5485 * Pulled from NotificationManagerService.java
5486 */
5487message NotificationRemoteViews {
5488 optional NotificationRemoteViewsProto notification_remote_views = 1;
5489}
5490
Yotam Aron74299972020-01-16 16:20:58 +02005491/**
5492 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5493 */
5494message PackageNotificationPreferences {
5495 // Uid under which the package is installed.
5496 optional int32 uid = 1;
5497 // Notification importance, which specifies when and how a notification is displayed.
5498 // Specified under core/java/android/app/NotificationManager.java.
5499 optional int32 importance = 2;
5500 // Lockscreen visibility as set by the user.
5501 optional int32 visibility = 3;
5502 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5503 // PreferencesHelper.java)
5504 optional int32 user_locked_fields = 4;
5505}
5506
5507/**
5508 * Atom that contains a list of a package's channel preferences, pulled from
5509 * NotificationManagerService.java.
5510 */
5511message PackageNotificationChannelPreferences {
5512 // Uid under which the package is installed.
5513 optional int32 uid = 1;
5514 // Channel's ID. Should always be available.
5515 optional string channel_id = 2;
5516 // Channel's name. Should always be available.
5517 optional string channel_name = 3;
5518 // Channel's description. Optionally set by the channel creator.
5519 optional string description = 4;
5520 // Notification importance, which specifies when and how a notification is displayed. Specified
5521 // under core/java/android/app/NotificationManager.java.
5522 optional int32 importance = 5;
5523 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5524 // at core/java/android/app/NotificationChannel.java
5525 optional int32 user_locked_fields = 6;
5526 // Indicates if the channel was deleted by the app.
5527 optional bool is_deleted = 7;
5528}
5529
5530/**
5531 * Atom that contains a list of a package's channel group preferences, pulled from
5532 * NotificationManagerService.java.
5533 */
5534message PackageNotificationChannelGroupPreferences {
5535 // Uid under which the package is installed.
5536 optional int32 uid = 1;
5537 // Channel Group's ID. Should always be available.
5538 optional string group_id = 2;
5539 // Channel Group's name. Should always be available.
5540 optional string group_name = 3;
5541 // Channel Group's description. Optionally set by group creator.
5542 optional string description = 4;
5543 // Indicates if notifications from this channel group are blocked.
5544 optional bool is_blocked = 5;
5545 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5546 // at core/java/android/app/NotificationChannelGroup.java
5547 optional int32 user_locked_fields = 6;
5548}
5549
Yangsteraf9aee72018-10-12 09:26:16 -07005550message PowerProfileProto {
5551 optional double cpu_suspend = 1;
5552
5553 optional double cpu_idle = 2;
5554
5555 optional double cpu_active = 3;
5556
5557 message CpuCluster {
5558 optional int32 id = 1;
5559 optional double cluster_power = 2;
5560 optional int32 cores = 3;
5561 repeated int64 speed = 4;
5562 repeated double core_power = 5;
5563 }
5564
5565 repeated CpuCluster cpu_cluster = 40;
5566
5567 optional double wifi_scan = 4;
5568
5569 optional double wifi_on = 5;
5570
5571 optional double wifi_active = 6;
5572
5573 optional double wifi_controller_idle = 7;
5574
5575 optional double wifi_controller_rx = 8;
5576
5577 optional double wifi_controller_tx = 9;
5578
5579 repeated double wifi_controller_tx_levels = 10;
5580
5581 optional double wifi_controller_operating_voltage = 11;
5582
5583 optional double bluetooth_controller_idle = 12;
5584
5585 optional double bluetooth_controller_rx = 13;
5586
5587 optional double bluetooth_controller_tx = 14;
5588
5589 optional double bluetooth_controller_operating_voltage = 15;
5590
5591 optional double modem_controller_sleep = 16;
5592
5593 optional double modem_controller_idle = 17;
5594
5595 optional double modem_controller_rx = 18;
5596
5597 repeated double modem_controller_tx = 19;
5598
5599 optional double modem_controller_operating_voltage = 20;
5600
5601 optional double gps_on = 21;
5602
5603 repeated double gps_signal_quality_based = 22;
5604
5605 optional double gps_operating_voltage = 23;
5606
5607 optional double bluetooth_on = 24;
5608
5609 optional double bluetooth_active = 25;
5610
5611 optional double bluetooth_at_cmd = 26;
5612
5613 optional double ambient_display = 27;
5614
5615 optional double screen_on = 28;
5616
5617 optional double radio_on = 29;
5618
5619 optional double radio_scanning = 30;
5620
5621 optional double radio_active = 31;
5622
5623 optional double screen_full = 32;
5624
5625 optional double audio = 33;
5626
5627 optional double video = 34;
5628
5629 optional double flashlight = 35;
5630
5631 optional double memory = 36;
5632
5633 optional double camera = 37;
5634
5635 optional double wifi_batched_scan = 38;
5636
5637 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005638}
Chenjie Yuab530202018-09-26 12:39:20 -07005639
5640/**
5641 * power_profile.xml and other constants for power model calculations.
5642 * Pulled from PowerProfile.java
5643 */
5644message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005645 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005646}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005647
5648/**
arangelovd5db50e2018-10-12 20:24:39 +01005649 * Logs when a user restriction was added or removed.
5650 *
5651 * Logged from:
5652 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5653 */
5654message UserRestrictionChanged {
5655 // The raw string of the user restriction as defined in UserManager.
5656 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5657 optional string restriction = 1;
5658 // Whether the restriction is enabled or disabled.
5659 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005660}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005661
5662/**
5663 * Pulls process user time and system time. Puller takes a snapshot of all pids
5664 * in the system and returns cpu stats for those that are working at the time.
5665 * Dead pids will be dropped. Kernel processes are excluded.
5666 * Min cool-down is 5 sec.
5667 */
5668message ProcessCpuTime {
5669 optional int32 uid = 1 [(is_uid) = true];
5670
5671 optional string process_name = 2;
5672 // Process cpu time in user space, cumulative from boot/process start
5673 optional int64 user_time_millis = 3;
5674 // Process cpu time in system space, cumulative from boot/process start
5675 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005676}
Misha Wagner5a51e002018-10-03 15:04:09 +01005677
5678/**
5679 * Pulls the CPU usage for each thread.
5680 *
5681 * Read from /proc/$PID/task/$TID/time_in_state files.
5682 *
5683 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5684 * time_in_state files not being present on some phones, have not been addressed. These should be
5685 * considered before a public release.
5686 */
5687message CpuTimePerThreadFreq {
5688 // UID that owns the process.
5689 optional int32 uid = 1 [(is_uid) = true];
5690 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005691 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005692 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005693 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005694 // Name of the process taken from `/proc/$PID/cmdline`.
5695 optional string process_name = 4;
5696 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5697 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005698
5699 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5700 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5701 // frequencies are given here as the alternative is sending eight separate atoms. This method
5702 // significantly reduces the amount of data created
5703 optional int32 frequency1_khz = 6;
5704 optional int32 time1_millis = 7;
5705 optional int32 frequency2_khz = 8;
5706 optional int32 time2_millis = 9;
5707 optional int32 frequency3_khz = 10;
5708 optional int32 time3_millis = 11;
5709 optional int32 frequency4_khz = 12;
5710 optional int32 time4_millis = 13;
5711 optional int32 frequency5_khz = 14;
5712 optional int32 time5_millis = 15;
5713 optional int32 frequency6_khz = 16;
5714 optional int32 time6_millis = 17;
5715 optional int32 frequency7_khz = 18;
5716 optional int32 time7_millis = 19;
5717 optional int32 frequency8_khz = 20;
5718 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005719}
Bookatz75ee60422018-11-09 12:27:37 -08005720
5721/**
Bookatz366a4432018-11-20 09:42:33 -08005722 * Pulls information about the device's build.
5723 */
5724message BuildInformation {
5725 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5726 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5727 optional string fingerprint = 1;
5728
5729 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5730 optional string brand = 2;
5731
5732 // Build.PRODUCT. The name of the overall product.
5733 optional string product = 3;
5734
5735 // Build.DEVICE. The name of the industrial design.
5736 optional string device = 4;
5737
5738 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5739 optional string version_release = 5;
5740
5741 // Build.ID. E.g. a label like "M4-rc20".
5742 optional string id = 6;
5743
5744 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5745 // represent this build.
5746 optional string version_incremental = 7;
5747
5748 // Build.TYPE. The type of build, like "user" or "eng".
5749 optional string type = 8;
5750
5751 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5752 optional string tags = 9;
5753}
5754
5755/**
Adam He420947c2019-01-23 15:59:09 -08005756 * Logs information about mismatched caller for content capture.
5757 *
5758 * Logged from:
5759 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5760 */
5761message ContentCaptureCallerMismatchReported {
5762 optional string intended_package = 1;
5763 optional string calling_package = 2;
5764}
5765
5766/**
5767 * Logs information about content capture service events.
5768 *
5769 * Logged from:
5770 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5771 */
5772message ContentCaptureServiceEvents {
5773 // The type of event.
5774 enum Event {
5775 UNKNOWN = 0;
5776 ON_CONNECTED = 1;
5777 ON_DISCONNECTED = 2;
5778 SET_WHITELIST = 3;
5779 SET_DISABLED = 4;
5780 ON_USER_DATA_REMOVED = 5;
5781 }
5782 optional Event event = 1;
5783 // component/package of content capture service.
5784 optional string service_info = 2;
5785 // component/package of target.
5786 // it's a concatenated list of component/package for SET_WHITELIST event
5787 // separated by " ".
5788 optional string target_info = 3;
5789}
5790
5791/**
5792 * Logs information about content capture session events.
5793 *
5794 * Logged from:
5795 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5796 */
5797message ContentCaptureSessionEvents {
5798 // The type of event.
5799 enum Event {
5800 UNKNOWN = 0;
5801 ON_SESSION_STARTED = 1;
5802 ON_SESSION_FINISHED = 2;
5803 SESSION_NOT_CREATED = 3;
5804 }
5805 optional int32 session_id = 1;
5806 optional Event event = 2;
5807 // (n/a on session finished)
5808 optional int32 state_flags = 3;
5809 // component/package of content capture service.
5810 optional string service_info = 4;
5811 // component/package of app.
5812 // (n/a on session finished)
5813 optional string app_info = 5;
5814 optional bool is_child_session = 6;
5815}
5816
5817/**
5818 * Logs information about session being flushed.
5819 *
5820 * Logged from:
5821 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5822 */
5823message ContentCaptureFlushed {
5824 optional int32 session_id = 1;
5825 // component/package of content capture service.
5826 optional string service_info = 2;
5827 // component/package of app.
5828 optional string app_info = 3;
5829 // session start/finish events
5830 optional int32 child_session_started = 4;
5831 optional int32 child_session_finished = 5;
5832 // count of view events.
5833 optional int32 view_appeared_count = 6;
5834 optional int32 view_disappeared_count = 7;
5835 optional int32 view_text_changed_count = 8;
5836
5837 // Flush stats.
5838 optional int32 max_events = 9;
5839 optional int32 idle_flush_freq = 10;
5840 optional int32 text_flush_freq = 11;
5841 optional int32 flush_reason = 12;
5842}
5843
5844/**
Bookatz75ee60422018-11-09 12:27:37 -08005845 * Pulls on-device BatteryStats power use calculations for the overall device.
5846 */
5847message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005848 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5849 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5850 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5851 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005852}
5853
5854/**
5855 * Pulls on-device BatteryStats power use calculations broken down by uid.
5856 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5857 * that is attributed to non-uid items. They must all be included to get the total power use.
5858 */
5859message DeviceCalculatedPowerBlameUid {
5860 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5861 optional int32 uid = 1 [(is_uid) = true];
5862
Bookatz3dbc13a2018-12-21 12:16:51 -08005863 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5864 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5865 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005866}
5867
5868/**
5869 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5870 * drain type.
5871 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5872 * is attributed uids. They must all be included to get the total power use.
5873 */
5874message DeviceCalculatedPowerBlameOther {
5875 // The type of item whose power use is being reported.
5876 enum DrainType {
5877 AMBIENT_DISPLAY = 0;
5878 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5879 BLUETOOTH = 2;
5880 CAMERA = 3;
5881 // Cell-standby
5882 CELL = 4;
5883 FLASHLIGHT = 5;
5884 IDLE = 6;
5885 MEMORY = 7;
5886 // Amount that total computed drain exceeded the drain estimated using the
5887 // battery level changes and capacity.
5888 OVERCOUNTED = 8;
5889 PHONE = 9;
5890 SCREEN = 10;
5891 // Amount that total computed drain was below the drain estimated using the
5892 // battery level changes and capacity.
5893 UNACCOUNTED = 11;
5894 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5895 WIFI = 13;
5896 }
5897 optional DrainType drain_type = 1;
5898
Bookatz3dbc13a2018-12-21 12:16:51 -08005899 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5900 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5901 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005902}
arangelov4e994062018-11-13 16:12:38 +00005903
5904/**
5905 * Logs device policy features.
5906 *
5907 * Logged from:
5908 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5909 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5910 */
5911message DevicePolicyEvent {
5912 // The event id - unique for each event.
5913 optional android.stats.devicepolicy.EventId event_id = 1;
5914 // The admin package name.
5915 optional string admin_package_name = 2;
5916 // A generic integer parameter.
5917 optional int32 integer_value = 3;
5918 // A generic boolean parameter.
5919 optional bool boolean_value = 4;
5920 // A parameter specifying a time period in milliseconds.
5921 optional uint64 time_period_millis = 5;
5922 // A parameter specifying a list of package names, bundle extras or string parameters.
5923 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5924}
shawnlinea5b66b2018-11-13 15:05:29 +08005925
5926/**
5927 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5928 *
5929 * Logged from:
5930 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5931 */
5932message DocsUILaunchReported {
5933 optional android.stats.docsui.LaunchAction launch_action = 1;
5934 optional bool has_initial_uri = 2;
5935 optional android.stats.docsui.MimeType mime_type = 3;
5936 optional android.stats.docsui.Root initial_root = 4;
5937}
5938
5939/**
5940 * Logs root/app visited event in file managers/picker. Call this when the user
5941 * taps on root/app in hamburger menu.
5942 *
5943 * Logged from:
5944 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5945 */
5946message DocsUIRootVisitedReported {
5947 optional android.stats.docsui.ContextScope scope = 1;
5948 optional android.stats.docsui.Root root = 2;
5949}
5950
5951/**
5952 * Logs file operation stats. Call this when a file operation has completed.
5953 *
5954 * Logged from:
5955 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5956 */
5957message DocsUIFileOperationReported {
5958 optional android.stats.docsui.Provider provider = 1;
5959 optional android.stats.docsui.FileOperation file_op = 2;
5960}
5961
5962/**
5963 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5964 * mode.
5965 *
5966 * Logged from:
5967 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5968 */
5969message DocsUIFileOperationCopyMoveModeReported {
5970 optional android.stats.docsui.FileOperation file_op = 1;
5971 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5972}
5973
5974
5975/**
5976 * Logs file sub operation stats. Call this when a file operation has failed.
5977 *
5978 * Logged from:
5979 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5980 */
5981message DocsUIFileOperationFailureReported {
5982 optional android.stats.docsui.Authority authority = 1;
5983 optional android.stats.docsui.SubFileOperation sub_op = 2;
5984}
5985
5986/**
5987* Logs the cancellation of a file operation. Call this when a job is canceled
5988*
5989* Logged from:
5990* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5991*/
5992message DocsUIFileOperationCanceledReported {
5993 optional android.stats.docsui.FileOperation file_op = 1;
5994}
5995
5996/**
5997 * Logs startup time in milliseconds.
5998 *
5999 * Logged from:
6000 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6001 */
6002message DocsUIStartupMsReported {
6003 optional int32 startup_millis = 1;
6004}
6005
6006/**
6007 * Logs the action that was started by user.
6008 *
6009 * Logged from:
6010 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6011 */
6012message DocsUIUserActionReported {
6013 optional android.stats.docsui.UserAction action = 1;
6014}
6015
6016/**
6017 * Logs the invalid type when invalid scoped access is requested.
6018 *
6019 * Logged from:
6020 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6021 */
6022message DocsUIInvalidScopedAccessRequestReported {
6023 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006024}
Ben Murdochbab399f62018-12-06 11:01:38 +00006025
6026/**
shawnlina75e82d2019-01-07 10:31:12 +08006027 * Logs the package name that launches docsui picker mode.
6028 *
6029 * Logged from:
6030 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6031 */
6032message DocsUIPickerLaunchedFromReported {
6033 optional string package_name = 1;
6034}
6035
6036/**
6037 * Logs the search type.
6038 *
6039 * Logged from:
6040 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6041 */
6042message DocsUISearchTypeReported {
6043 optional android.stats.docsui.SearchType search_type = 1;
6044}
6045
6046/**
6047 * Logs the search mode.
6048 *
6049 * Logged from:
6050 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6051 */
6052message DocsUISearchModeReported {
6053 optional android.stats.docsui.SearchMode search_mode = 1;
6054}
6055
6056/**
6057 * Logs the pick result information.
6058 *
6059 * Logged from:
6060 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6061 */
6062message DocsUIPickResultReported {
6063 optional int32 total_action_count = 1;
6064 optional int64 duration_millis = 2;
6065 optional int32 file_count= 3;
6066 optional bool is_searching = 4;
6067 optional android.stats.docsui.Root picked_from = 5;
6068 optional android.stats.docsui.MimeType mime_type = 6;
6069 optional int32 repeatedly_pick_times = 7;
6070}
6071
6072/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006073 * Logs when an app's memory is compacted.
6074 *
6075 * Logged from:
6076 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6077 */
6078message AppCompacted {
6079 // The pid of the process being compacted.
6080 optional int32 pid = 1;
6081
6082 // The name of the process being compacted.
6083 optional string process_name = 2;
6084
6085 // The type of compaction.
6086 enum Action {
6087 UNKNOWN = 0;
6088 SOME = 1;
6089 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006090 PERSISTENT = 3;
6091 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006092 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006093 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006094
6095 // Total RSS in kilobytes consumed by the process prior to compaction.
6096 optional int64 before_rss_total_kilobytes = 4;
6097
6098 // File RSS in kilobytes consumed by the process prior to compaction.
6099 optional int64 before_rss_file_kilobytes = 5;
6100
6101 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6102 optional int64 before_rss_anon_kilobytes = 6;
6103
6104 // Swap in kilobytes consumed by the process prior to compaction.
6105 optional int64 before_swap_kilobytes = 7;
6106
6107 // Total RSS in kilobytes consumed by the process after compaction.
6108 optional int64 after_rss_total_kilobytes = 8;
6109
6110 // File RSS in kilobytes consumed by the process after compaction.
6111 optional int64 after_rss_file_kilobytes = 9;
6112
6113 // Anonymous RSS in kilobytes consumed by the process after compaction.
6114 optional int64 after_rss_anon_kilobytes = 10;
6115
6116 // Swap in kilobytes consumed by the process after compaction.
6117 optional int64 after_swap_kilobytes = 11;
6118
6119 // The time taken to perform compaction in milliseconds.
6120 optional int64 time_to_compact_millis = 12;
6121
6122 // The last compaction action performed for this app.
6123 optional Action last_action = 13;
6124
Ben Murdoch01720b82018-12-19 18:03:44 +00006125 // The last time that compaction was attempted on this process in milliseconds
6126 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6127 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006128
Ben Murdoch885c21b2019-03-15 18:02:04 +00006129 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006130 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006131
6132 // The process state at the time of compaction.
6133 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006134
6135 // Free ZRAM in kilobytes before compaction.
6136 optional int64 before_zram_free_kilobytes = 17;
6137
6138 // Free ZRAM in kilobytes after compaction.
6139 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006140}
lifr157fc552018-12-12 16:38:04 +08006141
6142/**
lifrb6b90b62019-03-29 00:40:17 +08006143 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6144 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6145 *
lifr1f74b052019-04-16 22:16:30 +08006146 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6147 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6148 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6149 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006150 */
6151message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006152 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006153
lifr1f74b052019-04-16 22:16:30 +08006154 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006155
6156 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006157 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006158
lifr1f74b052019-04-16 22:16:30 +08006159 // Only valid for event_type = EVENT_GETADDRINFO.
6160 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006161
lifr1f74b052019-04-16 22:16:30 +08006162 // Flags passed to android_res_nsend() defined in multinetwork.h
6163 // Only valid for event_type = EVENT_RESNSEND.
6164 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006165
lifrad9becc2019-05-20 11:04:41 +08006166 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006167
6168 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006169 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006170
6171 // Additional pass-through fields opaque to statsd.
6172 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006173 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006174
6175 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6176 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006177}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006178
6179/**
6180 * Logs when a data stall event occurs.
6181 *
6182 * Log from:
6183 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6184 */
6185message DataStallEvent {
6186 // Data stall evaluation type.
6187 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6188 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6189 optional int32 evaluation_type = 1;
6190 // See definition in data_stall_event.proto.
6191 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6192 // See definition in data_stall_event.proto.
6193 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6194 // See definition in data_stall_event.proto.
6195 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6196 // See definition in data_stall_event.proto.
6197 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6198 // See definition in data_stall_event.proto.
6199 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6200}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006201
6202/*
6203 * Logs when RescueParty resets some set of experiment flags.
6204 *
6205 * Logged from:
6206 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6207 */
6208message RescuePartyResetReported {
6209 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6210 optional int32 rescue_level = 1;
6211}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006212
6213/**
6214 * Logs when signed config is received from an APK, and if that config was applied successfully.
6215 * Logged from:
6216 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6217 */
6218message SignedConfigReported {
6219 enum Type {
6220 UNKNOWN_TYPE = 0;
6221 GLOBAL_SETTINGS = 1;
6222 }
6223 optional Type type = 1;
6224
6225 // The final status of the signed config received.
6226 enum Status {
6227 UNKNOWN_STATUS = 0;
6228 APPLIED = 1;
6229 BASE64_FAILURE_CONFIG = 2;
6230 BASE64_FAILURE_SIGNATURE = 3;
6231 SECURITY_EXCEPTION = 4;
6232 INVALID_CONFIG = 5;
6233 OLD_CONFIG = 6;
6234 SIGNATURE_CHECK_FAILED = 7;
6235 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006236 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006237 }
6238 optional Status status = 2;
6239
6240 // The version of the signed config processed.
6241 optional int32 version = 3;
6242
6243 // The package name that the config was extracted from.
6244 optional string from_package = 4;
6245
6246 enum Key {
6247 NO_KEY = 0;
6248 DEBUG = 1;
6249 PRODUCTION = 2;
6250 }
6251 // Which key was used to verify the config.
6252 optional Key verified_with = 5;
6253}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006254
6255/*
6256 * Logs GNSS Network-Initiated (NI) location events.
6257 *
6258 * Logged from:
6259 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6260 */
6261message GnssNiEventReported {
6262 // The type of GnssNiEvent.
6263 enum EventType {
6264 UNKNOWN = 0;
6265 NI_REQUEST = 1;
6266 NI_RESPONSE = 2;
6267 }
6268 optional EventType event_type = 1;
6269
6270 // An ID generated by HAL to associate NI notifications and UI responses.
6271 optional int32 notification_id = 2;
6272
6273 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006274 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006275
6276 // NI requires notification.
6277 optional bool need_notify = 4;
6278
6279 // NI requires verification.
6280 optional bool need_verify = 5;
6281
6282 // NI requires privacy override, no notification/minimal trace.
6283 optional bool privacy_override = 6;
6284
6285 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6286 // seconds.
6287 optional int32 timeout = 7;
6288
6289 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006290 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006291
6292 // String representing the requester of the network inititated location request.
6293 optional string requestor_id = 9;
6294
6295 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6296 // network initiated location request.
6297 optional string text = 10;
6298
6299 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006300 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006301
6302 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006303 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006304
6305 // True if SUPL ES is enabled.
6306 optional bool is_supl_es_enabled = 13;
6307
6308 // True if GNSS location is enabled.
6309 optional bool is_location_enabled = 14;
6310
6311 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006312 optional android.server.location.GnssUserResponseType user_response = 15;
6313}
6314
6315/**
6316 * Logs GNSS non-framework (NFW) location notification.
6317 *
6318 * Logged from:
6319 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6320 */
6321message GnssNfwNotificationReported {
6322 // Package name of the Android proxy application representing the non-framework entity that
6323 // requested location. Set to empty string if unknown.
6324 optional string proxy_app_package_name = 1;
6325
6326 // Protocol stack that initiated the non-framework location request.
6327 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6328
6329 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6330 // set to empty string. This field is opaque to the framework and used for logging purposes.
6331 optional string other_protocol_stack_name = 3;
6332
6333 // Source initiating/receiving the location information.
6334 optional android.server.location.NfwRequestor requestor = 4;
6335
6336 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6337 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6338 // and used for logging purposes.
6339 optional string requestor_id = 5;
6340
6341 // Indicates whether location information was provided for this request.
6342 optional android.server.location.NfwResponseType response_type = 6;
6343
6344 // True if the device is in user initiated emergency session.
6345 optional bool in_emergency_mode = 7;
6346
6347 // True if cached location is provided.
6348 optional bool is_cached_location = 8;
6349
6350 // True if proxy app permission mismatch between framework and GNSS HAL.
6351 optional bool is_permission_mismatched = 9;
6352}
6353
6354/**
6355 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6356 *
6357 * Logged from:
6358 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6359 */
6360message GnssConfigurationReported {
6361 // SUPL host name.
6362 optional string supl_host = 1;
6363
6364 // SUPL port number.
6365 optional int32 supl_port = 2;
6366
6367 // C2K host name.
6368 optional string c2k_host = 3;
6369
6370 // C2K port number.
6371 optional int32 c2k_port = 4;
6372
6373 // The SUPL version requested by Carrier.
6374 optional int32 supl_ver = 5;
6375
6376 // The SUPL mode.
6377 optional android.server.location.SuplMode supl_mode = 6;
6378
6379 // True if NI emergency SUPL restrictions is enabled.
6380 optional bool supl_es = 7;
6381
6382 // LTE Positioning Profile settings
6383 optional android.server.location.LppProfile lpp_profile = 8;
6384
6385 // Positioning protocol on A-Glonass system.
6386 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6387
6388 // True if emergency PDN is used. Otherwise, regular PDN is used.
6389 optional bool use_emergency_pdn_for_emergency_supl= 10;
6390
6391 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6392 optional android.server.location.GpsLock gps_lock = 11;
6393
6394 // Number of seconds to extend the emergency session duration post emergency call.
6395 optional int32 es_extension_sec = 12;
6396
6397 // The full list of package names of proxy Android applications representing the non-framework
6398 // location access entities (on/off the device) for which the framework user has granted
6399 // non-framework location access permission. The package names are concatenated in one string
6400 // with spaces as separators.
6401 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006402}
Jack Yu95b64f32018-12-13 18:26:11 +08006403
6404/**
6405 * Logs when a NFC device's error occurred.
6406 * Logged from:
6407 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6408 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6409 */
6410message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006411 enum Type {
6412 UNKNOWN = 0;
6413 CMD_TIMEOUT = 1;
6414 ERROR_NOTIFICATION = 2;
6415 AID_OVERFLOW = 3;
6416 }
6417 optional Type type = 1;
6418 // If it's nci cmd timeout, log the timeout command.
6419 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006420
Alex Salod7c3eef2019-01-25 14:43:27 -08006421 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006422}
6423
6424/**
6425 * Logs when a NFC device's state changed event
6426 * Logged from:
6427 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6428 */
6429message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006430 enum State {
6431 UNKNOWN = 0;
6432 OFF = 1;
6433 ON = 2;
6434 ON_LOCKED = 3; // Secure Nfc enabled.
6435 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6436 }
6437 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006438}
6439
6440/**
6441 * Logs when a NFC Beam Transaction occurred.
6442 * Logged from:
6443 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6444 */
6445message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006446 enum Operation {
6447 UNKNOWN = 0;
6448 SEND = 1;
6449 RECEIVE = 2;
6450 }
6451 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006452}
6453
6454/**
6455 * Logs when a NFC Card Emulation Transaction occurred.
6456 * Logged from:
6457 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6458 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6459 */
6460message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006461 enum Category {
6462 UNKNOWN = 0;
6463 HCE_PAYMENT = 1;
6464 HCE_OTHER = 2;
6465 OFFHOST = 3;
6466 }
6467 // Transaction belongs to HCE payment or HCE other category, or offhost.
6468 optional Category category = 1;
6469 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6470 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006471}
6472
6473/**
6474 * Logs when a NFC Tag event occurred.
6475 * Logged from:
6476 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6477 */
6478message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006479 enum Type {
6480 UNKNOWN = 0;
6481 URL = 1;
6482 BT_PAIRING = 2;
6483 PROVISION = 3;
6484 WIFI_CONNECT = 4;
6485 APP_LAUNCH = 5;
6486 OTHERS = 6;
6487 }
6488 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006489}
6490
6491/**
6492 * Logs when Hce transaction triggered
6493 * Logged from:
6494 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6495 */
6496message NfcHceTransactionOccurred {
6497 // The latency period(in microseconds) it took for the first HCE data
6498 // exchange.
6499 optional uint32 latency_micros = 1;
6500}
6501
6502/**
6503 * Logs when SecureElement state event changed
6504 * Logged from:
6505 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6506 */
6507message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006508 enum State {
6509 UNKNOWN = 0;
6510 INITIALIZED = 1;
6511 DISCONNECTED = 2;
6512 CONNECTED = 3;
6513 HALCRASH = 4;
6514 }
6515 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006516
Alex Salod7c3eef2019-01-25 14:43:27 -08006517 optional string state_change_reason = 2;
6518 // SIMx or eSEx.
6519 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006520}
6521
6522/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006523 * Information about a permission grant request
6524 */
6525message PermissionGrantRequestResultReported {
6526 // unique value identifying an API call. A API call might result in multiple of these atoms
6527 optional int64 request_id = 1;
6528
6529 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006530 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006531
6532 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006533 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006534
6535 // The permission to be granted
6536 optional string permission_name = 4;
6537
6538 // If the permission was explicitly requested via the API or added by the system
6539 optional bool is_implicit = 5;
6540
6541 enum Result {
6542 UNDEFINED = 0;
6543 // permission request was ignored
6544 IGNORED = 1;
6545 // permission request was ignored because it was user fixed
6546 IGNORED_USER_FIXED = 2;
6547 // permission request was ignored because it was policy fixed
6548 IGNORED_POLICY_FIXED = 3;
6549 // permission was granted by user action
6550 USER_GRANTED = 4;
6551 // permission was automatically granted
6552 AUTO_GRANTED = 5;
6553 // permission was denied by user action
6554 USER_DENIED = 6;
6555 // permission was denied with prejudice by the user
6556 USER_DENIED_WITH_PREJUDICE = 7;
6557 // permission was automatically denied
6558 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006559 // permission request was ignored because permission is restricted
6560 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006561 // one time permission was granted by user action
6562 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006563 // user ignored request by leaving the request screen without choosing any option
6564 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006565 // user granted the permission after being linked to settings
6566 USER_GRANTED_IN_SETTINGS = 12;
6567 // user denied the permission after being linked to settings
6568 USER_DENIED_IN_SETTINGS = 13;
6569 // user denied the permission with prejudice after being linked to settings
6570 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6571 // permission was automatically revoked after one-time permission expired
6572 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006573 // permission was automatically revoked for unused app
6574 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006575 }
6576 // The result of the permission grant
6577 optional Result result = 6;
6578}
6579
6580/**
Jack Yu95b64f32018-12-13 18:26:11 +08006581 * Logs when Omapi API used
6582 * Logged from:
6583 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6584 */
6585message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006586 enum Operation {
6587 UNKNOWN = 0;
6588 OPEN_CHANNEL = 1;
6589 }
6590 optional Operation operation = 1;
6591 // SIMx or eSEx.
6592 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006593
Alex Salod7c3eef2019-01-25 14:43:27 -08006594 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006595}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006596
6597/**
Alex Saloa060aee2019-01-21 14:36:41 -08006598 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6599 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006600 * Logged from:
6601 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6602 */
6603message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006604 optional int64 dispatch_latency_millis = 1;
6605}
6606
6607/**
6608 * Logs AttentionManagerService attention check result.
6609 *
6610 * Logged from:
6611 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6612 */
6613message AttentionManagerServiceResultReported {
6614 // See core/java/android/service/attention/AttentionService.java
6615 enum AttentionCheckResult {
6616 UNKNOWN = 20;
6617 ATTENTION_SUCCESS_ABSENT = 0;
6618 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006619 ATTENTION_FAILURE_UNKNOWN = 2;
6620 ATTENTION_FAILURE_CANCELLED = 3;
6621 ATTENTION_FAILURE_PREEMPTED = 4;
6622 ATTENTION_FAILURE_TIMED_OUT = 5;
6623 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006624 }
6625 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006626}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006627
6628/**
6629 * Logs when an adb connection changes state.
6630 *
6631 * Logged from:
6632 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6633 */
6634message AdbConnectionChanged {
6635 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6636 // previously selected for this system.
6637 optional int64 last_connection_time_millis = 1;
6638
6639 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6640 // to reconnect via adb without user interaction.
6641 optional int64 auth_window_millis = 2;
6642
6643 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6644 optional android.debug.AdbConnectionStateEnum state = 3;
6645
6646 // True if the 'always allow' option was selected for this system.
6647 optional bool always_allow = 4;
6648}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006649
6650/*
6651 * Logs the reported speech DSP status.
6652 *
6653 * Logged from:
6654 * Vendor audio implementation.
6655 */
6656message SpeechDspStatReported {
6657 // The total Speech DSP uptime in milliseconds.
6658 optional int32 total_uptime_millis = 1;
6659 // The total Speech DSP downtime in milliseconds.
6660 optional int32 total_downtime_millis = 2;
6661 optional int32 total_crash_count = 3;
6662 optional int32 total_recover_count = 4;
6663}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006664
6665/**
6666 * Logs USB connector contaminant status.
6667 *
6668 * Logged from: USB Service.
6669 */
6670message UsbContaminantReported {
6671 optional string id = 1;
6672 optional android.service.usb.ContaminantPresenceStatus status = 2;
6673}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006674
6675/**
6676 * This atom is for debugging purpose.
6677 */
6678message DebugElapsedClock {
6679 // Monotically increasing value for each pull.
6680 optional int64 pull_count = 1;
6681 // Time from System.elapsedRealtime.
6682 optional int64 elapsed_clock_millis = 2;
6683 // Time from System.elapsedRealtime.
6684 optional int64 same_elapsed_clock_millis = 3;
6685 // Diff between current elapsed time and elapsed time from previous pull.
6686 optional int64 elapsed_clock_diff_millis = 4;
6687
6688 enum Type {
6689 TYPE_UNKNOWN = 0;
6690 ALWAYS_PRESENT = 1;
6691 PRESENT_ON_ODD_PULLS = 2;
6692 }
6693 // Type of behavior for the pulled data.
6694 optional Type type = 5;
6695}
6696
6697/**
6698 * This atom is for debugging purpose.
6699 */
6700message DebugFailingElapsedClock {
6701 // Monotically increasing value for each pull.
6702 optional int64 pull_count = 1;
6703 // Time from System.elapsedRealtime.
6704 optional int64 elapsed_clock_millis = 2;
6705 // Time from System.elapsedRealtime.
6706 optional int64 same_elapsed_clock_millis = 3;
6707 // Diff between current elapsed time and elapsed time from previous pull.
6708 optional int64 elapsed_clock_diff_millis = 4;
6709}
Steven Wuacef6bb2019-01-23 14:21:17 -05006710
6711/** Logs System UI bubbles event changed.
6712 *
6713 * Logged from:
6714 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6715 */
6716message BubbleUIChanged {
6717
6718 // The app package that is posting the bubble.
6719 optional string package_name = 1;
6720
6721 // The notification channel that is posting the bubble.
6722 optional string notification_channel = 2;
6723
6724 // The notification id associated with the posted bubble.
6725 optional int32 notification_id = 3;
6726
6727 // The position of the bubble within the bubble stack.
6728 optional int32 position = 4;
6729
6730 // The total number of bubbles within the bubble stack.
6731 optional int32 total_number = 5;
6732
6733 // User interactions with the bubble.
6734 enum Action {
6735 UNKNOWN = 0;
6736 POSTED = 1;
6737 UPDATED = 2;
6738 EXPANDED = 3;
6739 COLLAPSED = 4;
6740 DISMISSED = 5;
6741 STACK_DISMISSED = 6;
6742 STACK_MOVED = 7;
6743 HEADER_GO_TO_APP = 8;
6744 HEADER_GO_TO_SETTINGS = 9;
6745 PERMISSION_OPT_IN = 10;
6746 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006747 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006748 SWIPE_LEFT = 13;
6749 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006750 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006751 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006752 }
6753 optional Action action = 6;
6754
6755 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6756 optional float normalized_x_position = 7;
6757 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006758
6759 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6760 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006761
6762 // Whether the bubble is an on-going one.
6763 optional bool is_ongoing = 10;
6764
6765 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006766 // This is deprecated and the value should be ignored.
6767 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006768}
Kweku Adams8845d012018-12-11 20:06:45 -08006769
6770/**
Steven Wu552f63f2019-02-05 13:41:36 -05006771 * Logs System UI bubbles developer errors.
6772 *
6773 * Logged from:
6774 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6775 */
6776message BubbleDeveloperErrorReported {
6777
6778 // The app package that is posting the bubble.
6779 optional string package_name = 1;
6780
6781 // Bubble developer error type enums.
6782 enum Error {
6783 UNKNOWN = 0;
6784 ACTIVITY_INFO_MISSING = 1;
6785 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6786 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6787 }
6788 optional Error error = 2 [default = UNKNOWN];
6789}
6790
6791/**
Kweku Adams8845d012018-12-11 20:06:45 -08006792 * Logs that a constraint for a scheduled job has changed.
6793 *
6794 * Logged from:
6795 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6796 */
6797message ScheduledJobConstraintChanged {
6798 repeated AttributionNode attribution_node = 1;
6799
6800 // Name of the job.
6801 optional string job_name = 2;
6802
6803 optional com.android.server.job.ConstraintEnum constraint = 3;
6804
6805 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006806 UNKNOWN = 0;
6807 UNSATISFIED = 1;
6808 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006809 }
6810 optional State state = 4;
6811}
Alex Salod7c3eef2019-01-25 14:43:27 -08006812
6813/**
6814 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6815 * returns true.
6816 *
6817 * Logged from:
6818 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6819 */
6820message ScreenTimeoutExtensionReported {
6821 // Describes how many times in a row did the power manager reset the screen off timeout.
6822 optional uint32 consecutive_timeout_extended_count = 1;
6823}
Hui Yu885aca12019-01-10 17:11:34 -08006824
6825/*
6826* Logs number of milliseconds it takes to start a process.
6827* The definition of app process start time is from the app launch time to
6828* the time that Zygote finished forking the app process and loaded the
6829* application package's java classes.
6830
6831* This metric is different from AppStartOccurred which is for foreground
6832* activity only.
6833
6834* ProcessStartTime can report all processes (both foreground and background)
6835* start time.
6836*
6837* Logged from:
6838* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6839*/
6840message ProcessStartTime {
6841 // The uid of the ProcessRecord.
6842 optional int32 uid = 1 [(is_uid) = true];
6843
6844 // The process pid.
6845 optional int32 pid = 2;
6846
6847 // The process name.
6848 // Usually package name, "system" for system server.
6849 // Provided by ActivityManagerService.
6850 optional string process_name = 3;
6851
6852 enum StartType {
6853 UNKNOWN = 0;
6854 WARM = 1;
6855 HOT = 2;
6856 COLD = 3;
6857 }
6858
6859 // The start type.
6860 optional StartType type = 4;
6861
6862 // The elapsed realtime at the start of the process.
6863 optional int64 process_start_time_millis = 5;
6864
6865 // Number of milliseconds it takes to reach bind application.
6866 optional int32 bind_application_delay_millis = 6;
6867
6868 // Number of milliseconds it takes to finish start of the process.
6869 optional int32 process_start_delay_millis = 7;
6870
6871 // hostingType field in ProcessRecord, the component type such as "activity",
6872 // "service", "content provider", "broadcast" or other strings.
6873 optional string hosting_type = 8;
6874
6875 // hostingNameStr field in ProcessRecord. The component class name that runs
6876 // in this process.
6877 optional string hosting_name = 9;
6878}
6879
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006880/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006881 * Track Media Codec usage
6882 * Logged from:
6883 * frameworks/av/media/libstagefright/MediaCodec.cpp
6884 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6885 */
6886message MediametricsCodecReported {
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 android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6893}
6894
6895/**
6896 * Track Media Extractor (pulling video/audio streams out of containers) usage
6897 * Logged from:
6898 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6899 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6900 */
6901message MediametricsExtractorReported {
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.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6908}
6909
6910/**
6911 * Track how we arbitrate between microphone/input requests.
6912 * Logged from
6913 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6914 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6915 */
6916message MediametricsAudiopolicyReported {
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.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6923}
6924
6925/**
6926 * Track how we arbitrate between microphone requests.
6927 * Logged from
6928 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6929 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6930 */
6931message MediametricsAudiorecordReported {
6932 optional int64 timestamp_nanos = 1;
6933 optional string package_name = 2;
6934 optional int64 package_version_code = 3;
6935 optional int64 media_apex_version = 4;
6936
6937 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6938}
6939
6940/**
6941 * Track how we arbitrate between microphone/input requests.
6942 * Logged from
6943 * frameworks/av/media/libnblog/ReportPerformance.cpp
6944 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6945 */
6946message MediametricsAudiothreadReported {
6947 optional int64 timestamp_nanos = 1;
6948 optional string package_name = 2;
6949 optional int64 package_version_code = 3;
6950 optional int64 media_apex_version = 4;
6951
6952 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6953}
6954
6955/**
6956 * Track how we arbitrate between microphone/input requests.
6957 * Logged from
6958 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6959 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6960 */
6961message MediametricsAudiotrackReported {
6962 optional int64 timestamp_nanos = 1;
6963 optional string package_name = 2;
6964 optional int64 package_version_code = 3;
6965 optional int64 media_apex_version = 4;
6966
6967 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6968}
6969
6970/**
6971 * Track information about DRM framework performance
6972 * Logged from
6973 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6974 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6975 */
6976message MediametricsMediadrmReported {
6977 optional int64 timestamp_nanos = 1;
6978 optional string package_name = 2;
6979 optional int64 package_version_code = 3;
6980 optional int64 media_apex_version = 4;
6981
6982 // vendor+description tell about which DRM plugin is in use on this device
6983 optional string vendor = 5;
6984 optional string description = 6;
6985 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6986 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6987}
6988
6989/**
6990 * Track information about the widevine DRM plugin performance
6991 * Logged from
6992 * vendor/widevine/libwvdrmengine/cdm/metrics
6993 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6994 */
6995message MediametricsDrmWidevineReported {
6996 optional int64 timestamp_nanos = 1;
6997 optional string package_name = 2;
6998 optional int64 package_version_code = 3;
6999 optional int64 media_apex_version = 4;
7000
7001 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7002}
7003
7004/**
7005 * Track information about recordings (e.g. camcorder)
7006 * Logged from
7007 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7008 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7009 */
7010message MediametricsRecorderReported {
7011 optional int64 timestamp_nanos = 1;
7012 optional string package_name = 2;
7013 optional int64 package_version_code = 3;
7014 optional int64 media_apex_version = 4;
7015
7016 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7017}
7018
7019/**
7020 * Track Media Player usage
7021 * Logged from:
7022 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7023 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7024 */
7025message MediametricsNuPlayerReported {
7026 optional int64 timestamp_nanos = 1;
7027 optional string package_name = 2;
7028 optional int64 package_version_code = 3;
7029 optional int64 media_apex_version = 4;
7030
7031 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7032}
7033
7034/**
Robert Shiha4beed32019-08-19 14:15:23 -07007035 * Track Legacy DRM usage
7036 * Logged from
7037 * frameworks/av/drm/drmserver/DrmManager.cpp
7038 */
7039message MediametricsDrmManagerReported {
7040 optional int64 timestamp_nanos = 1;
7041 optional string package_name = 2;
7042 optional int64 package_version_code = 3;
7043 optional int64 media_apex_version = 4;
7044
7045 enum Method {
7046 METHOD_NOT_FOUND = -1;
7047 GET_CONSTRAINTS = 0;
7048 GET_METADATA = 1;
7049 CAN_HANDLE = 2;
7050 PROCESS_DRM_INFO = 3;
7051 ACQUIRE_DRM_INFO = 4;
7052 SAVE_RIGHTS = 5;
7053 GET_ORIGINAL_MIME_TYPE = 6;
7054 GET_DRM_OBJECT_TYPE = 7;
7055 CHECK_RIGHTS_STATUS = 8;
7056 REMOVE_RIGHTS = 9;
7057 REMOVE_ALL_RIGHTS = 10;
7058 OPEN_CONVERT_SESSION = 11;
7059 OPEN_DECRYPT_SESSION = 12;
7060 }
7061
7062 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7063 optional string plugin_id = 5;
7064 optional string description = 6;
7065 optional Method method = 7;
7066 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007067
7068 optional int64 get_constraints_count = 9;
7069 optional int64 get_metadata_count = 10;
7070 optional int64 can_handle_count = 11;
7071 optional int64 process_drm_info_count = 12;
7072 optional int64 acquire_drm_info_count = 13;
7073 optional int64 save_rights_count = 14;
7074 optional int64 get_original_mime_type_count = 15;
7075 optional int64 get_drm_object_type_count = 16;
7076 optional int64 check_rights_status_count = 17;
7077 optional int64 remove_rights_count = 18;
7078 optional int64 remove_all_rights_count = 19;
7079 optional int64 open_convert_session_count = 20;
7080 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007081}
7082
7083/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007084 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007085 * Pulled from: StatsCompanionService
7086*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007087message DangerousPermissionState {
7088 // Name of the permission
7089 optional string permission_name = 1;
7090
7091 // Uid of the package
7092 optional int32 uid = 2 [(is_uid) = true];
7093
7094 // Package requesting the permission
7095 optional string package_name = 3;
7096
7097 // If the permission is granted to the uid
7098 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007099
7100 // Permission flags as per android.content.pm.PermissionFlags
7101 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007102}
7103
Michael Groover4a0ca942019-01-24 17:41:25 -08007104/**
7105 * Logs when a package is denied access to a device identifier based on the new access requirements.
7106 *
7107 * Logged from:
7108 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7109 */
7110message DeviceIdentifierAccessDenied {
7111 // The name of the package denied access to the requested device identifier.
7112 optional string package_name = 1;
7113
7114 // The name of the device identifier method the package attempted to invoke.
7115 optional string method_name = 2;
7116
7117 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007118 // Starting from Android 11, this boolean is not set and will always be false.
7119 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007120
7121 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007122 // Starting from Android 11, this boolean is not set and will always be false.
7123 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007124}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007125
7126/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007127 * Pulls the ongoing mainline install train version code.
7128 * Pulled from StatsCompanionService
7129 */
7130message TrainInfo {
7131 optional int64 train_version_code = 1;
7132
7133 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007134
7135 optional string train_name = 3;
7136
7137 enum Status {
7138 UNKNOWN = 0;
7139 INSTALL_REQUESTED = 1;
7140 INSTALL_STARTED = 2;
7141 INSTALL_STAGED_NOT_READY = 3;
7142 INSTALL_STAGED_READY = 4;
7143 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007144 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7145 // and INSTALL_FAILURE_COMMIT.
7146 INSTALL_FAILURE = 6 [deprecated = true];
7147 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007148 INSTALL_CANCELLED = 7;
7149 INSTALLER_ROLLBACK_REQUESTED = 8;
7150 INSTALLER_ROLLBACK_INITIATED = 9;
7151 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7152 INSTALLER_ROLLBACK_STAGED = 11;
7153 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7154 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7155 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7156 INSTALLER_ROLLBACK_SUCCESS = 15;
7157 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007158 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7159 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7160 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7161 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7162 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7163 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007164 INSTALL_FAILURE_DOWNLOAD = 23;
7165 INSTALL_FAILURE_STATE_MISMATCH = 24;
7166 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007167 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007168 }
7169 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007170}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007171
7172/**
7173 * Logs the gesture stage changed event.
7174 *
7175 * Logged from:
7176 * frameworks/base/packages/SystemUI/
7177 */
7178message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007179 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007180}
7181
7182/**
7183 * Logs the feedback type.
7184 *
7185 * Logged from:
7186 * frameworks/base/packages/SystemUI/
7187 */
7188message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007189 // Whether or not the gesture was used.
7190 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007191}
7192
7193/**
7194 * Logs the progress.
7195 *
7196 * Logged from:
7197 * frameworks/base/packages/SystemUI/
7198 */
7199message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007200 // [0,100] progress for the assist gesture.
7201 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007202}
Neil Fullerdb14b482019-02-05 19:44:44 +00007203
7204/*
7205 * Information about the time zone data on a device.
7206 */
7207message TimeZoneDataInfo {
7208 // A version identifier for the data set on device. e.g. "2018i"
7209 optional string tzdb_version = 1;
7210}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007211
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007212/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007213 * Logs the GPU stats global health information.
7214 *
7215 * Logged from:
7216 * frameworks/native/services/gpuservice/gpustats/
7217 */
7218message GpuStatsGlobalInfo {
7219 // Package name of the gpu driver.
7220 optional string driver_package_name = 1;
7221
7222 // Version name of the gpu driver.
7223 optional string driver_version_name = 2;
7224
7225 // Version code of the gpu driver.
7226 optional int64 driver_version_code = 3;
7227
7228 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7229 optional int64 driver_build_time = 4;
7230
7231 // Total count of the gl driver gets loaded.
7232 optional int64 gl_loading_count = 5;
7233
7234 // Total count of the gl driver fails to be loaded.
7235 optional int64 gl_loading_failure_count = 6;
7236
7237 // Total count of the Vulkan driver gets loaded.
7238 optional int64 vk_loading_count = 7;
7239
7240 // Total count of the Vulkan driver fails to be loaded.
7241 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007242
7243 // Api version of the system Vulkan driver.
7244 optional int32 vulkan_version = 9;
7245
7246 // Api version of the system CPU Vulkan driver.
7247 optional int32 cpu_vulkan_version = 10;
7248
7249 // Api version of the system GLES driver.
7250 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007251
7252 // Total count of the angle driver gets loaded.
7253 optional int64 angle_loading_count = 12;
7254
7255 // Total count of the angle driver fails to be loaded.
7256 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007257}
7258
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007259/**
7260 * GPU driver loading time info.
7261 */
7262message GpuDriverLoadingTime {
7263 // List of all the driver loading times for this app. The list size is
7264 // capped at 50.
7265 repeated int64 driver_loading_time = 1;
7266}
7267
7268/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007269 * Logs the GPU stats per app health information.
7270 *
7271 * Logged from:
7272 * frameworks/native/services/gpuservice/gpustats/
7273 */
7274message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007275 // Package name of the application that loads the gpu driver. Total number
7276 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007277 optional string app_package_name = 1;
7278
7279 // Version code of the gpu driver this app loads.
7280 optional int64 driver_version_code = 2;
7281
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007282 // gl driver loading time info.
7283 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7284 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007285
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007286 // Vulkan driver loading time info.
7287 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7288 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007289
7290 // Angle driver loading time info.
7291 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7292 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007293
7294 // CPU Vulkan implementation is in use.
7295 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007296
7297 // App is not doing pre-rotation correctly.
7298 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007299
7300 // App creates GLESv1 context.
7301 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007302}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007303
7304/*
7305 * Logs the size of the system ion heap.
7306 *
7307 * Pulled from StatsCompanionService.
7308 */
7309message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007310 // Deprecated due to limited support of ion stats in debugfs.
7311 // Use `IonHeapSize` instead.
7312 option deprecated = true;
7313
Rafal Slawikd4e87572019-03-12 13:08:38 +00007314 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007315 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007316 optional int64 size_in_bytes = 1;
7317}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007318
Rafal Slawik77987ed2019-06-17 12:28:23 +01007319/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007320 * Logs the total size of the ion heap.
7321 *
7322 * Pulled from StatsCompanionService.
7323 */
7324message IonHeapSize {
7325 // Total size of all ion heaps in kilobytes.
7326 // Read from: /sys/kernel/ion/total_heaps_kb.
7327 optional int32 total_size_kb = 1;
7328}
7329
7330/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007331 * Logs the per-process size of the system ion heap.
7332 *
7333 * Pulled from StatsCompanionService.
7334 */
7335message ProcessSystemIonHeapSize {
7336 // The uid if available. -1 means not available.
7337 optional int32 uid = 1 [(is_uid) = true];
7338
7339 // The process name (from /proc/PID/cmdline).
7340 optional string process_name = 2;
7341
7342 // Sum of sizes of all allocations.
7343 optional int32 total_size_in_kilobytes = 3;
7344
7345 // Number of allocations.
7346 optional int32 allocation_count = 4;
7347
7348 // Size of the largest allocation.
7349 optional int32 max_size_in_kilobytes = 5;
7350}
7351
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007352/**
7353 * Push network stack events.
7354 *
7355 * Log from:
7356 * frameworks/base/packages/NetworkStack/
7357 */
7358message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007359 // The id that indicates the event reported from NetworkStack.
7360 optional int32 event_id = 1;
7361 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007362 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7363}
Carmen Agimofa769c152019-03-04 14:39:14 +00007364
7365/**
7366 * Logs the apps that are installed on the external storage.
7367 * Pulled from:
7368 * StatsCompanionService
7369 */
7370message AppsOnExternalStorageInfo {
7371 // The type of the external storage.
7372 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7373 // The name of the package that is installed on the external storage.
7374 optional string package_name = 2;
7375}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007376
7377/**
7378 * Logs the settings related to Face.
7379 * Logged from:
7380 * frameworks/base/services/core/java/com/android/server/stats
7381 */
7382message FaceSettings {
7383 // Whether or not face unlock is allowed on Keyguard.
7384 optional bool unlock_keyguard_enabled = 1;
7385 // Whether or not face unlock dismisses the Keyguard.
7386 optional bool unlock_dismisses_keyguard = 2;
7387 // Whether or not face unlock requires attention.
7388 optional bool unlock_attention_required = 3;
7389 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7390 optional bool unlock_app_enabled = 4;
7391 // Whether or not face unlock always requires user confirmation.
7392 optional bool unlock_always_require_confirmation = 5;
7393 // Whether or not a diverse set of poses are required during enrollment.
7394 optional bool unlock_diversity_required = 6;
7395}
Maggie White442b6312019-04-05 16:26:44 -07007396
7397/**
7398 * Logs cooling devices maintained by the kernel.
7399 *
7400 * Pulled from StatsCompanionService.java
7401 */
7402message CoolingDevice {
7403 // The type of cooling device being reported. Eg. CPU, GPU...
7404 optional android.os.CoolingTypeEnum device_location = 1;
7405 // The name of the cooling device source. Eg. CPU0
7406 optional string device_name = 2;
7407 // Current throttle state of the cooling device. The value can any unsigned
7408 // integer between 0 and max_state defined in its driver. 0 means device is
7409 // not in throttling, higher value means deeper throttling.
7410 optional int32 state = 3;
7411}
Ben Blount763a5d52019-04-10 11:48:58 -07007412
7413/**
7414 * Intelligence has several counter-type events that don't warrant a
7415 * full separate atom. These are primarily API call counters but also include
7416 * counters for feature usage and specific failure modes.
7417 *
7418 * Logged from the Intelligence mainline module.
7419 */
7420message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007421 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007422 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007423 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007424 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007425 // How many times the event occured (to report a batch of high frequency events).
7426 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007427 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007428 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007429}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007430
7431/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007432 * Logs when Car Power state changed.
7433 *
7434 * Logged from:
7435 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7436 */
7437message CarPowerStateChanged {
7438 // States come from CpmsState in CarPowerManagementService.java.
7439 enum State {
7440 WAIT_FOR_VHAL = 0;
7441 ON = 1;
7442 SHUTDOWN_PREPARE = 2;
7443 WAIT_FOR_FINISH = 3;
7444 SUSPEND = 4;
7445 SIMULATE_SLEEP = 5;
7446 }
7447 optional State state = 1;
7448}
7449
7450/**
7451 * Logs whether GarageMode is entered.
7452 *
7453 * Logged from:
7454 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7455 */
7456message GarageModeInfo {
7457 // Whether GarageMode is entered.
7458 optional bool is_garage_mode = 1;
7459}
Martijn Coenencd95d462019-04-25 17:09:45 +02007460
7461/**
7462 * Historical app ops data per package.
7463 */
7464message AppOps {
7465 // Uid of the package requesting the op
7466 optional int32 uid = 1 [(is_uid) = true];
7467
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007468 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007469 optional string package_name = 2;
7470
7471 // operation id; maps to the OP_* constants in AppOpsManager.java
7472 optional int32 op_id = 3;
7473
7474 // The number of times the op was granted while the app was in the
7475 // foreground (only for trusted requests)
7476 optional int64 trusted_foreground_granted_count = 4;
7477
7478 // The number of times the op was granted while the app was in the
7479 // background (only for trusted requests)
7480 optional int64 trusted_background_granted_count = 5;
7481
7482 // The number of times the op was rejected while the app was in the
7483 // foreground (only for trusted requests)
7484 optional int64 trusted_foreground_rejected_count = 6;
7485
7486 // The number of times the op was rejected while the app was in the
7487 // background (only for trusted requests)
7488 optional int64 trusted_background_rejected_count = 7;
7489
7490 // For long-running operations, total duration of the operation
7491 // while the app was in the foreground (only for trusted requests)
7492 optional int64 trusted_foreground_duration_millis = 8;
7493
7494 // For long-running operations, total duration of the operation
7495 // while the app was in the background (only for trusted requests)
7496 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007497
7498 // Whether AppOps is guarded by Runtime permission
7499 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007500}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007501
7502/**
7503 * Location Manager API Usage information(e.g. API under usage,
7504 * API call's parameters).
7505 * Logged from:
7506 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7507 */
7508message LocationManagerApiUsageReported {
7509
7510 // Indicating if usage starts or usage ends.
7511 optional android.stats.location.UsageState state = 1;
7512
7513 // LocationManagerService's API in use.
7514 // We can identify which API from LocationManager is
7515 // invoking current LMS API by the combination of
7516 // API parameter(e.g. is_listener_null, is_intent_null,
7517 // is_location_request_null)
7518 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7519
7520 // Name of the package calling the API.
7521 optional string calling_package_name = 3;
7522
7523 // Type of the location provider.
7524 optional android.stats.location.ProviderType provider = 4;
7525
7526 // Quality of the location request
7527 optional android.stats.location.LocationRequestQuality quality = 5;
7528
7529 // The desired interval for active location updates, in milliseconds.
7530 // Bucketized to reduce cardinality.
7531 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7532
7533 // Minimum distance between location updates, in meters.
7534 // Bucketized to reduce cardinality.
7535 optional android.stats.location.SmallestDisplacementBucket
7536 bucketized_smallest_displacement = 7;
7537
7538 // The number of location updates.
7539 optional int64 num_updates = 8;
7540
7541 // The request expiration time, in millisecond since boot.
7542 // Bucketized to reduce cardinality.
7543 optional android.stats.location.ExpirationBucket
7544 bucketized_expire_in = 9;
7545
7546 // Type of Callback passed in for this API.
7547 optional android.stats.location.CallbackType callback_type = 10;
7548
7549 // The radius of the central point of the alert
7550 // region, in meters. Only for API REQUEST_GEOFENCE.
7551 // Bucketized to reduce cardinality.
7552 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7553
7554 // Activity Importance of API caller.
7555 // Categorized to 3 types that are interesting from location's perspective.
7556 optional android.stats.location.ActivityImportance activiy_importance = 12;
7557}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007558
7559/**
7560 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7561 */
7562message ReviewPermissionsFragmentResultReported {
7563 // unique value identifying a permission group change. A permission group change might result
7564 // in multiple of these atoms
7565 optional int64 change_id = 1;
7566
7567 // UID of package the permission belongs to
7568 optional int32 uid = 2 [(is_uid) = true];
7569
7570 // Name of package the permission belongs to
7571 optional string package_name = 3;
7572
7573 // The permission to be granted
7574 optional string permission_name = 4;
7575
7576 // The result of the permission grant
7577 optional bool permission_granted = 5;
7578}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007579
7580/**
7581* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7582* Logged from: RuntimePermissionUpdgradeController
7583*/
7584message RuntimePermissionsUpgradeResult {
7585 // Permission granted as result of upgrade
7586 optional string permission_name = 1;
7587
7588 // UID of package granted permission
7589 optional int32 uid = 2 [(is_uid) = true];
7590
7591 // Name of package granted permission
7592 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007593}
7594
7595/**
7596* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7597*/
7598message GrantPermissionsActivityButtonActions {
7599 // Permission granted as result of upgrade
7600 optional string permission_group_name = 1;
7601
7602 // UID of package granted permission
7603 optional int32 uid = 2 [(is_uid) = true];
7604
7605 // Name of package requesting permission
7606 optional string package_name = 3;
7607
7608 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7609 // LABEL_ constants in GrantPermissionActivity.java
7610 optional int32 buttons_presented = 4;
7611
7612 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7613 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007614
7615 // id which identifies single session of user interacting with permission controller
7616 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007617}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007618
7619/**
7620 * Information about LocationAccessCheck notification presented to user
7621 */
7622message LocationAccessCheckNotificationAction {
7623
7624 // id which identifies single session of user interacting with permission controller
7625 optional int64 session_id = 1;
7626
7627 // Uid of package for which location access check is presented
7628 optional int32 package_uid = 2;
7629
7630 // Name of package for which location access check is presented
7631 optional string package_name = 3;
7632
7633 enum Result {
7634 UNDEFINED = 0;
7635 // notification was presented to the user
7636 NOTIFICATION_PRESENTED = 1;
7637 // notification was declined by the user
7638 NOTIFICATION_DECLINED = 2;
7639 // notification was clicked by the user
7640 NOTIFICATION_CLICKED = 3;
7641 }
7642
7643 // View / interaction recorded
7644 optional Result result = 4;
7645}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007646
7647/**
7648 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7649 */
7650message AppPermissionFragmentActionReported {
7651 // id which identifies single session of user interacting with permission controller
7652 optional int64 session_id = 1;
7653
7654 // unique value identifying a permission group change. A permission group change might result
7655 // in multiple of these atoms
7656 optional int64 change_id = 2;
7657
7658 // UID of package the permission belongs to
7659 optional int32 uid = 3 [(is_uid) = true];
7660
7661 // Name of package the permission belongs to
7662 optional string package_name = 4;
7663
7664 // The permission to be granted
7665 optional string permission_name = 5;
7666
7667 // The result of the permission grant
7668 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007669
7670 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7671 optional int32 permission_flags = 7;
7672
7673 enum Button {
7674 UNDEFINED = 0;
7675 // Allow button
7676 ALLOW = 1;
7677 // Deny button
7678 DENY = 2;
7679 // Ask every time button
7680 ASK_EVERY_TIME = 3;
7681 // Allow all the time button
7682 ALLOW_ALWAYS = 4;
7683 // Allow only while using the app button
7684 ALLOW_FOREGROUND = 5;
7685 // Same is Deny button but shown in while in use dialog
7686 DENY_FOREGROUND = 6;
7687 }
7688
7689 // Button pressed in the dialog
7690 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007691}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007692
7693/**
7694* Information about a AppPermissionFragment viewed by user
7695*/
7696message AppPermissionFragmentViewed {
7697 // id which identifies single session of user interacting with permission controller
7698 optional int64 session_id = 1;
7699
7700 // UID of package for which permissions are viewed
7701 optional int32 uid = 2 [(is_uid) = true];
7702
7703 // Name of package for which permissions are viewed
7704 optional string package_name = 3;
7705
7706 // Permission group viewed
7707 optional string permission_group_name = 4;
7708}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007709
7710/**
7711* Information about a AppPermissionsFragment viewed by user
7712*/
7713message AppPermissionsFragmentViewed {
7714 // id which identifies single session of user interacting with permission controller
7715 optional int64 session_id = 1;
7716
7717 // id which identifies single view as every view might have several logging records
7718 // with different package information attached
7719 optional int64 view_id = 2;
7720
7721 // Permission group viewed
7722 optional string permission_group_name = 3;
7723
7724 // UID of package for which permissions are viewed
7725 optional int32 uid = 4 [(is_uid) = true];
7726
7727 // Name of package for which permissions are viewed
7728 optional string package_name = 5;
7729
7730 // Category in which permission is included
7731 enum Category {
7732 UNDEFINED = 0;
7733 ALLOWED = 1;
7734 ALLOWED_FOREGROUND = 2;
7735 DENIED = 3;
7736 }
7737 optional Category category = 6;
7738}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007739
7740/**
7741* Information about a PermissionAppsFragment viewed by user.
7742* Logged from ui/handheld/PermissionAppsFragment.java
7743*/
7744message PermissionAppsFragmentViewed {
7745 // id which identifies single session of user interacting with permission controller
7746 optional int64 session_id = 1;
7747
7748 // id which identifies single view as every view might have several logging records
7749 // with different package information attached
7750 optional int64 view_id = 2;
7751
7752 // Permission group viewed
7753 optional string permission_group_name = 3;
7754
7755 // UID of package for which permissions are viewed
7756 optional int32 uid = 4 [(is_uid) = true];
7757
7758 // Name of package for which permissions are viewed
7759 optional string package_name = 5;
7760
7761 // Category in which app is included
7762 enum Category {
7763 UNDEFINED = 0;
7764 ALLOWED = 1;
7765 ALLOWED_FOREGROUND = 2;
7766 DENIED = 3;
7767 }
7768 optional Category category = 6;
7769}
Tony Make2b1b672019-07-29 16:59:47 +01007770
7771/**
7772 * Logs when there is a smart selection related event.
7773 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7774 * Logged from: TextClassifierEventLogger.java
7775 */
7776message TextSelectionEvent {
7777 // A session ID.
7778 optional string session_id = 1;
7779
7780 // Event type of this event.
7781 optional android.stats.textclassifier.EventType event_type = 2;
7782
Tony Mak9c84bd22019-12-09 07:27:25 +00007783 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007784 optional string model_name = 3;
7785
7786 // Type of widget that was involved in triggering this event.
7787 optional android.stats.textclassifier.WidgetType widget_type = 4;
7788
7789 // Index of this event in a session.
7790 optional int32 event_index = 5;
7791
7792 // Entity type that is involved.
7793 optional string entity_type = 6;
7794
7795 // Relative word index of the start of the selection.
7796 optional int32 relative_word_start_index = 7;
7797
7798 // Relative word (exclusive) index of the end of the selection.
7799 optional int32 relative_word_end_index = 8;
7800
7801 // Relative word index of the start of the smart selection.
7802 optional int32 relative_suggested_word_start_index = 9;
7803
7804 // Relative word (exclusive) index of the end of the smart selection.
7805 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007806
7807 // Name of source package.
7808 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007809}
7810
7811/**
7812 * Logs when there is a smart linkify related event.
7813 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7814 * Logged from: TextClassifierEventLogger.java
7815 */
7816message TextLinkifyEvent {
7817 // A session ID.
7818 optional string session_id = 1;
7819
7820 // Event type of this event.
7821 optional android.stats.textclassifier.EventType event_type = 2;
7822
Tony Mak9c84bd22019-12-09 07:27:25 +00007823 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007824 optional string model_name = 3;
7825
7826 // Type of widget that was involved in triggering this event.
7827 optional android.stats.textclassifier.WidgetType widget_type = 4;
7828
7829 // Index of this event in a session.
7830 optional int32 event_index = 5;
7831
7832 // Entity type that is involved.
7833 optional string entity_type = 6;
7834
7835 // Number of links detected.
7836 optional int32 num_links = 7;
7837
7838 // The total length of all links.
7839 optional int32 linked_text_length = 8;
7840
7841 // Length of input text.
7842 optional int32 text_length = 9;
7843
7844 // Time spent on generating links in ms.
7845 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007846
7847 // Name of source package.
7848 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007849}
7850
7851/**
7852 * Logs when there is a conversation actions related event.
7853 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7854 * Logged from: TextClassifierEventLogger.java
7855 */
7856message ConversationActionsEvent {
7857 // A session ID.
7858 optional string session_id = 1;
7859
7860 // Event type of this event.
7861 optional android.stats.textclassifier.EventType event_type = 2;
7862
Tony Mak9c84bd22019-12-09 07:27:25 +00007863 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007864 optional string model_name = 3;
7865
7866 // Type of widget that was involved in triggering this event.
7867 optional android.stats.textclassifier.WidgetType widget_type = 4;
7868
7869 // The first entity type that is involved.
7870 optional string first_entity_type = 5;
7871
7872 // The second entity type that is involved.
7873 optional string second_entity_type = 6;
7874
7875 // The third entity type that is involved.
7876 optional string third_entity_type = 7;
7877
7878 // The score of the first entity type.
7879 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007880
7881 // Name of source package.
7882 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007883
7884 // Name of the annotator model that is involved in this event.
7885 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007886}
7887
7888/**
7889 * Logs when there is a language detection related event.
7890 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7891 * Logged from: TextClassifierEventLogger.java
7892 */
7893message LanguageDetectionEvent {
7894 // A session ID.
7895 optional string session_id = 1;
7896
7897 // Event type of this event.
7898 optional android.stats.textclassifier.EventType event_type = 2;
7899
Tony Mak9c84bd22019-12-09 07:27:25 +00007900 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007901 optional string model_name = 3;
7902
7903 // Type of widget that was involved in triggering this event.
7904 optional android.stats.textclassifier.WidgetType widget_type = 4;
7905
7906 // Detected language.
7907 optional string language_tag = 5;
7908
7909 // Score of the detected language.
7910 optional float score = 6;
7911
7912 // Position of this action.
7913 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007914
7915 // Name of source package.
7916 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007917}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007918
7919/**
7920 * Information about an OTA update attempt by update_engine.
7921 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7922 */
7923message UpdateEngineUpdateAttemptReported {
7924 // The number of attempts for the update engine to apply a given payload.
7925 optional int32 attempt_number = 1;
7926
7927 optional android.stats.otaupdate.PayloadType payload_type = 2;
7928
7929 // The total time in minutes for the update engine to apply a given payload.
7930 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7931 // it's increased when the system is sleeping.
7932 optional int32 duration_boottime_in_minutes = 3;
7933
7934 // The total time in minutes for the update engine to apply a given payload.
7935 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7936 // and it's not increased when the system is sleeping.
7937 optional int32 duration_monotonic_in_minutes = 4;
7938
7939 // The size of the payload in MiBs.
7940 optional int32 payload_size_mib = 5;
7941
7942 // The attempt result reported by the update engine for an OTA update.
7943 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7944
7945 // The error code reported by the update engine after an OTA update attempt
7946 // on A/B devices.
7947 optional android.stats.otaupdate.ErrorCode error_code = 7;
7948
7949 // The build fingerprint of the source system. The value is read from a
7950 // system property when the device takes the update. e.g.
7951 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7952 optional string source_fingerprint = 8;
7953}
7954
7955/**
7956 * Information about all the attempts the device make before finishing the
7957 * successful update.
7958 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7959 */
7960message UpdateEngineSuccessfulUpdateReported {
7961 // The number of attempts for the update engine to apply the payload for a
7962 // successful update.
7963 optional int32 attempt_count = 1;
7964
7965 optional android.stats.otaupdate.PayloadType payload_type = 2;
7966
7967 optional int32 payload_size_mib = 3;
7968
7969 // The total number of bytes downloaded by update_engine since the last
7970 // successful update.
7971 optional int32 total_bytes_downloaded_mib = 4;
7972
7973 // The ratio in percentage of the over-downloaded bytes compared to the
7974 // total bytes needed to successfully install the update. e.g. 200 if we
7975 // download 200MiB in total for a 100MiB package.
7976 optional int32 download_overhead_percentage = 5;
7977
7978 // The total time in minutes for the update engine to apply the payload for a
7979 // successful update.
7980 optional int32 total_duration_minutes = 6;
7981
7982 // The number of reboot of the device during a successful update.
7983 optional int32 reboot_count = 7;
7984}
Alec Mourie088e762019-07-02 13:10:55 -07007985
7986/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007987 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7988 * key to indicate whether it was successful or not.
7989 *
7990 * Logged from:
7991 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7992 */
7993message RebootEscrowRecoveryReported {
7994 optional bool successful = 1;
7995}
7996
7997/**
Alec Mourie088e762019-07-02 13:10:55 -07007998 * Global display pipeline metrics reported by SurfaceFlinger.
7999 * Pulled from:
8000 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8001 */
8002message SurfaceflingerStatsGlobalInfo {
8003 // Total number of frames presented during the tracing period
8004 optional int64 total_frames = 1;
8005 // Total number of frames missed
8006 optional int64 missed_frames = 2;
8007 // Total number of frames that fell back to client composition
8008 optional int64 client_composition_frames = 3;
8009 // Total time the display was turned on
8010 optional int64 display_on_millis = 4;
8011 // Total time that was spent performing animations.
8012 // This is derived from the present-to-present layer histogram
8013 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008014 // Total number of event connections tracked by SurfaceFlinger at the time
8015 // of this pull. If this number grows prohibitively large, then this can
8016 // cause jank due to resource contention.
8017 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008018 // Set of timings measured from when SurfaceFlinger began compositing a
8019 // frame, until the frame was requested to be presented to the display. This
8020 // measures SurfaceFlinger's total CPU walltime on the critical path per
8021 // frame.
8022 optional FrameTimingHistogram frame_duration = 7
8023 [(android.os.statsd.log_mode) = MODE_BYTES];
8024 // Set of timings measured from when SurfaceFlinger first began using the
8025 // GPU to composite a frame, until the GPU has finished compositing that
8026 // frame. This measures the total additional time SurfaceFlinger needed to
8027 // perform due to falling back into GPU composition.
8028 optional FrameTimingHistogram render_engine_timing = 8
8029 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008030}
8031
8032/**
8033 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8034 * The number of layers uploaded will be restricted due to size limitations.
8035 * Pulled from:
8036 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8037 */
8038message SurfaceflingerStatsLayerInfo {
8039 // The layer for this set of metrics
8040 // For now we can infer that the package name is included in the layer
8041 // name.
8042 optional string layer_name = 1;
8043 // Total number of frames presented
8044 optional int64 total_frames = 2;
8045 // Total number of dropped frames while latching a buffer for this layer.
8046 optional int64 dropped_frames = 3;
8047 // Set of timings measured between successive presentation timestamps.
8048 optional FrameTimingHistogram present_to_present = 4
8049 [(android.os.statsd.log_mode) = MODE_BYTES];
8050 // Set of timings measured from when an app queued a buffer for
8051 // presentation, until the buffer was actually presented to the
8052 // display.
8053 optional FrameTimingHistogram post_to_present = 5
8054 [(android.os.statsd.log_mode) = MODE_BYTES];
8055 // Set of timings measured from when a buffer is ready to be presented,
8056 // until the buffer was actually presented to the display.
8057 optional FrameTimingHistogram acquire_to_present = 6
8058 [(android.os.statsd.log_mode) = MODE_BYTES];
8059 // Set of timings measured from when a buffer was latched by
8060 // SurfaceFlinger, until the buffer was presented to the display
8061 optional FrameTimingHistogram latch_to_present = 7
8062 [(android.os.statsd.log_mode) = MODE_BYTES];
8063 // Set of timings measured from the desired presentation to the actual
8064 // presentation time
8065 optional FrameTimingHistogram desired_to_present = 8
8066 [(android.os.statsd.log_mode) = MODE_BYTES];
8067 // Set of timings measured from when an app queued a buffer for
8068 // presentation, until the buffer was ready to be presented.
8069 optional FrameTimingHistogram post_to_acquire = 9
8070 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008071 // Frames missed latch because the acquire fence didn't fire
8072 optional int64 late_acquire_frames = 10;
8073 // Frames latched early because the desired present time was bad
8074 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008075}
8076
8077/**
8078 * Histogram of frame counts bucketed by time in milliseconds.
8079 * Because of size limitations, we hard-cap the number of buckets, with
8080 * buckets for corresponding to larger milliseconds being less precise.
8081 */
8082message FrameTimingHistogram {
8083 // Timings in milliseconds that describes a set of histogram buckets
8084 repeated int32 time_millis_buckets = 1;
8085 // Number of frames that match to each time_millis, i.e. the bucket
8086 // contents
8087 // It's required that len(time_millis) == len(frame_count)
8088 repeated int64 frame_counts = 2;
8089}
Emilian Peev6729f372019-08-29 09:14:09 -07008090
Emilian Peev6729f372019-08-29 09:14:09 -07008091/**
8092 * Information about camera facing and API level usage.
8093 * Logged from:
8094 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8095 */
8096message CameraActionEvent {
8097 // Camera session duration
8098 optional int64 duration = 1;
8099
8100 // Camera API level used
8101 optional int32 api_level = 2;
8102
8103 // Name of client package
8104 optional string package_name = 3;
8105
8106 // Camera facing
8107 enum Facing {
8108 UNKNOWN = 0;
8109 BACK = 1;
8110 FRONT = 2;
8111 EXTERNAL = 3;
8112 }
8113 optional Facing facing = 4;
8114}
atrost01a20932019-08-28 15:40:37 +01008115
8116/**
8117 * Logs when a compatibility change is affecting an app.
8118 *
8119 * Logged from:
8120 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8121 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8122 */
8123message AppCompatibilityChangeReported {
8124 // The UID of the app being affected by the compatibilty change.
8125 optional int32 uid = 1 [(is_uid) = true];
8126
8127 // The ID of the change affecting the app.
8128 optional int64 change_id = 2;
8129
8130 enum State {
8131 UNKNOWN_STATE = 0;
8132 ENABLED = 1;
8133 DISABLED = 2;
8134 LOGGED = 3;
8135 }
8136
8137 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8138 // logged otherwise.
8139 optional State state = 3;
8140
8141 enum Source {
8142 UNKNOWN_SOURCE = 0;
8143 APP_PROCESS = 1;
8144 SYSTEM_SERVER = 2;
8145 }
8146
8147 // Where it was logged from.
8148 optional Source source = 4;
8149
8150}
Hector Dearman40579f62019-11-01 13:19:30 +00008151
8152/**
8153 * Logged from
8154 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8155 */
8156message PerfettoUploaded {
8157 enum Event {
8158 PERFETTO_UNDEFINED = 0;
8159 PERFETTO_TRACE_BEGIN = 1;
8160 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8161 PERFETTO_ON_CONNECT = 3;
8162 PERFETTO_ON_TRACING_DISABLED = 4;
8163 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8164 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8165 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8166 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8167 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8168 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8169 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8170 PERFETTO_TRIGGER_BEGIN = 12;
8171 PERFETTO_TRIGGER_SUCCESS = 13;
8172 PERFETTO_TRIGGER_FAILURE = 14;
8173 PERFETTO_HIT_GUARDRAILS = 15;
8174 PERFETTO_ON_TIMEOUT = 16;
8175 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8176 }
8177
8178 // Which stage of the pipeline we are reporting from.
8179 optional Event event = 1;
8180
8181 // UUID matching the one set inside the SystemInfo trace packet.
8182 optional int64 trace_uuid_lsb = 2;
8183 optional int64 trace_uuid_msb = 3;
8184}
Mark Tabrya824a642019-11-05 12:26:12 -08008185
8186/**
8187 * Pulls client metrics on data transferred via Vehicle Maps Service.
8188 * Metrics are keyed by uid + layer.
8189 *
8190 * Pulled from:
8191 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8192 */
8193message VmsClientStats {
8194 // UID of the VMS client app
8195 optional int32 uid = 1 [(is_uid) = true];
8196
8197 // VMS layer definition
8198 optional int32 layer_type = 2;
8199 optional int32 layer_channel = 3;
8200 optional int32 layer_version = 4;
8201
8202 // Bytes and packets sent by the client for the layer
8203 optional int64 tx_bytes = 5;
8204 optional int64 tx_packets = 6;
8205
8206 // Bytes and packets received by the client for the layer
8207 optional int64 rx_bytes = 7;
8208 optional int64 rx_packets = 8;
8209
8210 // Bytes and packets dropped due to client error
8211 optional int64 dropped_bytes = 9;
8212 optional int64 dropped_packets = 10;
8213}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008214
8215/**
8216 * State of a dangerous permission requested by a package - sampled
8217 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8218*/
8219message DangerousPermissionStateSampled {
8220 // Name of the permission
8221 optional string permission_name = 1;
8222
8223 // Uid of the package
8224 optional int32 uid = 2 [(is_uid) = true];
8225
8226 // If the permission is granted to the uid
8227 optional bool is_granted = 3;
8228
8229 // Permission flags as per android.content.pm.PermissionFlags
8230 optional int32 permission_flags = 4;
8231}
8232
Stan Iliev637ba5e2019-08-16 13:43:08 -04008233/**
8234 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8235 */
8236enum PipelineType {
8237 GL = 0;
8238 VULKAN = 1;
8239}
8240
8241/**
8242 * HWUI stats for a given app.
8243 */
8244message GraphicsStats {
8245 // The package name of the app
8246 optional string package_name = 1;
8247
8248 // The version code of the app
8249 optional int64 version_code = 2;
8250
8251 // The start & end timestamps in UTC as
8252 // milliseconds since January 1, 1970
8253 // Compatible with java.util.Date#setTime()
8254 optional int64 stats_start = 3;
8255
8256 optional int64 stats_end = 4;
8257
8258 // HWUI renders pipeline type: GL or Vulkan.
8259 optional PipelineType pipeline = 5;
8260
8261 // Distinct frame count.
8262 optional int32 total_frames = 6;
8263
8264 // Number of "missed vsync" events.
8265 optional int32 missed_vsync_count = 7;
8266
8267 // Number of frames in triple-buffering scenario (high input latency)
8268 optional int32 high_input_latency_count = 8;
8269
8270 // Number of "slow UI thread" events.
8271 optional int32 slow_ui_thread_count = 9;
8272
8273 // Number of "slow bitmap upload" events.
8274 optional int32 slow_bitmap_upload_count = 10;
8275
8276 // Number of "slow draw" events.
8277 optional int32 slow_draw_count = 11;
8278
8279 // Number of frames that missed their deadline (aka, visibly janked)
8280 optional int32 missed_deadline_count = 12;
8281
8282 // The frame time histogram for the package
8283 optional FrameTimingHistogram cpu_histogram = 13
8284 [(android.os.statsd.log_mode) = MODE_BYTES];
8285
8286 // The gpu frame time histogram for the package
8287 optional FrameTimingHistogram gpu_histogram = 14
8288 [(android.os.statsd.log_mode) = MODE_BYTES];
8289
8290 // UI mainline module version.
8291 optional int64 version_ui_module = 15;
8292
8293 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8294 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8295 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8296 // more apps are running / rendering.
8297 optional bool is_today = 16;
8298}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008299
8300/**
8301 * Message related to dangerous (runtime) app ops access
8302 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008303message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008304 // Uid of the package accessing app op
8305 optional int32 uid = 1 [(is_uid) = true];
8306
8307 // Name of the package accessing app op
8308 optional string package_name = 2;
8309
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008310 // operation string id per OPSTR_ constants in AppOpsManager.java
8311 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008312
8313 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8314 // Features must be provided through manifest using <feature> tag available in R and above.
8315 optional string feature_id = 4;
8316
8317 // message related to app op access, limited to 600 chars by API
8318 optional string message = 5;
8319
8320 enum SamplingStrategy {
8321 DEFAULT = 0;
8322 UNIFORM = 1;
8323 RARELY_USED = 2;
8324 }
8325
8326 // sampling strategy used to collect this message
8327 optional SamplingStrategy sampling_strategy = 6;
8328}
8329
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008330/*
8331 * Logs userspace reboot outcome and duration.
8332 *
8333 * Logged from:
8334 * frameworks/base/core/java/com/android/server/BootReceiver.java
8335 */
8336message UserspaceRebootReported {
8337 // Possible outcomes of userspace reboot.
8338 enum Outcome {
8339 // Default value in case platform failed to determine the outcome.
8340 OUTCOME_UNKNOWN = 0;
8341 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8342 SUCCESS = 1;
8343 // Userspace reboot shutdown sequence was aborted.
8344 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8345 // Remounting userdata into checkpointing mode failed.
8346 FAILED_USERDATA_REMOUNT = 3;
8347 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8348 // reboot.
8349 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8350 }
8351 // Outcome of userspace reboot. Always set.
8352 optional Outcome outcome = 1;
8353 // Duration of userspace reboot in case it has a successful outcome.
8354 // Duration is measured as time between userspace reboot was initiated and until boot completed
8355 // (e.g. sys.boot_completed=1).
8356 optional int64 duration_millis = 2;
8357 // State of primary user's (user0) credential encryption storage.
8358 enum UserEncryptionState {
8359 // Default value.
8360 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8361 // Credential encrypted storage is unlocked.
8362 UNLOCKED = 1;
8363 // Credential encrypted storage is locked.
8364 LOCKED = 2;
8365 }
8366 // State of primary user's encryption storage at the moment boot completed. Always set.
8367 optional UserEncryptionState user_encryption_state = 3;
8368}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008369
8370/*
8371 * Logs integrity check information during each install.
8372 *
8373 * Logged from:
8374 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8375 */
8376message IntegrityCheckResultReported {
8377 optional string package_name = 1;
8378 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008379 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008380 optional string installer_package_name = 4;
8381 enum Response {
8382 UNKNOWN = 0;
8383 ALLOWED = 1;
8384 REJECTED = 2;
8385 FORCE_ALLOWED = 3;
8386 }
8387 optional Response response = 5;
8388 // An estimate on the cause of the response. This will only be populated for
8389 // REJECTED and FORCE_ALLOWED
8390 optional bool caused_by_app_cert_rule = 6;
8391 optional bool caused_by_installer_rule = 7;
8392}
8393
8394/**
8395 * Logs the information about the rules and the provider whenever rules are
8396 * pushed into AppIntegrityManager.
8397 *
8398 * Logged from:
8399 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8400 */
8401message IntegrityRulesPushed {
8402 optional bool success = 1;
8403 // Package name of the app that pushed the rules.
8404 optional string rule_provider = 2;
8405 // Version string of arbitrary format provided by the rule provider to
8406 // identify the rules.
8407 optional string rule_version = 3;
8408}
Jordan Liubedfa702019-12-20 15:08:45 -08008409
8410/**
8411 * Logs when a cell broadcast message is received on the device.
8412 *
8413 * Logged from CellBroadcastService module:
8414 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8415 */
8416message CellBroadcastMessageReported {
8417 // The type of Cell Broadcast message
8418 enum CbType {
8419 UNKNOWN_TYPE = 0;
8420 GSM = 1;
8421 CDMA = 2;
8422 CDMA_SPC = 3;
8423 }
8424
8425 // GSM, CDMA, CDMA-SCP
8426 optional CbType type = 1;
8427}
8428
8429/**
8430 * Logs when an error occurs while handling a cell broadcast message;
8431 *
8432 * Logged from CellBroadcastService module:
8433 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8434 */
8435message CellBroadcastMessageError {
8436 // The type of error raised when trying to handle a cell broadcast message
8437 enum ErrorType {
8438 UNKNOWN_TYPE = 0;
8439 CDMA_DECODING_ERROR = 1;
8440 CDMA_SCP_EMPTY = 2;
8441 CDMA_SCP_HANDLING_ERROR = 3;
8442 GSM_INVALID_HEADER_LENGTH = 4;
8443 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8444 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8445 GSM_INVALID_PDU = 7;
8446 GSM_INVALID_GEO_FENCING_DATA = 8;
8447 GSM_UMTS_INVALID_WAC = 9;
8448 FAILED_TO_INSERT_TO_DB = 10;
8449 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8450 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8451 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8452 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8453 }
8454
8455 // What kind of error occurred
8456 optional ErrorType type = 1;
8457
8458 // Exception message (or log message) associated with the error (max 1000 chars)
8459 optional string exception_message = 2;
8460}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008461
8462/**
8463 * Logs when the SDK Extensions test app has polled the current version.
8464 * This is atom ID 354.
8465 *
8466 * Logged from:
8467 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8468 */
8469message SdkExtensionStatus {
8470 enum ApiCallStatus {
8471 CALL_NOT_ATTEMPTED = 0;
8472 CALL_SUCCESSFUL = 1;
8473 CALL_FAILED = 2;
8474 }
8475
8476 optional ApiCallStatus result = 1;
8477
8478 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8479 optional int32 r_extension_version = 2;
8480
8481 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8482 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8483 optional int32 failed_call_symbol = 3;
8484}
Marco Ballesio497aff42020-01-24 08:39:42 -08008485
8486/**
8487 * Logs when an app is frozen or unfrozen.
8488 *
8489 * Logged from:
8490 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8491 */
8492message AppFreezeChanged {
8493 // The type of event.
8494 enum Action {
8495 UNKNOWN = 0;
8496 FREEZE_APP = 1;
8497 UNFREEZE_APP = 2;
8498 }
8499 optional Action action = 1;
8500
8501 // Pid of the process being frozen.
8502 optional int32 pid = 2;
8503
8504 // Name of the process being frozen.
8505 optional string process_name = 3;
8506
8507 // Time since last unfrozen.
8508 optional int64 time_unfrozen_millis = 4;
8509}