blob: 5d37b30a747b8096adfc3c04dd9e5d8f9b120f59 [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"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000395 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800396 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
397 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800398 DisplayJankReported display_jank_reported = 257;
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000399 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000400 }
David Chenc8a43242017-10-17 16:23:28 -0700401
David Chen6e3e6cb2018-01-03 16:14:06 -0800402 // Pulled events will start at field 10000.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000403 // Next: 10076
David Chenc8a43242017-10-17 16:23:28 -0700404 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800405 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
406 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
407 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
408 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
409 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
410 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800411 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800412 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
413 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
414 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
415 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
416 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
417 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
418 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
419 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
420 SystemUptime system_uptime = 10015 [(module) = "framework"];
421 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
422 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000423 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800424 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
425 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800426 Temperature temperature = 10021 [(module) = "framework"];
427 BinderCalls binder_calls = 10022 [(module) = "framework"];
428 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
429 LooperStats looper_stats = 10024 [(module) = "framework"];
430 DiskStats disk_stats = 10025 [(module) = "framework"];
431 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
432 AppSize app_size = 10027 [(module) = "framework"];
433 CategorySize category_size = 10028 [(module) = "framework"];
434 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800435 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800436 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
437 DiskIo disk_io = 10032 [(module) = "framework"];
438 PowerProfile power_profile = 10033 [(module) = "framework"];
439 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
440 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
441 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700442 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800443 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
444 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
445 10040 [(module) = "framework"];
446 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
447 10041 [(module) = "framework"];
448 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800449 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800450 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800451 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
453 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
454 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
455 RoleHolder role_holder = 10049 [(module) = "framework"];
456 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800457 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
459 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800460 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
461 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800462 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
463 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
464 FaceSettings face_settings = 10058 [(module) = "framework"];
465 CoolingDevice cooling_device = 10059 [(module) = "framework"];
466 AppOps app_ops = 10060 [(module) = "framework"];
467 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700468 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
469 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800470 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800471 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800472 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
473 DangerousPermissionStateSampled dangerous_permission_state_sampled =
474 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400475 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000476 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000477 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200478 PackageNotificationPreferences package_notification_preferences =
479 10071 [(module) = "framework"];
480 PackageNotificationChannelPreferences package_notification_channel_preferences =
481 10072 [(module) = "framework"];
482 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
483 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800484 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000485 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700486 }
yroa1fe77c2018-02-26 14:22:54 -0800487
Bookatz76aafcf2018-09-17 16:17:10 -0700488 // DO NOT USE field numbers above 100,000 in AOSP.
489 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
490 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100491
492 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700493}
494
Yao Chend54f9dd2017-10-17 17:37:48 +0000495/**
Yangster-mac20877162017-12-22 17:19:39 -0800496 * This proto represents a node of an attribution chain.
497 * Note: All attribution chains are represented as a repeated field of type
498 * AttributionNode. It is understood that in such arrays, the order is that
499 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000500 */
Yangster-mac20877162017-12-22 17:19:39 -0800501message AttributionNode {
502 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800503 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800504
Yangster-mac20877162017-12-22 17:19:39 -0800505 // The (optional) string tag for an element in the attribution chain. If the
506 // element has no tag, it is encoded as an empty string.
507 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700508}
509
Yangster-mac48b3d622018-08-18 12:38:11 -0700510message KeyValuePair {
511 optional int32 key = 1;
512 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700513 int32 value_int = 2;
514 int64 value_long = 3;
515 string value_str = 4;
516 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700517 }
518}
519
520message KeyValuePairsAtom {
521 optional int32 uid = 1;
522 repeated KeyValuePair pairs = 2;
523}
524
Yao Chend54f9dd2017-10-17 17:37:48 +0000525/*
526 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800527 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000528 *
529 * RULES:
530 * - The field ids for each atom must start at 1, and count upwards by 1.
531 * Skipping field ids is not allowed.
532 * - These form an API, so renaming, renumbering or removing fields is
533 * not allowed between android releases. (This is not currently enforced,
534 * but there will be a tool to enforce this restriction).
535 * - The types must be built-in protocol buffer types, namely, no sub-messages
536 * are allowed (yet). The bytes type is also not allowed.
537 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800538 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000539 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800540 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000541 * - A field that is a uid should be a string field, tagged with the [xxx]
542 * annotation. The generated code on android will be represented by UIDs,
543 * and those UIDs will be translated in xxx to those strings.
544 *
545 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700546 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000547 * - If there is a UID, it goes first. Think in an object-oriented fashion.
548 * *****************************************************************************
549 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700550
Yao Chend54f9dd2017-10-17 17:37:48 +0000551/**
Tej Singha72344992019-04-17 18:55:08 -0700552 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700553 * Logs when the Thermal service HAL notifies the throttling start/stop events.
554 *
555 * Logged from:
556 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
557 */
558message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700559 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700560 optional android.os.TemperatureTypeEnum sensor_type = 1;
561
Maggie White442b6312019-04-05 16:26:44 -0700562 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700563 enum State {
564 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700565 START = 1; // START indicated that throttling was triggered.
566 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700567 }
Yangster-mace16189a2018-08-26 12:20:16 -0700568 optional State state = 2;
569
570 optional float temperature = 3;
571}
572
573/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000574 * Logs when the screen state changes.
575 *
576 * Logged from:
577 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
578 */
579message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800580 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800581 optional android.view.DisplayStateEnum state = 1
582 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700583}
Yao Chend54f9dd2017-10-17 17:37:48 +0000584
585/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700586 * Logs that the process state of the uid, as determined by ActivityManager
587 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000588 *
589 * Logged from:
590 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
591 */
Bookatzc1a050a2017-10-10 15:49:28 -0700592message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800593 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000594
Bookatzdb026a22018-01-10 19:01:56 -0800595 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800596 optional android.app.ProcessStateEnum state = 2
597 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000598}
599
600/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700601 * Logs process state change of a process, as per the activity manager.
602 *
603 * Logged from:
604 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
605 */
606message ProcessStateChanged {
607 optional int32 uid = 1;
608 optional string process_name = 2;
609 optional string package_name = 3;
610 // TODO: remove this when validation is done
611 optional int64 version = 5;
612 // The state, from frameworks/base/core/proto/android/app/enums.proto.
613 optional android.app.ProcessStateEnum state = 4;
614}
615
616/**
617 * Logs when ActivityManagerService sleep state is changed.
618 *
619 * Logged from:
620 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
621 */
622message ActivityManagerSleepStateChanged {
623 // TODO: import frameworks proto
624 enum State {
625 UNKNOWN = 0;
626 ASLEEP = 1;
627 AWAKE = 2;
628 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800629 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700630}
631
632/**
633 * Logs when system memory state changes.
634 *
635 * Logged from:
636 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
637 */
638message MemoryFactorStateChanged {
639 // TODO: import frameworks proto
640 enum State {
641 MEMORY_UNKNOWN = 0;
642 NORMAL = 1; // normal.
643 MODERATE = 2; // moderate memory pressure.
644 LOW = 3; // low memory.
645 CRITICAL = 4; // critical memory.
646
647 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800648 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700649}
650
651/**
652 * Logs when app is using too much cpu, according to ActivityManagerService.
653 *
654 * Logged from:
655 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
656 */
657message ExcessiveCpuUsageReported {
658 optional int32 uid = 1;
659 optional string process_name = 2;
660 optional string package_name = 3;
661 // package version. TODO: remove this when validation is done
662 optional int64 version = 4;
663}
664
665/**
666 * Logs when a cached process is killed, along with its pss.
667 *
668 * Logged from:
669 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
670 */
671message CachedKillReported {
672 optional int32 uid = 1;
673 optional string process_name = 2;
674 optional string package_name = 3;
675 // TODO: remove this when validation is done
676 optional int64 version = 5;
677 optional int64 pss = 4;
678}
679
680/**
xshu2c3d9e42019-09-26 17:54:02 -0700681 * Logs the change in wifi health.
682 *
683 * Logged from:
684 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
685 */
686message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800687 enum Band {
688 UNKNOWN = 0;
689 // All of 2.4GHz band
690 BAND_2G = 1;
691 // Frequencies in the range of [5150, 5250) GHz
692 BAND_5G_LOW = 2;
693 // Frequencies in the range of [5250, 5725) GHz
694 BAND_5G_MIDDLE = 3;
695 // Frequencies in the range of [5725, 5850) GHz
696 BAND_5G_HIGH = 4;
697 // Frequencies in the range of [5925, 6425) GHz
698 BAND_6G_LOW = 5;
699 // Frequencies in the range of [6425, 6875) GHz
700 BAND_6G_MIDDLE = 6;
701 // Frequencies in the range of [6875, 7125) GHz
702 BAND_6G_HIGH = 7;
703 }
xshu2c3d9e42019-09-26 17:54:02 -0700704 // duration this stat is obtained over in milliseconds
705 optional int32 duration_millis = 1;
706 // whether wifi is classified as sufficient for the user's data traffic, determined
707 // by whether the calculated throughput exceeds the average demand within |duration_millis|
708 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700709 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800710 optional bool is_cell_data_available = 3;
711 // the Band bucket the connected network is on
712 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700713}
714
715/**
716 * Logged when wifi detects a significant change in connection failure rate.
717 *
718 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
719 *
720 */
721message WifiFailureStatReported {
722 enum AbnormalityType {
723 UNKNOWN = 0;
724 SIGNIFICANT_INCREASE = 1;
725 SIGNIFICANT_DECREASE = 2;
726 SIMPLY_HIGH = 3;
727 }
728 enum FailureType {
729 FAILURE_UNKNOWN = 0;
730 FAILURE_CONNECTION = 1;
731 FAILURE_ASSOCIATION_REJECTION = 2;
732 FAILURE_ASSOCIATION_TIMEOUT = 3;
733 FAILURE_AUTHENTICATION = 4;
734 FAILURE_NON_LOCAL_DISCONNECTION = 5;
735 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
736 }
737 // Reason for uploading this stat
738 optional AbnormalityType abnormality_type = 1;
739 // The particular type of failure
740 optional FailureType failure_type = 2;
741 // How many times we have encountered this combination of AbnormalityType and FailureType
742 optional int32 failure_count = 3;
743}
744
745/**
746 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
747 *
748 * Logged from:
749 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
750 */
751message WifiConnectionResultReported {
752 enum FailureCode {
753 FAILURE_UNKNOWN = 0;
754 FAILURE_ASSOCIATION_TIMEOUT = 1;
755 FAILURE_ASSOCIATION_REJECTION = 2;
756 FAILURE_AUTHENTICATION_GENERAL = 3;
757 FAILURE_AUTHENTICATION_EAP = 4;
758 FAILURE_DHCP = 5;
759 FAILURE_NETWORK_DISCONNECTION = 6;
760 FAILURE_ROAM_TIMEOUT = 7;
761 }
762 // true represents a successful connection
763 optional bool connection_result = 1;
764 // reason for the connection failure
765 optional FailureCode failure_code = 2;
766 // scan rssi before the connection attempt
767 optional int32 rssi = 3;
768}
769
770/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700771 * Logs when memory stats of a process is reported.
772 *
773 * Logged from:
774 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
775 */
776message ProcessMemoryStatReported {
777 optional int32 uid = 1;
778 optional string process_name = 2;
779 optional string package_name = 3;
780 //TODO: remove this when validation is done
781 optional int64 version = 9;
782 optional int64 pss = 4;
783 optional int64 uss = 5;
784 optional int64 rss = 6;
785 enum Type {
786 ADD_PSS_INTERNAL_SINGLE = 0;
787 ADD_PSS_INTERNAL_ALL_MEM = 1;
788 ADD_PSS_INTERNAL_ALL_POLL = 2;
789 ADD_PSS_EXTERNAL = 3;
790 ADD_PSS_EXTERNAL_SLOW = 4;
791 }
792 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800793 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700794}
795
796/**
Bookatzc1a050a2017-10-10 15:49:28 -0700797 * Logs that a process started, finished, crashed, or ANRed.
798 *
799 * Logged from:
800 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
801 */
802message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700803 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700804
David Chen0b5c90c2018-01-25 16:51:49 -0800805 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800806 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700807
Bookatzddccf0a2017-11-28 16:48:14 -0800808 // What lifecycle state the process changed to.
809 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800810 enum State {
811 FINISHED = 0;
812 STARTED = 1;
813 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800814 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800815 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700816}
817
Bookatzc1a050a2017-10-10 15:49:28 -0700818/**
819 * Logs when the ble scan state changes.
820 *
821 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700822 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700823 */
824message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800825 repeated AttributionNode attribution_node = 1
826 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700827
828 enum State {
829 OFF = 0;
830 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700831 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
832 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700833 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800834 optional State state = 2 [
835 (state_field_option).option = EXCLUSIVE_STATE,
836 (state_field_option).default_state_value = 0 /* State.OFF */,
837 (state_field_option).reset_state_value = 2 /* State.RESET */,
838 (state_field_option).nested = true
839 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700840
Bookatze5ec0b42018-03-26 13:34:56 -0700841 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800842 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700843 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800844 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700845 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800846 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700847}
848
849/**
850 * Logs reporting of a ble scan finding results.
851 *
852 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700853 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700854 */
Bookatzae6738e2018-09-13 11:38:56 -0700855// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700856message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800857 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700858
859 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800860 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861}
862
863/**
864 * Logs when a sensor state changes.
865 *
866 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700867 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700868 */
869message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800870 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700871
Bookatzc1a050a2017-10-10 15:49:28 -0700872 // The id (int) of the sensor.
873 optional int32 sensor_id = 2;
874
875 enum State {
876 OFF = 0;
877 ON = 1;
878 }
879 optional State state = 3;
880}
881
Bookatzc1a050a2017-10-10 15:49:28 -0700882/**
883 * Logs when GPS state changes.
884 *
885 * Logged from:
886 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
887 */
888message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800889 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700890
891 enum State {
892 OFF = 0;
893 ON = 1;
894 }
895 optional State state = 2;
896}
897
Bookatz48d362e2018-11-06 15:49:08 -0800898/**
899 * Logs when GPS signal quality.
900 *
901 * Logged from:
902 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
903 */
904message GpsSignalQualityChanged {
905 optional android.server.location.GpsSignalQualityEnum level = 1;
906}
907
Bookatzc1a050a2017-10-10 15:49:28 -0700908
909/**
910 * Logs when a sync manager sync state changes.
911 *
912 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700913 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700914 */
915message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800916 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700917
David Chen0b5c90c2018-01-25 16:51:49 -0800918 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800919 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700920
921 enum State {
922 OFF = 0;
923 ON = 1;
924 }
925 optional State state = 3;
926}
927
Yangster-mac96353002018-09-05 11:18:55 -0700928/*
929 * Deferred job stats.
930 *
931 * Logged from:
932 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
933*/
934message DeferredJobStatsReported {
935 repeated AttributionNode attribution_node = 1;
936
937 // Number of jobs deferred.
938 optional int32 num_jobs_deferred = 2;
939
940 // Time since the last job runs.
941 optional int64 time_since_last_job_millis = 3;
942}
943
Bookatzc1a050a2017-10-10 15:49:28 -0700944/**
945 * Logs when a job scheduler job state changes.
946 *
947 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700948 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700949 */
950message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800951 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700952
953 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800954 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700955
956 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800957 FINISHED = 0;
958 STARTED = 1;
959 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700960 }
961 optional State state = 3;
962
Tej Singh33a412b2018-03-16 18:43:59 -0700963 // The reason a job has stopped.
964 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700965 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700966 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100967
968 // The standby bucket of the app that scheduled the job. These match the framework constants
969 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
970 // already assigned 0.
971 enum Bucket {
972 UNKNOWN = -1;
973 ACTIVE = 0;
974 WORKING_SET = 1;
975 FREQUENT = 2;
976 RARE = 3;
977 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800978 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100979 }
980 optional Bucket standby_bucket = 5 [default = UNKNOWN];
981
982 // The job id (as assigned by the app).
983 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700984}
985
986/**
987 * Logs when the audio state changes.
988 *
989 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700990 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700991 */
992message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800993 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700994
995 enum State {
996 OFF = 0;
997 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700998 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
999 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001000 }
1001 optional State state = 2;
1002}
1003
1004/**
1005 * Logs when the video codec state changes.
1006 *
1007 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001008 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001009 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001010message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001012
1013 enum State {
1014 OFF = 0;
1015 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001016 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1017 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001018 }
1019 optional State state = 2;
1020}
1021
1022/**
1023 * Logs when the flashlight state changes.
1024 *
1025 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001026 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001027 */
1028message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001029 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001030
1031 enum State {
1032 OFF = 0;
1033 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001034 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1035 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001036 }
1037 optional State state = 2;
1038}
1039
1040/**
1041 * Logs when the camera state changes.
1042 *
1043 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001044 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001045 */
1046message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001048
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001052 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1053 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001054 }
1055 optional State state = 2;
1056}
1057
1058/**
1059 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001060 *
1061 * Logged from:
1062 * TODO
1063 */
Bookatzd6746242017-10-24 18:39:35 -07001064message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001065 repeated AttributionNode attribution_node = 1
1066 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001067
Bookatz1a1b0462018-01-12 11:47:03 -08001068 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1069 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001070 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001071 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001072
1073 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001074 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001075
1076 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001077 RELEASE = 0;
1078 ACQUIRE = 1;
1079 CHANGE_RELEASE = 2;
1080 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001081 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001082 optional State state = 4 [
1083 (state_field_option).option = EXCLUSIVE_STATE,
1084 (state_field_option).default_state_value = 0,
1085 (state_field_option).nested = true
1086 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001087}
1088
1089/**
Bookatzc1a050a2017-10-10 15:49:28 -07001090 * Logs when a partial wakelock is considered 'long' (over 1 min).
1091 *
1092 * Logged from:
1093 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1094 */
1095message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001096 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001097
Yao Chend54f9dd2017-10-17 17:37:48 +00001098 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1099 optional string tag = 2;
1100
Bookatzc1a050a2017-10-10 15:49:28 -07001101 // TODO: I have no idea what this is.
1102 optional string history_tag = 3;
1103
1104 enum State {
1105 OFF = 0;
1106 ON = 1;
1107 }
1108 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001109}
1110
Bookatzc1a050a2017-10-10 15:49:28 -07001111/**
Bookatza66083f2018-09-20 17:24:00 -07001112 * Logs when the device is interactive, according to the PowerManager Notifier.
1113 *
1114 * Logged from:
1115 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1116 */
1117message InteractiveStateChanged {
1118 enum State {
1119 OFF = 0;
1120 ON = 1;
1121 }
1122 optional State state = 1;
1123}
1124
1125/**
Bookatzc1a050a2017-10-10 15:49:28 -07001126 * Logs Battery Saver state change.
1127 *
1128 * Logged from:
1129 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1130 */
1131message BatterySaverModeStateChanged {
1132 enum State {
1133 OFF = 0;
1134 ON = 1;
1135 }
1136 optional State state = 1;
1137}
1138
1139/**
1140 * Logs Doze mode state change.
1141 *
1142 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001143 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001144 */
1145message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001146 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001147}
1148
1149
1150/**
1151 * Logs state change of Doze mode including maintenance windows.
1152 *
1153 * Logged from:
1154 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1155 */
1156message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001157 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001158}
1159
1160/**
1161 * Logs screen brightness level.
1162 *
1163 * Logged from:
1164 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1165 */
1166message ScreenBrightnessChanged {
1167 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1168 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001169}
1170
1171/**
1172 * Logs battery level (percent full, from 0 to 100).
1173 *
1174 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001175 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001176 */
1177message BatteryLevelChanged {
1178 // Battery level. Should be in [0, 100].
1179 optional int32 battery_level = 1;
1180}
1181
1182/**
1183 * Logs change in charging status of the device.
1184 *
1185 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001186 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001187 */
1188message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001189 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1190 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001191}
1192
1193/**
1194 * Logs whether the device is plugged in, and what power source it is using.
1195 *
1196 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001197 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001198 */
1199message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001200 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1201 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001202}
1203
Bookatz8c6571b2017-10-24 15:04:41 -07001204/**
1205 * Logs when an app's wakeup alarm fires.
1206 *
1207 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001208 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001209 */
1210message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001211 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001212
1213 // Name of the wakeup alarm.
1214 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001215
1216 // Name of source package (for historical reasons, since BatteryStats tracked it).
1217 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001218
1219 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1220 enum Bucket {
1221 UNKNOWN = 0;
1222 EXEMPTED = 5;
1223 ACTIVE = 10;
1224 WORKING_SET = 20;
1225 FREQUENT = 30;
1226 RARE = 40;
1227 NEVER = 50;
1228 }
1229 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1230 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001231}
1232
1233/**
1234 * Logs when an an app causes the mobile radio to change state.
1235 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1236 *
1237 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001238 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001239 */
1240message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001241 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001242
Bookatz1a1b0462018-01-12 11:47:03 -08001243 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1244 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001245}
1246
1247/**
1248 * Logs when an an app causes the wifi radio to change state.
1249 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1250 *
1251 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001252 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001253 */
1254message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001255 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001256
Bookatz1a1b0462018-01-12 11:47:03 -08001257 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1258 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001259}
1260
1261/**
1262 * Logs kernel wakeup reasons and aborts.
1263 *
1264 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001265 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001266 */
1267message KernelWakeupReported {
1268 // Name of the kernel wakeup reason (or abort).
1269 optional string wakeup_reason_name = 1;
1270
1271 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001272 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001273}
1274
1275/**
Bookatzda1798c2018-12-13 14:16:00 -08001276 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001277 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001278 *
1279 * Logged from:
1280 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1281 */
1282message WifiEnabledStateChanged {
1283 enum State {
1284 OFF = 0;
1285 ON = 1;
1286 }
1287 optional State state = 1;
1288}
1289
1290/**
tsaichristinececebdc2020-02-04 14:05:56 -08001291 * This atom is deprecated starting in R.
1292 *
Bookatzda1798c2018-12-13 14:16:00 -08001293 * 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 -08001294 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1295 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001296 *
1297 * Logged from:
1298 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1299 */
1300message WifiRunningStateChanged {
1301 repeated AttributionNode attribution_node = 1;
1302
1303 enum State {
1304 OFF = 0;
1305 ON = 1;
1306 }
1307 optional State state = 2;
1308}
1309
1310/**
Bookatze5885242017-10-24 20:10:31 -07001311 * Logs wifi locks held by an app.
1312 *
1313 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001314 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001315 */
1316message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001317 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001318
1319 enum State {
1320 OFF = 0;
1321 ON = 1;
1322 }
1323 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001324
1325 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1326 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001327}
1328
1329/**
1330 * Logs wifi signal strength changes.
1331 *
1332 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001333 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001334 */
1335message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001336 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1337 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001338}
1339
1340/**
1341 * Logs wifi scans performed by an app.
1342 *
1343 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001344 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001345 */
1346message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001347 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001348
1349 enum State {
1350 OFF = 0;
1351 ON = 1;
1352 }
1353 optional State state = 2;
1354}
1355
1356/**
Tej Singh4503e102018-01-04 14:35:01 -08001357 * Logs wifi multicast locks held by an app
1358 *
1359 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001360 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001361 */
1362message WifiMulticastLockStateChanged {
1363 repeated AttributionNode attribution_node = 1;
1364
1365 enum State {
1366 OFF = 0;
1367 ON = 1;
1368 }
1369 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001370
1371 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001372}
1373
1374/**
Tej Singh1ea42892018-01-19 09:27:00 -08001375 * Logs shutdown reason and duration on next boot.
1376 *
1377 * Logged from:
1378 * frameworks/base/core/java/com/android/server/BootReceiver.java
1379 */
1380message ShutdownSequenceReported {
1381 // True if shutdown is for a reboot. Default: false if we do not know.
1382 optional bool reboot = 1;
1383
1384 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1385 optional string reason = 2;
1386
1387 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1388 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001389 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001390
1391 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001392 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001393}
1394
Tej Singh6483ea42018-01-25 17:45:49 -08001395
1396/**
1397 * Logs boot reason and duration.
1398 *
1399 * Logged from:
1400 * system/core/bootstat/bootstat.cpp
1401 */
1402message BootSequenceReported {
1403 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1404 // Default: "<EMPTY>" if not available.
1405 optional string bootloader_reason = 1;
1406
1407 // Reason for system boot. Eg. bootloader, reboot,userrequested
1408 // Default: "<EMPTY>" if not available.
1409 optional string system_reason = 2;
1410
1411 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001412 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001413
1414 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001415 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001416
1417 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001418 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001419
1420 // Time since last boot in ms. Default: 0 if not available.
1421 optional int64 time_since_last_boot = 6;
1422}
1423
Tej Singhc477d9c2018-02-05 18:31:39 -08001424
1425/**
1426 * Logs call state and disconnect cause (if applicable).
1427 *
1428 * Logged from:
1429 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1430 */
1431message CallStateChanged {
1432 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1433 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1434 optional android.telecom.CallStateEnum call_state = 1;
1435
1436 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1437 // This value is only applicable when the call_state is DISCONNECTED, and
1438 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1439 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1440 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1441
1442 // True if the call is self-managed, which are apps that use the
1443 // telecom infrastructure to make their own calls.
1444 optional bool self_managed = 3;
1445
1446 // True if call is external. External calls are calls on connected Wear
1447 // devices but show up in Telecom so the user can pull them onto the device.
1448 optional bool external_call = 4;
1449}
1450
Tej Singh1ea42892018-01-19 09:27:00 -08001451/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001452 * Logs keyguard state. The keyguard is the lock screen.
1453 *
1454 * Logged from:
1455 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1456 */
1457message KeyguardStateChanged {
1458 enum State {
1459 UNKNOWN = 0;
1460 // The keyguard is hidden when the phone is unlocked.
1461 HIDDEN = 1;
1462 // The keyguard is shown when the phone is locked (screen turns off).
1463 SHOWN= 2;
1464 // The keyguard is occluded when something is overlaying the keyguard.
1465 // Eg. Opening the camera while on the lock screen.
1466 OCCLUDED = 3;
1467 }
1468 optional State state = 1;
1469}
1470
1471/**
1472 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1473 * prompts the user to enter a password (pattern, pin, etc).
1474 *
1475 * Logged from:
1476 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1477 */
1478
1479message KeyguardBouncerStateChanged {
1480 enum State {
1481 UNKNOWN = 0;
1482 // Bouncer is hidden, either as a result of successfully entering the
1483 // password, screen timing out, or user going back to lock screen.
1484 HIDDEN = 1;
1485 // This is when the user is being prompted to enter the password.
1486 SHOWN = 2;
1487 }
1488 optional State state = 1;
1489}
1490
1491/**
1492 * Logs the result of entering a password into the keyguard bouncer.
1493 *
1494 * Logged from:
1495 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1496 */
1497message KeyguardBouncerPasswordEntered {
1498 enum BouncerResult {
1499 UNKNOWN = 0;
1500 // The password entered was incorrect.
1501 FAILURE = 1;
1502 // The password entered was correct.
1503 SUCCESS = 2;
1504 }
1505 optional BouncerResult result = 1;
1506}
1507
Tej Singha883b372018-02-15 11:30:01 -08001508/*
1509 * Logs changes to the configuration of the device. The configuration is defined
1510 * in frameworks/base/core/java/android/content/res/Configuration.java
1511 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1512 * Please go there to interpret the possible values each field can be.
1513 *
1514 * Logged from:
1515 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1516 */
1517message ResourceConfigurationChanged {
1518 // Bit mask of color capabilities of the screen.
1519 // Contains information about the color gamut and hdr mode of the screen.
1520 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001521 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001522
1523 // The target screen density being rendered to.
1524 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001525 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001526
1527 // Current user preference for the scaling factor for fonts,
1528 // relative to the base density scaling.
1529 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001530 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001531
1532 // Flag indicating whether the hard keyboard is hidden.
1533 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001534 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001535
1536 // The type of keyboard attached to the device.
1537 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1538 optional int32 keyboard = 5;
1539
1540 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1545 // 0 if undefined.
1546 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1547 optional int32 mcc = 7;
1548
1549 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1550 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1551 // MNC_ZERO symbol defined in Configuration.java.
1552 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1553 optional int32 mnc = 8;
1554
1555 // The kind of navigation available on the device.
1556 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1557 optional int32 navigation = 9;
1558
1559 // Flag indicating whether the navigation is available.
1560 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001561 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001562
1563 // Overall orientation of the screen.
1564 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1565 optional int32 orientation = 11;
1566
1567 // The current height of the available screen space, in dp units.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001569 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001570
1571 // Bit mask of overall layout of the screen.
1572 // Contains information about screen size, whether the screen is wider/taller
1573 // than normal, whether the screen layout is right-tl-left or left-to-right,
1574 // and whether the screen has a rounded shape.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001576 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001577
1578 // Current width of the available screen space, in dp units.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // The smallest screen size an application will see in normal operation.
1583 // This is the smallest value of both screenWidthDp and screenHeightDp
1584 // in portrait and landscape.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001586 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001587
1588 // The type of touch screen attached to the device.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1590 optional int32 touchscreen = 16;
1591
1592 // Bit mask of the ui mode.
1593 // Contains information about the overall ui mode of the device.
1594 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1595 // Also contains information about whether the device is in night mode.
1596 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001597 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001598}
1599
Tej Singheee317b2018-03-07 19:28:05 -08001600
1601/**
1602 * Logs changes in the connection state of the mobile radio.
1603 *
1604 * Logged from:
1605 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1606 */
1607message MobileConnectionStateChanged {
1608 // States are from the state machine DataConnection.java.
1609 enum State {
1610 UNKNOWN = 0;
1611 // The connection is inactive, or disconnected.
1612 INACTIVE = 1;
1613 // The connection is being activated, or connecting.
1614 ACTIVATING = 2;
1615 // The connection is active, or connected.
1616 ACTIVE = 3;
1617 // The connection is disconnecting.
1618 DISCONNECTING = 4;
1619 // The connection is disconnecting after creating a connection.
1620 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1621 }
1622 optional State state = 1;
1623 // For multi-sim phones, this distinguishes between the sim cards.
1624 optional int32 sim_slot_index = 2;
1625 // Used to identify the connection. Starts at 0 and increments by 1 for
1626 // every new network created. Resets whenever the device reboots.
1627 optional int32 data_connection_id = 3;
1628 // A bitmask for the capabilities of this connection.
1629 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1630 // Default value (if we have no information): 0
1631 optional int64 capabilities = 4;
1632 // If this connection has internet.
1633 // This just checks if the DEFAULT bit of capabilities is set.
1634 optional bool has_internet = 5;
1635}
1636
1637/**
1638 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1639 *
1640 * Logged from:
1641 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1642 */
1643message MobileRadioTechnologyChanged {
1644 optional android.telephony.NetworkTypeEnum state = 1;
1645 // For multi-sim phones, this distinguishes between the sim cards.
1646 optional int32 sim_slot_index = 2;
1647}
1648
Andrew Chantb56388b2018-03-22 21:07:33 -07001649/**
1650 * Logs the VID and PID of any connected USB devices.
1651 *
1652 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1653 *
1654 * Logged by Vendor.
1655 */
1656message UsbDeviceAttached {
1657 optional int32 vid = 1;
1658 optional int32 pid = 2;
1659 optional bool has_audio = 3;
1660 optional bool has_hid = 4;
1661 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001662 enum State {
1663 STATE_DISCONNECTED = 0;
1664 STATE_CONNECTED = 1;
1665 }
1666 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001667 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001668}
1669
Tej Singheee317b2018-03-07 19:28:05 -08001670
Tej Singhdd7bd352018-02-09 19:33:15 -08001671/**
Tej Singh5d991e12018-03-09 19:48:11 -08001672 * Logs when Bluetooth is enabled and disabled.
1673 *
1674 * Logged from:
1675 * services/core/java/com/android/server/BluetoothManagerService.java
1676 */
1677message BluetoothEnabledStateChanged {
1678 repeated AttributionNode attribution_node = 1;
1679 // Whether or not bluetooth is enabled on the device.
1680 enum State {
1681 UNKNOWN = 0;
1682 ENABLED = 1;
1683 DISABLED = 2;
1684 }
1685 optional State state = 2;
1686 // The reason for being enabled/disabled.
1687 // Eg. Airplane mode, crash, application request.
1688 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1689 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001690 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001691}
1692
1693/**
Jack Hed9837c82019-01-09 01:19:13 -08001694 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001695 *
1696 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001697 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1698 *
1699 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001700 */
1701message BluetoothConnectionStateChanged {
1702 // The state of the connection.
1703 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1704 optional android.bluetooth.ConnectionStateEnum state = 1;
1705 // An identifier that can be used to match connect and disconnect events.
1706 // Currently is last two bytes of a hash of a device level ID and
1707 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001708 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001709 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001710 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1711 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001712 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001713 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001714 // An identifier that can be used to match events for this device.
1715 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1716 // Salt: Randomly generated 256 bit value
1717 // Hash algorithm: HMAC-SHA256
1718 // Size: 32 byte
1719 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001720 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001721}
1722
1723/**
1724 * Logs when a Bluetooth device connects and disconnects over ACL
1725 *
1726 * Logged from:
1727 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1728 *
1729 * Next Tag: 3
1730 */
1731message BluetoothAclConnectionStateChanged {
1732 // An identifier that can be used to match events for this device.
1733 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1734 // Salt: Randomly generated 256 bit value
1735 // Hash algorithm: HMAC-SHA256
1736 // Size: 32 byte
1737 // Default: null or empty if the device identifier is not known
1738 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1739 // The state of the connection.
1740 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1741 optional android.bluetooth.ConnectionStateEnum state = 2;
1742}
1743
1744/**
1745 * Logs when a Bluetooth device connects and disconnects over SCO
1746 *
1747 * Logged from:
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1749 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1750 *
1751 * Next Tag: 4
1752 */
1753message BluetoothScoConnectionStateChanged {
1754 // An identifier that can be used to match events for this device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if the device identifier is not known
1760 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1761 // The state of the connection.
1762 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1763 optional android.bluetooth.ConnectionStateEnum state = 2;
1764 // Codec used for this SCO connection
1765 // Default: UNKNOWN
1766 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001767}
1768
Jack Hec27040a2019-01-09 20:54:41 -08001769/**
1770 * Logged when active device of a profile changes
1771 *
1772 * Logged from:
1773 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1774 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1775 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1776 */
1777message BluetoothActiveDeviceChanged {
1778 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1779 // From android.bluetooth.BluetoothProfile
1780 optional int32 bt_profile = 1;
1781 // An identifier that can be used to match events for this new active device.
1782 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1783 // Salt: Randomly generated 256 bit value
1784 // Hash algorithm: HMAC-SHA256
1785 // Size: 32 byte
1786 // Default: null or empty if there is no active device for this profile
1787 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1788}
1789
Jack Heab86dbd22018-12-18 15:43:27 -08001790// Logs when there is an event affecting Bluetooth device's link layer connection.
1791// - This event is triggered when there is a related HCI command or event
1792// - Users of this metrics can deduce Bluetooth device's connection state from these events
1793// - HCI commands are logged before the command is sent, after receiving command status, and after
1794// receiving command complete
1795// - HCI events are logged when they arrive
1796//
1797// Low level log from system/bt
1798//
1799// Bluetooth classic commands:
1800// - CMD_CREATE_CONNECTION
1801// - CMD_DISCONNECT
1802// - CMD_CREATE_CONNECTION_CANCEL
1803// - CMD_ACCEPT_CONNECTION_REQUEST
1804// - CMD_REJECT_CONNECTION_REQUEST
1805// - CMD_SETUP_ESCO_CONNECTION
1806// - CMD_ACCEPT_ESCO_CONNECTION
1807// - CMD_REJECT_ESCO_CONNECTION
1808// - CMD_ENH_SETUP_ESCO_CONNECTION
1809// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1810//
1811// Bluetooth low energy commands:
1812// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1813// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1814// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1815// - CMD_BLE_CLEAR_WHITE_LIST
1816// - CMD_BLE_ADD_WHITE_LIST
1817// - CMD_BLE_REMOVE_WHITE_LIST
1818//
1819// Bluetooth classic events:
1820// - EVT_CONNECTION_COMP
1821// - EVT_CONNECTION_REQUEST
1822// - EVT_DISCONNECTION_COMP
1823// - EVT_ESCO_CONNECTION_COMP
1824// - EVT_ESCO_CONNECTION_CHANGED
1825//
1826// Bluetooth low energy meta events:
1827// - BLE_EVT_CONN_COMPLETE_EVT
1828// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1829//
1830// Next tag: 10
1831message BluetoothLinkLayerConnectionEvent {
1832 // An identifier that can be used to match events for this device.
1833 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1834 // Salt: Randomly generated 256 bit value
1835 // Hash algorithm: HMAC-SHA256
1836 // Size: 32 byte
1837 // Default: null or empty if the device identifier is not known
1838 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1839 // Connection handle of this connection if available
1840 // Range: 0x0000 - 0x0EFF (12 bits)
1841 // Default: 0xFFFF if the handle is unknown
1842 optional int32 connection_handle = 2;
1843 // Direction of the link
1844 // Default: DIRECTION_UNKNOWN
1845 optional android.bluetooth.DirectionEnum direction = 3;
1846 // Type of this link
1847 // Default: LINK_TYPE_UNKNOWN
1848 optional android.bluetooth.LinkTypeEnum type = 4;
1849
1850 // Reason metadata for this link layer connection event, rules for interpretation:
1851 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1852 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1853 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1854 // set and valid, ignore hci_ble_event
1855
1856 // HCI command associated with this event
1857 // Default: CMD_UNKNOWN
1858 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1859 // HCI event associated with this event
1860 // Default: EVT_UNKNOWN
1861 optional android.bluetooth.hci.EventEnum hci_event = 6;
1862 // HCI BLE meta event associated with this event
1863 // Default: BLE_EVT_UNKNOWN
1864 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1865 // HCI command status code if this is triggerred by hci_cmd
1866 // Default: STATUS_UNKNOWN
1867 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1868 // HCI reason code associated with this event
1869 // Default: STATUS_UNKNOWN
1870 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1871}
1872
Howard Roe103fe22019-01-17 16:52:16 -08001873/**
1874 * Logs when a module is rolled back by Watchdog.
1875 *
1876 * Logged from: Rollback Manager
1877 */
1878message WatchdogRollbackOccurred {
1879 enum RollbackType {
1880 UNKNOWN = 0;
1881 ROLLBACK_INITIATE = 1;
1882 ROLLBACK_SUCCESS = 2;
1883 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001884 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001885 }
1886 optional RollbackType rollback_type = 1;
1887
1888 optional string package_name = 2;
1889
1890 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001891
1892 enum RollbackReasonType {
1893 REASON_UNKNOWN = 0;
1894 REASON_NATIVE_CRASH = 1;
1895 REASON_EXPLICIT_HEALTH_CHECK = 2;
1896 REASON_APP_CRASH = 3;
1897 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001898 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001899 }
1900 optional RollbackReasonType rollback_reason = 4;
1901
1902 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1903 // is initiated. Empty if the package is unknown.
1904 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001905
1906 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001907}
1908
Jack Hec27040a2019-01-09 20:54:41 -08001909/**
1910 * Logs when there is a change in Bluetooth A2DP playback state
1911 *
1912 * Logged from:
1913 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1914 */
1915message BluetoothA2dpPlaybackStateChanged {
1916 // An identifier that can be used to match events for this device.
1917 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1918 // Salt: Randomly generated 256 bit value
1919 // Hash algorithm: HMAC-SHA256
1920 // Size: 32 byte
1921 // Default: null or empty if the device identifier is not known
1922 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1923 // Current playback state
1924 // Default: PLAYBACK_STATE_UNKNOWN
1925 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1926 // Current audio coding mode
1927 // Default: AUDIO_CODING_MODE_UNKNOWN
1928 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1929}
1930
1931/**
1932 * Logs when there is a change in A2DP codec config for a particular remote device
1933 *
1934 * Logged from:
1935 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1936 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1937 */
1938message BluetoothA2dpCodecConfigChanged {
1939 // An identifier that can be used to match events for this device.
1940 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1941 // Salt: Randomly generated 256 bit value
1942 // Hash algorithm: HMAC-SHA256
1943 // Size: 32 byte
1944 // Default: null or empty if the device identifier is not known
1945 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1946 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1947 // Default SOURCE_CODEC_TYPE_INVALID
1948 optional int32 codec_type = 2;
1949 // Codec priroity, the higher the more preferred, -1 for disabled
1950 // Default: CODEC_PRIORITY_DEFAULT
1951 optional int32 codec_priority = 3;
1952 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1953 // Default: SAMPLE_RATE_NONE
1954 optional int32 sample_rate = 4;
1955 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1956 // Default: BITS_PER_SAMPLE_NONE
1957 optional int32 bits_per_sample = 5;
1958 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1959 // Default: CHANNEL_MODE_NONE
1960 optional int32 channel_mode = 6;
1961 // Codec specific values
1962 // Default 0
1963 optional int64 codec_specific_1 = 7;
1964 optional int64 codec_specific_2 = 8;
1965 optional int64 codec_specific_3 = 9;
1966 optional int64 codec_specific_4 = 10;
1967}
1968
1969/**
1970 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1971 * Each codec's capability is logged separately due to statsd restriction
1972 *
1973 * Logged from:
1974 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1975 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1976 */
1977message BluetoothA2dpCodecCapabilityChanged {
1978 // An identifier that can be used to match events for this device.
1979 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1980 // Salt: Randomly generated 256 bit value
1981 // Hash algorithm: HMAC-SHA256
1982 // Size: 32 byte
1983 // Default: null or empty if the device identifier is not known
1984 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1985 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1986 // Default SOURCE_CODEC_TYPE_INVALID
1987 optional int32 codec_type = 2;
1988 // Codec priroity, the higher the more preferred, -1 for disabled
1989 // Default: CODEC_PRIORITY_DEFAULT
1990 optional int32 codec_priority = 3;
1991 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1992 // in BluetoothCodecConfig
1993 // Default: empty and SAMPLE_RATE_NONE for individual item
1994 optional int32 sample_rate = 4;
1995 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1996 // in BluetoothCodecConfig
1997 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1998 optional int32 bits_per_sample = 5;
1999 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2000 // BluetoothCodecConfig
2001 // Default: empty and CHANNEL_MODE_NONE for individual item
2002 optional int32 channel_mode = 6;
2003 // Codec specific values
2004 // Default 0
2005 optional int64 codec_specific_1 = 7;
2006 optional int64 codec_specific_2 = 8;
2007 optional int64 codec_specific_3 = 9;
2008 optional int64 codec_specific_4 = 10;
2009}
2010
2011/**
2012 * Logs when A2DP failed to read from PCM source.
2013 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2014 *
2015 * Logged from:
2016 * system/bt
2017 */
2018message BluetoothA2dpAudioUnderrunReported {
2019 // An identifier that can be used to match events for this device.
2020 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2021 // Salt: Randomly generated 256 bit value
2022 // Hash algorithm: HMAC-SHA256
2023 // Size: 32 byte
2024 // Default: null or empty if the device identifier is not known
2025 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2026 // Encoding interval in nanoseconds
2027 // Default: 0
2028 optional int64 encoding_interval_nanos = 2;
2029 // Number of bytes of PCM data that could not be read from the source
2030 // Default: 0
2031 optional int32 num_missing_pcm_bytes = 3;
2032}
2033
2034/**
2035 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2036 * buffer queue is full and we have to drop data
2037 *
2038 * Logged from:
2039 * system/bt
2040 */
2041message BluetoothA2dpAudioOverrunReported {
2042 // An identifier that can be used to match events for this device.
2043 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2044 // Salt: Randomly generated 256 bit value
2045 // Hash algorithm: HMAC-SHA256
2046 // Size: 32 byte
2047 // Default: null or empty if the device identifier is not known
2048 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2049 // Encoding interval in nanoseconds
2050 // Default: 0
2051 optional int64 encoding_interval_nanos = 2;
2052 // Number of buffers dropped in this event
2053 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2054 // Default: 0
2055 optional int32 num_dropped_buffers = 3;
2056 // Number of encoded buffers dropped in this event
2057 // Default 0
2058 optional int32 num_dropped_encoded_frames = 4;
2059 // Number of encoded bytes dropped in this event
2060 // Default: 0
2061 optional int32 num_dropped_encoded_bytes = 5;
2062}
2063
2064/**
2065 * Logs when we receive reports regarding a device's RSSI value
2066 *
2067 * Logged from:
2068 * system/bt
2069 */
2070message BluetoothDeviceRssiReported {
2071 // An identifier that can be used to match events for this device.
2072 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2073 // Salt: Randomly generated 256 bit value
2074 // Hash algorithm: HMAC-SHA256
2075 // Size: 32 byte
2076 // Default: null or empty if the device identifier is not known
2077 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2078 // Connection handle of this connection if available
2079 // Range: 0x0000 - 0x0EFF (12 bits)
2080 // Default: 0xFFFF if the handle is unknown
2081 optional int32 connection_handle = 2;
2082 // HCI command status code if this is triggerred by hci_cmd
2083 // Default: STATUS_UNKNOWN
2084 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2085 // BR/EDR
2086 // Range: -128 ≤ N ≤ 127 (signed integer)
2087 // Units: dB
2088 // LE:
2089 // Range: -127 to 20, 127 (signed integer)
2090 // Units: dBm
2091 // Invalid when an out of range value is reported
2092 optional int32 rssi = 4;
2093}
2094
2095/**
2096 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2097 *
2098 * Logged from:
2099 * system/bt
2100 */
2101message BluetoothDeviceFailedContactCounterReported {
2102 // An identifier that can be used to match events for this device.
2103 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2104 // Salt: Randomly generated 256 bit value
2105 // Hash algorithm: HMAC-SHA256
2106 // Size: 32 byte
2107 // Default: null or empty if the device identifier is not known
2108 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2109 // Connection handle of this connection if available
2110 // Range: 0x0000 - 0x0EFF (12 bits)
2111 // Default: 0xFFFF if the handle is unknown
2112 optional int32 connection_handle = 2;
2113 // HCI command status code if this is triggerred by hci_cmd
2114 // Default: STATUS_UNKNOWN
2115 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2116 // Number of consecutive failed contacts for a connection corresponding to the Handle
2117 // Range: uint16_t, 0-0xFFFF
2118 // Default: 0xFFFFF
2119 optional int32 failed_contact_counter = 4;
2120}
2121
2122/**
2123 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2124 *
2125 * Logged from:
2126 * system/bt
2127 */
2128message BluetoothDeviceTxPowerLevelReported {
2129 // An identifier that can be used to match events for this device.
2130 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2131 // Salt: Randomly generated 256 bit value
2132 // Hash algorithm: HMAC-SHA256
2133 // Size: 32 byte
2134 // Default: null or empty if the device identifier is not known
2135 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2136 // Connection handle of this connection if available
2137 // Range: 0x0000 - 0x0EFF (12 bits)
2138 // Default: 0xFFFF if the handle is unknown
2139 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002140 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002141 // Default: STATUS_UNKNOWN
2142 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2143 // Range: -30 ≤ N ≤ 20
2144 // Units: dBm
2145 // Invalid when an out of range value is reported
2146 optional int32 transmit_power_level = 4;
2147}
Jack Heab86dbd22018-12-18 15:43:27 -08002148
Tej Singh5d991e12018-03-09 19:48:11 -08002149/**
Jack He1021a612019-01-20 21:22:46 -08002150 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2151 * receiving an HCI command from the host
2152 *
2153 * Logged from: system/bt
2154 */
2155message BluetoothHciTimeoutReported {
2156 // HCI command associated with this event
2157 // Default: CMD_UNKNOWN
2158 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2159}
2160
2161/**
2162 * Logs when we receive Bluetooth Link Quality Report event from the controller
2163 * See Android Bluetooth HCI specification for more details
2164 *
2165 * Note: all count and bytes field are counted since last event
2166 *
2167 * Logged from: system/bt
2168 */
2169message BluetoothQualityReportReported {
2170 // Quality report ID
2171 // Original type: uint8_t
2172 // Default: BQR_ID_UNKNOWN
2173 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2174 // Packet type of the connection
2175 // Original type: uint8_t
2176 // Default: BQR_PACKET_TYPE_UNKNOWN
2177 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2178 // Connection handle of the connection
2179 // Original type: uint16_t
2180 optional int32 connection_handle = 3;
2181 // Performing Role for the connection
2182 // Original type: uint8_t
2183 optional int32 connection_role = 4;
2184 // Current Transmit Power Level for the connection. This value is the same as the controller's
2185 // response to the HCI_Read_Transmit_Power_Level HCI command
2186 // Original type: uint8_t
2187 optional int32 tx_power_level = 5;
2188 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2189 // absolute receiver signal strength value
2190 // Original type: int8_t
2191 optional int32 rssi = 6;
2192 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2193 // channels used by the link currently
2194 // Original type: uint8_t
2195 optional int32 snr = 7;
2196 // Indicates the number of unused channels in AFH_channel_map
2197 // Original type: uint8_t
2198 optional int32 unused_afh_channel_count = 8;
2199 // Indicates the number of the channels which are interfered and quality is bad but are still
2200 // selected for AFH
2201 // Original type: uint8_t
2202 optional int32 afh_select_unideal_channel_count = 9;
2203 // Current Link Supervision Timeout Setting
2204 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2205 // Original type: uint16_t
2206 optional int32 lsto = 10;
2207 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2208 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2209 // 0x01 (Piconet Clock)
2210 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2211 // Original type: uint32_t
2212 optional int64 connection_piconet_clock = 11;
2213 // The count of retransmission
2214 // Original type: uint32_t
2215 optional int64 retransmission_count = 12;
2216 // The count of no RX
2217 // Original type: uint32_t
2218 optional int64 no_rx_count = 13;
2219 // The count of NAK (Negative Acknowledge)
2220 // Original type: uint32_t
2221 optional int64 nak_count = 14;
2222 // Controller timestamp of last TX ACK
2223 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2224 // Original type: uint32_t
2225 optional int64 last_tx_ack_timestamp = 15;
2226 // The count of Flow-off (STOP)
2227 // Original type: uint32_t
2228 optional int64 flow_off_count = 16;
2229 // Controller timestamp of last Flow-on (GO)
2230 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2231 // Original type: uint32_t
2232 optional int64 last_flow_on_timestamp = 17;
2233 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2234 // Original type: uint32_t
2235 optional int64 buffer_overflow_bytes = 18;
2236 // Buffer underflow count (in byte) since last event
2237 // Original type: uint32_t
2238 optional int64 buffer_underflow_bytes = 19;
2239}
2240
2241/**
2242 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2243 *
2244 * Notes:
2245 * - Each event can be partially filled as we might learn different pieces of device
2246 * information at different time
2247 * - Multiple device info events can be combined to give more complete picture
2248 * - When multiple device info events tries to describe the same information, the
2249 * later one wins
2250 *
2251 * Logged from:
2252 * packages/apps/Bluetooth
2253 */
Jack Heaea26982019-04-04 11:19:48 -07002254message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002255 // An identifier that can be used to match events for this device.
2256 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2257 // Salt: Randomly generated 256 bit value
2258 // Hash algorithm: HMAC-SHA256
2259 // Size: 32 byte
2260 // Default: null or empty if the device identifier is not known
2261 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2262 // Where is this device info obtained from
2263 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2264 // Name of the data source
2265 // For EXTERNAL: package name of the data source
2266 // For INTERNAL: null for general case, component name otherwise
2267 optional string source_name = 3;
2268 // Name of the manufacturer of this device
2269 optional string manufacturer = 4;
2270 // Model of this device
2271 optional string model = 5;
2272 // Hardware version of this device
2273 optional string hardware_version = 6;
2274 // Software version of this device
2275 optional string software_version = 7;
2276}
2277
2278/**
2279 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2280 * device, as documented by the Bluetooth Core HCI specification
2281 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2282 * Vol 2, Part E, Page 1118
2283 *
2284 * Logged from:
2285 * system/bt
2286 */
2287message BluetoothRemoteVersionInfoReported {
2288 // Connection handle of the connection
2289 // Original type: uint16_t
2290 optional int32 connection_handle = 1;
2291 // HCI command status code
2292 // Default: STATUS_UNKNOWN
2293 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2294 // 1 byte Version of current LMP in the remote controller
2295 optional int32 lmp_version = 3;
2296 // 2 bytes LMP manufacturer code of the remote controller
2297 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2298 optional int32 lmp_manufacturer_code = 4;
2299 // 4 bytes subversion of the LMP in the remote controller
2300 optional int32 lmp_subversion = 5;
2301}
2302
2303/**
2304 * Logs when certain Bluetooth SDP attributes are discovered
2305 * Constant definitions are from:
2306 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2307 *
2308 * Current logged attributes:
2309 * - BluetoothProfileDescriptorList
2310 * - Supported Features Bitmask
2311 *
2312 * Logged from:
2313 * system/bt
2314 */
2315message BluetoothSdpAttributeReported {
2316 // An identifier that can be used to match events for this device.
2317 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2318 // Salt: Randomly generated 256 bit value
2319 // Hash algorithm: HMAC-SHA256
2320 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2321 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2322 // Original type: uint16_t
2323 optional int32 protocol_uuid = 2;
2324 // Short form UUIDs used to identify Bluetooth SDP attribute types
2325 // Original type: uint16_t
2326 optional int32 attribute_id = 3;
2327 // Attribute value for the particular attribute
2328 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2329}
2330
2331/**
2332 * Logs when bond state of a Bluetooth device changes
2333 *
2334 * Logged from:
2335 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2336 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2337 */
2338message BluetoothBondStateChanged {
2339 // An identifier that can be used to match events for this device.
2340 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2341 // Salt: Randomly generated 256 bit value
2342 // Hash algorithm: HMAC-SHA256
2343 // Size: 32 byte
2344 // Default: null or empty if the device identifier is not known
2345 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2346 // Preferred transport type to remote dual mode device
2347 // Default: TRANSPORT_AUTO means no preference
2348 optional android.bluetooth.TransportTypeEnum transport = 2;
2349 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2350 // Default: UNKNOWN
2351 optional android.bluetooth.DeviceTypeEnum type = 3;
2352 // Current bond state (NONE, BONDING, BONDED)
2353 // Default: BOND_STATE_UNKNOWN
2354 optional android.bluetooth.BondStateEnum bond_state = 4;
2355 // Bonding sub state
2356 // Default: BOND_SUB_STATE_UNKNOWN
2357 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2358 // Unbond Reason
2359 // Default: UNBOND_REASON_UNKNOWN
2360 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2361}
2362
2363/**
2364 * Logs there is an event related Bluetooth classic pairing
2365 *
2366 * Logged from:
2367 * system/bt
2368 */
2369message BluetoothClassicPairingEventReported {
2370 // An identifier that can be used to match events for this device.
2371 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2372 // Salt: Randomly generated 256 bit value
2373 // Hash algorithm: HMAC-SHA256
2374 // Size: 32 byte
2375 // Default: null or empty if the device identifier is not known
2376 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2377 // Connection handle of this connection if available
2378 // Range: 0x0000 - 0x0EFF (12 bits)
2379 // Default: 0xFFFF if the handle is unknown
2380 optional int32 connection_handle = 2;
2381 // HCI command associated with this event
2382 // Default: CMD_UNKNOWN
2383 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2384 // HCI event associated with this event
2385 // Default: EVT_UNKNOWN
2386 optional android.bluetooth.hci.EventEnum hci_event = 4;
2387 // HCI command status code if this is triggerred by hci_cmd
2388 // Default: STATUS_UNKNOWN
2389 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2390 // HCI reason code associated with this event
2391 // Default: STATUS_UNKNOWN
2392 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002393 // A status value related to this specific event
2394 // Default: 0
2395 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002396}
2397
2398/**
2399 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2400 *
2401 * Logged from:
2402 * system/bt
2403 */
2404message BluetoothSmpPairingEventReported {
2405 // An identifier that can be used to match events for this device.
2406 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2407 // Salt: Randomly generated 256 bit value
2408 // Hash algorithm: HMAC-SHA256
2409 // Size: 32 byte
2410 // Default: null or empty if the device identifier is not known
2411 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2412 // SMP command sent or received over L2CAP
2413 // Default: CMD_UNKNOWN
2414 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2415 // Whether this command is sent or received
2416 // Default: DIRECTION_UNKNOWN
2417 optional android.bluetooth.DirectionEnum direction = 3;
2418 // SMP failure reason code
2419 // Default: PAIRING_FAIL_REASON_DEFAULT
2420 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2421}
2422
2423/**
Jack He815cdba2019-01-30 17:24:55 -08002424 * Logs when a Bluetooth socket’s connection state changed
2425 *
2426 * Logged from:
2427 * system/bt
2428 */
2429message BluetoothSocketConnectionStateChanged {
2430 // An identifier that can be used to match events for this device.
2431 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2432 // Salt: Randomly generated 256 bit value
2433 // Hash algorithm: HMAC-SHA256
2434 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002435 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002436 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002437 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002438 // Default 0 when unknown or don't care
2439 optional int32 port = 2;
2440 // Socket type as mentioned in
2441 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2442 // Default: SOCKET_TYPE_UNKNOWN
2443 optional android.bluetooth.SocketTypeEnum type = 3;
2444 // Socket connection state
2445 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2446 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2447 // Number of bytes sent to remote device during this connection
2448 optional int64 tx_bytes = 5;
2449 // Number of bytes received from remote device during this connection
2450 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002451 // Socket owner's UID
2452 optional int32 uid = 7 [(is_uid) = true];
2453 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2454 // |port| must be spawned by |server_port|
2455 // Default 0 when unknown or don't care
2456 optional int32 server_port = 8;
2457 // Whether this is a server listener socket
2458 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002459}
2460
2461/**
Jack He71426802019-04-02 13:32:52 -07002462 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2463 *
2464 * Logged from:
2465 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2466 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2467 *
2468 */
2469message BluetoothClassOfDeviceReported {
2470 // An identifier that can be used to match events for this device.
2471 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2472 // Salt: Randomly generated 256 bit value
2473 // Hash algorithm: HMAC-SHA256
2474 // Size: 32 byte
2475 // Default: null or empty if this is a server listener socket
2476 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2477 // Class of Device (CoD) value including both Major, Minor device class and service class
2478 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2479 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2480 // Default: 0
2481 optional int32 class_of_device = 2;
2482}
2483
2484/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002485 * Logs when something is plugged into or removed from the USB-C connector.
2486 *
2487 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002488 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002489 */
2490message UsbConnectorStateChanged {
2491 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002492 STATE_DISCONNECTED = 0;
2493 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002494 }
2495 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002496 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002497 // Last active session in ms.
2498 // 0 when the port is in connected state.
2499 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002500}
2501
2502/**
2503 * Logs the reported speaker impedance.
2504 *
2505 * Logged from:
2506 * Vendor audio implementation.
2507 */
2508message SpeakerImpedanceReported {
2509 optional int32 speaker_location = 1;
2510 optional int32 impedance = 2;
2511}
2512
2513/**
2514 * Logs the report of a failed hardware.
2515 *
2516 * Logged from:
2517 * Vendor HALs.
2518 *
2519 */
2520message HardwareFailed {
2521 enum HardwareType {
2522 HARDWARE_FAILED_UNKNOWN = 0;
2523 HARDWARE_FAILED_MICROPHONE = 1;
2524 HARDWARE_FAILED_CODEC = 2;
2525 HARDWARE_FAILED_SPEAKER = 3;
2526 HARDWARE_FAILED_FINGERPRINT = 4;
2527 }
2528 optional HardwareType hardware_type = 1;
2529
Maggie White6dcd8572019-01-31 14:11:50 -08002530 /**
2531 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002532 * the same hardware_type. The specific locations are vendor defined integers,
2533 * referring to board-specific numbering schemes.
2534 */
2535 optional int32 hardware_location = 2;
2536
Maggie White6dcd8572019-01-31 14:11:50 -08002537 /**
2538 * failure_code is specific to the HardwareType of the failed hardware.
2539 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002540 */
Maggie White6dcd8572019-01-31 14:11:50 -08002541 enum HardwareErrorCode {
2542 UNKNOWN = 0;
2543 COMPLETE = 1;
2544 SPEAKER_HIGH_Z = 2;
2545 SPEAKER_SHORT = 3;
2546 FINGERPRINT_SENSOR_BROKEN = 4;
2547 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002548 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002549 }
2550 optional int32 failure_code = 3;
2551}
2552
2553/**
2554 * Log an event when the device has been physically dropped.
2555 * Reported from the /vendor partition.
2556 */
2557message PhysicalDropDetected {
2558 // Confidence that the event was actually a drop, 0 -> 100
2559 optional int32 confidence_pctg = 1;
2560 // Peak acceleration of the drop, in 1/1000s of a g.
2561 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002562 // Duration of freefall in ms
2563 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002564}
2565
2566/**
2567 * Log bucketed battery charge cycles.
2568 *
2569 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002570 * a given charge point. For example, if 10 cycle buckets are
2571 * initialized, bucket 1 is the lowest 1/10th of the battery,
2572 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002573 *
2574 * Logged from:
2575 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2576 */
2577message ChargeCyclesReported {
2578 optional int32 cycle_bucket_1 = 1;
2579 optional int32 cycle_bucket_2 = 2;
2580 optional int32 cycle_bucket_3 = 3;
2581 optional int32 cycle_bucket_4 = 4;
2582 optional int32 cycle_bucket_5 = 5;
2583 optional int32 cycle_bucket_6 = 6;
2584 optional int32 cycle_bucket_7 = 7;
2585 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002586 optional int32 cycle_bucket_9 = 9;
2587 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002588}
2589
2590/**
Howard Roa46b6582018-09-18 16:45:02 -07002591 * Log battery health snapshot.
2592 *
2593 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2594 * are snapshotted periodically over 24hrs.
2595 */
2596message BatteryHealthSnapshot {
2597 enum BatterySnapshotType {
2598 UNKNOWN = 0;
2599 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2600 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2601 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2602 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2603 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2604 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2605 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2606 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2607 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2608 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2609 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2610 }
2611 optional BatterySnapshotType type = 1;
2612 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002613 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002614 // Voltage Battery Voltage, in microVolts.
2615 optional int32 voltage_micro_volt = 3;
2616 // Current Battery current, in microAmps.
2617 optional int32 current_micro_amps = 4;
2618 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2619 optional int32 open_circuit_micro_volt = 5;
2620 // Resistance Battery Resistance, in microOhms.
2621 optional int32 resistance_micro_ohm = 6;
2622 // Level Battery Level, as % of full.
2623 optional int32 level_percent = 7;
2624}
2625
2626/**
2627 * Log slow I/O operations on the primary storage.
2628 */
2629message SlowIo {
2630 // Classifications of IO Operations.
2631 enum IoOperation {
2632 UNKNOWN = 0;
2633 READ = 1;
2634 WRITE = 2;
2635 UNMAP = 3;
2636 SYNC = 4;
2637 }
2638 optional IoOperation operation = 1;
2639
2640 // The number of slow IO operations of this type over 24 hours.
2641 optional int32 count = 2;
2642}
2643
2644/**
2645 * Log battery caused shutdown with the last recorded voltage.
2646 */
2647message BatteryCausedShutdown {
2648 // The last recorded battery voltage prior to shutdown.
2649 optional int32 last_recorded_micro_volt = 1;
2650}
2651
2652/**
Tej Singha72344992019-04-17 18:55:08 -07002653 * Logs when ThermalService receives throttling events.
2654 *
2655 * Logged from:
2656 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2657 */
2658message ThermalThrottlingSeverityStateChanged {
2659 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2660 optional android.os.TemperatureTypeEnum sensor_type = 1;
2661
2662 // The name of the temperature source. Eg. CPU0
2663 optional string sensor_name = 2;
2664
2665 // Temperature in tenths of a degree C.
2666 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2667 optional int32 temperature_deci_celsius = 3;
2668
2669 // Relative severity of the throttling, see enum definition.
2670 optional android.os.ThrottlingSeverityEnum severity = 4;
2671}
2672
2673/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002674 * Logs the duration of a davey (jank of >=700ms) when it occurs
2675 *
2676 * Logged from:
2677 * frameworks/base/libs/hwui/JankTracker.cpp
2678 */
2679message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002680 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002681 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002682
Tej Singhbb8554a2018-01-26 11:59:14 -08002683 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002684 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002685}
2686
2687/**
Bookatze5885242017-10-24 20:10:31 -07002688 * Logs phone signal strength changes.
2689 *
2690 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002691 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002692 */
2693message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002694 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2695 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002696}
2697
Yangster4ccebea2018-10-09 17:09:02 -07002698
2699/**
2700 * Logs when the phone state, sim state or signal strength changes
2701 *
2702 * Logged from:
2703 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2704 */
2705message PhoneServiceStateChanged {
2706 optional android.telephony.ServiceStateEnum state = 1;
2707 optional android.telephony.SimStateEnum sim_state = 2;
2708 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2709}
2710
2711/**
2712 * Logs when the phone becomes on or off.
2713 *
2714 * Logged from:
2715 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2716 */
2717message PhoneStateChanged {
2718 enum State {
2719 OFF = 0;
2720 ON = 1;
2721 }
2722 optional State state = 1;
2723}
2724
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002725message BackGesture {
2726 enum BackType {
2727 DEFAULT_BACK_TYPE = 0;
2728 COMPLETED = 1;
2729 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2730 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2731 INCOMPLETE = 4;
2732 }
2733 optional BackType type = 1;
2734
2735 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2736 enum WindowHorizontalLocation {
2737 DEFAULT_LOCATION = 0;
2738 LEFT = 1;
2739 RIGHT = 2;
2740 }
2741 optional WindowHorizontalLocation x_location = 3;
2742}
2743
2744message ExclusionRectStateChanged {
2745 optional string component_name = 1; // if not available, simply packageName
2746 optional int32 requested_height = 2; // px
2747 optional int32 rejected_height = 3; // px
2748
2749 enum WindowHorizontalLocation {
2750 DEFAULT_LOCATION = 0;
2751 LEFT = 1;
2752 RIGHT = 2;
2753 }
2754 optional WindowHorizontalLocation x_location = 4;
2755 optional bool landscape = 5;
2756 optional bool splitscreen = 6;
2757 optional int32 duration_millis = 7;
2758}
2759
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002760message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002761 optional android.stats.launcher.LauncherAction action = 1;
2762 optional android.stats.launcher.LauncherState src_state = 2;
2763 optional android.stats.launcher.LauncherState dst_state = 3;
2764 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002765 optional bool is_swipe_up_enabled = 5;
2766}
2767
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002768message StyleUIChanged {
2769 optional android.stats.style.Action action = 1;
2770 optional int32 color_package_hash = 2;
2771 optional int32 font_package_hash = 3;
2772 optional int32 shape_package_hash = 4;
2773 optional int32 clock_package_hash = 5;
2774 optional int32 launcher_grid = 6;
2775 optional int32 wallpaper_category_hash = 7;
2776 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002777 optional int32 color_preference = 9;
2778 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002779}
2780
David Chenc28b2bb2017-10-24 12:52:52 -07002781/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002782 * Logs when Settings UI has changed.
2783 *
2784 * Logged from:
2785 * packages/apps/Settings
2786 */
2787message SettingsUIChanged {
2788 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002789 * Where this SettingsUIChange event comes from. For example, if
2790 * it's a PAGE_VISIBLE event, where the page is opened from.
2791 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002792 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002793
2794 /**
2795 * What the UI action is.
2796 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002797 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002798
2799 /**
2800 * Where the action is happening
2801 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002802 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002803
2804 /**
2805 * What preference changed in this event.
2806 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002807 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002808
2809 /**
2810 * The new value of the changed preference.
2811 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002812 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002813}
2814
2815/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002816 * Logs basic timing information about touch events.
2817 * Reported at most every 5 minutes while device is being interacted with.
2818 *
2819 * Logged from:
2820 * frameworks/native/services/inputflinger
2821 */
2822message TouchEventReported {
2823 /**
2824 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002825 * and the standard deviation of the time spent processing touchscreen events
2826 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002827 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002828 * On supported devices, the starting point is taken during the hard interrupt inside the
2829 * kernel touch driver. On all other devices, the starting point is taken inside
2830 * the kernel's input event subsystem upon receipt of the input event.
2831 * The ending point is taken inside InputDispatcher, just after the input event
2832 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002833 */
2834 // Minimum value
2835 optional float latency_min_micros = 1;
2836 // Maximum value
2837 optional float latency_max_micros = 2;
2838 // Average value
2839 optional float latency_mean_micros = 3;
2840 // Standard deviation
2841 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002842 // Number of touch events (input_event) in this report
2843 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002844}
2845
2846/**
Philip Quinn0eded622019-01-29 12:46:28 -08002847 * Logs gesture classification and timing information for touch events.
2848 *
2849 * Logged from:
2850 * frameworks/base/core/java/android/view/GestureDetector.java
2851 * frameworks/base/core/java/android/view/View.java
2852 */
2853message TouchGestureClassified {
2854 // The source of the classification (e.g. Java class name).
2855 optional string source = 1;
2856
2857 enum Classification {
2858 UNKNOWN_CLASSIFICATION = 0;
2859 SINGLE_TAP = 1;
2860 DOUBLE_TAP = 2;
2861 LONG_PRESS = 3;
2862 DEEP_PRESS = 4;
2863 SCROLL = 5;
2864 }
2865 // The classification of the gesture.
2866 optional Classification classification = 2;
2867
2868 // The interval from the start of a touch event stream until the
2869 // classification was made.
2870 optional int32 latency_millis = 3;
2871
2872 // The distance from the location of the first touch event to the
2873 // location of the touch event when the classification was made.
2874 optional float displacement_px = 4;
2875}
2876
2877/**
David Chenc28b2bb2017-10-24 12:52:52 -07002878 * Logs that a setting was updated.
2879 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002880 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002881 * The tag and is_default allow resetting of settings to default values based on the specified
2882 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2883 */
2884message SettingChanged {
2885 // The name of the setting.
2886 optional string setting = 1;
2887
2888 // The change being imposed on this setting. May represent a number, eg "3".
2889 optional string value = 2;
2890
2891 // The new value of this setting. For most settings, this is same as value. For some settings,
2892 // value is +X or -X where X represents an element in a set. For example, if the previous value
2893 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2894 // The +/- feature is currently only used for location_providers_allowed.
2895 optional string new_value = 3;
2896
2897 // The previous value of this setting.
2898 optional string prev_value = 4;
2899
2900 // The tag used with the is_default for resetting sets of settings. This is generally null.
2901 optional string tag = 5;
2902
Bookatz90867622018-01-31 15:05:57 -08002903 // True if this setting with tag should be resettable.
2904 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002905
David Chenbd789912018-03-16 17:19:55 -07002906 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002907 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002908
2909 enum ChangeReason {
2910 UPDATED = 1; // Updated can be an insertion or an update.
2911 DELETED = 2;
2912 }
2913 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002914}
Chenjie Yub3dda412017-10-24 13:41:59 -07002915
Chenjie Yu05013b32017-11-21 10:21:41 -08002916/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002917 * Logs activity going to foreground or background
2918 *
2919 * Logged from:
2920 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2921 */
2922message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002923 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002924 optional string pkg_name = 2;
2925 optional string class_name = 3;
2926
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002927 enum State {
2928 BACKGROUND = 0;
2929 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002930 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002931 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002932}
David Chenc8a43242017-10-17 16:23:28 -07002933
2934/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002935 * Logs when a volume entered low Storage state.
2936 * Logged from:
2937 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2938 */
2939message LowStorageStateChanged {
2940 // Volume that ran out of storage.
2941 optional string volume_description = 1;
2942
2943 enum State {
2944 UNKNOWN = 0;
2945 OFF = 1;
2946 ON = 2;
2947 }
2948 optional State state = 2;
2949}
2950
2951/**
2952 * Logs when an app is downgraded.
2953 * Logged from:
2954 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2955 */
2956message AppDowngraded {
2957 optional string package_name = 1;
2958 // Size of the package (all data) before being downgraded.
2959 optional int64 size_in_bytes_before = 2;
2960 // Size of the package (all data) after being downgraded.
2961 optional int64 size_in_bytes_after = 3;
2962
2963 optional bool aggressive = 4;
2964}
2965
2966/**
2967 * Logs when an app is optimized after being downgraded.
2968 * Logged from:
2969 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2970 */
2971message AppOptimizedAfterDowngraded {
2972 optional string package_name = 1;
2973}
2974
2975/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002976 * Logs whenever an app is installed on external storage.
2977 * Logged from:
2978 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2979 */
2980message AppInstallOnExternalStorageReported {
2981 // The type of external storage.
2982 optional android.stats.storage.ExternalStorageType storage_type = 1;
2983 // The name of the package that is installed on the sd card.
2984 optional string package_name = 2;
2985}
2986
2987/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002988 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002989 * Logged from:
2990 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2991 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002993 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002994
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002995 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002996
2997 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002999 optional string process_name = 3;
3000
3001 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003002 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003003
3004 optional string package_name = 5;
3005
3006 enum InstantApp {
3007 UNAVAILABLE = 0;
3008 FALSE = 1;
3009 TRUE = 2;
3010 }
3011 optional InstantApp is_instant_app = 6;
3012
3013 enum ForegroundState {
3014 UNKNOWN = 0;
3015 BACKGROUND = 1;
3016 FOREGROUND = 2;
3017 }
3018 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003019
3020 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003021}
David Chen9e3808c2017-11-20 17:25:34 -08003022
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003023/**
3024 * Logs when a WTF (What a Terrible Failure) happened.
3025 * Logged from:
3026 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3027 */
3028message WTFOccurred {
3029 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003030
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003032
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003033 // The name of the process.
3034 // system_server if it is not by an app
3035 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003036
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003037 // The pid if available. -1 means not available.
3038 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003039
3040 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003041}
3042
3043/**
3044 * Logs when system server reports low memory.
3045 * Logged from:
3046 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3047 */
3048message LowMemReported {
3049}
3050
3051/**
3052 * Logs when an app ANR (App Not Responding) occurs.
3053 * Logged from:
3054 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3055 */
3056message ANROccurred {
3057 optional int32 uid = 1 [(is_uid) = true];
3058
3059 optional string process_name = 2;
3060
3061 optional string short_component_name = 3;
3062
3063 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003064
3065 enum InstantApp {
3066 UNAVAILABLE = 0;
3067 FALSE = 1;
3068 TRUE = 2;
3069 }
3070 optional InstantApp is_instant_app = 5;
3071
3072 enum ForegroundState {
3073 UNKNOWN = 0;
3074 BACKGROUND = 1;
3075 FOREGROUND = 2;
3076 }
3077 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003078
3079 optional android.server.ErrorSource error_source = 7;
3080
3081 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003082}
3083
Bookatza7020bd2018-08-28 16:29:35 -07003084/**
3085 * Logs when the vibrator state changes.
3086 * Logged from:
3087 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3088 */
3089message VibratorStateChanged {
3090 repeated AttributionNode attribution_node = 1;
3091
3092 enum State {
3093 OFF = 0;
3094 ON = 1;
3095 }
3096 optional State state = 2;
3097
3098 // Duration (in milliseconds) requested to keep the vibrator on.
3099 // Only applicable for State == ON.
3100 optional int64 duration_millis = 3;
3101}
3102
David Chen0a368b22017-12-06 16:28:16 -08003103/*
3104 * Allows other apps to push events into statsd.
3105 * Logged from:
3106 * frameworks/base/core/java/android/util/StatsLog.java
3107 */
David Chen0b5c90c2018-01-25 16:51:49 -08003108message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003109 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003110 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003111
3112 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3113 optional int32 label = 2;
3114
3115 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3116 // predicates for the metrics).
3117 enum State {
3118 UNKNOWN = 0;
3119 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3120 STOP = 2;
3121 START = 3;
3122 }
3123 optional State state = 3;
3124}
3125
David Chen9e3808c2017-11-20 17:25:34 -08003126/**
Bookatz7948c872018-09-04 12:58:33 -07003127 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3128 * For example, this could be due to the user manually changing the time.
3129 *
3130 * Logged from:
3131 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3132 */
3133message WallClockTimeShifted {
3134 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3135 optional int64 wall_clock_timestamp_millis = 1;
3136}
3137
3138/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003139 * Logs when statsd detects an anomaly.
3140 *
3141 * Logged from:
3142 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3143 */
3144message AnomalyDetected {
3145 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003146 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003147
Yangster-mac94e197c2018-01-02 16:03:03 -08003148 // Id of the config whose anomaly detection alert fired.
3149 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003150
Yangster-mac94e197c2018-01-02 16:03:03 -08003151 // Id of the alert (i.e. name of the anomaly that was detected).
3152 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003153}
3154
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003155message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003156 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003157 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003158
3159 // The app package name.
3160 optional string pkg_name = 2;
3161
3162 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003163 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003164 WARM = 1;
3165 HOT = 2;
3166 COLD = 3;
3167 }
3168 // The transition type.
3169 optional TransitionType type = 3;
3170
3171 // The activity name.
3172 optional string activity_name = 4;
3173
3174 // The name of the calling app. Empty if not set.
3175 optional string calling_pkg_name = 5;
3176
3177 // Whether the app is an instant app.
3178 optional bool is_instant_app = 6;
3179
3180 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003181 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003182
Bookatz80d11a02018-01-16 10:46:35 -08003183 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003184
David Chen0b5c90c2018-01-25 16:51:49 -08003185 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003186 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003187 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003188 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003189 optional int32 bind_application_delay_millis = 11;
3190 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003191
3192 // Empty if not set.
3193 optional string launch_token = 13;
3194
Calin Juravle759fbda2018-02-20 19:52:30 +00003195 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003196 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003197
3198 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003199 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003200}
3201
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003202message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003203 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003204 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205
3206 // The app package name.
3207 optional string pkg_name = 2;
3208
3209 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003210 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003211 WARM = 1;
3212 HOT = 2;
3213 COLD = 3;
3214 }
3215 // The transition type.
3216 optional TransitionType type = 3;
3217
3218 // The activity name.
3219 optional string activity_name = 4;
3220}
3221
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003222message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003223 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003224 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003225
3226 // The app package name.
3227 optional string pkg_name = 2;
3228
3229 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003230 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003231 WITH_BUNDLE = 1;
3232 WITHOUT_BUNDLE = 2;
3233 }
3234 // The transition type.
3235 optional TransitionType type = 3;
3236
3237 // The activity name.
3238 optional string activity_name = 4;
3239
3240 optional bool transition_process_running = 5;
3241
3242 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003243 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003244}
3245
Bookatz8fcd09a2017-12-18 13:01:10 -08003246/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003247 * Logs a picture-in-picture action
3248 * Logged from:
3249 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3250 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3251 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3252 */
3253message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003254 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003255 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003256
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003257 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003258
Chenjie Yu52cacc62017-12-08 18:11:45 -08003259 enum State {
3260 ENTERED = 1;
3261 EXPANDED_TO_FULL_SCREEN = 2;
3262 MINIMIZED = 3;
3263 DISMISSED = 4;
3264 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003265 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003266}
3267
3268/**
Chenjie Yue8904192017-12-08 19:12:57 -08003269 * Logs overlay action
3270 * Logged from:
3271 * services/core/java/com/android/server/wm/Session.java
3272 */
3273message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003274 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003275
tsaichristine5adc7e02020-01-14 17:07:39 -08003276 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003277
3278 optional bool using_alert_window = 3;
3279
3280 enum State {
3281 ENTERED = 1;
3282 EXITED = 2;
3283 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003284 optional State state = 4 [
3285 (state_field_option).option = EXCLUSIVE_STATE,
3286 (state_field_option).nested = false,
3287 (state_field_option).default_state_value = 2
3288 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003289}
3290
Adam Bookatz38767932020-02-05 12:13:40 -08003291/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003292 * Logs foreground service starts and stops.
3293 * Note that this is not when a service starts or stops, but when it is
3294 * considered foreground.
3295 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003296 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003297 */
3298message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003299 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003300 // package_name + "/" + class_name
3301 optional string short_name = 2;
3302
3303 enum State {
3304 ENTER = 1;
3305 EXIT = 2;
3306 }
3307 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003308
3309 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3310 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3311 optional bool allow_while_in_use_permission = 4;
3312}
3313
3314/**
3315 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3316 * A foreground service session is any continuous period during which the uid holds at least one
3317 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3318 * Accesses initiated while the uid is in the TOP state are ignored.
3319 * Sessions with no attempted accesses are not logged.
3320 * Logged from
3321 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3322 */
3323message ForegroundServiceAppOpSessionEnded {
3324 optional int32 uid = 1 [(is_uid) = true];
3325
3326 // The operation's name.
3327 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3328 // Only these named ops are actually logged.
3329 enum AppOpName {
3330 OP_NONE = -1; // Also represents UNKNOWN.
3331 OP_COARSE_LOCATION = 0;
3332 OP_FINE_LOCATION = 1;
3333 OP_CAMERA = 26;
3334 OP_RECORD_AUDIO = 27;
3335 }
3336 optional AppOpName app_op_name = 2 [default = OP_NONE];
3337
3338 // The uid's permission mode for accessing the AppOp during this fgs session.
3339 enum Mode {
3340 MODE_UNKNOWN = 0;
3341 MODE_ALLOWED = 1; // Always allowed
3342 MODE_IGNORED = 2; // Denied
3343 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3344 }
3345 optional Mode app_op_mode = 3;
3346
3347 // Number of times this AppOp was requested and allowed.
3348 optional int32 count_ops_accepted = 4;
3349 // Number of times this AppOp was requested but denied.
3350 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003351}
3352
Chenjie Yue8904192017-12-08 19:12:57 -08003353/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003354 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3355 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3356 * attributed back to the parent (host) uid. One example is Chrome.
3357 *
3358 * Logged from:
3359 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3360 */
3361message IsolatedUidChanged {
3362 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003363 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003364 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003365 optional int32 parent_uid = 1;
3366
3367 optional int32 isolated_uid = 2;
3368
3369 // We expect an isolated uid to be removed before if it's used for another parent uid.
3370 enum Event {
3371 REMOVED = 0;
3372 CREATED = 1;
3373 }
3374 optional Event event = 3;
3375}
3376
3377/*
3378 * Logs the reception of an incoming network packet causing the main system to wake up for
3379 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3380 * and processed by WakeupController.cpp.
3381 */
3382message PacketWakeupOccurred {
3383 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3384 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003385 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003386 // The interface name on which the packet was received.
3387 optional string iface = 2;
3388 // The ethertype value of the packet.
3389 optional int32 ethertype = 3;
3390 // String representation of the destination MAC address of the packet.
3391 optional string destination_hardware_address = 4;
3392 // String representation of the source address of the packet if this was an IP packet.
3393 optional string source_ip = 5;
3394 // String representation of the destination address of the packet if this was an IP packet.
3395 optional string destination_ip = 6;
3396 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3397 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3398 // families.
3399 optional int32 ip_next_header = 7;
3400 // The source port if this was a TCP or UDP packet.
3401 optional int32 source_port = 8;
3402 // The destination port if this was a TCP or UDP packet.
3403 optional int32 destination_port = 9;
3404}
3405
3406/*
3407 * Logs the memory stats for an app on startup.
3408 * Logged from:
3409 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3410 */
3411message AppStartMemoryStateCaptured {
3412 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003413 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003414
3415 // The process name.
3416 optional string process_name = 2;
3417
3418 // The activity name.
3419 optional string activity_name = 3;
3420
3421 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003422 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003423
3424 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003425 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003426
3427 // RSS
3428 optional int64 rss_in_bytes = 6;
3429
3430 // CACHE
3431 optional int64 cache_in_bytes = 7;
3432
3433 // SWAP
3434 optional int64 swap_in_bytes = 8;
3435}
3436
3437/*
3438 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3439 * for LMK event.
3440 * Logged from:
3441 * system/core/lmkd/lmkd.c
3442 */
3443message LmkStateChanged {
3444 enum State {
3445 UNKNOWN = 0;
3446 START = 1;
3447 STOP = 2;
3448 }
3449 optional State state = 1;
3450}
3451
3452/*
3453 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3454 * Logged from:
3455 * system/core/lmkd/lmkd.c
3456 */
3457message LmkKillOccurred {
3458 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003459 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003460
3461 // The process name.
3462 optional string process_name = 2;
3463
3464 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003465 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003466
3467 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003468 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003469
3470 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003471 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003472
3473 // RSS
3474 optional int64 rss_in_bytes = 6;
3475
3476 // CACHE
3477 optional int64 cache_in_bytes = 7;
3478
3479 // SWAP
3480 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003481
3482 // The elapsed real time of start of the process.
3483 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003484
3485 // Min oom adj score considered by lmkd.
3486 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003487}
3488
Rajeev Kumar51b54602018-03-01 12:18:26 -08003489/*
3490 * Logs when the ActivityManagerService detects that an app died.
3491 *
3492 * Logged from:
3493 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3494 */
3495message AppDied {
3496 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003497 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003498}
3499
Howard Ro21a039c2018-08-06 14:55:47 -07003500/**
3501 * An atom for generic metrics logging. Available from Android Q.
3502 */
3503message GenericAtom {
3504 // The uid of the application that sent this custom atom.
3505 optional int32 uid = 1 [(is_uid) = true];
3506
3507 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003508 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003509}
3510
Tej Singhd6d6d772018-09-05 17:41:25 -07003511/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003512 * Atom for simple logging of user interaction and impression events, such as "the user touched
3513 * this button" or "this dialog was displayed".
3514 * Keep the UI event stream clean: don't use for system or background events.
3515 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003516 *
3517 * Logged from:
3518 * frameworks/base/services/core/java/com/android/server/
3519 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003520 */
3521message UiEventReported {
3522 // The event_id.
3523 optional int32 event_id = 1;
3524 // The event's source or target uid and package, if applicable.
3525 // For example, the package posting a notification, or the destination package of a share.
3526 optional int32 uid = 2 [(is_uid) = true];
3527 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003528 // An identifier used to disambiguate which logs refer to a particular instance of some
3529 // UI element. Useful when there might be multiple instances simultaneously active.
3530 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003531}
3532
3533/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003534 * Reports a notification was created or updated.
3535 *
3536 * Logged from:
3537 * frameworks/base/services/core/java/com/android/server/notification/
3538 */
3539message NotificationReported {
3540 // The event_id (as for UiEventReported).
3541 optional int32 event_id = 1;
3542 // The notifying app's uid and package.
3543 optional int32 uid = 2 [(is_uid) = true];
3544 optional string package_name = 3;
3545 // A small system-assigned identifier for the notification.
3546 // Locally probably-unique, but expect collisions across users and/or days.
3547 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003548 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3549 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003550
3551 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003552 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3553 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3554 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003555
3556 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003557 optional string category = 10; // App-assigned notification category (API-defined strings)
3558 optional int32 style = 11; // App-assigned notification style
3559 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003560
3561 // Ordering, importance and interruptiveness
3562
Will Brockman7614f6962020-02-10 19:43:03 -05003563 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003564
Will Brockman7614f6962020-02-10 19:43:03 -05003565 optional android.stats.sysui.NotificationImportance importance = 14;
3566 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003567
3568 enum NotificationImportanceExplanation {
3569 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3570 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3571 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3572 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3573 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3574 // Like _APP, but based on pre-channels priority signal.
3575 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3576 }
3577
Will Brockman7614f6962020-02-10 19:43:03 -05003578 optional NotificationImportanceExplanation importance_source = 16;
3579 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3580 optional NotificationImportanceExplanation importance_initial_source = 18;
3581 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3582 optional int32 assistant_hash = 20;
3583 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003584}
3585
3586message Notification {
3587 // The notifying app's uid and package.
3588 optional int32 uid = 1 [(is_uid) = true];
3589 optional string package_name = 2;
3590 // A small system-assigned identifier for the notification.
3591 optional int32 instance_id = 3;
3592
3593 // Grouping information.
3594 optional int32 group_instance_id = 4;
3595 optional bool is_group_summary = 5;
3596
3597 // The section of the shade that the notification is in.
3598 // See NotificationSectionsManager.PriorityBucket.
3599 enum NotificationSection {
3600 SECTION_UNKNOWN = 0;
3601 SECTION_PEOPLE = 1;
3602 SECTION_ALERTING = 2;
3603 SECTION_SILENT = 3;
3604 }
3605 optional NotificationSection section = 6;
3606}
3607
3608message NotificationList {
3609 repeated Notification notifications = 1; // An ordered sequence of notifications.
3610}
3611
3612/**
3613 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3614 *
3615 * Logged from:
3616 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3617 */
3618message NotificationPanelReported {
3619 // The event_id (as for UiEventReported).
3620 optional int32 event_id = 1;
3621 optional int32 num_notifications = 2;
3622 // The notifications in the panel, in the order that they appear there.
3623 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3624}
3625
3626/**
3627 * Reports a notification channel, or channel group, was created, updated, or deleted.
3628 *
3629 * Logged from:
3630 * frameworks/base/services/core/java/com/android/server/notification/
3631 */
3632message NotificationChannelModified {
3633 // The event_id (as for UiEventReported).
3634 optional int32 event_id = 1;
3635 // The notifying app's uid and package.
3636 optional int32 uid = 2 [(is_uid) = true];
3637 optional string package_name = 3;
3638 // App-assigned notification channel ID or channel-group ID
3639 optional string channel_id = 4;
3640 // Previous importance setting, if applicable
3641 optional android.stats.sysui.NotificationImportance old_importance = 5;
3642 // New importance setting
3643 optional android.stats.sysui.NotificationImportance importance = 6;
3644}
3645
3646
3647/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003648 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003649 *
3650 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003651 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003652 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003653message BiometricAcquired {
3654 // Biometric modality that was acquired.
3655 optional android.hardware.biometrics.ModalityEnum modality = 1;
3656 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3657 optional int32 user = 2;
3658 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3659 optional bool is_crypto = 3;
3660 // Action that the device is performing. Acquired messages are only expected for enroll and
3661 // authenticate. Other actions may indicate an error.
3662 optional android.hardware.biometrics.ActionEnum action = 4;
3663 // The client that this acquisition was received for.
3664 optional android.hardware.biometrics.ClientEnum client = 5;
3665 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3666 optional int32 acquire_info = 6;
3667 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3668 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003669 // Dictates if this message should trigger additional debugging.
3670 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003671}
3672
3673/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003674 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003675 *
3676 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003677 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003678 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003679message BiometricAuthenticated {
3680 // Biometric modality that was used.
3681 optional android.hardware.biometrics.ModalityEnum modality = 1;
3682 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3683 optional int32 user = 2;
3684 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3685 // storage.
3686 optional bool is_crypto = 3;
3687 // The client that this acquisition was received for.
3688 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003689 // If authentication requires user confirmation. See BiometricPrompt's
3690 // setRequireConfirmation(bool) method.
3691 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003692
Kevin Chyn1741a072019-01-17 11:54:40 -08003693 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003694 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003695 REJECTED = 1;
3696 PENDING_CONFIRMATION = 2;
3697 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003698 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003699
3700 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003701 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003702 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3703 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3704 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3705 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003706 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003707 // Dictates if this message should trigger additional debugging.
3708 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003709}
3710
3711/**
3712 * Logs when a biometric error occurs.
3713 *
3714 * Logged from:
3715 * frameworks/base/services/core/java/com/android/server/biometrics
3716 */
3717message BiometricErrorOccurred {
3718 // Biometric modality that was used.
3719 optional android.hardware.biometrics.ModalityEnum modality = 1;
3720 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3721 optional int32 user = 2;
3722 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3723 optional bool is_crypto = 3;
3724 // Action that the device is performing.
3725 optional android.hardware.biometrics.ActionEnum action = 4;
3726 // The client that this acquisition was received for.
3727 optional android.hardware.biometrics.ClientEnum client = 5;
3728 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3729 // are unique to modality.
3730 optional int32 error_info = 6;
3731 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3732 // by the vendor and not specified by the HIDL interface.
3733 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003734 // Dictates if this message should trigger additional debugging.
3735 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003736 // Time spent during the authentication attempt.
3737 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003738}
3739
3740/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003741 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003742 * Logged from:
3743 * frameworks/base/services/core/java/com/android/server/biometrics
3744 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003745message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003746 // Biometric modality.
3747 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003748 // Type of issue detected.
3749 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003750 // Dictates if this message should trigger additional debugging.
3751 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003752}
Howard Ro688ae182018-09-25 00:09:36 -07003753
joshmccloskey6f952b22019-03-25 20:59:35 -07003754/**
3755 * Logs when a biometric enrollment occurs.
3756 *
3757 * Logged from:
3758 * frameworks/base/services/core/java/com/android/server/biometrics
3759 */
3760message BiometricEnrolled {
3761 // Biometric modality that was used.
3762 optional android.hardware.biometrics.ModalityEnum modality = 1;
3763 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3764 optional int32 user = 2;
3765 // The amount of time the enrollment took in milliseconds.
3766 optional int64 latency_millis = 3;
3767 // Whether or not the enrollment was successful.
3768 optional bool success = 4;
3769}
3770
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003771/*
Tej Singh0d176952019-01-16 19:10:54 -08003772 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003773 */
Tej Singh0d176952019-01-16 19:10:54 -08003774message FlagFlipUpdateOccurred {
3775 // If the event is from a flag config package, specify the package name.
3776 optional string flag_flip_package_name = 1;
3777
3778 // The order id of the package
3779 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003780}
3781
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003782/**
3783 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003784 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003785 */
3786message TrainExperimentIds {
3787 repeated int64 experiment_id = 1;
3788}
3789
Yangster-macb89807e2018-11-15 21:10:57 -08003790/*
3791 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003792 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003793 */
3794message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003795 // Name of the train.
3796 optional string train_name = 1;
3797 // Version code for a "train" of packages that need to be installed atomically
3798 optional int64 train_version_code = 2;
3799 // After installation of this package, device requires a restart.
3800 optional bool requires_staging = 3;
3801 // Rollback should be enabled for this install.
3802 optional bool rollback_enabled = 4;
3803 // Requires low latency monitoring if possible.
3804 optional bool requires_low_latency_monitor = 5;
3805
Yangster-macb89807e2018-11-15 21:10:57 -08003806 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003807 UNKNOWN = 0;
3808 INSTALL_REQUESTED = 1;
3809 INSTALL_STARTED = 2;
3810 INSTALL_STAGED_NOT_READY = 3;
3811 INSTALL_STAGED_READY = 4;
3812 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003813 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3814 // and INSTALL_FAILURE_COMMIT.
3815 INSTALL_FAILURE = 6 [deprecated = true];
3816 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003817 INSTALL_CANCELLED = 7;
3818 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003819 INSTALLER_ROLLBACK_INITIATED = 9;
3820 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3821 INSTALLER_ROLLBACK_STAGED = 11;
3822 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3823 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3824 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3825 INSTALLER_ROLLBACK_SUCCESS = 15;
3826 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003827 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3828 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3829 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3830 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3831 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3832 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003833 INSTALL_FAILURE_DOWNLOAD = 23;
3834 INSTALL_FAILURE_STATE_MISMATCH = 24;
3835 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003836 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003837 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003838 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003839 // Possible experiment ids for monitoring this push.
3840 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3841 // user id
3842 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003843 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003844 // Whether or not this is a rollback event
3845 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003846}
3847
Tej Singhc9203082019-05-03 13:42:23 -07003848/* Test atom, is not logged anywhere */
3849message TestAtomReported {
3850 repeated AttributionNode attribution_node = 1;
3851 optional int32 int_field = 2;
3852 optional int64 long_field = 3;
3853 optional float float_field = 4;
3854 optional string string_field = 5;
3855 optional bool boolean_field = 6;
3856 enum State {
3857 UNKNOWN = 0;
3858 OFF = 1;
3859 ON = 2;
3860 }
3861 optional State state = 7;
3862 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3863}
3864
Maggie Whitefc1aa592018-11-28 21:55:23 -08003865/** Represents USB port overheat event. */
3866message UsbPortOverheatEvent {
3867 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3868 optional int32 plug_temperature_deci_c = 1;
3869
3870 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3871 optional int32 max_temperature_deci_c = 2;
3872
3873 /* Time between USB plug event and overheat threshold trip, in seconds. */
3874 optional int32 time_to_overheat_secs = 3;
3875
3876 /* Time between overheat threshold trip and hysteresis, in seconds. */
3877 optional int32 time_to_hysteresis_secs = 4;
3878
3879 /* Time between hysteresis and active mitigation ending, in seconds. */
3880 optional int32 time_to_inactive_secs = 5;
3881};
3882
Maggie White8735b852019-01-18 11:40:49 -08003883/**
3884 * Logs total effective full charge and discharge cycles on a battery.
3885 * Here are some examples of one effective cycle:
3886 * 1) the battery charges from 0% to 100% and drains back to 0%,
3887 * 2) charging from 50% to 100% and draining back to 50% twice.
3888 * Pulled from:
3889 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3890 */
3891message BatteryCycleCount {
3892 /* Number of total charge and discharge cycles on the system battery. */
3893 optional int32 cycle_count = 1;
3894}
3895
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003896/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003897 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3898 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003899 * Pulled from:
3900 * StatsCompanionService
3901 */
3902
Carmen Agimof12dec122019-03-06 16:14:38 +00003903message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003904
Carmen Agimof12dec122019-03-06 16:14:38 +00003905 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003906 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003907 PUBLIC = 1;
3908 PRIVATE = 2;
3909 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003910 }
3911
Carmen Agimof12dec122019-03-06 16:14:38 +00003912 // The type of external storage.
3913 optional android.stats.storage.ExternalStorageType storage_type = 1;
3914 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3915 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003916 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003917 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003918}
3919
Yangster-macb89807e2018-11-15 21:10:57 -08003920/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003921 * Logs when a connection becomes available and lost.
3922 * Logged in StatsCompanionService.java
3923 */
3924message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003925 // Id of the network.
3926 optional int32 net_id = 1;
3927
3928 enum State {
3929 UNKNOWN = 0;
3930 CONNECTED = 1;
3931 DISCONNECTED = 2;
3932 }
3933 // Connected state of a network.
3934 optional State state = 2;
3935}
3936
3937/**
3938 * Logs when a service starts and stops.
3939 * Logged from:
3940 * services/core/java/com/android/server/am/ActiveServices.java
3941 */
3942message ServiceStateChanged {
3943
3944 optional int32 uid = 1 [(is_uid) = true];
3945
3946 optional string package_name = 2;
3947
3948 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003949
3950 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003951 START = 1;
3952 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003953 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003954
3955 optional State state = 4;
3956}
3957
3958/**
3959 * Logs when a service is launched.
3960 * Logged from:
3961 * services/core/java/com/android/server/am/ActiveServices.java
3962 */
3963message ServiceLaunchReported {
3964
3965 optional int32 uid = 1 [(is_uid) = true];
3966
3967 optional string package_name = 2;
3968
3969 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003970}
Howard Ro688ae182018-09-25 00:09:36 -07003971
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003972/**
3973 * Logs when a hidden API is used.
3974 *
3975 * Logged from:
3976 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3977 */
3978message HiddenApiUsed {
3979 // The uid of the app making the hidden access.
3980 optional int32 uid = 1 [(is_uid) = true];
3981
3982 // Signature of the method or field accessed.
3983 optional string signature = 2;
3984
3985 enum AccessMethod {
3986 NONE = 0;
3987 REFLECTION = 1;
3988 JNI = 2;
3989 LINKING = 3;
3990 }
3991
3992 // Type of access.
3993 optional AccessMethod access_method = 3;
3994
3995 // Whether the access was prevented or not.
3996 optional bool access_denied = 4;
3997}
3998
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003999/**
4000 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4001 * - When user sees privacy chip
4002 * - When user clicks privacy chip
4003 * - How does the user exit the Privacy Dialog
4004 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004005 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4006 */
4007message PrivacyIndicatorsInteracted {
4008
4009 enum Type {
4010 UNKNOWN = 0;
4011 CHIP_VIEWED = 1;
4012 CHIP_CLICKED = 2;
4013 DIALOG_PRIVACY_SETTINGS = 3;
4014 DIALOG_DISMISS = 4;
4015 DIALOG_LINE_ITEM = 5;
4016 }
4017
tsaichristine5adc7e02020-01-14 17:07:39 -08004018 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004019
4020 // Used if the type is LINE_ITEM
4021 optional string package_name = 2;
4022}
4023
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004024/**
4025 * Logs information about a package that is moved from the internal to external storage and vice
4026 * versa.
4027 * It logs the package name, the type of the external storage where the package is installed
4028 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4029 * and the move type: if it's from internal to external or the other way around.
4030 *
4031 * Logged from:
4032 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4033 */
4034message AppMovedStorageReported {
4035 enum MoveType {
4036 UNKNOWN = 0;
4037 TO_EXTERNAL = 1;
4038 TO_INTERNAL = 2;
4039 }
4040 // The type of the external storage.
4041 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4042 // The type of move.
4043 optional MoveType move_type = 2;
4044 // The name of the package that was moved.
4045 optional string package_name = 3;
4046}
4047
jianjin8f2dee02019-03-29 14:03:08 -07004048/**
4049 * Logs when system server watchdog occurs.
4050 * Logged from:
4051 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4052 */
4053message SystemServerWatchdogOccurred {
4054 optional string subject = 1;
4055}
4056
4057/**
4058 * Logs when new file added to tombstones.
4059 * Logged from:
4060 * frameworks/base/core/java/com/android/server/BootReceiver.java
4061 */
4062message TombStoneOccurred {
4063}
4064
Hai Zhang5d3328d2019-04-13 21:25:06 +08004065/*
4066 * Information about a role request
4067 *
4068 * Logged from:
4069 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4070 */
4071message RoleRequestResultReported {
4072 // UID of application requesting the role
4073 optional int32 requesting_uid = 1;
4074
4075 // Package name of application requesting the role
4076 optional string requesting_package_name = 2;
4077
4078 // The role to be granted
4079 optional string role_name = 3;
4080
4081 // The count of applications qualifying for the role
4082 optional int32 qualifying_count = 4;
4083
4084 // UID of application current granted the role
4085 optional int32 current_uid = 5;
4086
4087 // Package name of application current granted the role
4088 optional string current_package_name = 6;
4089
4090 // UID of another application that user chose to grant the role to, instead of the requesting
4091 // application
4092 optional int32 granted_another_uid = 7;
4093
4094 // Package name of another application that user chose to grant the role to, instead of the
4095 // requesting application
4096 optional string granted_another_package_name = 8;
4097
4098 enum Result {
4099 UNDEFINED = 0;
4100 // role request was ignored
4101 IGNORED = 1;
4102 // role request was ignored because it's already granted
4103 IGNORED_ALREADY_GRANTED = 2;
4104 // role request was ignored because the application isn't qualified
4105 IGNORED_NOT_QUALIFIED = 3;
4106 // role request was ignored because user said it should be always denied
4107 IGNORED_USER_ALWAYS_DENIED = 4;
4108 // role was granted by user action
4109 USER_GRANTED = 5;
4110 // role was denied by user action
4111 USER_DENIED = 6;
4112 // role was denied by user granting another application the role
4113 USER_DENIED_GRANTED_ANOTHER = 7;
4114 // role was denied and set to be always denied by the user
4115 USER_DENIED_WITH_ALWAYS = 8;
4116 }
4117 // The result of the role request
4118 optional Result result = 9;
4119}
4120
Mark Tabrya824a642019-11-05 12:26:12 -08004121/**
4122 * Logs when a Vehicle Maps Service client's connection state has changed
4123 *
4124 * Logged from:
4125 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4126 */
4127message VmsClientConnectionStateChanged {
4128 // The UID of the VMS client app
4129 optional int32 uid = 1 [(is_uid) = true];
4130
4131 enum State {
4132 UNKNOWN = 0;
4133 // Attempting to connect to the client
4134 CONNECTING = 1;
4135 // Client connection established
4136 CONNECTED = 2;
4137 // Client connection closed unexpectedly
4138 DISCONNECTED = 3;
4139 // Client connection closed by VMS
4140 TERMINATED = 4;
4141 // Error establishing the client connection
4142 CONNECTION_ERROR = 5;
4143 }
4144
4145 optional State state = 2;
4146}
4147
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004148/**
4149 * Logs when MediaProvider has successfully finished scanning a storage volume.
4150 *
4151 * Logged from:
4152 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4153 */
4154message MediaProviderScanEvent {
4155 enum Reason {
4156 // Scan triggered due to unknown reason
4157 UNKNOWN = 0;
4158 // Scan triggered due to storage volume being mounted
4159 MOUNTED = 1;
4160 // Scan triggered due to explicit user action or app request
4161 DEMAND = 2;
4162 // Scan triggered due to idle maintenance
4163 IDLE = 3;
4164 }
4165
4166 // Volume type that this event pertains to
4167 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4168 // Reason why this scan was triggered
4169 optional Reason reason = 2;
4170 // Total number of files scanned
4171 optional int64 item_count = 3;
4172 // Duration of scan, normalized per file
4173 optional float normalized_duration_millis = 4;
4174 // Number of database inserts, normalized per file
4175 optional float normalized_insert_count = 5;
4176 // Number of database updates, normalized per file
4177 optional float normalized_update_count = 6;
4178 // Number of database deletes, normalized per file
4179 optional float normalized_delete_count = 7;
4180}
4181
4182/**
4183 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4184 *
4185 * Logged from:
4186 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4187 */
4188message MediaProviderDeletionEvent {
4189 // Volume type that this event pertains to
4190 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4191 // Device timestamp when this deletion event occurred
4192 optional int64 timestamp_millis = 2;
4193 // App that requested deletion
4194 optional string package_name = 3;
4195 // Number of items that were deleted
4196 optional int32 item_count = 4;
4197}
4198
4199/**
4200 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4201 *
4202 * Logged from:
4203 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4204 */
4205message MediaProviderPermissionEvent {
4206 enum Result {
4207 UNKNOWN = 0;
4208 USER_GRANTED = 1;
4209 AUTO_GRANTED = 2;
4210 USER_DENIED = 3;
4211 USER_DENIED_WITH_PREJUDICE = 4;
4212 AUTO_DENIED = 5;
4213 }
4214
4215 // Volume type that this event pertains to
4216 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4217 // Device timestamp when this permission event occurred
4218 optional int64 timestamp_millis = 2;
4219 // App that requested permission
4220 optional string package_name = 3;
4221 // Number of items that were requested
4222 optional int32 item_count = 4;
4223 // Result of this request
4224 optional Result result = 5;
4225}
4226
4227/**
4228 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4229 *
4230 * Logged from:
4231 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4232 */
4233message MediaProviderSchemaChange {
4234 // Volume type that this event pertains to
4235 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4236 // Old database version code
4237 optional int32 version_from = 2;
4238 // New database version code
4239 optional int32 version_to = 3;
4240 // Total number of files in database
4241 optional int64 item_count = 4;
4242 // Duration of schema change, normalized per file
4243 optional float normalized_duration_millis = 5;
4244}
4245
4246/**
4247 * Logs when MediaProvider has finished an idle maintenance job.
4248 *
4249 * Logged from:
4250 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4251 */
4252message MediaProviderIdleMaintenance {
4253 // Volume type that this event pertains to
4254 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4255
4256 // Total number of files in database
4257 optional int64 item_count = 2;
4258 // Duration of idle maintenance, normalized per file
4259 optional float normalized_duration_millis = 3;
4260 // Number of thumbnails found to be stale, normalized per file
4261 optional float normalized_stale_thumbnails = 4;
4262 // Number of items found to be expired, normalized per file
4263 optional float normalized_expired_media = 5;
4264}
4265
Keun young Park3e033cb2019-12-18 11:27:35 -08004266/**
4267 * Represents boot time event with duration in ms.
4268 *
4269 * Logged from: bootstat and various system server components. Check each enums for details.
4270 */
4271message BootTimeEventDuration {
4272 enum DurationEvent {
4273 UNKNOWN = 0;
4274 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4275 ABSOLUTE_BOOT_TIME = 1;
4276 // Bootloader's 1st stage execution time.
4277 // Logged from bootstat.
4278 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4279 // Bootloader's 1st stage loading time.
4280 // Logged from bootstat.
4281 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4282 // Bootloader's kernel loading time.
4283 // Logged from bootstat.
4284 BOOTLOADER_KERNEL_LOAD = 4;
4285 // Bootloader's 2nd stage execution time.
4286 // Logged from bootstat.
4287 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4288 // Bootloader's 2nd stage loading time.
4289 // Logged from bootstat.
4290 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4291 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4292 // for locked device.
4293 // Logged from bootstat.
4294 BOOTLOADER_UI_WAIT = 7;
4295 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4296 // Logged from bootstat.
4297 BOOTLOADER_TOTAL = 8;
4298 // Shutdown duration inside init for the reboot before the current boot up.
4299 // Logged from f/b/services/.../BootReceiver.java.
4300 SHUTDOWN_DURATION = 9;
4301 // Total time for mounting of disk devices during bootup.
4302 // Logged from f/b/services/.../BootReceiver.java.
4303 MOUNT_DEFAULT_DURATION = 10;
4304 // Total time for early stage mounting of disk devices during bootup.
4305 // Logged from f/b/services/.../BootReceiver.java.
4306 MOUNT_EARLY_DURATION = 11;
4307 // Total time for late stage mounting of disk devices during bootup.
4308 // Logged from f/b/services/.../BootReceiver.java.
4309 MOUNT_LATE_DURATION = 12;
4310 // Average time to scan non-system app after OTA
4311 // Logged from f/b/services/.../PackageManagerService.java
4312 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4313 // Time to initialize Package manager after OTA
4314 // Logged from f/b/services/.../PackageManagerService.java
4315 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4316 // Time to scan all system app from Package manager after OTA
4317 // Logged from f/b/services/.../PackageManagerService.java
4318 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4319 // Init's total time for cold boot stage.
4320 // Logged from bootstat.
4321 COLDBOOT_WAIT = 16;
4322 // Init's total time for initializing selinux.
4323 // Logged from bootstat.
4324 SELINUX_INIT = 17;
4325 // Time since last factory reset.
4326 // Logged from bootstat.
4327 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004328 // Init's total time spent for completing the 1st stage.
4329 // Logged from bootstat.
4330 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004331 }
4332
4333 // Type of the event.
4334 optional DurationEvent event = 1;
4335 // Duration of the event in ms.
4336 optional int64 duration_millis = 2;
4337}
4338
4339/**
4340 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4341 * since boot-up.
4342 *
4343 * Logged from: bootstat and various system server components. Check each enums for details.
4344 */
4345message BootTimeEventElapsedTime {
4346 enum ElapsedTimeEvent {
4347 UNKNOWN = 0;
4348 // Time when init starts 1st stage. Logged from bootstat.
4349 ANDROID_INIT_STAGE_1 = 1;
4350 // Time when sys.boot_completed prop is set.
4351 // Logged from bootstat.
4352 BOOT_COMPLETE = 2;
4353 // BOOT_COMPLETE for encrypted device.
4354 BOOT_COMPLETE_ENCRYPTION = 3;
4355 // BOOT_COMPLETE for device with no encryption.
4356 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4357 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004358 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004359 // BOOT_COMPLETE after factory reset.
4360 FACTORY_RESET_BOOT_COMPLETE = 6;
4361 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4362 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004363 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4364 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004365 // BOOT_COMPLETE after OTA.
4366 OTA_BOOT_COMPLETE = 9;
4367 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4368 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004369 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4370 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004371 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4372 // Logged from f/b/services/.../UserController.java
4373 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4374 // Time when the system starts sending BOOT_COMPLETED broadcast.
4375 // Logged from f/b/services/.../UserController.java
4376 FRAMEWORK_BOOT_COMPLETED = 13;
4377 // Time when the package manager starts init.
4378 // Logged from f/b/services/.../SystemServer.java
4379 PACKAGE_MANAGER_INIT_START = 14;
4380 // Time when package manager is ready
4381 // Logged from f/b/services/.../SystemServer.java
4382 PACKAGE_MANAGER_INIT_READY = 15;
4383 // Represents the time when user has entered unlock credential for system with user pin.
4384 // Logged from bootstat.
4385 POST_DECRYPT = 16;
4386 // Represents the start of zygote's init.
4387 // Logged from zygote itself.
4388 ZYGOTE_INIT_START = 17;
4389 // Represents the start of secondary zygote's init.
4390 // TODO: add logging to zygote
4391 SECONDARY_ZYGOTE_INIT_START = 18;
4392 // Represents the start of system server's init.
4393 // Logged from f/b/services/.../SystemServer.java
4394 SYSTEM_SERVER_INIT_START = 19;
4395 // Represents the completion of system server's init.
4396 // Logged from f/b/services/.../SystemServer.java
4397 SYSTEM_SERVER_READY = 20;
4398 // Represents the start of launcher during boot-up.
4399 // TODO: add logging
4400 LAUNCHER_START = 21;
4401 // Represents the completion of launcher's initial rendering. User can use other apps from
4402 // launcher from this point.
4403 // TODO: add logging
4404 LAUNCHER_SHOWN = 22;
4405 }
4406
4407 // Type of the event.
4408 optional ElapsedTimeEvent event = 1;
4409 // Time since bootup for the event.
4410 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4411 optional int64 time_millis = 2;
4412}
4413
4414/**
4415 * Boot time events with UTC time.
4416 *
4417 * Logged from: bootstat and various system server components. Check each enums for details.
4418 */
4419message BootTimeEventUtcTime {
4420 enum UtcTimeEvent {
4421 UNKNOWN = 0;
4422 // Time of the bootstat's marking of 1st boot after the last factory reset.
4423 // Logged from bootstat.
4424 FACTORY_RESET_RESET_TIME = 1;
4425 // The time when bootstat records FACTORY_RESET_* events. This is close to
4426 // BOOT_COMPLETE time for the current bootup.
4427 // Logged from bootstat.
4428 FACTORY_RESET_CURRENT_TIME = 2;
4429 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4430 // Logged from bootstat.
4431 FACTORY_RESET_RECORD_VALUE = 3;
4432 }
4433
4434 // Type of the event.
4435 optional UtcTimeEvent event = 1;
4436 // UTC time for the event.
4437 optional int64 utc_time_secs = 2;
4438}
4439
4440/**
4441 * Boot time events representing specific error code during bootup.
4442 * Meaning of error code can be different per each event type.
4443 *
4444 * Logged from: bootstat and various system server components. Check each enums for details.
4445 */
4446message BootTimeEventErrorCode {
4447 enum ErrorCodeEvent {
4448 UNKNOWN = 0;
4449 // Linux error code for time() call to get the current UTC time.
4450 // Logged from bootstat.
4451 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4452 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4453 // as UMOUNT_STAT_* from init/reboot.cpp.
4454 // Logged from f/b/services/.../BootReceiver.java.
4455 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004456 // Reprepsents fie system mounting error code of /data partition for the current boot.
4457 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004458 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004459 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004460 }
4461
4462 // Type of the event.
4463 optional ErrorCodeEvent event = 1;
4464 // error code defined per each event type.
4465 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4466 // FS_MGR_FS_STAT.
4467 optional int32 error_code = 2;
4468}
4469
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004470/**
4471 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4472 * after an OTA.
4473 *
4474 * Logged from:
4475 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4476 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4477 */
4478message SnapshotMergeReported {
4479 // Keep in sync with
4480 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4481 enum UpdateState {
4482 // No update or merge is in progress.
4483 NONE = 0;
4484 // An update is applying; snapshots may already exist.
4485 INITIATED = 1;
4486 // An update is pending, but has not been successfully booted yet.
4487 UNVERIFIED = 2;
4488 // The kernel is merging in the background.
4489 MERGING = 3;
4490 // Post-merge cleanup steps could not be completed due to a transient
4491 // error, but the next reboot will finish any pending operations.
4492 MERGE_NEEDS_REBOOT = 4;
4493 // Merging is complete, and needs to be acknowledged.
4494 MERGE_COMPLETED = 5;
4495 // Merging failed due to an unrecoverable error.
4496 MERGE_FAILED = 6;
4497 // The update was implicitly cancelled, either by a rollback or a flash
4498 // operation via fastboot. This state can only be returned by WaitForMerge.
4499 CANCELLED = 7;
4500 };
4501
4502 // Status of the update after the merge attempts.
4503 optional UpdateState final_state = 1;
4504
4505 // Time to complete a merge operation in milliseconds.
4506 // A negative value corresponds to the case in which the merge operation
4507 // was interrupted and resumed (e.g. in case of a system reboot during the
4508 // merge).
4509 optional int64 duration_millis = 2;
4510
4511 // Number of reboots that occurred after issuing and before completing the
4512 // merge of all the snapshot devices.
4513 optional int32 intermediate_reboots = 3;
4514}
4515
Chenjie Yubbcbc602018-02-05 16:51:52 -08004516//////////////////////////////////////////////////////////////////////
4517// Pulled atoms below this line //
4518//////////////////////////////////////////////////////////////////////
4519
4520/**
David Chenc8a43242017-10-17 16:23:28 -07004521 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4522 *
4523 * Pulled from:
4524 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4525 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004526message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004527 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004528
4529 optional int64 rx_bytes = 2;
4530
4531 optional int64 rx_packets = 3;
4532
4533 optional int64 tx_bytes = 4;
4534
4535 optional int64 tx_packets = 5;
4536}
4537
4538/**
4539 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4540 *
4541 * Pulled from:
4542 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4543 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004544message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004545 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004546
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004547 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4548 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004549
4550 optional int64 rx_bytes = 3;
4551
4552 optional int64 rx_packets = 4;
4553
4554 optional int64 tx_bytes = 5;
4555
4556 optional int64 tx_packets = 6;
4557}
4558
4559/**
4560 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4561 *
4562 * Pulled from:
4563 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4564 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004565message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004566 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004567
4568 optional int64 rx_bytes = 2;
4569
4570 optional int64 rx_packets = 3;
4571
4572 optional int64 tx_bytes = 4;
4573
4574 optional int64 tx_packets = 5;
4575}
4576
4577/**
4578 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4579 *
4580 * Pulled from:
4581 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4582 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004583message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004584 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004585
Yao Chenc40a19d2018-03-15 16:48:25 -07004586 // 1 denotes foreground and 0 denotes background. This is called Set in
4587 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004588 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004589
4590 optional int64 rx_bytes = 3;
4591
4592 optional int64 rx_packets = 4;
4593
4594 optional int64 tx_bytes = 5;
4595
4596 optional int64 tx_packets = 6;
4597}
4598
4599/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004600 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4601 *
4602 * Pulled from:
4603 * StatsCompanionService
4604 */
4605message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004606 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004607
4608 optional int64 rx_bytes = 2;
4609
4610 optional int64 tx_bytes = 3;
4611}
4612
4613/**
David Chenc8a43242017-10-17 16:23:28 -07004614 * Pulls the kernel wakelock durations. This atom is adapted from
4615 * android/internal/os/KernelWakelockStats.java
4616 *
4617 * Pulled from:
4618 * StatsCompanionService using KernelWakelockReader.
4619 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004620message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004621 optional string name = 1;
4622
4623 optional int32 count = 2;
4624
4625 optional int32 version = 3;
4626
Yangster-maca8a30442018-10-13 23:46:34 -07004627 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004628}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004629
Chenjie Yu05013b32017-11-21 10:21:41 -08004630/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004631 * Pulls low power state information. If power.stats HAL is not available, this
4632 * includes platform and subsystem sleep state information,
4633 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4634 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004635 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004636 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004637 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4638 * as defined in:
4639 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004640 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004641message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004642 // Subsystem name
4643 optional string subsystem_name = 1;
4644 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4645 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004646 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4647 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004648 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004649 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004650 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004651 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004652 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004653}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004654
Chenjie Yu05013b32017-11-21 10:21:41 -08004655/**
Bookatz92da2832018-11-01 18:10:03 -07004656 * Pulls on-device power measurement information.
4657 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4658 * Pulled from:
4659 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4660 */
4661message OnDevicePowerMeasurement {
4662 // Name of the subsystem (to which the rail belongs).
4663 optional string subsystem_name = 1;
4664
4665 // Rail name. The rail lies within the subsystem.
4666 optional string rail_name = 2;
4667
4668 // Time (in ms since boot) at which the rail energy value was measured.
4669 // This may differ slightly from the time that statsd logs this information.
4670 optional uint64 measurement_timestamp_millis = 3;
4671
4672 // Accumulated energy used via the rail since device boot in uWs.
4673 optional uint64 energy_microwatt_secs = 4;
4674}
4675
4676/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004677 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004678 * Pulls the time the cpu spend on the frequency index. Frequency index
4679 * starts from highest to lowest. The value should be monotonically
4680 * increasing since boot. However, if there is a cpu
4681 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004682 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004683message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004684 optional uint32 cluster = 1;
4685 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004686 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004687}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004688
Chenjie Yu05013b32017-11-21 10:21:41 -08004689/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004690 * Pulls Cpu Time Per Uid.
4691 * Note that isolated process uid time should be attributed to host uids.
4692 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004693message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004694 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004695 optional uint64 user_time_micros = 2;
4696 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004697}
4698
4699/**
4700 * Pulls Cpu Time Per Uid per frequency.
4701 * Note that isolated process uid time should be attributed to host uids.
4702 * For each uid, we order the time by descending frequencies.
4703 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004704message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004705 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004706 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004707 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004708}
Hugo Benichi884970e2017-11-14 22:42:46 +09004709
Chenjie Yu05013b32017-11-21 10:21:41 -08004710/**
4711 * Pulls Wifi Controller Activity Energy Info
4712 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004713message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004714 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004715 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004716 // stack reported state
4717 // TODO: replace this with proto enum
4718 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004719 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004720 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004721 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004722 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004723 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004724 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004725 // product of current(mA), voltage(V) and time(ms)
4726 optional uint64 controller_energy_used = 6;
4727}
4728
4729/**
4730 * Pulls Modem Activity Energy Info
4731 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004732message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004733 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004734 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004735 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004736 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004737 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004738 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004739 /**
4740 * Tx power index
4741 * index 0 = tx_power < 0dBm
4742 * index 1 = 0dBm < tx_power < 5dBm
4743 * index 2 = 5dBm < tx_power < 15dBm
4744 * index 3 = 15dBm < tx_power < 20dBm
4745 * index 4 = tx_power > 20dBm
4746 */
4747 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004748 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004749 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004750 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004751 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004752 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004753 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004754 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004755 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004758 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004759 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004760 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004761}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004762
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004763/**
4764 * Pulls Bluetooth Activity Energy Info
4765 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4766 */
4767message BluetoothActivityInfo {
4768 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004769 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004770 // bluetooth stack state
4771 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004772 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004773 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004774 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004776 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004777 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004778 // product of current(mA), voltage(V) and time(ms)
4779 optional uint64 energy_used = 6;
4780}
4781
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004782/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004783 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004784 *
4785 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004786 */
4787message ProcessMemoryState {
4788 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004789 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004790
4791 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004792 // Usually package name, "system" for system server.
4793 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004794 optional string process_name = 2;
4795
Rafal Slawikda51b932018-12-13 16:31:33 +00004796 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004797 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004798
4799 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004800 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004801
4802 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004803 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004804
Rajeev Kumar90235992018-01-29 11:06:48 -08004805 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004806 // Value is read from memory.stat, field total_rss if per-app memory
4807 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004808 optional int64 rss_in_bytes = 6;
4809
4810 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004811 // Value is read from memory.stat, field total_cache if per-app memory
4812 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004813 optional int64 cache_in_bytes = 7;
4814
4815 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004816 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004817 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004818 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004819
Rafal Slawik203c3db2019-09-25 19:53:01 +01004820 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004821 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004822
Rafal Slawik203c3db2019-09-25 19:53:01 +01004823 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4824 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004825
Rafal Slawik203c3db2019-09-25 19:53:01 +01004826 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4827 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004828}
4829
4830/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004831 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004832 *
4833 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4834 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004835 *
4836 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004837 */
4838message ProcessMemoryHighWaterMark {
4839 // The uid if available. -1 means not available.
4840 optional int32 uid = 1 [(is_uid) = true];
4841
Rafal Slawikda51b932018-12-13 16:31:33 +00004842 // The process name.
4843 // Usually package name or process cmdline.
4844 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004845 optional string process_name = 2;
4846
Rafal Slawik239b6802019-09-09 18:46:01 +01004847 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4848 // computed by converting kilobytes to bytes.
4849 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4850
Rafal Slawik3bea8952018-11-15 12:39:33 +00004851 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4852 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004853 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004854}
4855
4856/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004857 * Logs the memory stats for a process.
4858 *
4859 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4860 * and for selected native processes.
4861 */
4862message ProcessMemorySnapshot {
4863 // The uid if available. -1 means not available.
4864 optional int32 uid = 1 [(is_uid) = true];
4865
4866 // The process name.
4867 // Usually package name or process cmdline.
4868 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4869 optional string process_name = 2;
4870
4871 // The pid of the process.
4872 // Allows to disambiguate instances of the process.
4873 optional int32 pid = 3;
4874
4875 // The current OOM score adjustment value.
4876 // Read from ProcessRecord for managed processes.
4877 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4878 optional int32 oom_score_adj = 4;
4879
4880 // The current RSS of the process.
4881 // VmRSS from /proc/pid/status.
4882 optional int32 rss_in_kilobytes = 5;
4883
4884 // The current anon RSS of the process.
4885 // RssAnon from /proc/pid/status.
4886 optional int32 anon_rss_in_kilobytes = 6;
4887
4888 // The current swap size of the process.
4889 // VmSwap from /proc/pid/status.
4890 optional int32 swap_in_kilobytes = 7;
4891
4892 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4893 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4894}
4895
4896/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004897 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004898 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004899message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004900 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004901}
4902
4903/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004904 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004905 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004906message SystemUptime {
4907 // Milliseconds since the system was booted.
4908 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4909 // for external input).
4910 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004911 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004912}
4913
4914/*
4915 * Reads from /proc/uid_concurrent_active_time which has the format:
4916 * active: X (X is # cores)
4917 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4918 * [uid1]: [time-0] [time-1] [time-2] ... ...
4919 * ...
4920 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4921 * The file contains a monotonically increasing count of time for a single boot.
4922 */
4923message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004924 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004925 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004926}
4927
4928/**
4929 * Reads from /proc/uid_concurrent_policy_time which has the format:
4930 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4931 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4932 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4933 * ...
4934 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4935 * The file contains a monotonically increasing count of time for a single boot.
4936 */
4937message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004938 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004939 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004940 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004941}
4942
4943/*
4944 * Pulls free disk space, for data, system partition and temporary directory.
4945 */
4946message DiskSpace {
4947 // available bytes in data partition
4948 optional uint64 data_available_bytes = 1;
4949 // available bytes in system partition
4950 optional uint64 system_available_bytes = 2;
4951 // available bytes in download cache or temp directories
4952 optional uint64 temp_available_bytes = 3;
4953}
Tej Singhbf972d92018-01-10 20:51:13 -08004954
4955/**
4956 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004957 *
4958 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004959 */
4960message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004961 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004962}
4963
4964/**
4965 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004966 * Pulled from:
4967 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004968 */
4969message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004970 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004971}
4972
4973/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004974 * Pulls battery voltage.
4975 * Pulled from:
4976 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4977 */
4978message BatteryVoltage {
4979 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004980 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004981}
4982
4983/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004984 * Pulls battery level (percent full, from 0 to 100).
4985 *
4986 * Pulled from:
4987 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4988 */
4989message BatteryLevel {
4990 // Battery level. Should be in [0, 100].
4991 optional int32 battery_level = 1;
4992}
4993
4994/**
Tej Singhd89137e2018-03-26 14:51:40 -07004995 * Pulls the temperature of various parts of the device.
4996 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004997 *
Maggie White442b6312019-04-05 16:26:44 -07004998 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004999 */
5000message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005001 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005002 optional android.os.TemperatureTypeEnum sensor_location = 1;
5003
5004 // The name of the temperature source. Eg. CPU0
5005 optional string sensor_name = 2;
5006
Tej Singhd89137e2018-03-26 14:51:40 -07005007 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005008 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005009 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005010
5011 // Relative severity of the throttling, see enum definition.
5012 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005013}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005014
5015/**
5016 * Pulls the statistics of calls to Binder.
5017 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005018 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5019 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005020 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005021 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005022 */
5023message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005024 // UID of the process responsible for the binder transaction. It will be set if the process
5025 // executing the binder transaction attribute the transaction to another uid using
5026 // Binder.setThreadWorkSource().
5027 //
5028 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005029 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005030 // UID of the process executing the binder transaction.
5031 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005032 // Fully qualified class name of the API call.
5033 //
5034 // This is a system server class name.
5035 //
5036 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5037 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5038 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5039 // commonly used APIs.
5040 optional string service_class_name = 2;
5041 // Method name of the API call. It can also be a transaction code if we cannot
5042 // resolve it to a name. See Binder#getTransactionName.
5043 //
5044 // This is a system server method name.
5045 optional string service_method_name = 3;
5046 // Total number of API calls.
5047 optional int64 call_count = 4;
5048 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5049 optional bool screen_interactive = 13;
5050 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5051 // call_count will be equal to recorded_call_count.
5052 //
5053 // If recorded_call_count is different than call_count, it means data collection has been
5054 // sampled. All the fields below will be sampled in this case.
5055 optional int64 recorded_call_count = 12;
5056 // Number of exceptions thrown by the API.
5057 optional int64 recorded_exception_count = 5;
5058 // Total latency of all API calls.
5059 // Average can be computed using total_latency_micros / recorded_call_count.
5060 optional int64 recorded_total_latency_micros = 6;
5061 // Maximum latency of one API call.
5062 optional int64 recorded_max_latency_micros = 7;
5063 // Total CPU usage of all API calls.
5064 // Average can be computed using total_cpu_micros / recorded_call_count.
5065 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5066 optional int64 recorded_total_cpu_micros = 8;
5067 // Maximum CPU usage of one API call.
5068 optional int64 recorded_max_cpu_micros = 9;
5069 // Maximum parcel reply size of one API call.
5070 optional int64 recorded_max_reply_size_bytes = 10;
5071 // Maximum parcel request size of one API call.
5072 optional int64 recorded_max_request_size_bytes = 11;
5073}
5074
5075/**
5076 * Pulls the statistics of exceptions during calls to Binder.
5077 *
5078 * Binder stats are cumulative from boot unless somebody reset the data using
5079 * > adb shell dumpsys binder_calls_stats --reset
5080 */
5081message BinderCallsExceptions {
5082 // Exception class name, e.g. java.lang.IllegalArgumentException.
5083 //
5084 // This is an exception class name thrown by the system server.
5085 optional string exception_class_name = 1;
5086 // Total number of exceptions.
5087 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005088}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005089
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005090/**
5091 * Pulls the statistics of message dispatching on HandlerThreads.
5092 *
5093 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5094 * config on the device.
5095 *
5096 * Next tag: 11
5097 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005098message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005099 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005100 optional int32 uid = 1 [(is_uid) = true];
5101
5102 // Fully qualified class name of the handler target class.
5103 //
5104 // This field does not contain PII. This is a system server class name.
5105 optional string handler_class_name = 2;
5106
5107 // The name of the thread that runs the Looper.
5108 //
5109 // This field does not contain PII. This is a system server thread name.
5110 optional string looper_thread_name = 3;
5111
5112 // The name of the dispatched message.
5113 //
5114 // This field does not contain PII. This is a system server constant or class
5115 // name.
5116 optional string message_name = 4;
5117
5118 // Total number of successfully dispatched messages.
5119 optional int64 message_count = 5;
5120
5121 // Total number of messages that failed dispatching.
5122 optional int64 exception_count = 6;
5123
5124 // Total number of processed messages we have data recorded for. If we
5125 // collected data for all the messages, message_count will be equal to
5126 // recorded_message_count.
5127 //
5128 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005129 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005130 optional int64 recorded_message_count = 7;
5131
5132 // Total latency of all processed messages.
5133 // Average can be computed using recorded_total_latency_micros /
5134 // recorded_message_count.
5135 optional int64 recorded_total_latency_micros = 8;
5136
5137 // Total CPU usage of all processed message.
5138 // Average can be computed using recorded_total_cpu_micros /
5139 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005140 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005141 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005142
5143 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5144 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005145
5146 // Max recorded CPU usage of all processed messages.
5147 optional int64 recorded_max_cpu_micros = 11;
5148
5149 // Max recorded latency of all processed messages.
5150 optional int64 recorded_max_latency_micros = 12;
5151
5152 // Total number of messages we tracked the dispatching delay for. If we
5153 // collected data for all the messages, message_count will be equal to
5154 // recorded_delay_message_count.
5155 //
5156 // If recorded_delay_message_count is different than message_count, it means data
5157 // collection has been sampled or/and not all messages specified the target dispatch time.
5158 // The fields below will be sampled in this case.
5159 optional int64 recorded_delay_message_count = 13;
5160
5161 // Total dispatching delay of all processed messages.
5162 // Calculated as a difference between the target dispatching time (Message.when)
5163 // and the actual dispatching time.
5164 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5165 optional int64 recorded_total_delay_millis = 14;
5166
5167 // Max dispatching delay of all processed messages.
5168 // Calculated as a difference between the target dispatching time (Message.when)
5169 // and the actual dispatching time.
5170 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005171}
Tej Singh86dc9db2018-09-06 00:39:57 +00005172
5173/**
5174 * Pulls disk information, such as write speed and latency.
5175 */
5176message DiskStats {
5177 // Time taken to open, write 512B to, and close a file.
5178 // -1 if error performing the check.
5179 optional int64 data_write_latency_millis = 1;
5180
5181 optional bool file_based_encryption = 2;
5182
5183 // Recent disk write speed in kB/s.
5184 // -1 if error querying storageed.
5185 // 0 if data is unavailable.
5186 optional int32 recent_disk_write_speed = 3;
5187}
5188
5189
5190/**
5191 * Free and total bytes of the Data, Cache, and System partition.
5192 */
5193message DirectoryUsage {
5194 enum Directory {
5195 UNKNOWN = 0;
5196 DATA = 1;
5197 CACHE = 2;
5198 SYSTEM = 3;
5199 }
5200 optional Directory directory = 1;
5201 optional int64 free_bytes = 2;
5202 optional int64 total_bytes = 3;
5203}
5204
5205
5206/**
5207 * Size of an application: apk size, data size, and cache size.
5208 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5209 * Information is only reported for apps with the primary user (user 0).
5210 * Sizes are aggregated by package name.
5211 */
5212message AppSize {
5213 // Including uids will involve modifying diskstats logic.
5214 optional string package_name = 1;
5215 // App size in bytes. -1 if unavailable.
5216 optional int64 app_size_bytes = 2;
5217 // App data size in bytes. -1 if unavailable.
5218 optional int64 app_data_size_bytes = 3;
5219 // App cache size in bytes. -1 if unavailable.
5220 optional int64 app_cache_size_bytes = 4;
5221 // Time that the cache file was produced.
5222 // Uses System.currentTimeMillis(), which is wall clock time.
5223 optional int64 cache_time_millis = 5;
5224}
5225
5226
5227/**
5228 * Size of a particular category. Eg: photos, videos.
5229 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5230 */
5231message CategorySize {
5232 enum Category {
5233 UNKNOWN = 0;
5234 APP_SIZE = 1;
5235 APP_DATA_SIZE = 2;
5236 APP_CACHE_SIZE = 3;
5237 PHOTOS = 4;
5238 VIDEOS = 5;
5239 AUDIO = 6;
5240 DOWNLOADS = 7;
5241 SYSTEM = 8;
5242 OTHER = 9;
5243 }
5244 optional Category category = 1;
5245 // Category size in bytes.
5246 optional int64 size_bytes = 2;
5247 // Time that the cache file was produced.
5248 // Uses System.currentTimeMillis(), which is wall clock time.
5249 optional int64 cache_time_millis = 3;
5250}
Tej Singhd6d6d772018-09-05 17:41:25 -07005251
5252/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005253 * Pulls per uid I/O stats. The stats are cumulative since boot.
5254 *
5255 * Read/write bytes are I/O events from a storage device
5256 * Read/write chars are data requested by read/write syscalls, and can be
5257 * satisfied by caching.
5258 *
5259 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5260 */
5261message DiskIo {
5262 optional int32 uid = 1 [(is_uid) = true];
5263 optional int64 fg_chars_read = 2;
5264 optional int64 fg_chars_write = 3;
5265 optional int64 fg_bytes_read = 4;
5266 optional int64 fg_bytes_write = 5;
5267 optional int64 bg_chars_read = 6;
5268 optional int64 bg_chars_write = 7;
5269 optional int64 bg_bytes_read = 8;
5270 optional int64 bg_bytes_write = 9;
5271 optional int64 fg_fsync = 10;
5272 optional int64 bg_fsync= 11;
5273}
5274
5275
5276/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005277 * Pulls the number of fingerprints for each user.
5278 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005279 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005280 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005281message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005282 // The associated user. Eg: 0 for owners, 10+ for others.
5283 // Defined in android/os/UserHandle.java
5284 optional int32 user = 1;
5285 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005286 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005287}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005288
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005289/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005290 * Pulls the number of faces for each user.
5291 *
5292 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5293 */
5294message NumFacesEnrolled {
5295 // The associated user. Eg: 0 for owners, 10+ for others.
5296 // Defined in android/os/UserHandle.java
5297 optional int32 user = 1;
5298 // Number of faces registered to that user.
5299 optional int32 num_faces_enrolled = 2;
5300}
5301/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005302 * A mapping of role holder -> role
5303 */
5304message RoleHolder {
5305 // uid of the role holder
5306 optional int32 uid = 1 [(is_uid) = true];
5307
5308 // package name of the role holder
5309 optional string package_name = 2;
5310
5311 // the role held
5312 optional string role = 3;
5313}
5314
Yangsteraf9aee72018-10-12 09:26:16 -07005315message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005316 // These are all in byte resolution.
5317 optional int64 min = 1 [deprecated = true];
5318 optional int64 average = 2 [deprecated = true];
5319 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005320
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005321 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5322 // int64 fields.
5323 optional int32 mean_kb = 4;
5324 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005325}
5326
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005327// A reduced subset of process states; reducing the number of possible states allows more
5328// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5329enum ProcessStateAggregated {
5330 PROCESS_STATE_UNKNOWN = 0;
5331 // Persistent system process.
5332 PROCESS_STATE_PERSISTENT = 1;
5333 // Top activity; actually any visible activity.
5334 PROCESS_STATE_TOP = 2;
5335 // Process binding to top or a foreground service.
5336 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5337 // Processing running a foreground service.
5338 PROCESS_STATE_FGS = 4;
5339 // Important foreground process (ime, wallpaper, etc).
5340 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5341 // Important background process.
5342 PROCESS_STATE_BACKGROUND = 6;
5343 // Process running a receiver.
5344 PROCESS_STATE_RECEIVER = 7;
5345 // All kinds of cached processes.
5346 PROCESS_STATE_CACHED = 8;
5347}
5348
5349// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005350message ProcessStatsStateProto {
5351 optional android.service.procstats.ScreenState screen_state = 1;
5352
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005353 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005354
5355 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5356 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005357 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5358
5359 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005360
5361 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005362 optional int64 duration_millis = 4 [deprecated = true];
5363 // Same as above, but with minute resolution so it fits into an int32.
5364 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005365
5366 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005367 optional int64 realtime_duration_millis = 9 [deprecated = true];
5368 // Same as above, but with minute resolution so it fits into an int32.
5369 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005370
5371 // # of samples taken
5372 optional int32 sample_size = 5;
5373
5374 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005375 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005376
5377 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005378 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005379
5380 // RSS is memory resident for this process
5381 optional AggStats rss = 8;
5382}
5383
5384// Next Tag: 7
5385message ProcessStatsProto {
5386 // Name of process.
5387 optional string process = 1;
5388
5389 // Uid of the process.
5390 optional int32 uid = 2;
5391
5392 // Information about how often kills occurred
5393 message Kill {
5394 // Count of excessive CPU kills
5395 optional int32 cpu = 1;
5396
5397 // Count of kills when cached
5398 optional int32 cached = 2;
5399
5400 // PSS stats during cached kill
5401 optional AggStats cached_pss = 3;
5402 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005403 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005404
5405 // Time and memory spent in various states.
5406 repeated ProcessStatsStateProto states = 5;
5407
5408 // Total time process has been running... screen_state, memory_state, and process_state
5409 // will not be set.
5410 optional ProcessStatsStateProto total_running_state = 6;
5411}
5412
5413message PackageServiceOperationStatsProto {
5414 // Operate enum: Started, Foreground, Bound, Executing
5415 optional android.service.procstats.ServiceOperationState operation = 1;
5416
5417 // Number of times the service was in this operation.
5418 optional int32 count = 2;
5419
5420 // Information about a state the service can be in.
5421 message StateStats {
5422 // Screen state enum.
5423 optional android.service.procstats.ScreenState screen_state = 1;
5424 // Memory state enum.
5425 optional android.service.procstats.MemoryState memory_state = 2;
5426
5427 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005428 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005429 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005430 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005431 }
5432 repeated StateStats state_stats = 3;
5433}
5434
5435message PackageServiceStatsProto {
5436 // Name of service component.
5437 optional string service_name = 1;
5438
5439 // The operation stats.
5440 // The package_name, package_uid, package_version, service_name will not be set to save space.
5441 repeated PackageServiceOperationStatsProto operation_stats = 2;
5442}
5443
5444message PackageAssociationSourceProcessStatsProto {
5445 // Uid of the process.
5446 optional int32 process_uid = 1;
5447 // Process name.
5448 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005449 // Package name.
5450 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005451 // Total count of the times this association appeared.
5452 optional int32 total_count = 3;
5453
5454 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005455 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005456
5457 // Total count of the times this association became actively impacting its target process.
5458 optional int32 active_count = 5;
5459
5460 // Information on one source in this association.
5461 message StateStats {
5462 // Process state enum.
5463 optional android.service.procstats.ProcessState process_state = 1;
5464 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005465 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005466 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005467 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005468 }
5469 repeated StateStats active_state_stats = 6;
5470}
5471
5472message PackageAssociationProcessStatsProto {
5473 // Name of the target component.
5474 optional string component_name = 1;
5475 // Information on one source in this association.
5476 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5477}
5478
5479
5480message ProcessStatsPackageProto {
5481 // Name of package.
5482 optional string package = 1;
5483
5484 // Uid of the package.
5485 optional int32 uid = 2;
5486
5487 // Version of the package.
5488 optional int64 version = 3;
5489
5490 // Stats for each process running with the package loaded in to it.
5491 repeated ProcessStatsProto process_stats = 4;
5492
5493 // Stats for each of the package's services.
5494 repeated PackageServiceStatsProto service_stats = 5;
5495
5496 // Stats for each association with the package.
5497 repeated PackageAssociationProcessStatsProto association_stats = 6;
5498}
5499
5500message ProcessStatsSectionProto {
5501 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005502 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005503
5504 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005505 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005506
5507 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005508 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005509
5510 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005511 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005512
5513 // System runtime library. e.g. "libdvm.so", "libart.so".
5514 optional string runtime = 5;
5515
5516 // whether kernel reports swapped pss.
5517 optional bool has_swapped_pss = 6;
5518
5519 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5520 enum Status {
5521 STATUS_UNKNOWN = 0;
5522 STATUS_COMPLETE = 1;
5523 STATUS_PARTIAL = 2;
5524 STATUS_SHUTDOWN = 3;
5525 STATUS_SYSPROPS = 4;
5526 }
5527 repeated Status status = 7;
5528
Chenjie Yub2ecc792019-01-17 10:27:26 -08005529 // Number of pages available of various types and sizes, representation fragmentation.
5530 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5531
Yangsteraf9aee72018-10-12 09:26:16 -07005532 // Stats for each process.
5533 repeated ProcessStatsProto process_stats = 8;
5534
5535 // Stats for each package.
5536 repeated ProcessStatsPackageProto package_stats = 9;
5537}
5538
Chenjie Yub2ecc792019-01-17 10:27:26 -08005539message ProcessStatsAvailablePagesProto {
5540 // Node these pages are in (as per /proc/pagetypeinfo)
5541 optional int32 node = 1;
5542
5543 // Zone these pages are in (as per /proc/pagetypeinfo)
5544 optional string zone = 2;
5545
5546 // Label for the type of these pages (as per /proc/pagetypeinfo)
5547 optional string label = 3;
5548
5549 // Distribution of number of pages available by order size. First entry in array is
5550 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5551 repeated int32 pages_per_order = 4;
5552}
5553
Chenjie Yu12e5e672018-09-14 15:54:59 -07005554/**
5555 * Pulled from ProcessStatsService.java
5556 */
5557message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005558 optional ProcessStatsSectionProto proc_stats_section = 1;
5559}
5560
Chenjie Yuf910b7802019-01-11 16:08:20 -08005561/**
5562 * Pulled from ProcessStatsService.java
5563 */
5564message ProcStatsPkgProc {
5565 optional ProcessStatsSectionProto proc_stats_section = 1;
5566}
5567
Chris Wrencdea3b72019-11-22 16:58:17 -05005568// Next Tag: 2
5569message PackageRemoteViewInfoProto {
5570 optional string package_name = 1;
5571 // add per-package additional info here (like channels)
5572}
5573
5574// Next Tag: 2
5575message NotificationRemoteViewsProto {
5576 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5577}
5578
5579/**
5580 * Pulled from NotificationManagerService.java
5581 */
5582message NotificationRemoteViews {
5583 optional NotificationRemoteViewsProto notification_remote_views = 1;
5584}
5585
Yotam Aron74299972020-01-16 16:20:58 +02005586/**
5587 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5588 */
5589message PackageNotificationPreferences {
5590 // Uid under which the package is installed.
5591 optional int32 uid = 1;
5592 // Notification importance, which specifies when and how a notification is displayed.
5593 // Specified under core/java/android/app/NotificationManager.java.
5594 optional int32 importance = 2;
5595 // Lockscreen visibility as set by the user.
5596 optional int32 visibility = 3;
5597 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5598 // PreferencesHelper.java)
5599 optional int32 user_locked_fields = 4;
5600}
5601
5602/**
5603 * Atom that contains a list of a package's channel preferences, pulled from
5604 * NotificationManagerService.java.
5605 */
5606message PackageNotificationChannelPreferences {
5607 // Uid under which the package is installed.
5608 optional int32 uid = 1;
5609 // Channel's ID. Should always be available.
5610 optional string channel_id = 2;
5611 // Channel's name. Should always be available.
5612 optional string channel_name = 3;
5613 // Channel's description. Optionally set by the channel creator.
5614 optional string description = 4;
5615 // Notification importance, which specifies when and how a notification is displayed. Specified
5616 // under core/java/android/app/NotificationManager.java.
5617 optional int32 importance = 5;
5618 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5619 // at core/java/android/app/NotificationChannel.java
5620 optional int32 user_locked_fields = 6;
5621 // Indicates if the channel was deleted by the app.
5622 optional bool is_deleted = 7;
5623}
5624
5625/**
5626 * Atom that contains a list of a package's channel group preferences, pulled from
5627 * NotificationManagerService.java.
5628 */
5629message PackageNotificationChannelGroupPreferences {
5630 // Uid under which the package is installed.
5631 optional int32 uid = 1;
5632 // Channel Group's ID. Should always be available.
5633 optional string group_id = 2;
5634 // Channel Group's name. Should always be available.
5635 optional string group_name = 3;
5636 // Channel Group's description. Optionally set by group creator.
5637 optional string description = 4;
5638 // Indicates if notifications from this channel group are blocked.
5639 optional bool is_blocked = 5;
5640 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5641 // at core/java/android/app/NotificationChannelGroup.java
5642 optional int32 user_locked_fields = 6;
5643}
5644
Yangsteraf9aee72018-10-12 09:26:16 -07005645message PowerProfileProto {
5646 optional double cpu_suspend = 1;
5647
5648 optional double cpu_idle = 2;
5649
5650 optional double cpu_active = 3;
5651
5652 message CpuCluster {
5653 optional int32 id = 1;
5654 optional double cluster_power = 2;
5655 optional int32 cores = 3;
5656 repeated int64 speed = 4;
5657 repeated double core_power = 5;
5658 }
5659
5660 repeated CpuCluster cpu_cluster = 40;
5661
5662 optional double wifi_scan = 4;
5663
5664 optional double wifi_on = 5;
5665
5666 optional double wifi_active = 6;
5667
5668 optional double wifi_controller_idle = 7;
5669
5670 optional double wifi_controller_rx = 8;
5671
5672 optional double wifi_controller_tx = 9;
5673
5674 repeated double wifi_controller_tx_levels = 10;
5675
5676 optional double wifi_controller_operating_voltage = 11;
5677
5678 optional double bluetooth_controller_idle = 12;
5679
5680 optional double bluetooth_controller_rx = 13;
5681
5682 optional double bluetooth_controller_tx = 14;
5683
5684 optional double bluetooth_controller_operating_voltage = 15;
5685
5686 optional double modem_controller_sleep = 16;
5687
5688 optional double modem_controller_idle = 17;
5689
5690 optional double modem_controller_rx = 18;
5691
5692 repeated double modem_controller_tx = 19;
5693
5694 optional double modem_controller_operating_voltage = 20;
5695
5696 optional double gps_on = 21;
5697
5698 repeated double gps_signal_quality_based = 22;
5699
5700 optional double gps_operating_voltage = 23;
5701
5702 optional double bluetooth_on = 24;
5703
5704 optional double bluetooth_active = 25;
5705
5706 optional double bluetooth_at_cmd = 26;
5707
5708 optional double ambient_display = 27;
5709
5710 optional double screen_on = 28;
5711
5712 optional double radio_on = 29;
5713
5714 optional double radio_scanning = 30;
5715
5716 optional double radio_active = 31;
5717
5718 optional double screen_full = 32;
5719
5720 optional double audio = 33;
5721
5722 optional double video = 34;
5723
5724 optional double flashlight = 35;
5725
5726 optional double memory = 36;
5727
5728 optional double camera = 37;
5729
5730 optional double wifi_batched_scan = 38;
5731
5732 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005733}
Chenjie Yuab530202018-09-26 12:39:20 -07005734
5735/**
5736 * power_profile.xml and other constants for power model calculations.
5737 * Pulled from PowerProfile.java
5738 */
5739message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005740 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005741}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005742
5743/**
arangelovd5db50e2018-10-12 20:24:39 +01005744 * Logs when a user restriction was added or removed.
5745 *
5746 * Logged from:
5747 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5748 */
5749message UserRestrictionChanged {
5750 // The raw string of the user restriction as defined in UserManager.
5751 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5752 optional string restriction = 1;
5753 // Whether the restriction is enabled or disabled.
5754 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005755}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005756
5757/**
5758 * Pulls process user time and system time. Puller takes a snapshot of all pids
5759 * in the system and returns cpu stats for those that are working at the time.
5760 * Dead pids will be dropped. Kernel processes are excluded.
5761 * Min cool-down is 5 sec.
5762 */
5763message ProcessCpuTime {
5764 optional int32 uid = 1 [(is_uid) = true];
5765
5766 optional string process_name = 2;
5767 // Process cpu time in user space, cumulative from boot/process start
5768 optional int64 user_time_millis = 3;
5769 // Process cpu time in system space, cumulative from boot/process start
5770 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005771}
Misha Wagner5a51e002018-10-03 15:04:09 +01005772
5773/**
5774 * Pulls the CPU usage for each thread.
5775 *
5776 * Read from /proc/$PID/task/$TID/time_in_state files.
5777 *
5778 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5779 * time_in_state files not being present on some phones, have not been addressed. These should be
5780 * considered before a public release.
5781 */
5782message CpuTimePerThreadFreq {
5783 // UID that owns the process.
5784 optional int32 uid = 1 [(is_uid) = true];
5785 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005786 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005787 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005788 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005789 // Name of the process taken from `/proc/$PID/cmdline`.
5790 optional string process_name = 4;
5791 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5792 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005793
5794 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5795 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5796 // frequencies are given here as the alternative is sending eight separate atoms. This method
5797 // significantly reduces the amount of data created
5798 optional int32 frequency1_khz = 6;
5799 optional int32 time1_millis = 7;
5800 optional int32 frequency2_khz = 8;
5801 optional int32 time2_millis = 9;
5802 optional int32 frequency3_khz = 10;
5803 optional int32 time3_millis = 11;
5804 optional int32 frequency4_khz = 12;
5805 optional int32 time4_millis = 13;
5806 optional int32 frequency5_khz = 14;
5807 optional int32 time5_millis = 15;
5808 optional int32 frequency6_khz = 16;
5809 optional int32 time6_millis = 17;
5810 optional int32 frequency7_khz = 18;
5811 optional int32 time7_millis = 19;
5812 optional int32 frequency8_khz = 20;
5813 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005814}
Bookatz75ee60422018-11-09 12:27:37 -08005815
5816/**
Bookatz366a4432018-11-20 09:42:33 -08005817 * Pulls information about the device's build.
5818 */
5819message BuildInformation {
5820 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5821 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5822 optional string fingerprint = 1;
5823
5824 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5825 optional string brand = 2;
5826
5827 // Build.PRODUCT. The name of the overall product.
5828 optional string product = 3;
5829
5830 // Build.DEVICE. The name of the industrial design.
5831 optional string device = 4;
5832
5833 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5834 optional string version_release = 5;
5835
5836 // Build.ID. E.g. a label like "M4-rc20".
5837 optional string id = 6;
5838
5839 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5840 // represent this build.
5841 optional string version_incremental = 7;
5842
5843 // Build.TYPE. The type of build, like "user" or "eng".
5844 optional string type = 8;
5845
5846 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5847 optional string tags = 9;
5848}
5849
5850/**
Adam He420947c2019-01-23 15:59:09 -08005851 * Logs information about mismatched caller for content capture.
5852 *
5853 * Logged from:
5854 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5855 */
5856message ContentCaptureCallerMismatchReported {
5857 optional string intended_package = 1;
5858 optional string calling_package = 2;
5859}
5860
5861/**
5862 * Logs information about content capture service events.
5863 *
5864 * Logged from:
5865 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5866 */
5867message ContentCaptureServiceEvents {
5868 // The type of event.
5869 enum Event {
5870 UNKNOWN = 0;
5871 ON_CONNECTED = 1;
5872 ON_DISCONNECTED = 2;
5873 SET_WHITELIST = 3;
5874 SET_DISABLED = 4;
5875 ON_USER_DATA_REMOVED = 5;
5876 }
5877 optional Event event = 1;
5878 // component/package of content capture service.
5879 optional string service_info = 2;
5880 // component/package of target.
5881 // it's a concatenated list of component/package for SET_WHITELIST event
5882 // separated by " ".
5883 optional string target_info = 3;
5884}
5885
5886/**
5887 * Logs information about content capture session events.
5888 *
5889 * Logged from:
5890 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5891 */
5892message ContentCaptureSessionEvents {
5893 // The type of event.
5894 enum Event {
5895 UNKNOWN = 0;
5896 ON_SESSION_STARTED = 1;
5897 ON_SESSION_FINISHED = 2;
5898 SESSION_NOT_CREATED = 3;
5899 }
5900 optional int32 session_id = 1;
5901 optional Event event = 2;
5902 // (n/a on session finished)
5903 optional int32 state_flags = 3;
5904 // component/package of content capture service.
5905 optional string service_info = 4;
5906 // component/package of app.
5907 // (n/a on session finished)
5908 optional string app_info = 5;
5909 optional bool is_child_session = 6;
5910}
5911
5912/**
5913 * Logs information about session being flushed.
5914 *
5915 * Logged from:
5916 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5917 */
5918message ContentCaptureFlushed {
5919 optional int32 session_id = 1;
5920 // component/package of content capture service.
5921 optional string service_info = 2;
5922 // component/package of app.
5923 optional string app_info = 3;
5924 // session start/finish events
5925 optional int32 child_session_started = 4;
5926 optional int32 child_session_finished = 5;
5927 // count of view events.
5928 optional int32 view_appeared_count = 6;
5929 optional int32 view_disappeared_count = 7;
5930 optional int32 view_text_changed_count = 8;
5931
5932 // Flush stats.
5933 optional int32 max_events = 9;
5934 optional int32 idle_flush_freq = 10;
5935 optional int32 text_flush_freq = 11;
5936 optional int32 flush_reason = 12;
5937}
5938
5939/**
Bookatz75ee60422018-11-09 12:27:37 -08005940 * Pulls on-device BatteryStats power use calculations for the overall device.
5941 */
5942message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005943 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5944 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5945 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5946 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005947}
5948
5949/**
5950 * Pulls on-device BatteryStats power use calculations broken down by uid.
5951 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5952 * that is attributed to non-uid items. They must all be included to get the total power use.
5953 */
5954message DeviceCalculatedPowerBlameUid {
5955 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5956 optional int32 uid = 1 [(is_uid) = true];
5957
Bookatz3dbc13a2018-12-21 12:16:51 -08005958 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5959 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5960 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005961}
5962
5963/**
5964 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5965 * drain type.
5966 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5967 * is attributed uids. They must all be included to get the total power use.
5968 */
5969message DeviceCalculatedPowerBlameOther {
5970 // The type of item whose power use is being reported.
5971 enum DrainType {
5972 AMBIENT_DISPLAY = 0;
5973 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5974 BLUETOOTH = 2;
5975 CAMERA = 3;
5976 // Cell-standby
5977 CELL = 4;
5978 FLASHLIGHT = 5;
5979 IDLE = 6;
5980 MEMORY = 7;
5981 // Amount that total computed drain exceeded the drain estimated using the
5982 // battery level changes and capacity.
5983 OVERCOUNTED = 8;
5984 PHONE = 9;
5985 SCREEN = 10;
5986 // Amount that total computed drain was below the drain estimated using the
5987 // battery level changes and capacity.
5988 UNACCOUNTED = 11;
5989 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5990 WIFI = 13;
5991 }
5992 optional DrainType drain_type = 1;
5993
Bookatz3dbc13a2018-12-21 12:16:51 -08005994 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5995 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5996 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005997}
arangelov4e994062018-11-13 16:12:38 +00005998
5999/**
6000 * Logs device policy features.
6001 *
6002 * Logged from:
6003 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6004 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6005 */
6006message DevicePolicyEvent {
6007 // The event id - unique for each event.
6008 optional android.stats.devicepolicy.EventId event_id = 1;
6009 // The admin package name.
6010 optional string admin_package_name = 2;
6011 // A generic integer parameter.
6012 optional int32 integer_value = 3;
6013 // A generic boolean parameter.
6014 optional bool boolean_value = 4;
6015 // A parameter specifying a time period in milliseconds.
6016 optional uint64 time_period_millis = 5;
6017 // A parameter specifying a list of package names, bundle extras or string parameters.
6018 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6019}
shawnlinea5b66b2018-11-13 15:05:29 +08006020
6021/**
6022 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6023 *
6024 * Logged from:
6025 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6026 */
6027message DocsUILaunchReported {
6028 optional android.stats.docsui.LaunchAction launch_action = 1;
6029 optional bool has_initial_uri = 2;
6030 optional android.stats.docsui.MimeType mime_type = 3;
6031 optional android.stats.docsui.Root initial_root = 4;
6032}
6033
6034/**
6035 * Logs root/app visited event in file managers/picker. Call this when the user
6036 * taps on root/app in hamburger menu.
6037 *
6038 * Logged from:
6039 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6040 */
6041message DocsUIRootVisitedReported {
6042 optional android.stats.docsui.ContextScope scope = 1;
6043 optional android.stats.docsui.Root root = 2;
6044}
6045
6046/**
6047 * Logs file operation stats. Call this when a file operation has completed.
6048 *
6049 * Logged from:
6050 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6051 */
6052message DocsUIFileOperationReported {
6053 optional android.stats.docsui.Provider provider = 1;
6054 optional android.stats.docsui.FileOperation file_op = 2;
6055}
6056
6057/**
6058 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6059 * mode.
6060 *
6061 * Logged from:
6062 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6063 */
6064message DocsUIFileOperationCopyMoveModeReported {
6065 optional android.stats.docsui.FileOperation file_op = 1;
6066 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6067}
6068
6069
6070/**
6071 * Logs file sub operation stats. Call this when a file operation has failed.
6072 *
6073 * Logged from:
6074 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6075 */
6076message DocsUIFileOperationFailureReported {
6077 optional android.stats.docsui.Authority authority = 1;
6078 optional android.stats.docsui.SubFileOperation sub_op = 2;
6079}
6080
6081/**
6082* Logs the cancellation of a file operation. Call this when a job is canceled
6083*
6084* Logged from:
6085* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6086*/
6087message DocsUIFileOperationCanceledReported {
6088 optional android.stats.docsui.FileOperation file_op = 1;
6089}
6090
6091/**
6092 * Logs startup time in milliseconds.
6093 *
6094 * Logged from:
6095 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6096 */
6097message DocsUIStartupMsReported {
6098 optional int32 startup_millis = 1;
6099}
6100
6101/**
6102 * Logs the action that was started by user.
6103 *
6104 * Logged from:
6105 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6106 */
6107message DocsUIUserActionReported {
6108 optional android.stats.docsui.UserAction action = 1;
6109}
6110
6111/**
6112 * Logs the invalid type when invalid scoped access is requested.
6113 *
6114 * Logged from:
6115 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6116 */
6117message DocsUIInvalidScopedAccessRequestReported {
6118 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006119}
Ben Murdochbab399f62018-12-06 11:01:38 +00006120
6121/**
shawnlina75e82d2019-01-07 10:31:12 +08006122 * Logs the package name that launches docsui picker mode.
6123 *
6124 * Logged from:
6125 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6126 */
6127message DocsUIPickerLaunchedFromReported {
6128 optional string package_name = 1;
6129}
6130
6131/**
6132 * Logs the search type.
6133 *
6134 * Logged from:
6135 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6136 */
6137message DocsUISearchTypeReported {
6138 optional android.stats.docsui.SearchType search_type = 1;
6139}
6140
6141/**
6142 * Logs the search mode.
6143 *
6144 * Logged from:
6145 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6146 */
6147message DocsUISearchModeReported {
6148 optional android.stats.docsui.SearchMode search_mode = 1;
6149}
6150
6151/**
6152 * Logs the pick result information.
6153 *
6154 * Logged from:
6155 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6156 */
6157message DocsUIPickResultReported {
6158 optional int32 total_action_count = 1;
6159 optional int64 duration_millis = 2;
6160 optional int32 file_count= 3;
6161 optional bool is_searching = 4;
6162 optional android.stats.docsui.Root picked_from = 5;
6163 optional android.stats.docsui.MimeType mime_type = 6;
6164 optional int32 repeatedly_pick_times = 7;
6165}
6166
6167/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006168 * Logs when an app's memory is compacted.
6169 *
6170 * Logged from:
6171 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6172 */
6173message AppCompacted {
6174 // The pid of the process being compacted.
6175 optional int32 pid = 1;
6176
6177 // The name of the process being compacted.
6178 optional string process_name = 2;
6179
6180 // The type of compaction.
6181 enum Action {
6182 UNKNOWN = 0;
6183 SOME = 1;
6184 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006185 PERSISTENT = 3;
6186 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006187 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006188 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006189
6190 // Total RSS in kilobytes consumed by the process prior to compaction.
6191 optional int64 before_rss_total_kilobytes = 4;
6192
6193 // File RSS in kilobytes consumed by the process prior to compaction.
6194 optional int64 before_rss_file_kilobytes = 5;
6195
6196 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6197 optional int64 before_rss_anon_kilobytes = 6;
6198
6199 // Swap in kilobytes consumed by the process prior to compaction.
6200 optional int64 before_swap_kilobytes = 7;
6201
6202 // Total RSS in kilobytes consumed by the process after compaction.
6203 optional int64 after_rss_total_kilobytes = 8;
6204
6205 // File RSS in kilobytes consumed by the process after compaction.
6206 optional int64 after_rss_file_kilobytes = 9;
6207
6208 // Anonymous RSS in kilobytes consumed by the process after compaction.
6209 optional int64 after_rss_anon_kilobytes = 10;
6210
6211 // Swap in kilobytes consumed by the process after compaction.
6212 optional int64 after_swap_kilobytes = 11;
6213
6214 // The time taken to perform compaction in milliseconds.
6215 optional int64 time_to_compact_millis = 12;
6216
6217 // The last compaction action performed for this app.
6218 optional Action last_action = 13;
6219
Ben Murdoch01720b82018-12-19 18:03:44 +00006220 // The last time that compaction was attempted on this process in milliseconds
6221 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6222 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006223
Ben Murdoch885c21b2019-03-15 18:02:04 +00006224 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006225 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006226
6227 // The process state at the time of compaction.
6228 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006229
6230 // Free ZRAM in kilobytes before compaction.
6231 optional int64 before_zram_free_kilobytes = 17;
6232
6233 // Free ZRAM in kilobytes after compaction.
6234 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006235}
lifr157fc552018-12-12 16:38:04 +08006236
6237/**
lifrb6b90b62019-03-29 00:40:17 +08006238 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6239 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6240 *
lifr1f74b052019-04-16 22:16:30 +08006241 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6242 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6243 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6244 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006245 */
6246message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006247 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006248
lifr1f74b052019-04-16 22:16:30 +08006249 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006250
6251 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006252 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006253
lifr1f74b052019-04-16 22:16:30 +08006254 // Only valid for event_type = EVENT_GETADDRINFO.
6255 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006256
lifr1f74b052019-04-16 22:16:30 +08006257 // Flags passed to android_res_nsend() defined in multinetwork.h
6258 // Only valid for event_type = EVENT_RESNSEND.
6259 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006260
lifrad9becc2019-05-20 11:04:41 +08006261 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006262
6263 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006264 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006265
6266 // Additional pass-through fields opaque to statsd.
6267 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006268 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006269
6270 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6271 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006272}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006273
6274/**
6275 * Logs when a data stall event occurs.
6276 *
6277 * Log from:
6278 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6279 */
6280message DataStallEvent {
6281 // Data stall evaluation type.
6282 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6283 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6284 optional int32 evaluation_type = 1;
6285 // See definition in data_stall_event.proto.
6286 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6287 // See definition in data_stall_event.proto.
6288 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6289 // See definition in data_stall_event.proto.
6290 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6291 // See definition in data_stall_event.proto.
6292 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6293 // See definition in data_stall_event.proto.
6294 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6295}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006296
6297/*
6298 * Logs when RescueParty resets some set of experiment flags.
6299 *
6300 * Logged from:
6301 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6302 */
6303message RescuePartyResetReported {
6304 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6305 optional int32 rescue_level = 1;
6306}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006307
6308/**
6309 * Logs when signed config is received from an APK, and if that config was applied successfully.
6310 * Logged from:
6311 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6312 */
6313message SignedConfigReported {
6314 enum Type {
6315 UNKNOWN_TYPE = 0;
6316 GLOBAL_SETTINGS = 1;
6317 }
6318 optional Type type = 1;
6319
6320 // The final status of the signed config received.
6321 enum Status {
6322 UNKNOWN_STATUS = 0;
6323 APPLIED = 1;
6324 BASE64_FAILURE_CONFIG = 2;
6325 BASE64_FAILURE_SIGNATURE = 3;
6326 SECURITY_EXCEPTION = 4;
6327 INVALID_CONFIG = 5;
6328 OLD_CONFIG = 6;
6329 SIGNATURE_CHECK_FAILED = 7;
6330 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006331 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006332 }
6333 optional Status status = 2;
6334
6335 // The version of the signed config processed.
6336 optional int32 version = 3;
6337
6338 // The package name that the config was extracted from.
6339 optional string from_package = 4;
6340
6341 enum Key {
6342 NO_KEY = 0;
6343 DEBUG = 1;
6344 PRODUCTION = 2;
6345 }
6346 // Which key was used to verify the config.
6347 optional Key verified_with = 5;
6348}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006349
6350/*
6351 * Logs GNSS Network-Initiated (NI) location events.
6352 *
6353 * Logged from:
6354 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6355 */
6356message GnssNiEventReported {
6357 // The type of GnssNiEvent.
6358 enum EventType {
6359 UNKNOWN = 0;
6360 NI_REQUEST = 1;
6361 NI_RESPONSE = 2;
6362 }
6363 optional EventType event_type = 1;
6364
6365 // An ID generated by HAL to associate NI notifications and UI responses.
6366 optional int32 notification_id = 2;
6367
6368 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006369 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006370
6371 // NI requires notification.
6372 optional bool need_notify = 4;
6373
6374 // NI requires verification.
6375 optional bool need_verify = 5;
6376
6377 // NI requires privacy override, no notification/minimal trace.
6378 optional bool privacy_override = 6;
6379
6380 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6381 // seconds.
6382 optional int32 timeout = 7;
6383
6384 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006385 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006386
6387 // String representing the requester of the network inititated location request.
6388 optional string requestor_id = 9;
6389
6390 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6391 // network initiated location request.
6392 optional string text = 10;
6393
6394 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006395 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006396
6397 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006398 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006399
6400 // True if SUPL ES is enabled.
6401 optional bool is_supl_es_enabled = 13;
6402
6403 // True if GNSS location is enabled.
6404 optional bool is_location_enabled = 14;
6405
6406 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006407 optional android.server.location.GnssUserResponseType user_response = 15;
6408}
6409
6410/**
6411 * Logs GNSS non-framework (NFW) location notification.
6412 *
6413 * Logged from:
6414 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6415 */
6416message GnssNfwNotificationReported {
6417 // Package name of the Android proxy application representing the non-framework entity that
6418 // requested location. Set to empty string if unknown.
6419 optional string proxy_app_package_name = 1;
6420
6421 // Protocol stack that initiated the non-framework location request.
6422 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6423
6424 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6425 // set to empty string. This field is opaque to the framework and used for logging purposes.
6426 optional string other_protocol_stack_name = 3;
6427
6428 // Source initiating/receiving the location information.
6429 optional android.server.location.NfwRequestor requestor = 4;
6430
6431 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6432 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6433 // and used for logging purposes.
6434 optional string requestor_id = 5;
6435
6436 // Indicates whether location information was provided for this request.
6437 optional android.server.location.NfwResponseType response_type = 6;
6438
6439 // True if the device is in user initiated emergency session.
6440 optional bool in_emergency_mode = 7;
6441
6442 // True if cached location is provided.
6443 optional bool is_cached_location = 8;
6444
6445 // True if proxy app permission mismatch between framework and GNSS HAL.
6446 optional bool is_permission_mismatched = 9;
6447}
6448
6449/**
6450 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6451 *
6452 * Logged from:
6453 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6454 */
6455message GnssConfigurationReported {
6456 // SUPL host name.
6457 optional string supl_host = 1;
6458
6459 // SUPL port number.
6460 optional int32 supl_port = 2;
6461
6462 // C2K host name.
6463 optional string c2k_host = 3;
6464
6465 // C2K port number.
6466 optional int32 c2k_port = 4;
6467
6468 // The SUPL version requested by Carrier.
6469 optional int32 supl_ver = 5;
6470
6471 // The SUPL mode.
6472 optional android.server.location.SuplMode supl_mode = 6;
6473
6474 // True if NI emergency SUPL restrictions is enabled.
6475 optional bool supl_es = 7;
6476
6477 // LTE Positioning Profile settings
6478 optional android.server.location.LppProfile lpp_profile = 8;
6479
6480 // Positioning protocol on A-Glonass system.
6481 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6482
6483 // True if emergency PDN is used. Otherwise, regular PDN is used.
6484 optional bool use_emergency_pdn_for_emergency_supl= 10;
6485
6486 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6487 optional android.server.location.GpsLock gps_lock = 11;
6488
6489 // Number of seconds to extend the emergency session duration post emergency call.
6490 optional int32 es_extension_sec = 12;
6491
6492 // The full list of package names of proxy Android applications representing the non-framework
6493 // location access entities (on/off the device) for which the framework user has granted
6494 // non-framework location access permission. The package names are concatenated in one string
6495 // with spaces as separators.
6496 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006497}
Jack Yu95b64f32018-12-13 18:26:11 +08006498
6499/**
6500 * Logs when a NFC device's error occurred.
6501 * Logged from:
6502 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6503 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6504 */
6505message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006506 enum Type {
6507 UNKNOWN = 0;
6508 CMD_TIMEOUT = 1;
6509 ERROR_NOTIFICATION = 2;
6510 AID_OVERFLOW = 3;
6511 }
6512 optional Type type = 1;
6513 // If it's nci cmd timeout, log the timeout command.
6514 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006515
Alex Salod7c3eef2019-01-25 14:43:27 -08006516 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006517}
6518
6519/**
6520 * Logs when a NFC device's state changed event
6521 * Logged from:
6522 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6523 */
6524message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006525 enum State {
6526 UNKNOWN = 0;
6527 OFF = 1;
6528 ON = 2;
6529 ON_LOCKED = 3; // Secure Nfc enabled.
6530 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6531 }
6532 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006533}
6534
6535/**
6536 * Logs when a NFC Beam Transaction occurred.
6537 * Logged from:
6538 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6539 */
6540message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006541 enum Operation {
6542 UNKNOWN = 0;
6543 SEND = 1;
6544 RECEIVE = 2;
6545 }
6546 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006547}
6548
6549/**
6550 * Logs when a NFC Card Emulation Transaction occurred.
6551 * Logged from:
6552 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6553 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6554 */
6555message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006556 enum Category {
6557 UNKNOWN = 0;
6558 HCE_PAYMENT = 1;
6559 HCE_OTHER = 2;
6560 OFFHOST = 3;
6561 }
6562 // Transaction belongs to HCE payment or HCE other category, or offhost.
6563 optional Category category = 1;
6564 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6565 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006566}
6567
6568/**
6569 * Logs when a NFC Tag event occurred.
6570 * Logged from:
6571 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6572 */
6573message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006574 enum Type {
6575 UNKNOWN = 0;
6576 URL = 1;
6577 BT_PAIRING = 2;
6578 PROVISION = 3;
6579 WIFI_CONNECT = 4;
6580 APP_LAUNCH = 5;
6581 OTHERS = 6;
6582 }
6583 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006584}
6585
6586/**
6587 * Logs when Hce transaction triggered
6588 * Logged from:
6589 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6590 */
6591message NfcHceTransactionOccurred {
6592 // The latency period(in microseconds) it took for the first HCE data
6593 // exchange.
6594 optional uint32 latency_micros = 1;
6595}
6596
6597/**
6598 * Logs when SecureElement state event changed
6599 * Logged from:
6600 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6601 */
6602message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006603 enum State {
6604 UNKNOWN = 0;
6605 INITIALIZED = 1;
6606 DISCONNECTED = 2;
6607 CONNECTED = 3;
6608 HALCRASH = 4;
6609 }
6610 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006611
Alex Salod7c3eef2019-01-25 14:43:27 -08006612 optional string state_change_reason = 2;
6613 // SIMx or eSEx.
6614 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006615}
6616
6617/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006618 * Information about a permission grant request
6619 */
6620message PermissionGrantRequestResultReported {
6621 // unique value identifying an API call. A API call might result in multiple of these atoms
6622 optional int64 request_id = 1;
6623
6624 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006625 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006626
6627 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006628 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006629
6630 // The permission to be granted
6631 optional string permission_name = 4;
6632
6633 // If the permission was explicitly requested via the API or added by the system
6634 optional bool is_implicit = 5;
6635
6636 enum Result {
6637 UNDEFINED = 0;
6638 // permission request was ignored
6639 IGNORED = 1;
6640 // permission request was ignored because it was user fixed
6641 IGNORED_USER_FIXED = 2;
6642 // permission request was ignored because it was policy fixed
6643 IGNORED_POLICY_FIXED = 3;
6644 // permission was granted by user action
6645 USER_GRANTED = 4;
6646 // permission was automatically granted
6647 AUTO_GRANTED = 5;
6648 // permission was denied by user action
6649 USER_DENIED = 6;
6650 // permission was denied with prejudice by the user
6651 USER_DENIED_WITH_PREJUDICE = 7;
6652 // permission was automatically denied
6653 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006654 // permission request was ignored because permission is restricted
6655 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006656 // one time permission was granted by user action
6657 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006658 // user ignored request by leaving the request screen without choosing any option
6659 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006660 // user granted the permission after being linked to settings
6661 USER_GRANTED_IN_SETTINGS = 12;
6662 // user denied the permission after being linked to settings
6663 USER_DENIED_IN_SETTINGS = 13;
6664 // user denied the permission with prejudice after being linked to settings
6665 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6666 // permission was automatically revoked after one-time permission expired
6667 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006668 // permission was automatically revoked for unused app
6669 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006670 }
6671 // The result of the permission grant
6672 optional Result result = 6;
6673}
6674
6675/**
Jack Yu95b64f32018-12-13 18:26:11 +08006676 * Logs when Omapi API used
6677 * Logged from:
6678 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6679 */
6680message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006681 enum Operation {
6682 UNKNOWN = 0;
6683 OPEN_CHANNEL = 1;
6684 }
6685 optional Operation operation = 1;
6686 // SIMx or eSEx.
6687 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006688
Alex Salod7c3eef2019-01-25 14:43:27 -08006689 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006690}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006691
6692/**
Alex Saloa060aee2019-01-21 14:36:41 -08006693 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6694 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006695 * Logged from:
6696 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6697 */
6698message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006699 optional int64 dispatch_latency_millis = 1;
6700}
6701
6702/**
6703 * Logs AttentionManagerService attention check result.
6704 *
6705 * Logged from:
6706 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6707 */
6708message AttentionManagerServiceResultReported {
6709 // See core/java/android/service/attention/AttentionService.java
6710 enum AttentionCheckResult {
6711 UNKNOWN = 20;
6712 ATTENTION_SUCCESS_ABSENT = 0;
6713 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006714 ATTENTION_FAILURE_UNKNOWN = 2;
6715 ATTENTION_FAILURE_CANCELLED = 3;
6716 ATTENTION_FAILURE_PREEMPTED = 4;
6717 ATTENTION_FAILURE_TIMED_OUT = 5;
6718 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006719 }
6720 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006721}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006722
6723/**
6724 * Logs when an adb connection changes state.
6725 *
6726 * Logged from:
6727 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6728 */
6729message AdbConnectionChanged {
6730 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6731 // previously selected for this system.
6732 optional int64 last_connection_time_millis = 1;
6733
6734 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6735 // to reconnect via adb without user interaction.
6736 optional int64 auth_window_millis = 2;
6737
6738 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6739 optional android.debug.AdbConnectionStateEnum state = 3;
6740
6741 // True if the 'always allow' option was selected for this system.
6742 optional bool always_allow = 4;
6743}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006744
6745/*
6746 * Logs the reported speech DSP status.
6747 *
6748 * Logged from:
6749 * Vendor audio implementation.
6750 */
6751message SpeechDspStatReported {
6752 // The total Speech DSP uptime in milliseconds.
6753 optional int32 total_uptime_millis = 1;
6754 // The total Speech DSP downtime in milliseconds.
6755 optional int32 total_downtime_millis = 2;
6756 optional int32 total_crash_count = 3;
6757 optional int32 total_recover_count = 4;
6758}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006759
6760/**
6761 * Logs USB connector contaminant status.
6762 *
6763 * Logged from: USB Service.
6764 */
6765message UsbContaminantReported {
6766 optional string id = 1;
6767 optional android.service.usb.ContaminantPresenceStatus status = 2;
6768}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006769
6770/**
6771 * This atom is for debugging purpose.
6772 */
6773message DebugElapsedClock {
6774 // Monotically increasing value for each pull.
6775 optional int64 pull_count = 1;
6776 // Time from System.elapsedRealtime.
6777 optional int64 elapsed_clock_millis = 2;
6778 // Time from System.elapsedRealtime.
6779 optional int64 same_elapsed_clock_millis = 3;
6780 // Diff between current elapsed time and elapsed time from previous pull.
6781 optional int64 elapsed_clock_diff_millis = 4;
6782
6783 enum Type {
6784 TYPE_UNKNOWN = 0;
6785 ALWAYS_PRESENT = 1;
6786 PRESENT_ON_ODD_PULLS = 2;
6787 }
6788 // Type of behavior for the pulled data.
6789 optional Type type = 5;
6790}
6791
6792/**
6793 * This atom is for debugging purpose.
6794 */
6795message DebugFailingElapsedClock {
6796 // Monotically increasing value for each pull.
6797 optional int64 pull_count = 1;
6798 // Time from System.elapsedRealtime.
6799 optional int64 elapsed_clock_millis = 2;
6800 // Time from System.elapsedRealtime.
6801 optional int64 same_elapsed_clock_millis = 3;
6802 // Diff between current elapsed time and elapsed time from previous pull.
6803 optional int64 elapsed_clock_diff_millis = 4;
6804}
Steven Wuacef6bb2019-01-23 14:21:17 -05006805
6806/** Logs System UI bubbles event changed.
6807 *
6808 * Logged from:
6809 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6810 */
6811message BubbleUIChanged {
6812
6813 // The app package that is posting the bubble.
6814 optional string package_name = 1;
6815
6816 // The notification channel that is posting the bubble.
6817 optional string notification_channel = 2;
6818
6819 // The notification id associated with the posted bubble.
6820 optional int32 notification_id = 3;
6821
6822 // The position of the bubble within the bubble stack.
6823 optional int32 position = 4;
6824
6825 // The total number of bubbles within the bubble stack.
6826 optional int32 total_number = 5;
6827
6828 // User interactions with the bubble.
6829 enum Action {
6830 UNKNOWN = 0;
6831 POSTED = 1;
6832 UPDATED = 2;
6833 EXPANDED = 3;
6834 COLLAPSED = 4;
6835 DISMISSED = 5;
6836 STACK_DISMISSED = 6;
6837 STACK_MOVED = 7;
6838 HEADER_GO_TO_APP = 8;
6839 HEADER_GO_TO_SETTINGS = 9;
6840 PERMISSION_OPT_IN = 10;
6841 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006842 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006843 SWIPE_LEFT = 13;
6844 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006845 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006846 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006847 }
6848 optional Action action = 6;
6849
6850 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6851 optional float normalized_x_position = 7;
6852 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006853
6854 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6855 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006856
6857 // Whether the bubble is an on-going one.
6858 optional bool is_ongoing = 10;
6859
6860 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006861 // This is deprecated and the value should be ignored.
6862 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006863}
Kweku Adams8845d012018-12-11 20:06:45 -08006864
6865/**
Steven Wu552f63f2019-02-05 13:41:36 -05006866 * Logs System UI bubbles developer errors.
6867 *
6868 * Logged from:
6869 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6870 */
6871message BubbleDeveloperErrorReported {
6872
6873 // The app package that is posting the bubble.
6874 optional string package_name = 1;
6875
6876 // Bubble developer error type enums.
6877 enum Error {
6878 UNKNOWN = 0;
6879 ACTIVITY_INFO_MISSING = 1;
6880 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6881 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6882 }
6883 optional Error error = 2 [default = UNKNOWN];
6884}
6885
6886/**
Kweku Adams8845d012018-12-11 20:06:45 -08006887 * Logs that a constraint for a scheduled job has changed.
6888 *
6889 * Logged from:
6890 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6891 */
6892message ScheduledJobConstraintChanged {
6893 repeated AttributionNode attribution_node = 1;
6894
6895 // Name of the job.
6896 optional string job_name = 2;
6897
6898 optional com.android.server.job.ConstraintEnum constraint = 3;
6899
6900 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006901 UNKNOWN = 0;
6902 UNSATISFIED = 1;
6903 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006904 }
6905 optional State state = 4;
6906}
Alex Salod7c3eef2019-01-25 14:43:27 -08006907
6908/**
6909 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6910 * returns true.
6911 *
6912 * Logged from:
6913 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6914 */
6915message ScreenTimeoutExtensionReported {
6916 // Describes how many times in a row did the power manager reset the screen off timeout.
6917 optional uint32 consecutive_timeout_extended_count = 1;
6918}
Hui Yu885aca12019-01-10 17:11:34 -08006919
6920/*
6921* Logs number of milliseconds it takes to start a process.
6922* The definition of app process start time is from the app launch time to
6923* the time that Zygote finished forking the app process and loaded the
6924* application package's java classes.
6925
6926* This metric is different from AppStartOccurred which is for foreground
6927* activity only.
6928
6929* ProcessStartTime can report all processes (both foreground and background)
6930* start time.
6931*
6932* Logged from:
6933* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6934*/
6935message ProcessStartTime {
6936 // The uid of the ProcessRecord.
6937 optional int32 uid = 1 [(is_uid) = true];
6938
6939 // The process pid.
6940 optional int32 pid = 2;
6941
6942 // The process name.
6943 // Usually package name, "system" for system server.
6944 // Provided by ActivityManagerService.
6945 optional string process_name = 3;
6946
6947 enum StartType {
6948 UNKNOWN = 0;
6949 WARM = 1;
6950 HOT = 2;
6951 COLD = 3;
6952 }
6953
6954 // The start type.
6955 optional StartType type = 4;
6956
6957 // The elapsed realtime at the start of the process.
6958 optional int64 process_start_time_millis = 5;
6959
6960 // Number of milliseconds it takes to reach bind application.
6961 optional int32 bind_application_delay_millis = 6;
6962
6963 // Number of milliseconds it takes to finish start of the process.
6964 optional int32 process_start_delay_millis = 7;
6965
6966 // hostingType field in ProcessRecord, the component type such as "activity",
6967 // "service", "content provider", "broadcast" or other strings.
6968 optional string hosting_type = 8;
6969
6970 // hostingNameStr field in ProcessRecord. The component class name that runs
6971 // in this process.
6972 optional string hosting_name = 9;
6973}
6974
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006975/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006976 * Track Media Codec usage
6977 * Logged from:
6978 * frameworks/av/media/libstagefright/MediaCodec.cpp
6979 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6980 */
6981message MediametricsCodecReported {
6982 optional int64 timestamp_nanos = 1;
6983 optional string package_name = 2;
6984 optional int64 package_version_code = 3;
6985 optional int64 media_apex_version = 4;
6986
6987 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6988}
6989
6990/**
6991 * Track Media Extractor (pulling video/audio streams out of containers) usage
6992 * Logged from:
6993 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6994 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6995 */
6996message MediametricsExtractorReported {
6997 optional int64 timestamp_nanos = 1;
6998 optional string package_name = 2;
6999 optional int64 package_version_code = 3;
7000 optional int64 media_apex_version = 4;
7001
7002 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7003}
7004
7005/**
7006 * Track how we arbitrate between microphone/input requests.
7007 * Logged from
7008 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7009 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7010 */
7011message MediametricsAudiopolicyReported {
7012 optional int64 timestamp_nanos = 1;
7013 optional string package_name = 2;
7014 optional int64 package_version_code = 3;
7015 optional int64 media_apex_version = 4;
7016
7017 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7018}
7019
7020/**
7021 * Track how we arbitrate between microphone requests.
7022 * Logged from
7023 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7024 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7025 */
7026message MediametricsAudiorecordReported {
7027 optional int64 timestamp_nanos = 1;
7028 optional string package_name = 2;
7029 optional int64 package_version_code = 3;
7030 optional int64 media_apex_version = 4;
7031
7032 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7033}
7034
7035/**
7036 * Track how we arbitrate between microphone/input requests.
7037 * Logged from
7038 * frameworks/av/media/libnblog/ReportPerformance.cpp
7039 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7040 */
7041message MediametricsAudiothreadReported {
7042 optional int64 timestamp_nanos = 1;
7043 optional string package_name = 2;
7044 optional int64 package_version_code = 3;
7045 optional int64 media_apex_version = 4;
7046
7047 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7048}
7049
7050/**
7051 * Track how we arbitrate between microphone/input requests.
7052 * Logged from
7053 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7054 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7055 */
7056message MediametricsAudiotrackReported {
7057 optional int64 timestamp_nanos = 1;
7058 optional string package_name = 2;
7059 optional int64 package_version_code = 3;
7060 optional int64 media_apex_version = 4;
7061
7062 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7063}
7064
7065/**
7066 * Track information about DRM framework performance
7067 * Logged from
7068 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7069 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7070 */
7071message MediametricsMediadrmReported {
7072 optional int64 timestamp_nanos = 1;
7073 optional string package_name = 2;
7074 optional int64 package_version_code = 3;
7075 optional int64 media_apex_version = 4;
7076
7077 // vendor+description tell about which DRM plugin is in use on this device
7078 optional string vendor = 5;
7079 optional string description = 6;
7080 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7081 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7082}
7083
7084/**
7085 * Track information about the widevine DRM plugin performance
7086 * Logged from
7087 * vendor/widevine/libwvdrmengine/cdm/metrics
7088 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7089 */
7090message MediametricsDrmWidevineReported {
7091 optional int64 timestamp_nanos = 1;
7092 optional string package_name = 2;
7093 optional int64 package_version_code = 3;
7094 optional int64 media_apex_version = 4;
7095
7096 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7097}
7098
7099/**
7100 * Track information about recordings (e.g. camcorder)
7101 * Logged from
7102 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7103 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7104 */
7105message MediametricsRecorderReported {
7106 optional int64 timestamp_nanos = 1;
7107 optional string package_name = 2;
7108 optional int64 package_version_code = 3;
7109 optional int64 media_apex_version = 4;
7110
7111 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7112}
7113
7114/**
7115 * Track Media Player usage
7116 * Logged from:
7117 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7118 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7119 */
7120message MediametricsNuPlayerReported {
7121 optional int64 timestamp_nanos = 1;
7122 optional string package_name = 2;
7123 optional int64 package_version_code = 3;
7124 optional int64 media_apex_version = 4;
7125
7126 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7127}
7128
7129/**
Robert Shiha4beed32019-08-19 14:15:23 -07007130 * Track Legacy DRM usage
7131 * Logged from
7132 * frameworks/av/drm/drmserver/DrmManager.cpp
7133 */
7134message MediametricsDrmManagerReported {
7135 optional int64 timestamp_nanos = 1;
7136 optional string package_name = 2;
7137 optional int64 package_version_code = 3;
7138 optional int64 media_apex_version = 4;
7139
7140 enum Method {
7141 METHOD_NOT_FOUND = -1;
7142 GET_CONSTRAINTS = 0;
7143 GET_METADATA = 1;
7144 CAN_HANDLE = 2;
7145 PROCESS_DRM_INFO = 3;
7146 ACQUIRE_DRM_INFO = 4;
7147 SAVE_RIGHTS = 5;
7148 GET_ORIGINAL_MIME_TYPE = 6;
7149 GET_DRM_OBJECT_TYPE = 7;
7150 CHECK_RIGHTS_STATUS = 8;
7151 REMOVE_RIGHTS = 9;
7152 REMOVE_ALL_RIGHTS = 10;
7153 OPEN_CONVERT_SESSION = 11;
7154 OPEN_DECRYPT_SESSION = 12;
7155 }
7156
7157 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7158 optional string plugin_id = 5;
7159 optional string description = 6;
7160 optional Method method = 7;
7161 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007162
7163 optional int64 get_constraints_count = 9;
7164 optional int64 get_metadata_count = 10;
7165 optional int64 can_handle_count = 11;
7166 optional int64 process_drm_info_count = 12;
7167 optional int64 acquire_drm_info_count = 13;
7168 optional int64 save_rights_count = 14;
7169 optional int64 get_original_mime_type_count = 15;
7170 optional int64 get_drm_object_type_count = 16;
7171 optional int64 check_rights_status_count = 17;
7172 optional int64 remove_rights_count = 18;
7173 optional int64 remove_all_rights_count = 19;
7174 optional int64 open_convert_session_count = 20;
7175 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007176}
7177
7178/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007179 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007180 * Pulled from: StatsCompanionService
7181*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007182message DangerousPermissionState {
7183 // Name of the permission
7184 optional string permission_name = 1;
7185
7186 // Uid of the package
7187 optional int32 uid = 2 [(is_uid) = true];
7188
7189 // Package requesting the permission
7190 optional string package_name = 3;
7191
7192 // If the permission is granted to the uid
7193 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007194
7195 // Permission flags as per android.content.pm.PermissionFlags
7196 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007197}
7198
Michael Groover4a0ca942019-01-24 17:41:25 -08007199/**
7200 * Logs when a package is denied access to a device identifier based on the new access requirements.
7201 *
7202 * Logged from:
7203 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7204 */
7205message DeviceIdentifierAccessDenied {
7206 // The name of the package denied access to the requested device identifier.
7207 optional string package_name = 1;
7208
7209 // The name of the device identifier method the package attempted to invoke.
7210 optional string method_name = 2;
7211
7212 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007213 // Starting from Android 11, this boolean is not set and will always be false.
7214 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007215
7216 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007217 // Starting from Android 11, this boolean is not set and will always be false.
7218 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007219}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007220
7221/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007222 * Pulls the ongoing mainline install train version code.
7223 * Pulled from StatsCompanionService
7224 */
7225message TrainInfo {
7226 optional int64 train_version_code = 1;
7227
7228 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007229
7230 optional string train_name = 3;
7231
7232 enum Status {
7233 UNKNOWN = 0;
7234 INSTALL_REQUESTED = 1;
7235 INSTALL_STARTED = 2;
7236 INSTALL_STAGED_NOT_READY = 3;
7237 INSTALL_STAGED_READY = 4;
7238 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007239 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7240 // and INSTALL_FAILURE_COMMIT.
7241 INSTALL_FAILURE = 6 [deprecated = true];
7242 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007243 INSTALL_CANCELLED = 7;
7244 INSTALLER_ROLLBACK_REQUESTED = 8;
7245 INSTALLER_ROLLBACK_INITIATED = 9;
7246 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7247 INSTALLER_ROLLBACK_STAGED = 11;
7248 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7249 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7250 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7251 INSTALLER_ROLLBACK_SUCCESS = 15;
7252 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007253 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7254 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7255 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7256 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7257 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7258 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007259 INSTALL_FAILURE_DOWNLOAD = 23;
7260 INSTALL_FAILURE_STATE_MISMATCH = 24;
7261 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007262 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007263 }
7264 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007265}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007266
7267/**
7268 * Logs the gesture stage changed event.
7269 *
7270 * Logged from:
7271 * frameworks/base/packages/SystemUI/
7272 */
7273message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007274 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007275}
7276
7277/**
7278 * Logs the feedback type.
7279 *
7280 * Logged from:
7281 * frameworks/base/packages/SystemUI/
7282 */
7283message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007284 // Whether or not the gesture was used.
7285 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007286}
7287
7288/**
7289 * Logs the progress.
7290 *
7291 * Logged from:
7292 * frameworks/base/packages/SystemUI/
7293 */
7294message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007295 // [0,100] progress for the assist gesture.
7296 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007297}
Neil Fullerdb14b482019-02-05 19:44:44 +00007298
7299/*
7300 * Information about the time zone data on a device.
7301 */
7302message TimeZoneDataInfo {
7303 // A version identifier for the data set on device. e.g. "2018i"
7304 optional string tzdb_version = 1;
7305}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007306
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007307/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007308 * Logs the GPU stats global health information.
7309 *
7310 * Logged from:
7311 * frameworks/native/services/gpuservice/gpustats/
7312 */
7313message GpuStatsGlobalInfo {
7314 // Package name of the gpu driver.
7315 optional string driver_package_name = 1;
7316
7317 // Version name of the gpu driver.
7318 optional string driver_version_name = 2;
7319
7320 // Version code of the gpu driver.
7321 optional int64 driver_version_code = 3;
7322
7323 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7324 optional int64 driver_build_time = 4;
7325
7326 // Total count of the gl driver gets loaded.
7327 optional int64 gl_loading_count = 5;
7328
7329 // Total count of the gl driver fails to be loaded.
7330 optional int64 gl_loading_failure_count = 6;
7331
7332 // Total count of the Vulkan driver gets loaded.
7333 optional int64 vk_loading_count = 7;
7334
7335 // Total count of the Vulkan driver fails to be loaded.
7336 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007337
7338 // Api version of the system Vulkan driver.
7339 optional int32 vulkan_version = 9;
7340
7341 // Api version of the system CPU Vulkan driver.
7342 optional int32 cpu_vulkan_version = 10;
7343
7344 // Api version of the system GLES driver.
7345 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007346
7347 // Total count of the angle driver gets loaded.
7348 optional int64 angle_loading_count = 12;
7349
7350 // Total count of the angle driver fails to be loaded.
7351 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007352}
7353
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007354/**
7355 * GPU driver loading time info.
7356 */
7357message GpuDriverLoadingTime {
7358 // List of all the driver loading times for this app. The list size is
7359 // capped at 50.
7360 repeated int64 driver_loading_time = 1;
7361}
7362
7363/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007364 * Logs the GPU stats per app health information.
7365 *
7366 * Logged from:
7367 * frameworks/native/services/gpuservice/gpustats/
7368 */
7369message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007370 // Package name of the application that loads the gpu driver. Total number
7371 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007372 optional string app_package_name = 1;
7373
7374 // Version code of the gpu driver this app loads.
7375 optional int64 driver_version_code = 2;
7376
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007377 // gl driver loading time info.
7378 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7379 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007380
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007381 // Vulkan driver loading time info.
7382 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7383 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007384
7385 // Angle driver loading time info.
7386 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7387 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007388
7389 // CPU Vulkan implementation is in use.
7390 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007391
7392 // App is not doing pre-rotation correctly.
7393 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007394
7395 // App creates GLESv1 context.
7396 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007397}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007398
7399/*
7400 * Logs the size of the system ion heap.
7401 *
7402 * Pulled from StatsCompanionService.
7403 */
7404message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007405 // Deprecated due to limited support of ion stats in debugfs.
7406 // Use `IonHeapSize` instead.
7407 option deprecated = true;
7408
Rafal Slawikd4e87572019-03-12 13:08:38 +00007409 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007410 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007411 optional int64 size_in_bytes = 1;
7412}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007413
Rafal Slawik77987ed2019-06-17 12:28:23 +01007414/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007415 * Logs the total size of the ion heap.
7416 *
7417 * Pulled from StatsCompanionService.
7418 */
7419message IonHeapSize {
7420 // Total size of all ion heaps in kilobytes.
7421 // Read from: /sys/kernel/ion/total_heaps_kb.
7422 optional int32 total_size_kb = 1;
7423}
7424
7425/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007426 * Logs the per-process size of the system ion heap.
7427 *
7428 * Pulled from StatsCompanionService.
7429 */
7430message ProcessSystemIonHeapSize {
7431 // The uid if available. -1 means not available.
7432 optional int32 uid = 1 [(is_uid) = true];
7433
7434 // The process name (from /proc/PID/cmdline).
7435 optional string process_name = 2;
7436
7437 // Sum of sizes of all allocations.
7438 optional int32 total_size_in_kilobytes = 3;
7439
7440 // Number of allocations.
7441 optional int32 allocation_count = 4;
7442
7443 // Size of the largest allocation.
7444 optional int32 max_size_in_kilobytes = 5;
7445}
7446
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007447/**
7448 * Push network stack events.
7449 *
7450 * Log from:
7451 * frameworks/base/packages/NetworkStack/
7452 */
7453message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007454 // The id that indicates the event reported from NetworkStack.
7455 optional int32 event_id = 1;
7456 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007457 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7458}
Carmen Agimofa769c152019-03-04 14:39:14 +00007459
7460/**
7461 * Logs the apps that are installed on the external storage.
7462 * Pulled from:
7463 * StatsCompanionService
7464 */
7465message AppsOnExternalStorageInfo {
7466 // The type of the external storage.
7467 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7468 // The name of the package that is installed on the external storage.
7469 optional string package_name = 2;
7470}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007471
7472/**
7473 * Logs the settings related to Face.
7474 * Logged from:
7475 * frameworks/base/services/core/java/com/android/server/stats
7476 */
7477message FaceSettings {
7478 // Whether or not face unlock is allowed on Keyguard.
7479 optional bool unlock_keyguard_enabled = 1;
7480 // Whether or not face unlock dismisses the Keyguard.
7481 optional bool unlock_dismisses_keyguard = 2;
7482 // Whether or not face unlock requires attention.
7483 optional bool unlock_attention_required = 3;
7484 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7485 optional bool unlock_app_enabled = 4;
7486 // Whether or not face unlock always requires user confirmation.
7487 optional bool unlock_always_require_confirmation = 5;
7488 // Whether or not a diverse set of poses are required during enrollment.
7489 optional bool unlock_diversity_required = 6;
7490}
Maggie White442b6312019-04-05 16:26:44 -07007491
7492/**
7493 * Logs cooling devices maintained by the kernel.
7494 *
7495 * Pulled from StatsCompanionService.java
7496 */
7497message CoolingDevice {
7498 // The type of cooling device being reported. Eg. CPU, GPU...
7499 optional android.os.CoolingTypeEnum device_location = 1;
7500 // The name of the cooling device source. Eg. CPU0
7501 optional string device_name = 2;
7502 // Current throttle state of the cooling device. The value can any unsigned
7503 // integer between 0 and max_state defined in its driver. 0 means device is
7504 // not in throttling, higher value means deeper throttling.
7505 optional int32 state = 3;
7506}
Ben Blount763a5d52019-04-10 11:48:58 -07007507
7508/**
7509 * Intelligence has several counter-type events that don't warrant a
7510 * full separate atom. These are primarily API call counters but also include
7511 * counters for feature usage and specific failure modes.
7512 *
7513 * Logged from the Intelligence mainline module.
7514 */
7515message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007516 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007517 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007518 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007519 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007520 // How many times the event occured (to report a batch of high frequency events).
7521 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007522 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007523 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007524}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007525
7526/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007527 * Logs when Car Power state changed.
7528 *
7529 * Logged from:
7530 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7531 */
7532message CarPowerStateChanged {
7533 // States come from CpmsState in CarPowerManagementService.java.
7534 enum State {
7535 WAIT_FOR_VHAL = 0;
7536 ON = 1;
7537 SHUTDOWN_PREPARE = 2;
7538 WAIT_FOR_FINISH = 3;
7539 SUSPEND = 4;
7540 SIMULATE_SLEEP = 5;
7541 }
7542 optional State state = 1;
7543}
7544
7545/**
7546 * Logs whether GarageMode is entered.
7547 *
7548 * Logged from:
7549 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7550 */
7551message GarageModeInfo {
7552 // Whether GarageMode is entered.
7553 optional bool is_garage_mode = 1;
7554}
Martijn Coenencd95d462019-04-25 17:09:45 +02007555
7556/**
7557 * Historical app ops data per package.
7558 */
7559message AppOps {
7560 // Uid of the package requesting the op
7561 optional int32 uid = 1 [(is_uid) = true];
7562
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007563 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007564 optional string package_name = 2;
7565
7566 // operation id; maps to the OP_* constants in AppOpsManager.java
7567 optional int32 op_id = 3;
7568
7569 // The number of times the op was granted while the app was in the
7570 // foreground (only for trusted requests)
7571 optional int64 trusted_foreground_granted_count = 4;
7572
7573 // The number of times the op was granted while the app was in the
7574 // background (only for trusted requests)
7575 optional int64 trusted_background_granted_count = 5;
7576
7577 // The number of times the op was rejected while the app was in the
7578 // foreground (only for trusted requests)
7579 optional int64 trusted_foreground_rejected_count = 6;
7580
7581 // The number of times the op was rejected while the app was in the
7582 // background (only for trusted requests)
7583 optional int64 trusted_background_rejected_count = 7;
7584
7585 // For long-running operations, total duration of the operation
7586 // while the app was in the foreground (only for trusted requests)
7587 optional int64 trusted_foreground_duration_millis = 8;
7588
7589 // For long-running operations, total duration of the operation
7590 // while the app was in the background (only for trusted requests)
7591 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007592
7593 // Whether AppOps is guarded by Runtime permission
7594 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007595}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007596
7597/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007598 * Historical app ops data per package and features.
7599 */
7600message AppFeaturesOps {
7601 // Uid of the package requesting the op
7602 optional int32 uid = 1 [(is_uid) = true];
7603
7604 // Name of the package performing the op
7605 optional string package_name = 2;
7606
7607 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7608 // Features must be provided through manifest using <feature> tag available in R and above.
7609 optional string feature_id = 3;
7610
7611 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7612 optional string op = 4;
7613
7614 // The number of times the op was granted while the app was in the
7615 // foreground (only for trusted requests)
7616 optional int64 trusted_foreground_granted_count = 5;
7617
7618 // The number of times the op was granted while the app was in the
7619 // background (only for trusted requests)
7620 optional int64 trusted_background_granted_count = 6;
7621
7622 // The number of times the op was rejected while the app was in the
7623 // foreground (only for trusted requests)
7624 optional int64 trusted_foreground_rejected_count = 7;
7625
7626 // The number of times the op was rejected while the app was in the
7627 // background (only for trusted requests)
7628 optional int64 trusted_background_rejected_count = 8;
7629
7630 // For long-running operations, total duration of the operation
7631 // while the app was in the foreground (only for trusted requests)
7632 optional int64 trusted_foreground_duration_millis = 9;
7633
7634 // For long-running operations, total duration of the operation
7635 // while the app was in the background (only for trusted requests)
7636 optional int64 trusted_background_duration_millis = 10;
7637
7638 // Whether AppOps is guarded by Runtime permission
7639 optional bool is_runtime_permission = 11;
7640}
7641
7642/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007643 * Location Manager API Usage information(e.g. API under usage,
7644 * API call's parameters).
7645 * Logged from:
7646 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7647 */
7648message LocationManagerApiUsageReported {
7649
7650 // Indicating if usage starts or usage ends.
7651 optional android.stats.location.UsageState state = 1;
7652
7653 // LocationManagerService's API in use.
7654 // We can identify which API from LocationManager is
7655 // invoking current LMS API by the combination of
7656 // API parameter(e.g. is_listener_null, is_intent_null,
7657 // is_location_request_null)
7658 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7659
7660 // Name of the package calling the API.
7661 optional string calling_package_name = 3;
7662
7663 // Type of the location provider.
7664 optional android.stats.location.ProviderType provider = 4;
7665
7666 // Quality of the location request
7667 optional android.stats.location.LocationRequestQuality quality = 5;
7668
7669 // The desired interval for active location updates, in milliseconds.
7670 // Bucketized to reduce cardinality.
7671 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7672
7673 // Minimum distance between location updates, in meters.
7674 // Bucketized to reduce cardinality.
7675 optional android.stats.location.SmallestDisplacementBucket
7676 bucketized_smallest_displacement = 7;
7677
7678 // The number of location updates.
7679 optional int64 num_updates = 8;
7680
7681 // The request expiration time, in millisecond since boot.
7682 // Bucketized to reduce cardinality.
7683 optional android.stats.location.ExpirationBucket
7684 bucketized_expire_in = 9;
7685
7686 // Type of Callback passed in for this API.
7687 optional android.stats.location.CallbackType callback_type = 10;
7688
7689 // The radius of the central point of the alert
7690 // region, in meters. Only for API REQUEST_GEOFENCE.
7691 // Bucketized to reduce cardinality.
7692 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7693
7694 // Activity Importance of API caller.
7695 // Categorized to 3 types that are interesting from location's perspective.
7696 optional android.stats.location.ActivityImportance activiy_importance = 12;
7697}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007698
7699/**
7700 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7701 */
7702message ReviewPermissionsFragmentResultReported {
7703 // unique value identifying a permission group change. A permission group change might result
7704 // in multiple of these atoms
7705 optional int64 change_id = 1;
7706
7707 // UID of package the permission belongs to
7708 optional int32 uid = 2 [(is_uid) = true];
7709
7710 // Name of package the permission belongs to
7711 optional string package_name = 3;
7712
7713 // The permission to be granted
7714 optional string permission_name = 4;
7715
7716 // The result of the permission grant
7717 optional bool permission_granted = 5;
7718}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007719
7720/**
7721* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7722* Logged from: RuntimePermissionUpdgradeController
7723*/
7724message RuntimePermissionsUpgradeResult {
7725 // Permission granted as result of upgrade
7726 optional string permission_name = 1;
7727
7728 // UID of package granted permission
7729 optional int32 uid = 2 [(is_uid) = true];
7730
7731 // Name of package granted permission
7732 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007733}
7734
7735/**
7736* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7737*/
7738message GrantPermissionsActivityButtonActions {
7739 // Permission granted as result of upgrade
7740 optional string permission_group_name = 1;
7741
7742 // UID of package granted permission
7743 optional int32 uid = 2 [(is_uid) = true];
7744
7745 // Name of package requesting permission
7746 optional string package_name = 3;
7747
7748 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7749 // LABEL_ constants in GrantPermissionActivity.java
7750 optional int32 buttons_presented = 4;
7751
7752 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7753 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007754
7755 // id which identifies single session of user interacting with permission controller
7756 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007757}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007758
7759/**
7760 * Information about LocationAccessCheck notification presented to user
7761 */
7762message LocationAccessCheckNotificationAction {
7763
7764 // id which identifies single session of user interacting with permission controller
7765 optional int64 session_id = 1;
7766
7767 // Uid of package for which location access check is presented
7768 optional int32 package_uid = 2;
7769
7770 // Name of package for which location access check is presented
7771 optional string package_name = 3;
7772
7773 enum Result {
7774 UNDEFINED = 0;
7775 // notification was presented to the user
7776 NOTIFICATION_PRESENTED = 1;
7777 // notification was declined by the user
7778 NOTIFICATION_DECLINED = 2;
7779 // notification was clicked by the user
7780 NOTIFICATION_CLICKED = 3;
7781 }
7782
7783 // View / interaction recorded
7784 optional Result result = 4;
7785}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007786
7787/**
7788 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7789 */
7790message AppPermissionFragmentActionReported {
7791 // id which identifies single session of user interacting with permission controller
7792 optional int64 session_id = 1;
7793
7794 // unique value identifying a permission group change. A permission group change might result
7795 // in multiple of these atoms
7796 optional int64 change_id = 2;
7797
7798 // UID of package the permission belongs to
7799 optional int32 uid = 3 [(is_uid) = true];
7800
7801 // Name of package the permission belongs to
7802 optional string package_name = 4;
7803
7804 // The permission to be granted
7805 optional string permission_name = 5;
7806
7807 // The result of the permission grant
7808 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007809
7810 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7811 optional int32 permission_flags = 7;
7812
7813 enum Button {
7814 UNDEFINED = 0;
7815 // Allow button
7816 ALLOW = 1;
7817 // Deny button
7818 DENY = 2;
7819 // Ask every time button
7820 ASK_EVERY_TIME = 3;
7821 // Allow all the time button
7822 ALLOW_ALWAYS = 4;
7823 // Allow only while using the app button
7824 ALLOW_FOREGROUND = 5;
7825 // Same is Deny button but shown in while in use dialog
7826 DENY_FOREGROUND = 6;
7827 }
7828
7829 // Button pressed in the dialog
7830 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007831}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007832
7833/**
7834* Information about a AppPermissionFragment viewed by user
7835*/
7836message AppPermissionFragmentViewed {
7837 // id which identifies single session of user interacting with permission controller
7838 optional int64 session_id = 1;
7839
7840 // UID of package for which permissions are viewed
7841 optional int32 uid = 2 [(is_uid) = true];
7842
7843 // Name of package for which permissions are viewed
7844 optional string package_name = 3;
7845
7846 // Permission group viewed
7847 optional string permission_group_name = 4;
7848}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007849
7850/**
7851* Information about a AppPermissionsFragment viewed by user
7852*/
7853message AppPermissionsFragmentViewed {
7854 // id which identifies single session of user interacting with permission controller
7855 optional int64 session_id = 1;
7856
7857 // id which identifies single view as every view might have several logging records
7858 // with different package information attached
7859 optional int64 view_id = 2;
7860
7861 // Permission group viewed
7862 optional string permission_group_name = 3;
7863
7864 // UID of package for which permissions are viewed
7865 optional int32 uid = 4 [(is_uid) = true];
7866
7867 // Name of package for which permissions are viewed
7868 optional string package_name = 5;
7869
7870 // Category in which permission is included
7871 enum Category {
7872 UNDEFINED = 0;
7873 ALLOWED = 1;
7874 ALLOWED_FOREGROUND = 2;
7875 DENIED = 3;
7876 }
7877 optional Category category = 6;
7878}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007879
7880/**
7881* Information about a PermissionAppsFragment viewed by user.
7882* Logged from ui/handheld/PermissionAppsFragment.java
7883*/
7884message PermissionAppsFragmentViewed {
7885 // id which identifies single session of user interacting with permission controller
7886 optional int64 session_id = 1;
7887
7888 // id which identifies single view as every view might have several logging records
7889 // with different package information attached
7890 optional int64 view_id = 2;
7891
7892 // Permission group viewed
7893 optional string permission_group_name = 3;
7894
7895 // UID of package for which permissions are viewed
7896 optional int32 uid = 4 [(is_uid) = true];
7897
7898 // Name of package for which permissions are viewed
7899 optional string package_name = 5;
7900
7901 // Category in which app is included
7902 enum Category {
7903 UNDEFINED = 0;
7904 ALLOWED = 1;
7905 ALLOWED_FOREGROUND = 2;
7906 DENIED = 3;
7907 }
7908 optional Category category = 6;
7909}
Tony Make2b1b672019-07-29 16:59:47 +01007910
7911/**
7912 * Logs when there is a smart selection related event.
7913 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7914 * Logged from: TextClassifierEventLogger.java
7915 */
7916message TextSelectionEvent {
7917 // A session ID.
7918 optional string session_id = 1;
7919
7920 // Event type of this event.
7921 optional android.stats.textclassifier.EventType event_type = 2;
7922
Tony Mak9c84bd22019-12-09 07:27:25 +00007923 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007924 optional string model_name = 3;
7925
7926 // Type of widget that was involved in triggering this event.
7927 optional android.stats.textclassifier.WidgetType widget_type = 4;
7928
7929 // Index of this event in a session.
7930 optional int32 event_index = 5;
7931
7932 // Entity type that is involved.
7933 optional string entity_type = 6;
7934
7935 // Relative word index of the start of the selection.
7936 optional int32 relative_word_start_index = 7;
7937
7938 // Relative word (exclusive) index of the end of the selection.
7939 optional int32 relative_word_end_index = 8;
7940
7941 // Relative word index of the start of the smart selection.
7942 optional int32 relative_suggested_word_start_index = 9;
7943
7944 // Relative word (exclusive) index of the end of the smart selection.
7945 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007946
7947 // Name of source package.
7948 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007949}
7950
7951/**
7952 * Logs when there is a smart linkify related event.
7953 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7954 * Logged from: TextClassifierEventLogger.java
7955 */
7956message TextLinkifyEvent {
7957 // A session ID.
7958 optional string session_id = 1;
7959
7960 // Event type of this event.
7961 optional android.stats.textclassifier.EventType event_type = 2;
7962
Tony Mak9c84bd22019-12-09 07:27:25 +00007963 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007964 optional string model_name = 3;
7965
7966 // Type of widget that was involved in triggering this event.
7967 optional android.stats.textclassifier.WidgetType widget_type = 4;
7968
7969 // Index of this event in a session.
7970 optional int32 event_index = 5;
7971
7972 // Entity type that is involved.
7973 optional string entity_type = 6;
7974
7975 // Number of links detected.
7976 optional int32 num_links = 7;
7977
7978 // The total length of all links.
7979 optional int32 linked_text_length = 8;
7980
7981 // Length of input text.
7982 optional int32 text_length = 9;
7983
7984 // Time spent on generating links in ms.
7985 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007986
7987 // Name of source package.
7988 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007989}
7990
7991/**
7992 * Logs when there is a conversation actions related event.
7993 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7994 * Logged from: TextClassifierEventLogger.java
7995 */
7996message ConversationActionsEvent {
7997 // A session ID.
7998 optional string session_id = 1;
7999
8000 // Event type of this event.
8001 optional android.stats.textclassifier.EventType event_type = 2;
8002
Tony Mak9c84bd22019-12-09 07:27:25 +00008003 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008004 optional string model_name = 3;
8005
8006 // Type of widget that was involved in triggering this event.
8007 optional android.stats.textclassifier.WidgetType widget_type = 4;
8008
8009 // The first entity type that is involved.
8010 optional string first_entity_type = 5;
8011
8012 // The second entity type that is involved.
8013 optional string second_entity_type = 6;
8014
8015 // The third entity type that is involved.
8016 optional string third_entity_type = 7;
8017
8018 // The score of the first entity type.
8019 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008020
8021 // Name of source package.
8022 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008023
8024 // Name of the annotator model that is involved in this event.
8025 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008026}
8027
8028/**
8029 * Logs when there is a language detection related event.
8030 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8031 * Logged from: TextClassifierEventLogger.java
8032 */
8033message LanguageDetectionEvent {
8034 // A session ID.
8035 optional string session_id = 1;
8036
8037 // Event type of this event.
8038 optional android.stats.textclassifier.EventType event_type = 2;
8039
Tony Mak9c84bd22019-12-09 07:27:25 +00008040 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008041 optional string model_name = 3;
8042
8043 // Type of widget that was involved in triggering this event.
8044 optional android.stats.textclassifier.WidgetType widget_type = 4;
8045
8046 // Detected language.
8047 optional string language_tag = 5;
8048
8049 // Score of the detected language.
8050 optional float score = 6;
8051
8052 // Position of this action.
8053 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008054
8055 // Name of source package.
8056 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008057}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008058
8059/**
8060 * Information about an OTA update attempt by update_engine.
8061 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8062 */
8063message UpdateEngineUpdateAttemptReported {
8064 // The number of attempts for the update engine to apply a given payload.
8065 optional int32 attempt_number = 1;
8066
8067 optional android.stats.otaupdate.PayloadType payload_type = 2;
8068
8069 // The total time in minutes for the update engine to apply a given payload.
8070 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8071 // it's increased when the system is sleeping.
8072 optional int32 duration_boottime_in_minutes = 3;
8073
8074 // The total time in minutes for the update engine to apply a given payload.
8075 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8076 // and it's not increased when the system is sleeping.
8077 optional int32 duration_monotonic_in_minutes = 4;
8078
8079 // The size of the payload in MiBs.
8080 optional int32 payload_size_mib = 5;
8081
8082 // The attempt result reported by the update engine for an OTA update.
8083 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8084
8085 // The error code reported by the update engine after an OTA update attempt
8086 // on A/B devices.
8087 optional android.stats.otaupdate.ErrorCode error_code = 7;
8088
8089 // The build fingerprint of the source system. The value is read from a
8090 // system property when the device takes the update. e.g.
8091 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8092 optional string source_fingerprint = 8;
8093}
8094
8095/**
8096 * Information about all the attempts the device make before finishing the
8097 * successful update.
8098 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8099 */
8100message UpdateEngineSuccessfulUpdateReported {
8101 // The number of attempts for the update engine to apply the payload for a
8102 // successful update.
8103 optional int32 attempt_count = 1;
8104
8105 optional android.stats.otaupdate.PayloadType payload_type = 2;
8106
8107 optional int32 payload_size_mib = 3;
8108
8109 // The total number of bytes downloaded by update_engine since the last
8110 // successful update.
8111 optional int32 total_bytes_downloaded_mib = 4;
8112
8113 // The ratio in percentage of the over-downloaded bytes compared to the
8114 // total bytes needed to successfully install the update. e.g. 200 if we
8115 // download 200MiB in total for a 100MiB package.
8116 optional int32 download_overhead_percentage = 5;
8117
8118 // The total time in minutes for the update engine to apply the payload for a
8119 // successful update.
8120 optional int32 total_duration_minutes = 6;
8121
8122 // The number of reboot of the device during a successful update.
8123 optional int32 reboot_count = 7;
8124}
Alec Mourie088e762019-07-02 13:10:55 -07008125
8126/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008127 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8128 * key to indicate whether it was successful or not.
8129 *
8130 * Logged from:
8131 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8132 */
8133message RebootEscrowRecoveryReported {
8134 optional bool successful = 1;
8135}
8136
8137/**
Alec Mourie088e762019-07-02 13:10:55 -07008138 * Global display pipeline metrics reported by SurfaceFlinger.
8139 * Pulled from:
8140 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8141 */
8142message SurfaceflingerStatsGlobalInfo {
8143 // Total number of frames presented during the tracing period
8144 optional int64 total_frames = 1;
8145 // Total number of frames missed
8146 optional int64 missed_frames = 2;
8147 // Total number of frames that fell back to client composition
8148 optional int64 client_composition_frames = 3;
8149 // Total time the display was turned on
8150 optional int64 display_on_millis = 4;
8151 // Total time that was spent performing animations.
8152 // This is derived from the present-to-present layer histogram
8153 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008154 // Total number of event connections tracked by SurfaceFlinger at the time
8155 // of this pull. If this number grows prohibitively large, then this can
8156 // cause jank due to resource contention.
8157 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008158 // Set of timings measured from when SurfaceFlinger began compositing a
8159 // frame, until the frame was requested to be presented to the display. This
8160 // measures SurfaceFlinger's total CPU walltime on the critical path per
8161 // frame.
8162 optional FrameTimingHistogram frame_duration = 7
8163 [(android.os.statsd.log_mode) = MODE_BYTES];
8164 // Set of timings measured from when SurfaceFlinger first began using the
8165 // GPU to composite a frame, until the GPU has finished compositing that
8166 // frame. This measures the total additional time SurfaceFlinger needed to
8167 // perform due to falling back into GPU composition.
8168 optional FrameTimingHistogram render_engine_timing = 8
8169 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008170}
8171
8172/**
8173 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8174 * The number of layers uploaded will be restricted due to size limitations.
8175 * Pulled from:
8176 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8177 */
8178message SurfaceflingerStatsLayerInfo {
8179 // The layer for this set of metrics
8180 // For now we can infer that the package name is included in the layer
8181 // name.
8182 optional string layer_name = 1;
8183 // Total number of frames presented
8184 optional int64 total_frames = 2;
8185 // Total number of dropped frames while latching a buffer for this layer.
8186 optional int64 dropped_frames = 3;
8187 // Set of timings measured between successive presentation timestamps.
8188 optional FrameTimingHistogram present_to_present = 4
8189 [(android.os.statsd.log_mode) = MODE_BYTES];
8190 // Set of timings measured from when an app queued a buffer for
8191 // presentation, until the buffer was actually presented to the
8192 // display.
8193 optional FrameTimingHistogram post_to_present = 5
8194 [(android.os.statsd.log_mode) = MODE_BYTES];
8195 // Set of timings measured from when a buffer is ready to be presented,
8196 // until the buffer was actually presented to the display.
8197 optional FrameTimingHistogram acquire_to_present = 6
8198 [(android.os.statsd.log_mode) = MODE_BYTES];
8199 // Set of timings measured from when a buffer was latched by
8200 // SurfaceFlinger, until the buffer was presented to the display
8201 optional FrameTimingHistogram latch_to_present = 7
8202 [(android.os.statsd.log_mode) = MODE_BYTES];
8203 // Set of timings measured from the desired presentation to the actual
8204 // presentation time
8205 optional FrameTimingHistogram desired_to_present = 8
8206 [(android.os.statsd.log_mode) = MODE_BYTES];
8207 // Set of timings measured from when an app queued a buffer for
8208 // presentation, until the buffer was ready to be presented.
8209 optional FrameTimingHistogram post_to_acquire = 9
8210 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008211 // Frames missed latch because the acquire fence didn't fire
8212 optional int64 late_acquire_frames = 10;
8213 // Frames latched early because the desired present time was bad
8214 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008215}
8216
8217/**
8218 * Histogram of frame counts bucketed by time in milliseconds.
8219 * Because of size limitations, we hard-cap the number of buckets, with
8220 * buckets for corresponding to larger milliseconds being less precise.
8221 */
8222message FrameTimingHistogram {
8223 // Timings in milliseconds that describes a set of histogram buckets
8224 repeated int32 time_millis_buckets = 1;
8225 // Number of frames that match to each time_millis, i.e. the bucket
8226 // contents
8227 // It's required that len(time_millis) == len(frame_count)
8228 repeated int64 frame_counts = 2;
8229}
Emilian Peev6729f372019-08-29 09:14:09 -07008230
Emilian Peev6729f372019-08-29 09:14:09 -07008231/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008232 * Janky event as reported by SurfaceFlinger.
8233 * This event is intended to be consumed by a Perfetto subscriber for
8234 * automated trace collection.
8235 *
8236 * Logged from:
8237 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8238 */
8239message DisplayJankReported {
8240 // Informational field for how long the janky event lasted in milliseconds
8241 optional int64 event_duration_millis = 1;
8242 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8243 // the display on time.
8244 optional int32 present_deadlines_missed = 2;
8245}
8246
8247/**
Emilian Peev6729f372019-08-29 09:14:09 -07008248 * Information about camera facing and API level usage.
8249 * Logged from:
8250 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8251 */
8252message CameraActionEvent {
8253 // Camera session duration
8254 optional int64 duration = 1;
8255
8256 // Camera API level used
8257 optional int32 api_level = 2;
8258
8259 // Name of client package
8260 optional string package_name = 3;
8261
8262 // Camera facing
8263 enum Facing {
8264 UNKNOWN = 0;
8265 BACK = 1;
8266 FRONT = 2;
8267 EXTERNAL = 3;
8268 }
8269 optional Facing facing = 4;
8270}
atrost01a20932019-08-28 15:40:37 +01008271
8272/**
8273 * Logs when a compatibility change is affecting an app.
8274 *
8275 * Logged from:
8276 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8277 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8278 */
8279message AppCompatibilityChangeReported {
8280 // The UID of the app being affected by the compatibilty change.
8281 optional int32 uid = 1 [(is_uid) = true];
8282
8283 // The ID of the change affecting the app.
8284 optional int64 change_id = 2;
8285
8286 enum State {
8287 UNKNOWN_STATE = 0;
8288 ENABLED = 1;
8289 DISABLED = 2;
8290 LOGGED = 3;
8291 }
8292
8293 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8294 // logged otherwise.
8295 optional State state = 3;
8296
8297 enum Source {
8298 UNKNOWN_SOURCE = 0;
8299 APP_PROCESS = 1;
8300 SYSTEM_SERVER = 2;
8301 }
8302
8303 // Where it was logged from.
8304 optional Source source = 4;
8305
8306}
Hector Dearman40579f62019-11-01 13:19:30 +00008307
8308/**
8309 * Logged from
8310 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8311 */
8312message PerfettoUploaded {
8313 enum Event {
8314 PERFETTO_UNDEFINED = 0;
8315 PERFETTO_TRACE_BEGIN = 1;
8316 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8317 PERFETTO_ON_CONNECT = 3;
8318 PERFETTO_ON_TRACING_DISABLED = 4;
8319 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8320 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8321 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8322 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8323 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8324 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8325 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8326 PERFETTO_TRIGGER_BEGIN = 12;
8327 PERFETTO_TRIGGER_SUCCESS = 13;
8328 PERFETTO_TRIGGER_FAILURE = 14;
8329 PERFETTO_HIT_GUARDRAILS = 15;
8330 PERFETTO_ON_TIMEOUT = 16;
8331 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8332 }
8333
8334 // Which stage of the pipeline we are reporting from.
8335 optional Event event = 1;
8336
8337 // UUID matching the one set inside the SystemInfo trace packet.
8338 optional int64 trace_uuid_lsb = 2;
8339 optional int64 trace_uuid_msb = 3;
8340}
Mark Tabrya824a642019-11-05 12:26:12 -08008341
8342/**
8343 * Pulls client metrics on data transferred via Vehicle Maps Service.
8344 * Metrics are keyed by uid + layer.
8345 *
8346 * Pulled from:
8347 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8348 */
8349message VmsClientStats {
8350 // UID of the VMS client app
8351 optional int32 uid = 1 [(is_uid) = true];
8352
8353 // VMS layer definition
8354 optional int32 layer_type = 2;
8355 optional int32 layer_channel = 3;
8356 optional int32 layer_version = 4;
8357
8358 // Bytes and packets sent by the client for the layer
8359 optional int64 tx_bytes = 5;
8360 optional int64 tx_packets = 6;
8361
8362 // Bytes and packets received by the client for the layer
8363 optional int64 rx_bytes = 7;
8364 optional int64 rx_packets = 8;
8365
8366 // Bytes and packets dropped due to client error
8367 optional int64 dropped_bytes = 9;
8368 optional int64 dropped_packets = 10;
8369}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008370
8371/**
8372 * State of a dangerous permission requested by a package - sampled
8373 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8374*/
8375message DangerousPermissionStateSampled {
8376 // Name of the permission
8377 optional string permission_name = 1;
8378
8379 // Uid of the package
8380 optional int32 uid = 2 [(is_uid) = true];
8381
8382 // If the permission is granted to the uid
8383 optional bool is_granted = 3;
8384
8385 // Permission flags as per android.content.pm.PermissionFlags
8386 optional int32 permission_flags = 4;
8387}
8388
Stan Iliev637ba5e2019-08-16 13:43:08 -04008389/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008390 * HWUI stats for a given app.
8391 */
8392message GraphicsStats {
8393 // The package name of the app
8394 optional string package_name = 1;
8395
8396 // The version code of the app
8397 optional int64 version_code = 2;
8398
8399 // The start & end timestamps in UTC as
8400 // milliseconds since January 1, 1970
8401 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008402 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008403
Stan Ilievb6517192020-02-18 10:12:42 -05008404 optional int64 end_millis = 4;
8405
8406 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8407 enum PipelineType {
8408 UNKNOWN = 0;
8409 GL = 1;
8410 VULKAN = 2;
8411 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008412
8413 // HWUI renders pipeline type: GL or Vulkan.
8414 optional PipelineType pipeline = 5;
8415
8416 // Distinct frame count.
8417 optional int32 total_frames = 6;
8418
8419 // Number of "missed vsync" events.
8420 optional int32 missed_vsync_count = 7;
8421
8422 // Number of frames in triple-buffering scenario (high input latency)
8423 optional int32 high_input_latency_count = 8;
8424
8425 // Number of "slow UI thread" events.
8426 optional int32 slow_ui_thread_count = 9;
8427
8428 // Number of "slow bitmap upload" events.
8429 optional int32 slow_bitmap_upload_count = 10;
8430
8431 // Number of "slow draw" events.
8432 optional int32 slow_draw_count = 11;
8433
8434 // Number of frames that missed their deadline (aka, visibly janked)
8435 optional int32 missed_deadline_count = 12;
8436
8437 // The frame time histogram for the package
8438 optional FrameTimingHistogram cpu_histogram = 13
8439 [(android.os.statsd.log_mode) = MODE_BYTES];
8440
8441 // The gpu frame time histogram for the package
8442 optional FrameTimingHistogram gpu_histogram = 14
8443 [(android.os.statsd.log_mode) = MODE_BYTES];
8444
8445 // UI mainline module version.
8446 optional int64 version_ui_module = 15;
8447
8448 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8449 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8450 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8451 // more apps are running / rendering.
8452 optional bool is_today = 16;
8453}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008454
8455/**
8456 * Message related to dangerous (runtime) app ops access
8457 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008458message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008459 // Uid of the package accessing app op
8460 optional int32 uid = 1 [(is_uid) = true];
8461
8462 // Name of the package accessing app op
8463 optional string package_name = 2;
8464
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008465 // operation string id per OPSTR_ constants in AppOpsManager.java
8466 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008467
8468 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8469 // Features must be provided through manifest using <feature> tag available in R and above.
8470 optional string feature_id = 4;
8471
8472 // message related to app op access, limited to 600 chars by API
8473 optional string message = 5;
8474
8475 enum SamplingStrategy {
8476 DEFAULT = 0;
8477 UNIFORM = 1;
8478 RARELY_USED = 2;
8479 }
8480
8481 // sampling strategy used to collect this message
8482 optional SamplingStrategy sampling_strategy = 6;
8483}
8484
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008485/*
8486 * Logs userspace reboot outcome and duration.
8487 *
8488 * Logged from:
8489 * frameworks/base/core/java/com/android/server/BootReceiver.java
8490 */
8491message UserspaceRebootReported {
8492 // Possible outcomes of userspace reboot.
8493 enum Outcome {
8494 // Default value in case platform failed to determine the outcome.
8495 OUTCOME_UNKNOWN = 0;
8496 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8497 SUCCESS = 1;
8498 // Userspace reboot shutdown sequence was aborted.
8499 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8500 // Remounting userdata into checkpointing mode failed.
8501 FAILED_USERDATA_REMOUNT = 3;
8502 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8503 // reboot.
8504 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8505 }
8506 // Outcome of userspace reboot. Always set.
8507 optional Outcome outcome = 1;
8508 // Duration of userspace reboot in case it has a successful outcome.
8509 // Duration is measured as time between userspace reboot was initiated and until boot completed
8510 // (e.g. sys.boot_completed=1).
8511 optional int64 duration_millis = 2;
8512 // State of primary user's (user0) credential encryption storage.
8513 enum UserEncryptionState {
8514 // Default value.
8515 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8516 // Credential encrypted storage is unlocked.
8517 UNLOCKED = 1;
8518 // Credential encrypted storage is locked.
8519 LOCKED = 2;
8520 }
8521 // State of primary user's encryption storage at the moment boot completed. Always set.
8522 optional UserEncryptionState user_encryption_state = 3;
8523}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008524
8525/*
8526 * Logs integrity check information during each install.
8527 *
8528 * Logged from:
8529 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8530 */
8531message IntegrityCheckResultReported {
8532 optional string package_name = 1;
8533 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008534 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008535 optional string installer_package_name = 4;
8536 enum Response {
8537 UNKNOWN = 0;
8538 ALLOWED = 1;
8539 REJECTED = 2;
8540 FORCE_ALLOWED = 3;
8541 }
8542 optional Response response = 5;
8543 // An estimate on the cause of the response. This will only be populated for
8544 // REJECTED and FORCE_ALLOWED
8545 optional bool caused_by_app_cert_rule = 6;
8546 optional bool caused_by_installer_rule = 7;
8547}
8548
8549/**
8550 * Logs the information about the rules and the provider whenever rules are
8551 * pushed into AppIntegrityManager.
8552 *
8553 * Logged from:
8554 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8555 */
8556message IntegrityRulesPushed {
8557 optional bool success = 1;
8558 // Package name of the app that pushed the rules.
8559 optional string rule_provider = 2;
8560 // Version string of arbitrary format provided by the rule provider to
8561 // identify the rules.
8562 optional string rule_version = 3;
8563}
Jordan Liubedfa702019-12-20 15:08:45 -08008564
8565/**
8566 * Logs when a cell broadcast message is received on the device.
8567 *
8568 * Logged from CellBroadcastService module:
8569 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8570 */
8571message CellBroadcastMessageReported {
8572 // The type of Cell Broadcast message
8573 enum CbType {
8574 UNKNOWN_TYPE = 0;
8575 GSM = 1;
8576 CDMA = 2;
8577 CDMA_SPC = 3;
8578 }
8579
8580 // GSM, CDMA, CDMA-SCP
8581 optional CbType type = 1;
8582}
8583
8584/**
8585 * Logs when an error occurs while handling a cell broadcast message;
8586 *
8587 * Logged from CellBroadcastService module:
8588 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8589 */
8590message CellBroadcastMessageError {
8591 // The type of error raised when trying to handle a cell broadcast message
8592 enum ErrorType {
8593 UNKNOWN_TYPE = 0;
8594 CDMA_DECODING_ERROR = 1;
8595 CDMA_SCP_EMPTY = 2;
8596 CDMA_SCP_HANDLING_ERROR = 3;
8597 GSM_INVALID_HEADER_LENGTH = 4;
8598 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8599 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8600 GSM_INVALID_PDU = 7;
8601 GSM_INVALID_GEO_FENCING_DATA = 8;
8602 GSM_UMTS_INVALID_WAC = 9;
8603 FAILED_TO_INSERT_TO_DB = 10;
8604 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8605 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8606 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8607 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8608 }
8609
8610 // What kind of error occurred
8611 optional ErrorType type = 1;
8612
8613 // Exception message (or log message) associated with the error (max 1000 chars)
8614 optional string exception_message = 2;
8615}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008616
8617/**
8618 * Logs when the SDK Extensions test app has polled the current version.
8619 * This is atom ID 354.
8620 *
8621 * Logged from:
8622 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8623 */
8624message SdkExtensionStatus {
8625 enum ApiCallStatus {
8626 CALL_NOT_ATTEMPTED = 0;
8627 CALL_SUCCESSFUL = 1;
8628 CALL_FAILED = 2;
8629 }
8630
8631 optional ApiCallStatus result = 1;
8632
8633 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8634 optional int32 r_extension_version = 2;
8635
8636 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8637 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8638 optional int32 failed_call_symbol = 3;
8639}
Marco Ballesio497aff42020-01-24 08:39:42 -08008640
8641/**
8642 * Logs when an app is frozen or unfrozen.
8643 *
8644 * Logged from:
8645 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8646 */
8647message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008648 // The type of event.
8649 enum Action {
8650 UNKNOWN = 0;
8651 FREEZE_APP = 1;
8652 UNFREEZE_APP = 2;
8653 }
8654 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008655
Blake Kragten6ce382a2020-01-16 20:20:46 -08008656 // Pid of the process being frozen.
8657 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008658
Blake Kragten6ce382a2020-01-16 20:20:46 -08008659 // Name of the process being frozen.
8660 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008661
Blake Kragten6ce382a2020-01-16 20:20:46 -08008662 // Time since last unfrozen.
8663 optional int64 time_unfrozen_millis = 4;
8664}
8665
8666/**
8667 * Logs gnss stats from location service provider
8668 *
8669 * Pulled from:
8670 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8671 */
8672
8673message GnssStats {
8674 // Number of location reports since boot
8675 optional int64 location_reports = 1;
8676
8677 // Total pulled reports of Location failures since boot
8678 optional int64 location_failure_reports = 2;
8679
8680 // Number of time to first fix reports since boot
8681 optional int64 time_to_first_fix_reports = 3;
8682
8683 // Total pulled reported time to first fix (in milli-seconds) since boot
8684 optional int64 time_to_first_fix_milli_s = 4;
8685
8686 // Number of position accuracy reports since boot
8687 optional int64 position_accuracy_reports = 5;
8688
8689 // Total pulled reported position accuracy (in meters) since boot
8690 optional int64 position_accuracy_meters = 6;
8691
8692 // Number of top 4 average CN0 reports since boot
8693 optional int64 top_four_average_cn0_reports = 7;
8694
8695 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8696 optional int64 top_four_average_cn0_db_mhz = 8;
8697
8698 // Number of l5 top 4 average CN0 reports since boot
8699 optional int64 l5_top_four_average_cn0_reports = 9;
8700
8701 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8702 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8703
8704 // Total number of sv status messages reports since boot
8705 optional int64 sv_status_reports = 11;
8706
8707 // Total number of sv status messages reports, where sv is used in fix since boot
8708 optional int64 sv_status_reports_used_in_fix = 12;
8709
8710 // Total number of L5 sv status messages reports since boot
8711 optional int64 l5_sv_status_reports = 13;
8712
8713 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8714 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008715}