blob: b86dc35930f7fdad2e9f8cb448eb013e4f07bf3d [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;
Kweku Adams12752132020-02-18 15:36:48 -0800399 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000400 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000401 }
David Chenc8a43242017-10-17 16:23:28 -0700402
David Chen6e3e6cb2018-01-03 16:14:06 -0800403 // Pulled events will start at field 10000.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000404 // Next: 10076
David Chenc8a43242017-10-17 16:23:28 -0700405 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800406 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
407 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
408 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
409 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
410 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
411 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800412 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800413 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
414 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
415 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
416 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
417 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
418 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
419 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
420 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
421 SystemUptime system_uptime = 10015 [(module) = "framework"];
422 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
423 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000424 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800425 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
426 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800427 Temperature temperature = 10021 [(module) = "framework"];
428 BinderCalls binder_calls = 10022 [(module) = "framework"];
429 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
430 LooperStats looper_stats = 10024 [(module) = "framework"];
431 DiskStats disk_stats = 10025 [(module) = "framework"];
432 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
433 AppSize app_size = 10027 [(module) = "framework"];
434 CategorySize category_size = 10028 [(module) = "framework"];
435 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800436 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800437 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
438 DiskIo disk_io = 10032 [(module) = "framework"];
439 PowerProfile power_profile = 10033 [(module) = "framework"];
440 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
441 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
442 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700443 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800444 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
445 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
446 10040 [(module) = "framework"];
447 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
448 10041 [(module) = "framework"];
449 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800450 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800452 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
454 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
455 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
456 RoleHolder role_holder = 10049 [(module) = "framework"];
457 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800458 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
460 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800461 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
462 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
464 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
465 FaceSettings face_settings = 10058 [(module) = "framework"];
466 CoolingDevice cooling_device = 10059 [(module) = "framework"];
467 AppOps app_ops = 10060 [(module) = "framework"];
468 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700469 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
470 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800471 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800472 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
474 DangerousPermissionStateSampled dangerous_permission_state_sampled =
475 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400476 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000477 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000478 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200479 PackageNotificationPreferences package_notification_preferences =
480 10071 [(module) = "framework"];
481 PackageNotificationChannelPreferences package_notification_channel_preferences =
482 10072 [(module) = "framework"];
483 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
484 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800485 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000486 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700487 }
yroa1fe77c2018-02-26 14:22:54 -0800488
Bookatz76aafcf2018-09-17 16:17:10 -0700489 // DO NOT USE field numbers above 100,000 in AOSP.
490 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
491 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100492
493 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700494}
495
Yao Chend54f9dd2017-10-17 17:37:48 +0000496/**
Yangster-mac20877162017-12-22 17:19:39 -0800497 * This proto represents a node of an attribution chain.
498 * Note: All attribution chains are represented as a repeated field of type
499 * AttributionNode. It is understood that in such arrays, the order is that
500 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000501 */
Yangster-mac20877162017-12-22 17:19:39 -0800502message AttributionNode {
503 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800504 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800505
Yangster-mac20877162017-12-22 17:19:39 -0800506 // The (optional) string tag for an element in the attribution chain. If the
507 // element has no tag, it is encoded as an empty string.
508 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700509}
510
Yangster-mac48b3d622018-08-18 12:38:11 -0700511message KeyValuePair {
512 optional int32 key = 1;
513 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700514 int32 value_int = 2;
515 int64 value_long = 3;
516 string value_str = 4;
517 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700518 }
519}
520
521message KeyValuePairsAtom {
522 optional int32 uid = 1;
523 repeated KeyValuePair pairs = 2;
524}
525
Yao Chend54f9dd2017-10-17 17:37:48 +0000526/*
527 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800528 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000529 *
530 * RULES:
531 * - The field ids for each atom must start at 1, and count upwards by 1.
532 * Skipping field ids is not allowed.
533 * - These form an API, so renaming, renumbering or removing fields is
534 * not allowed between android releases. (This is not currently enforced,
535 * but there will be a tool to enforce this restriction).
536 * - The types must be built-in protocol buffer types, namely, no sub-messages
537 * are allowed (yet). The bytes type is also not allowed.
538 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800539 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000540 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800541 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 * - A field that is a uid should be a string field, tagged with the [xxx]
543 * annotation. The generated code on android will be represented by UIDs,
544 * and those UIDs will be translated in xxx to those strings.
545 *
546 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700547 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000548 * - If there is a UID, it goes first. Think in an object-oriented fashion.
549 * *****************************************************************************
550 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700551
Yao Chend54f9dd2017-10-17 17:37:48 +0000552/**
Tej Singha72344992019-04-17 18:55:08 -0700553 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700554 * Logs when the Thermal service HAL notifies the throttling start/stop events.
555 *
556 * Logged from:
557 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
558 */
559message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700560 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700561 optional android.os.TemperatureTypeEnum sensor_type = 1;
562
Maggie White442b6312019-04-05 16:26:44 -0700563 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700564 enum State {
565 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700566 START = 1; // START indicated that throttling was triggered.
567 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700568 }
Yangster-mace16189a2018-08-26 12:20:16 -0700569 optional State state = 2;
570
571 optional float temperature = 3;
572}
573
574/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000575 * Logs when the screen state changes.
576 *
577 * Logged from:
578 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
579 */
580message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800581 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800582 optional android.view.DisplayStateEnum state = 1
583 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700584}
Yao Chend54f9dd2017-10-17 17:37:48 +0000585
586/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700587 * Logs that the process state of the uid, as determined by ActivityManager
588 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000589 *
590 * Logged from:
591 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
592 */
Bookatzc1a050a2017-10-10 15:49:28 -0700593message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800594 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000595
Bookatzdb026a22018-01-10 19:01:56 -0800596 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800597 optional android.app.ProcessStateEnum state = 2
598 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000599}
600
601/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700602 * Logs process state change of a process, as per the activity manager.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
606 */
607message ProcessStateChanged {
608 optional int32 uid = 1;
609 optional string process_name = 2;
610 optional string package_name = 3;
611 // TODO: remove this when validation is done
612 optional int64 version = 5;
613 // The state, from frameworks/base/core/proto/android/app/enums.proto.
614 optional android.app.ProcessStateEnum state = 4;
615}
616
617/**
618 * Logs when ActivityManagerService sleep state is changed.
619 *
620 * Logged from:
621 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
622 */
623message ActivityManagerSleepStateChanged {
624 // TODO: import frameworks proto
625 enum State {
626 UNKNOWN = 0;
627 ASLEEP = 1;
628 AWAKE = 2;
629 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800630 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700631}
632
633/**
634 * Logs when system memory state changes.
635 *
636 * Logged from:
637 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
638 */
639message MemoryFactorStateChanged {
640 // TODO: import frameworks proto
641 enum State {
642 MEMORY_UNKNOWN = 0;
643 NORMAL = 1; // normal.
644 MODERATE = 2; // moderate memory pressure.
645 LOW = 3; // low memory.
646 CRITICAL = 4; // critical memory.
647
648 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800649 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700650}
651
652/**
653 * Logs when app is using too much cpu, according to ActivityManagerService.
654 *
655 * Logged from:
656 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
657 */
658message ExcessiveCpuUsageReported {
659 optional int32 uid = 1;
660 optional string process_name = 2;
661 optional string package_name = 3;
662 // package version. TODO: remove this when validation is done
663 optional int64 version = 4;
664}
665
666/**
667 * Logs when a cached process is killed, along with its pss.
668 *
669 * Logged from:
670 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
671 */
672message CachedKillReported {
673 optional int32 uid = 1;
674 optional string process_name = 2;
675 optional string package_name = 3;
676 // TODO: remove this when validation is done
677 optional int64 version = 5;
678 optional int64 pss = 4;
679}
680
681/**
xshu2c3d9e42019-09-26 17:54:02 -0700682 * Logs the change in wifi health.
683 *
684 * Logged from:
685 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
686 */
687message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800688 enum Band {
689 UNKNOWN = 0;
690 // All of 2.4GHz band
691 BAND_2G = 1;
692 // Frequencies in the range of [5150, 5250) GHz
693 BAND_5G_LOW = 2;
694 // Frequencies in the range of [5250, 5725) GHz
695 BAND_5G_MIDDLE = 3;
696 // Frequencies in the range of [5725, 5850) GHz
697 BAND_5G_HIGH = 4;
698 // Frequencies in the range of [5925, 6425) GHz
699 BAND_6G_LOW = 5;
700 // Frequencies in the range of [6425, 6875) GHz
701 BAND_6G_MIDDLE = 6;
702 // Frequencies in the range of [6875, 7125) GHz
703 BAND_6G_HIGH = 7;
704 }
xshu2c3d9e42019-09-26 17:54:02 -0700705 // duration this stat is obtained over in milliseconds
706 optional int32 duration_millis = 1;
707 // whether wifi is classified as sufficient for the user's data traffic, determined
708 // by whether the calculated throughput exceeds the average demand within |duration_millis|
709 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700710 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800711 optional bool is_cell_data_available = 3;
712 // the Band bucket the connected network is on
713 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700714}
715
716/**
717 * Logged when wifi detects a significant change in connection failure rate.
718 *
719 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
720 *
721 */
722message WifiFailureStatReported {
723 enum AbnormalityType {
724 UNKNOWN = 0;
725 SIGNIFICANT_INCREASE = 1;
726 SIGNIFICANT_DECREASE = 2;
727 SIMPLY_HIGH = 3;
728 }
729 enum FailureType {
730 FAILURE_UNKNOWN = 0;
731 FAILURE_CONNECTION = 1;
732 FAILURE_ASSOCIATION_REJECTION = 2;
733 FAILURE_ASSOCIATION_TIMEOUT = 3;
734 FAILURE_AUTHENTICATION = 4;
735 FAILURE_NON_LOCAL_DISCONNECTION = 5;
736 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
737 }
738 // Reason for uploading this stat
739 optional AbnormalityType abnormality_type = 1;
740 // The particular type of failure
741 optional FailureType failure_type = 2;
742 // How many times we have encountered this combination of AbnormalityType and FailureType
743 optional int32 failure_count = 3;
744}
745
746/**
747 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
748 *
749 * Logged from:
750 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
751 */
752message WifiConnectionResultReported {
753 enum FailureCode {
754 FAILURE_UNKNOWN = 0;
755 FAILURE_ASSOCIATION_TIMEOUT = 1;
756 FAILURE_ASSOCIATION_REJECTION = 2;
757 FAILURE_AUTHENTICATION_GENERAL = 3;
758 FAILURE_AUTHENTICATION_EAP = 4;
759 FAILURE_DHCP = 5;
760 FAILURE_NETWORK_DISCONNECTION = 6;
761 FAILURE_ROAM_TIMEOUT = 7;
762 }
763 // true represents a successful connection
764 optional bool connection_result = 1;
765 // reason for the connection failure
766 optional FailureCode failure_code = 2;
767 // scan rssi before the connection attempt
768 optional int32 rssi = 3;
769}
770
771/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700772 * Logs when memory stats of a process is reported.
773 *
774 * Logged from:
775 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
776 */
777message ProcessMemoryStatReported {
778 optional int32 uid = 1;
779 optional string process_name = 2;
780 optional string package_name = 3;
781 //TODO: remove this when validation is done
782 optional int64 version = 9;
783 optional int64 pss = 4;
784 optional int64 uss = 5;
785 optional int64 rss = 6;
786 enum Type {
787 ADD_PSS_INTERNAL_SINGLE = 0;
788 ADD_PSS_INTERNAL_ALL_MEM = 1;
789 ADD_PSS_INTERNAL_ALL_POLL = 2;
790 ADD_PSS_EXTERNAL = 3;
791 ADD_PSS_EXTERNAL_SLOW = 4;
792 }
793 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800794 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700795}
796
797/**
Bookatzc1a050a2017-10-10 15:49:28 -0700798 * Logs that a process started, finished, crashed, or ANRed.
799 *
800 * Logged from:
801 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
802 */
803message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700804 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700805
David Chen0b5c90c2018-01-25 16:51:49 -0800806 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800807 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700808
Bookatzddccf0a2017-11-28 16:48:14 -0800809 // What lifecycle state the process changed to.
810 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800811 enum State {
812 FINISHED = 0;
813 STARTED = 1;
814 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800815 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800816 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700817}
818
Bookatzc1a050a2017-10-10 15:49:28 -0700819/**
820 * Logs when the ble scan state changes.
821 *
822 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700823 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700824 */
825message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800826 repeated AttributionNode attribution_node = 1
827 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700828
829 enum State {
830 OFF = 0;
831 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700832 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
833 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700834 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800835 optional State state = 2 [
836 (state_field_option).option = EXCLUSIVE_STATE,
837 (state_field_option).default_state_value = 0 /* State.OFF */,
838 (state_field_option).reset_state_value = 2 /* State.RESET */,
839 (state_field_option).nested = true
840 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700841
Bookatze5ec0b42018-03-26 13:34:56 -0700842 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800843 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700844 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800845 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700846 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800847 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700848}
849
850/**
851 * Logs reporting of a ble scan finding results.
852 *
853 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700854 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700855 */
Bookatzae6738e2018-09-13 11:38:56 -0700856// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700857message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800858 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700859
860 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800861 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700862}
863
864/**
865 * Logs when a sensor state changes.
866 *
867 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700868 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700869 */
870message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800871 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700872
Bookatzc1a050a2017-10-10 15:49:28 -0700873 // The id (int) of the sensor.
874 optional int32 sensor_id = 2;
875
876 enum State {
877 OFF = 0;
878 ON = 1;
879 }
880 optional State state = 3;
881}
882
Bookatzc1a050a2017-10-10 15:49:28 -0700883/**
884 * Logs when GPS state changes.
885 *
886 * Logged from:
887 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
888 */
889message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
892 enum State {
893 OFF = 0;
894 ON = 1;
895 }
896 optional State state = 2;
897}
898
Bookatz48d362e2018-11-06 15:49:08 -0800899/**
900 * Logs when GPS signal quality.
901 *
902 * Logged from:
903 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
904 */
905message GpsSignalQualityChanged {
906 optional android.server.location.GpsSignalQualityEnum level = 1;
907}
908
Bookatzc1a050a2017-10-10 15:49:28 -0700909
910/**
911 * Logs when a sync manager sync state changes.
912 *
913 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700914 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700915 */
916message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700918
David Chen0b5c90c2018-01-25 16:51:49 -0800919 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800920 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700921
922 enum State {
923 OFF = 0;
924 ON = 1;
925 }
926 optional State state = 3;
927}
928
Yangster-mac96353002018-09-05 11:18:55 -0700929/*
930 * Deferred job stats.
931 *
932 * Logged from:
933 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
934*/
935message DeferredJobStatsReported {
936 repeated AttributionNode attribution_node = 1;
937
938 // Number of jobs deferred.
939 optional int32 num_jobs_deferred = 2;
940
941 // Time since the last job runs.
942 optional int64 time_since_last_job_millis = 3;
943}
944
Bookatzc1a050a2017-10-10 15:49:28 -0700945/**
946 * Logs when a job scheduler job state changes.
947 *
948 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700949 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700950 */
951message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800952 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700953
954 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800955 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700956
957 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800958 FINISHED = 0;
959 STARTED = 1;
960 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700961 }
962 optional State state = 3;
963
Tej Singh33a412b2018-03-16 18:43:59 -0700964 // The reason a job has stopped.
965 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700966 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700967 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100968
969 // The standby bucket of the app that scheduled the job. These match the framework constants
970 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
971 // already assigned 0.
972 enum Bucket {
973 UNKNOWN = -1;
974 ACTIVE = 0;
975 WORKING_SET = 1;
976 FREQUENT = 2;
977 RARE = 3;
978 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800979 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100980 }
981 optional Bucket standby_bucket = 5 [default = UNKNOWN];
982
983 // The job id (as assigned by the app).
984 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -0800985
986 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
987 // constraints as they are always assumed to be set.
988 optional bool has_charging_constraint = 7;
989 optional bool has_battery_not_low_constraint = 8;
990 optional bool has_storage_not_low_constraint = 9;
991 optional bool has_timing_delay_constraint = 10;
992 optional bool has_deadline_constraint = 11;
993 optional bool has_idle_constraint = 12;
994 optional bool has_connectivity_constraint = 13;
995 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -0700996}
997
998/**
999 * Logs when the audio state changes.
1000 *
1001 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001002 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001003 */
1004message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001005 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001006
1007 enum State {
1008 OFF = 0;
1009 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001010 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1011 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001012 }
1013 optional State state = 2;
1014}
1015
1016/**
1017 * Logs when the video codec state changes.
1018 *
1019 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001020 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001021 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001022message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001023 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001024
1025 enum State {
1026 OFF = 0;
1027 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001028 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1029 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001030 }
1031 optional State state = 2;
1032}
1033
1034/**
1035 * Logs when the flashlight state changes.
1036 *
1037 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001038 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001039 */
1040message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001041 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001042
1043 enum State {
1044 OFF = 0;
1045 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001046 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1047 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001048 }
1049 optional State state = 2;
1050}
1051
1052/**
1053 * Logs when the camera state changes.
1054 *
1055 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001056 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001057 */
1058message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001059 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001060
1061 enum State {
1062 OFF = 0;
1063 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001064 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1065 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001066 }
1067 optional State state = 2;
1068}
1069
1070/**
1071 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001072 *
1073 * Logged from:
1074 * TODO
1075 */
Bookatzd6746242017-10-24 18:39:35 -07001076message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001077 repeated AttributionNode attribution_node = 1
1078 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001079
Bookatz1a1b0462018-01-12 11:47:03 -08001080 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1081 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001082 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001083 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001084
1085 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001086 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001087
1088 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001089 RELEASE = 0;
1090 ACQUIRE = 1;
1091 CHANGE_RELEASE = 2;
1092 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001093 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001094 optional State state = 4 [
1095 (state_field_option).option = EXCLUSIVE_STATE,
1096 (state_field_option).default_state_value = 0,
1097 (state_field_option).nested = true
1098 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001099}
1100
1101/**
Bookatzc1a050a2017-10-10 15:49:28 -07001102 * Logs when a partial wakelock is considered 'long' (over 1 min).
1103 *
1104 * Logged from:
1105 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1106 */
1107message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001108 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001109
Yao Chend54f9dd2017-10-17 17:37:48 +00001110 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1111 optional string tag = 2;
1112
Bookatzc1a050a2017-10-10 15:49:28 -07001113 // TODO: I have no idea what this is.
1114 optional string history_tag = 3;
1115
1116 enum State {
1117 OFF = 0;
1118 ON = 1;
1119 }
1120 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001121}
1122
Bookatzc1a050a2017-10-10 15:49:28 -07001123/**
Bookatza66083f2018-09-20 17:24:00 -07001124 * Logs when the device is interactive, according to the PowerManager Notifier.
1125 *
1126 * Logged from:
1127 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1128 */
1129message InteractiveStateChanged {
1130 enum State {
1131 OFF = 0;
1132 ON = 1;
1133 }
1134 optional State state = 1;
1135}
1136
1137/**
Bookatzc1a050a2017-10-10 15:49:28 -07001138 * Logs Battery Saver state change.
1139 *
1140 * Logged from:
1141 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1142 */
1143message BatterySaverModeStateChanged {
1144 enum State {
1145 OFF = 0;
1146 ON = 1;
1147 }
1148 optional State state = 1;
1149}
1150
1151/**
1152 * Logs Doze mode state change.
1153 *
1154 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001155 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001156 */
1157message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001158 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001159}
1160
1161
1162/**
1163 * Logs state change of Doze mode including maintenance windows.
1164 *
1165 * Logged from:
1166 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1167 */
1168message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001169 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001170}
1171
1172/**
1173 * Logs screen brightness level.
1174 *
1175 * Logged from:
1176 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1177 */
1178message ScreenBrightnessChanged {
1179 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1180 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001181}
1182
1183/**
1184 * Logs battery level (percent full, from 0 to 100).
1185 *
1186 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001187 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001188 */
1189message BatteryLevelChanged {
1190 // Battery level. Should be in [0, 100].
1191 optional int32 battery_level = 1;
1192}
1193
1194/**
1195 * Logs change in charging status of the device.
1196 *
1197 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001198 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001199 */
1200message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001201 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1202 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001203}
1204
1205/**
1206 * Logs whether the device is plugged in, and what power source it is using.
1207 *
1208 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001209 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001210 */
1211message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001212 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1213 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001214}
1215
Bookatz8c6571b2017-10-24 15:04:41 -07001216/**
1217 * Logs when an app's wakeup alarm fires.
1218 *
1219 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001220 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001221 */
1222message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001223 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001224
1225 // Name of the wakeup alarm.
1226 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001227
1228 // Name of source package (for historical reasons, since BatteryStats tracked it).
1229 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001230
Ben Murdoch3389f1522019-05-21 15:05:34 +01001231 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001232 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001233}
1234
1235/**
1236 * Logs when an an app causes the mobile radio to change state.
1237 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1238 *
1239 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001240 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001241 */
1242message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001243 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001244
Bookatz1a1b0462018-01-12 11:47:03 -08001245 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1246 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001247}
1248
1249/**
1250 * Logs when an an app causes the wifi radio to change state.
1251 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1252 *
1253 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001254 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001255 */
1256message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001257 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001258
Bookatz1a1b0462018-01-12 11:47:03 -08001259 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1260 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001261}
1262
1263/**
1264 * Logs kernel wakeup reasons and aborts.
1265 *
1266 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001267 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001268 */
1269message KernelWakeupReported {
1270 // Name of the kernel wakeup reason (or abort).
1271 optional string wakeup_reason_name = 1;
1272
1273 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001274 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001275}
1276
1277/**
Bookatzda1798c2018-12-13 14:16:00 -08001278 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001279 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001280 *
1281 * Logged from:
1282 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1283 */
1284message WifiEnabledStateChanged {
1285 enum State {
1286 OFF = 0;
1287 ON = 1;
1288 }
1289 optional State state = 1;
1290}
1291
1292/**
tsaichristinececebdc2020-02-04 14:05:56 -08001293 * This atom is deprecated starting in R.
1294 *
Bookatzda1798c2018-12-13 14:16:00 -08001295 * 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 -08001296 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1297 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001298 *
1299 * Logged from:
1300 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1301 */
1302message WifiRunningStateChanged {
1303 repeated AttributionNode attribution_node = 1;
1304
1305 enum State {
1306 OFF = 0;
1307 ON = 1;
1308 }
1309 optional State state = 2;
1310}
1311
1312/**
Bookatze5885242017-10-24 20:10:31 -07001313 * Logs wifi locks held by an app.
1314 *
1315 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001316 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001317 */
1318message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001319 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001320
1321 enum State {
1322 OFF = 0;
1323 ON = 1;
1324 }
1325 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001326
1327 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1328 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001329}
1330
1331/**
1332 * Logs wifi signal strength changes.
1333 *
1334 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001335 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001336 */
1337message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001338 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1339 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001340}
1341
1342/**
1343 * Logs wifi scans performed by an app.
1344 *
1345 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001346 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001347 */
1348message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001349 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001350
1351 enum State {
1352 OFF = 0;
1353 ON = 1;
1354 }
1355 optional State state = 2;
1356}
1357
1358/**
Tej Singh4503e102018-01-04 14:35:01 -08001359 * Logs wifi multicast locks held by an app
1360 *
1361 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001362 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001363 */
1364message WifiMulticastLockStateChanged {
1365 repeated AttributionNode attribution_node = 1;
1366
1367 enum State {
1368 OFF = 0;
1369 ON = 1;
1370 }
1371 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001372
1373 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001374}
1375
1376/**
Tej Singh1ea42892018-01-19 09:27:00 -08001377 * Logs shutdown reason and duration on next boot.
1378 *
1379 * Logged from:
1380 * frameworks/base/core/java/com/android/server/BootReceiver.java
1381 */
1382message ShutdownSequenceReported {
1383 // True if shutdown is for a reboot. Default: false if we do not know.
1384 optional bool reboot = 1;
1385
1386 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1387 optional string reason = 2;
1388
1389 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1390 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001392
1393 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001394 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001395}
1396
Tej Singh6483ea42018-01-25 17:45:49 -08001397
1398/**
1399 * Logs boot reason and duration.
1400 *
1401 * Logged from:
1402 * system/core/bootstat/bootstat.cpp
1403 */
1404message BootSequenceReported {
1405 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1406 // Default: "<EMPTY>" if not available.
1407 optional string bootloader_reason = 1;
1408
1409 // Reason for system boot. Eg. bootloader, reboot,userrequested
1410 // Default: "<EMPTY>" if not available.
1411 optional string system_reason = 2;
1412
1413 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001414 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001415
1416 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001417 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001418
1419 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001420 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001421
1422 // Time since last boot in ms. Default: 0 if not available.
1423 optional int64 time_since_last_boot = 6;
1424}
1425
Tej Singhc477d9c2018-02-05 18:31:39 -08001426
1427/**
1428 * Logs call state and disconnect cause (if applicable).
1429 *
1430 * Logged from:
1431 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1432 */
1433message CallStateChanged {
1434 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1435 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1436 optional android.telecom.CallStateEnum call_state = 1;
1437
1438 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1439 // This value is only applicable when the call_state is DISCONNECTED, and
1440 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1441 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1442 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1443
1444 // True if the call is self-managed, which are apps that use the
1445 // telecom infrastructure to make their own calls.
1446 optional bool self_managed = 3;
1447
1448 // True if call is external. External calls are calls on connected Wear
1449 // devices but show up in Telecom so the user can pull them onto the device.
1450 optional bool external_call = 4;
1451}
1452
Tej Singh1ea42892018-01-19 09:27:00 -08001453/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001454 * Logs keyguard state. The keyguard is the lock screen.
1455 *
1456 * Logged from:
1457 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1458 */
1459message KeyguardStateChanged {
1460 enum State {
1461 UNKNOWN = 0;
1462 // The keyguard is hidden when the phone is unlocked.
1463 HIDDEN = 1;
1464 // The keyguard is shown when the phone is locked (screen turns off).
1465 SHOWN= 2;
1466 // The keyguard is occluded when something is overlaying the keyguard.
1467 // Eg. Opening the camera while on the lock screen.
1468 OCCLUDED = 3;
1469 }
1470 optional State state = 1;
1471}
1472
1473/**
1474 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1475 * prompts the user to enter a password (pattern, pin, etc).
1476 *
1477 * Logged from:
1478 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1479 */
1480
1481message KeyguardBouncerStateChanged {
1482 enum State {
1483 UNKNOWN = 0;
1484 // Bouncer is hidden, either as a result of successfully entering the
1485 // password, screen timing out, or user going back to lock screen.
1486 HIDDEN = 1;
1487 // This is when the user is being prompted to enter the password.
1488 SHOWN = 2;
1489 }
1490 optional State state = 1;
1491}
1492
1493/**
1494 * Logs the result of entering a password into the keyguard bouncer.
1495 *
1496 * Logged from:
1497 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1498 */
1499message KeyguardBouncerPasswordEntered {
1500 enum BouncerResult {
1501 UNKNOWN = 0;
1502 // The password entered was incorrect.
1503 FAILURE = 1;
1504 // The password entered was correct.
1505 SUCCESS = 2;
1506 }
1507 optional BouncerResult result = 1;
1508}
1509
Tej Singha883b372018-02-15 11:30:01 -08001510/*
1511 * Logs changes to the configuration of the device. The configuration is defined
1512 * in frameworks/base/core/java/android/content/res/Configuration.java
1513 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1514 * Please go there to interpret the possible values each field can be.
1515 *
1516 * Logged from:
1517 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1518 */
1519message ResourceConfigurationChanged {
1520 // Bit mask of color capabilities of the screen.
1521 // Contains information about the color gamut and hdr mode of the screen.
1522 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001523 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001524
1525 // The target screen density being rendered to.
1526 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001527 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001528
1529 // Current user preference for the scaling factor for fonts,
1530 // relative to the base density scaling.
1531 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001532 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001533
1534 // Flag indicating whether the hard keyboard is hidden.
1535 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001536 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001537
1538 // The type of keyboard attached to the device.
1539 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1540 optional int32 keyboard = 5;
1541
1542 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1543 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001544 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001545
1546 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1547 // 0 if undefined.
1548 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1549 optional int32 mcc = 7;
1550
1551 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1552 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1553 // MNC_ZERO symbol defined in Configuration.java.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1555 optional int32 mnc = 8;
1556
1557 // The kind of navigation available on the device.
1558 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1559 optional int32 navigation = 9;
1560
1561 // Flag indicating whether the navigation is available.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // Overall orientation of the screen.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1567 optional int32 orientation = 11;
1568
1569 // The current height of the available screen space, in dp units.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // Bit mask of overall layout of the screen.
1574 // Contains information about screen size, whether the screen is wider/taller
1575 // than normal, whether the screen layout is right-tl-left or left-to-right,
1576 // and whether the screen has a rounded shape.
1577 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001578 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001579
1580 // Current width of the available screen space, in dp units.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001582 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001583
1584 // The smallest screen size an application will see in normal operation.
1585 // This is the smallest value of both screenWidthDp and screenHeightDp
1586 // in portrait and landscape.
1587 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001588 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001589
1590 // The type of touch screen attached to the device.
1591 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1592 optional int32 touchscreen = 16;
1593
1594 // Bit mask of the ui mode.
1595 // Contains information about the overall ui mode of the device.
1596 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1597 // Also contains information about whether the device is in night mode.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001600}
1601
Tej Singheee317b2018-03-07 19:28:05 -08001602
1603/**
1604 * Logs changes in the connection state of the mobile radio.
1605 *
1606 * Logged from:
1607 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1608 */
1609message MobileConnectionStateChanged {
1610 // States are from the state machine DataConnection.java.
1611 enum State {
1612 UNKNOWN = 0;
1613 // The connection is inactive, or disconnected.
1614 INACTIVE = 1;
1615 // The connection is being activated, or connecting.
1616 ACTIVATING = 2;
1617 // The connection is active, or connected.
1618 ACTIVE = 3;
1619 // The connection is disconnecting.
1620 DISCONNECTING = 4;
1621 // The connection is disconnecting after creating a connection.
1622 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1623 }
1624 optional State state = 1;
1625 // For multi-sim phones, this distinguishes between the sim cards.
1626 optional int32 sim_slot_index = 2;
1627 // Used to identify the connection. Starts at 0 and increments by 1 for
1628 // every new network created. Resets whenever the device reboots.
1629 optional int32 data_connection_id = 3;
1630 // A bitmask for the capabilities of this connection.
1631 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1632 // Default value (if we have no information): 0
1633 optional int64 capabilities = 4;
1634 // If this connection has internet.
1635 // This just checks if the DEFAULT bit of capabilities is set.
1636 optional bool has_internet = 5;
1637}
1638
1639/**
1640 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1641 *
1642 * Logged from:
1643 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1644 */
1645message MobileRadioTechnologyChanged {
1646 optional android.telephony.NetworkTypeEnum state = 1;
1647 // For multi-sim phones, this distinguishes between the sim cards.
1648 optional int32 sim_slot_index = 2;
1649}
1650
Andrew Chantb56388b2018-03-22 21:07:33 -07001651/**
1652 * Logs the VID and PID of any connected USB devices.
1653 *
1654 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1655 *
1656 * Logged by Vendor.
1657 */
1658message UsbDeviceAttached {
1659 optional int32 vid = 1;
1660 optional int32 pid = 2;
1661 optional bool has_audio = 3;
1662 optional bool has_hid = 4;
1663 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001664 enum State {
1665 STATE_DISCONNECTED = 0;
1666 STATE_CONNECTED = 1;
1667 }
1668 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001669 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001670}
1671
Tej Singheee317b2018-03-07 19:28:05 -08001672
Tej Singhdd7bd352018-02-09 19:33:15 -08001673/**
Tej Singh5d991e12018-03-09 19:48:11 -08001674 * Logs when Bluetooth is enabled and disabled.
1675 *
1676 * Logged from:
1677 * services/core/java/com/android/server/BluetoothManagerService.java
1678 */
1679message BluetoothEnabledStateChanged {
1680 repeated AttributionNode attribution_node = 1;
1681 // Whether or not bluetooth is enabled on the device.
1682 enum State {
1683 UNKNOWN = 0;
1684 ENABLED = 1;
1685 DISABLED = 2;
1686 }
1687 optional State state = 2;
1688 // The reason for being enabled/disabled.
1689 // Eg. Airplane mode, crash, application request.
1690 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1691 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001692 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001693}
1694
1695/**
Jack Hed9837c82019-01-09 01:19:13 -08001696 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001697 *
1698 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001699 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1700 *
1701 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001702 */
1703message BluetoothConnectionStateChanged {
1704 // The state of the connection.
1705 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1706 optional android.bluetooth.ConnectionStateEnum state = 1;
1707 // An identifier that can be used to match connect and disconnect events.
1708 // Currently is last two bytes of a hash of a device level ID and
1709 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001710 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001711 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001712 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1713 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001714 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001715 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001716 // An identifier that can be used to match events for this device.
1717 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1718 // Salt: Randomly generated 256 bit value
1719 // Hash algorithm: HMAC-SHA256
1720 // Size: 32 byte
1721 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001722 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001723}
1724
1725/**
1726 * Logs when a Bluetooth device connects and disconnects over ACL
1727 *
1728 * Logged from:
1729 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1730 *
1731 * Next Tag: 3
1732 */
1733message BluetoothAclConnectionStateChanged {
1734 // An identifier that can be used to match events for this device.
1735 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1736 // Salt: Randomly generated 256 bit value
1737 // Hash algorithm: HMAC-SHA256
1738 // Size: 32 byte
1739 // Default: null or empty if the device identifier is not known
1740 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1741 // The state of the connection.
1742 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1743 optional android.bluetooth.ConnectionStateEnum state = 2;
1744}
1745
1746/**
1747 * Logs when a Bluetooth device connects and disconnects over SCO
1748 *
1749 * Logged from:
1750 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1751 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1752 *
1753 * Next Tag: 4
1754 */
1755message BluetoothScoConnectionStateChanged {
1756 // An identifier that can be used to match events for this device.
1757 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1758 // Salt: Randomly generated 256 bit value
1759 // Hash algorithm: HMAC-SHA256
1760 // Size: 32 byte
1761 // Default: null or empty if the device identifier is not known
1762 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1763 // The state of the connection.
1764 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1765 optional android.bluetooth.ConnectionStateEnum state = 2;
1766 // Codec used for this SCO connection
1767 // Default: UNKNOWN
1768 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001769}
1770
Jack Hec27040a2019-01-09 20:54:41 -08001771/**
1772 * Logged when active device of a profile changes
1773 *
1774 * Logged from:
1775 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1776 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1777 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1778 */
1779message BluetoothActiveDeviceChanged {
1780 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1781 // From android.bluetooth.BluetoothProfile
1782 optional int32 bt_profile = 1;
1783 // An identifier that can be used to match events for this new active device.
1784 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1785 // Salt: Randomly generated 256 bit value
1786 // Hash algorithm: HMAC-SHA256
1787 // Size: 32 byte
1788 // Default: null or empty if there is no active device for this profile
1789 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1790}
1791
Jack Heab86dbd22018-12-18 15:43:27 -08001792// Logs when there is an event affecting Bluetooth device's link layer connection.
1793// - This event is triggered when there is a related HCI command or event
1794// - Users of this metrics can deduce Bluetooth device's connection state from these events
1795// - HCI commands are logged before the command is sent, after receiving command status, and after
1796// receiving command complete
1797// - HCI events are logged when they arrive
1798//
1799// Low level log from system/bt
1800//
1801// Bluetooth classic commands:
1802// - CMD_CREATE_CONNECTION
1803// - CMD_DISCONNECT
1804// - CMD_CREATE_CONNECTION_CANCEL
1805// - CMD_ACCEPT_CONNECTION_REQUEST
1806// - CMD_REJECT_CONNECTION_REQUEST
1807// - CMD_SETUP_ESCO_CONNECTION
1808// - CMD_ACCEPT_ESCO_CONNECTION
1809// - CMD_REJECT_ESCO_CONNECTION
1810// - CMD_ENH_SETUP_ESCO_CONNECTION
1811// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1812//
1813// Bluetooth low energy commands:
1814// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1815// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1816// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1817// - CMD_BLE_CLEAR_WHITE_LIST
1818// - CMD_BLE_ADD_WHITE_LIST
1819// - CMD_BLE_REMOVE_WHITE_LIST
1820//
1821// Bluetooth classic events:
1822// - EVT_CONNECTION_COMP
1823// - EVT_CONNECTION_REQUEST
1824// - EVT_DISCONNECTION_COMP
1825// - EVT_ESCO_CONNECTION_COMP
1826// - EVT_ESCO_CONNECTION_CHANGED
1827//
1828// Bluetooth low energy meta events:
1829// - BLE_EVT_CONN_COMPLETE_EVT
1830// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1831//
1832// Next tag: 10
1833message BluetoothLinkLayerConnectionEvent {
1834 // An identifier that can be used to match events for this device.
1835 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1836 // Salt: Randomly generated 256 bit value
1837 // Hash algorithm: HMAC-SHA256
1838 // Size: 32 byte
1839 // Default: null or empty if the device identifier is not known
1840 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1841 // Connection handle of this connection if available
1842 // Range: 0x0000 - 0x0EFF (12 bits)
1843 // Default: 0xFFFF if the handle is unknown
1844 optional int32 connection_handle = 2;
1845 // Direction of the link
1846 // Default: DIRECTION_UNKNOWN
1847 optional android.bluetooth.DirectionEnum direction = 3;
1848 // Type of this link
1849 // Default: LINK_TYPE_UNKNOWN
1850 optional android.bluetooth.LinkTypeEnum type = 4;
1851
1852 // Reason metadata for this link layer connection event, rules for interpretation:
1853 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1854 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1855 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1856 // set and valid, ignore hci_ble_event
1857
1858 // HCI command associated with this event
1859 // Default: CMD_UNKNOWN
1860 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1861 // HCI event associated with this event
1862 // Default: EVT_UNKNOWN
1863 optional android.bluetooth.hci.EventEnum hci_event = 6;
1864 // HCI BLE meta event associated with this event
1865 // Default: BLE_EVT_UNKNOWN
1866 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1867 // HCI command status code if this is triggerred by hci_cmd
1868 // Default: STATUS_UNKNOWN
1869 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1870 // HCI reason code associated with this event
1871 // Default: STATUS_UNKNOWN
1872 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1873}
1874
Howard Roe103fe22019-01-17 16:52:16 -08001875/**
1876 * Logs when a module is rolled back by Watchdog.
1877 *
1878 * Logged from: Rollback Manager
1879 */
1880message WatchdogRollbackOccurred {
1881 enum RollbackType {
1882 UNKNOWN = 0;
1883 ROLLBACK_INITIATE = 1;
1884 ROLLBACK_SUCCESS = 2;
1885 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001886 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001887 }
1888 optional RollbackType rollback_type = 1;
1889
1890 optional string package_name = 2;
1891
1892 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001893
1894 enum RollbackReasonType {
1895 REASON_UNKNOWN = 0;
1896 REASON_NATIVE_CRASH = 1;
1897 REASON_EXPLICIT_HEALTH_CHECK = 2;
1898 REASON_APP_CRASH = 3;
1899 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001900 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001901 }
1902 optional RollbackReasonType rollback_reason = 4;
1903
1904 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1905 // is initiated. Empty if the package is unknown.
1906 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001907
1908 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001909}
1910
Jack Hec27040a2019-01-09 20:54:41 -08001911/**
1912 * Logs when there is a change in Bluetooth A2DP playback state
1913 *
1914 * Logged from:
1915 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1916 */
1917message BluetoothA2dpPlaybackStateChanged {
1918 // An identifier that can be used to match events for this device.
1919 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1920 // Salt: Randomly generated 256 bit value
1921 // Hash algorithm: HMAC-SHA256
1922 // Size: 32 byte
1923 // Default: null or empty if the device identifier is not known
1924 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1925 // Current playback state
1926 // Default: PLAYBACK_STATE_UNKNOWN
1927 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1928 // Current audio coding mode
1929 // Default: AUDIO_CODING_MODE_UNKNOWN
1930 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1931}
1932
1933/**
1934 * Logs when there is a change in A2DP codec config for a particular remote device
1935 *
1936 * Logged from:
1937 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1938 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1939 */
1940message BluetoothA2dpCodecConfigChanged {
1941 // An identifier that can be used to match events for this device.
1942 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1943 // Salt: Randomly generated 256 bit value
1944 // Hash algorithm: HMAC-SHA256
1945 // Size: 32 byte
1946 // Default: null or empty if the device identifier is not known
1947 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1948 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1949 // Default SOURCE_CODEC_TYPE_INVALID
1950 optional int32 codec_type = 2;
1951 // Codec priroity, the higher the more preferred, -1 for disabled
1952 // Default: CODEC_PRIORITY_DEFAULT
1953 optional int32 codec_priority = 3;
1954 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1955 // Default: SAMPLE_RATE_NONE
1956 optional int32 sample_rate = 4;
1957 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1958 // Default: BITS_PER_SAMPLE_NONE
1959 optional int32 bits_per_sample = 5;
1960 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1961 // Default: CHANNEL_MODE_NONE
1962 optional int32 channel_mode = 6;
1963 // Codec specific values
1964 // Default 0
1965 optional int64 codec_specific_1 = 7;
1966 optional int64 codec_specific_2 = 8;
1967 optional int64 codec_specific_3 = 9;
1968 optional int64 codec_specific_4 = 10;
1969}
1970
1971/**
1972 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1973 * Each codec's capability is logged separately due to statsd restriction
1974 *
1975 * Logged from:
1976 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1977 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1978 */
1979message BluetoothA2dpCodecCapabilityChanged {
1980 // An identifier that can be used to match events for this device.
1981 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1982 // Salt: Randomly generated 256 bit value
1983 // Hash algorithm: HMAC-SHA256
1984 // Size: 32 byte
1985 // Default: null or empty if the device identifier is not known
1986 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1987 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1988 // Default SOURCE_CODEC_TYPE_INVALID
1989 optional int32 codec_type = 2;
1990 // Codec priroity, the higher the more preferred, -1 for disabled
1991 // Default: CODEC_PRIORITY_DEFAULT
1992 optional int32 codec_priority = 3;
1993 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1994 // in BluetoothCodecConfig
1995 // Default: empty and SAMPLE_RATE_NONE for individual item
1996 optional int32 sample_rate = 4;
1997 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1998 // in BluetoothCodecConfig
1999 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2000 optional int32 bits_per_sample = 5;
2001 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2002 // BluetoothCodecConfig
2003 // Default: empty and CHANNEL_MODE_NONE for individual item
2004 optional int32 channel_mode = 6;
2005 // Codec specific values
2006 // Default 0
2007 optional int64 codec_specific_1 = 7;
2008 optional int64 codec_specific_2 = 8;
2009 optional int64 codec_specific_3 = 9;
2010 optional int64 codec_specific_4 = 10;
2011}
2012
2013/**
2014 * Logs when A2DP failed to read from PCM source.
2015 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2016 *
2017 * Logged from:
2018 * system/bt
2019 */
2020message BluetoothA2dpAudioUnderrunReported {
2021 // An identifier that can be used to match events for this device.
2022 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2023 // Salt: Randomly generated 256 bit value
2024 // Hash algorithm: HMAC-SHA256
2025 // Size: 32 byte
2026 // Default: null or empty if the device identifier is not known
2027 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2028 // Encoding interval in nanoseconds
2029 // Default: 0
2030 optional int64 encoding_interval_nanos = 2;
2031 // Number of bytes of PCM data that could not be read from the source
2032 // Default: 0
2033 optional int32 num_missing_pcm_bytes = 3;
2034}
2035
2036/**
2037 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2038 * buffer queue is full and we have to drop data
2039 *
2040 * Logged from:
2041 * system/bt
2042 */
2043message BluetoothA2dpAudioOverrunReported {
2044 // An identifier that can be used to match events for this device.
2045 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2046 // Salt: Randomly generated 256 bit value
2047 // Hash algorithm: HMAC-SHA256
2048 // Size: 32 byte
2049 // Default: null or empty if the device identifier is not known
2050 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2051 // Encoding interval in nanoseconds
2052 // Default: 0
2053 optional int64 encoding_interval_nanos = 2;
2054 // Number of buffers dropped in this event
2055 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2056 // Default: 0
2057 optional int32 num_dropped_buffers = 3;
2058 // Number of encoded buffers dropped in this event
2059 // Default 0
2060 optional int32 num_dropped_encoded_frames = 4;
2061 // Number of encoded bytes dropped in this event
2062 // Default: 0
2063 optional int32 num_dropped_encoded_bytes = 5;
2064}
2065
2066/**
2067 * Logs when we receive reports regarding a device's RSSI value
2068 *
2069 * Logged from:
2070 * system/bt
2071 */
2072message BluetoothDeviceRssiReported {
2073 // An identifier that can be used to match events for this device.
2074 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2075 // Salt: Randomly generated 256 bit value
2076 // Hash algorithm: HMAC-SHA256
2077 // Size: 32 byte
2078 // Default: null or empty if the device identifier is not known
2079 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2080 // Connection handle of this connection if available
2081 // Range: 0x0000 - 0x0EFF (12 bits)
2082 // Default: 0xFFFF if the handle is unknown
2083 optional int32 connection_handle = 2;
2084 // HCI command status code if this is triggerred by hci_cmd
2085 // Default: STATUS_UNKNOWN
2086 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2087 // BR/EDR
2088 // Range: -128 ≤ N ≤ 127 (signed integer)
2089 // Units: dB
2090 // LE:
2091 // Range: -127 to 20, 127 (signed integer)
2092 // Units: dBm
2093 // Invalid when an out of range value is reported
2094 optional int32 rssi = 4;
2095}
2096
2097/**
2098 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2099 *
2100 * Logged from:
2101 * system/bt
2102 */
2103message BluetoothDeviceFailedContactCounterReported {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 // Size: 32 byte
2109 // Default: null or empty if the device identifier is not known
2110 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2111 // Connection handle of this connection if available
2112 // Range: 0x0000 - 0x0EFF (12 bits)
2113 // Default: 0xFFFF if the handle is unknown
2114 optional int32 connection_handle = 2;
2115 // HCI command status code if this is triggerred by hci_cmd
2116 // Default: STATUS_UNKNOWN
2117 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2118 // Number of consecutive failed contacts for a connection corresponding to the Handle
2119 // Range: uint16_t, 0-0xFFFF
2120 // Default: 0xFFFFF
2121 optional int32 failed_contact_counter = 4;
2122}
2123
2124/**
2125 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothDeviceTxPowerLevelReported {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Connection handle of this connection if available
2139 // Range: 0x0000 - 0x0EFF (12 bits)
2140 // Default: 0xFFFF if the handle is unknown
2141 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002142 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002143 // Default: STATUS_UNKNOWN
2144 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2145 // Range: -30 ≤ N ≤ 20
2146 // Units: dBm
2147 // Invalid when an out of range value is reported
2148 optional int32 transmit_power_level = 4;
2149}
Jack Heab86dbd22018-12-18 15:43:27 -08002150
Tej Singh5d991e12018-03-09 19:48:11 -08002151/**
Jack He1021a612019-01-20 21:22:46 -08002152 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2153 * receiving an HCI command from the host
2154 *
2155 * Logged from: system/bt
2156 */
2157message BluetoothHciTimeoutReported {
2158 // HCI command associated with this event
2159 // Default: CMD_UNKNOWN
2160 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2161}
2162
2163/**
2164 * Logs when we receive Bluetooth Link Quality Report event from the controller
2165 * See Android Bluetooth HCI specification for more details
2166 *
2167 * Note: all count and bytes field are counted since last event
2168 *
2169 * Logged from: system/bt
2170 */
2171message BluetoothQualityReportReported {
2172 // Quality report ID
2173 // Original type: uint8_t
2174 // Default: BQR_ID_UNKNOWN
2175 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2176 // Packet type of the connection
2177 // Original type: uint8_t
2178 // Default: BQR_PACKET_TYPE_UNKNOWN
2179 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2180 // Connection handle of the connection
2181 // Original type: uint16_t
2182 optional int32 connection_handle = 3;
2183 // Performing Role for the connection
2184 // Original type: uint8_t
2185 optional int32 connection_role = 4;
2186 // Current Transmit Power Level for the connection. This value is the same as the controller's
2187 // response to the HCI_Read_Transmit_Power_Level HCI command
2188 // Original type: uint8_t
2189 optional int32 tx_power_level = 5;
2190 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2191 // absolute receiver signal strength value
2192 // Original type: int8_t
2193 optional int32 rssi = 6;
2194 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2195 // channels used by the link currently
2196 // Original type: uint8_t
2197 optional int32 snr = 7;
2198 // Indicates the number of unused channels in AFH_channel_map
2199 // Original type: uint8_t
2200 optional int32 unused_afh_channel_count = 8;
2201 // Indicates the number of the channels which are interfered and quality is bad but are still
2202 // selected for AFH
2203 // Original type: uint8_t
2204 optional int32 afh_select_unideal_channel_count = 9;
2205 // Current Link Supervision Timeout Setting
2206 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2207 // Original type: uint16_t
2208 optional int32 lsto = 10;
2209 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2210 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2211 // 0x01 (Piconet Clock)
2212 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2213 // Original type: uint32_t
2214 optional int64 connection_piconet_clock = 11;
2215 // The count of retransmission
2216 // Original type: uint32_t
2217 optional int64 retransmission_count = 12;
2218 // The count of no RX
2219 // Original type: uint32_t
2220 optional int64 no_rx_count = 13;
2221 // The count of NAK (Negative Acknowledge)
2222 // Original type: uint32_t
2223 optional int64 nak_count = 14;
2224 // Controller timestamp of last TX ACK
2225 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2226 // Original type: uint32_t
2227 optional int64 last_tx_ack_timestamp = 15;
2228 // The count of Flow-off (STOP)
2229 // Original type: uint32_t
2230 optional int64 flow_off_count = 16;
2231 // Controller timestamp of last Flow-on (GO)
2232 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2233 // Original type: uint32_t
2234 optional int64 last_flow_on_timestamp = 17;
2235 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2236 // Original type: uint32_t
2237 optional int64 buffer_overflow_bytes = 18;
2238 // Buffer underflow count (in byte) since last event
2239 // Original type: uint32_t
2240 optional int64 buffer_underflow_bytes = 19;
2241}
2242
2243/**
2244 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2245 *
2246 * Notes:
2247 * - Each event can be partially filled as we might learn different pieces of device
2248 * information at different time
2249 * - Multiple device info events can be combined to give more complete picture
2250 * - When multiple device info events tries to describe the same information, the
2251 * later one wins
2252 *
2253 * Logged from:
2254 * packages/apps/Bluetooth
2255 */
Jack Heaea26982019-04-04 11:19:48 -07002256message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002257 // An identifier that can be used to match events for this device.
2258 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2259 // Salt: Randomly generated 256 bit value
2260 // Hash algorithm: HMAC-SHA256
2261 // Size: 32 byte
2262 // Default: null or empty if the device identifier is not known
2263 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2264 // Where is this device info obtained from
2265 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2266 // Name of the data source
2267 // For EXTERNAL: package name of the data source
2268 // For INTERNAL: null for general case, component name otherwise
2269 optional string source_name = 3;
2270 // Name of the manufacturer of this device
2271 optional string manufacturer = 4;
2272 // Model of this device
2273 optional string model = 5;
2274 // Hardware version of this device
2275 optional string hardware_version = 6;
2276 // Software version of this device
2277 optional string software_version = 7;
2278}
2279
2280/**
2281 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2282 * device, as documented by the Bluetooth Core HCI specification
2283 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2284 * Vol 2, Part E, Page 1118
2285 *
2286 * Logged from:
2287 * system/bt
2288 */
2289message BluetoothRemoteVersionInfoReported {
2290 // Connection handle of the connection
2291 // Original type: uint16_t
2292 optional int32 connection_handle = 1;
2293 // HCI command status code
2294 // Default: STATUS_UNKNOWN
2295 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2296 // 1 byte Version of current LMP in the remote controller
2297 optional int32 lmp_version = 3;
2298 // 2 bytes LMP manufacturer code of the remote controller
2299 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2300 optional int32 lmp_manufacturer_code = 4;
2301 // 4 bytes subversion of the LMP in the remote controller
2302 optional int32 lmp_subversion = 5;
2303}
2304
2305/**
2306 * Logs when certain Bluetooth SDP attributes are discovered
2307 * Constant definitions are from:
2308 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2309 *
2310 * Current logged attributes:
2311 * - BluetoothProfileDescriptorList
2312 * - Supported Features Bitmask
2313 *
2314 * Logged from:
2315 * system/bt
2316 */
2317message BluetoothSdpAttributeReported {
2318 // An identifier that can be used to match events for this device.
2319 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2320 // Salt: Randomly generated 256 bit value
2321 // Hash algorithm: HMAC-SHA256
2322 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2323 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2324 // Original type: uint16_t
2325 optional int32 protocol_uuid = 2;
2326 // Short form UUIDs used to identify Bluetooth SDP attribute types
2327 // Original type: uint16_t
2328 optional int32 attribute_id = 3;
2329 // Attribute value for the particular attribute
2330 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2331}
2332
2333/**
2334 * Logs when bond state of a Bluetooth device changes
2335 *
2336 * Logged from:
2337 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2338 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2339 */
2340message BluetoothBondStateChanged {
2341 // An identifier that can be used to match events for this device.
2342 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2343 // Salt: Randomly generated 256 bit value
2344 // Hash algorithm: HMAC-SHA256
2345 // Size: 32 byte
2346 // Default: null or empty if the device identifier is not known
2347 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2348 // Preferred transport type to remote dual mode device
2349 // Default: TRANSPORT_AUTO means no preference
2350 optional android.bluetooth.TransportTypeEnum transport = 2;
2351 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2352 // Default: UNKNOWN
2353 optional android.bluetooth.DeviceTypeEnum type = 3;
2354 // Current bond state (NONE, BONDING, BONDED)
2355 // Default: BOND_STATE_UNKNOWN
2356 optional android.bluetooth.BondStateEnum bond_state = 4;
2357 // Bonding sub state
2358 // Default: BOND_SUB_STATE_UNKNOWN
2359 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2360 // Unbond Reason
2361 // Default: UNBOND_REASON_UNKNOWN
2362 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2363}
2364
2365/**
2366 * Logs there is an event related Bluetooth classic pairing
2367 *
2368 * Logged from:
2369 * system/bt
2370 */
2371message BluetoothClassicPairingEventReported {
2372 // An identifier that can be used to match events for this device.
2373 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2374 // Salt: Randomly generated 256 bit value
2375 // Hash algorithm: HMAC-SHA256
2376 // Size: 32 byte
2377 // Default: null or empty if the device identifier is not known
2378 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2379 // Connection handle of this connection if available
2380 // Range: 0x0000 - 0x0EFF (12 bits)
2381 // Default: 0xFFFF if the handle is unknown
2382 optional int32 connection_handle = 2;
2383 // HCI command associated with this event
2384 // Default: CMD_UNKNOWN
2385 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2386 // HCI event associated with this event
2387 // Default: EVT_UNKNOWN
2388 optional android.bluetooth.hci.EventEnum hci_event = 4;
2389 // HCI command status code if this is triggerred by hci_cmd
2390 // Default: STATUS_UNKNOWN
2391 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2392 // HCI reason code associated with this event
2393 // Default: STATUS_UNKNOWN
2394 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002395 // A status value related to this specific event
2396 // Default: 0
2397 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002398}
2399
2400/**
2401 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2402 *
2403 * Logged from:
2404 * system/bt
2405 */
2406message BluetoothSmpPairingEventReported {
2407 // An identifier that can be used to match events for this device.
2408 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2409 // Salt: Randomly generated 256 bit value
2410 // Hash algorithm: HMAC-SHA256
2411 // Size: 32 byte
2412 // Default: null or empty if the device identifier is not known
2413 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2414 // SMP command sent or received over L2CAP
2415 // Default: CMD_UNKNOWN
2416 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2417 // Whether this command is sent or received
2418 // Default: DIRECTION_UNKNOWN
2419 optional android.bluetooth.DirectionEnum direction = 3;
2420 // SMP failure reason code
2421 // Default: PAIRING_FAIL_REASON_DEFAULT
2422 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2423}
2424
2425/**
Jack He815cdba2019-01-30 17:24:55 -08002426 * Logs when a Bluetooth socket’s connection state changed
2427 *
2428 * Logged from:
2429 * system/bt
2430 */
2431message BluetoothSocketConnectionStateChanged {
2432 // An identifier that can be used to match events for this device.
2433 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2434 // Salt: Randomly generated 256 bit value
2435 // Hash algorithm: HMAC-SHA256
2436 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002437 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002438 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002439 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002440 // Default 0 when unknown or don't care
2441 optional int32 port = 2;
2442 // Socket type as mentioned in
2443 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2444 // Default: SOCKET_TYPE_UNKNOWN
2445 optional android.bluetooth.SocketTypeEnum type = 3;
2446 // Socket connection state
2447 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2448 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2449 // Number of bytes sent to remote device during this connection
2450 optional int64 tx_bytes = 5;
2451 // Number of bytes received from remote device during this connection
2452 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002453 // Socket owner's UID
2454 optional int32 uid = 7 [(is_uid) = true];
2455 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2456 // |port| must be spawned by |server_port|
2457 // Default 0 when unknown or don't care
2458 optional int32 server_port = 8;
2459 // Whether this is a server listener socket
2460 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002461}
2462
2463/**
Jack He71426802019-04-02 13:32:52 -07002464 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2465 *
2466 * Logged from:
2467 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2468 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2469 *
2470 */
2471message BluetoothClassOfDeviceReported {
2472 // An identifier that can be used to match events for this device.
2473 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2474 // Salt: Randomly generated 256 bit value
2475 // Hash algorithm: HMAC-SHA256
2476 // Size: 32 byte
2477 // Default: null or empty if this is a server listener socket
2478 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2479 // Class of Device (CoD) value including both Major, Minor device class and service class
2480 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2481 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2482 // Default: 0
2483 optional int32 class_of_device = 2;
2484}
2485
2486/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002487 * Logs when something is plugged into or removed from the USB-C connector.
2488 *
2489 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002490 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002491 */
2492message UsbConnectorStateChanged {
2493 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002494 STATE_DISCONNECTED = 0;
2495 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002496 }
2497 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002498 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002499 // Last active session in ms.
2500 // 0 when the port is in connected state.
2501 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002502}
2503
2504/**
2505 * Logs the reported speaker impedance.
2506 *
2507 * Logged from:
2508 * Vendor audio implementation.
2509 */
2510message SpeakerImpedanceReported {
2511 optional int32 speaker_location = 1;
2512 optional int32 impedance = 2;
2513}
2514
2515/**
2516 * Logs the report of a failed hardware.
2517 *
2518 * Logged from:
2519 * Vendor HALs.
2520 *
2521 */
2522message HardwareFailed {
2523 enum HardwareType {
2524 HARDWARE_FAILED_UNKNOWN = 0;
2525 HARDWARE_FAILED_MICROPHONE = 1;
2526 HARDWARE_FAILED_CODEC = 2;
2527 HARDWARE_FAILED_SPEAKER = 3;
2528 HARDWARE_FAILED_FINGERPRINT = 4;
2529 }
2530 optional HardwareType hardware_type = 1;
2531
Maggie White6dcd8572019-01-31 14:11:50 -08002532 /**
2533 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002534 * the same hardware_type. The specific locations are vendor defined integers,
2535 * referring to board-specific numbering schemes.
2536 */
2537 optional int32 hardware_location = 2;
2538
Maggie White6dcd8572019-01-31 14:11:50 -08002539 /**
2540 * failure_code is specific to the HardwareType of the failed hardware.
2541 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002542 */
Maggie White6dcd8572019-01-31 14:11:50 -08002543 enum HardwareErrorCode {
2544 UNKNOWN = 0;
2545 COMPLETE = 1;
2546 SPEAKER_HIGH_Z = 2;
2547 SPEAKER_SHORT = 3;
2548 FINGERPRINT_SENSOR_BROKEN = 4;
2549 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002550 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002551 }
2552 optional int32 failure_code = 3;
2553}
2554
2555/**
2556 * Log an event when the device has been physically dropped.
2557 * Reported from the /vendor partition.
2558 */
2559message PhysicalDropDetected {
2560 // Confidence that the event was actually a drop, 0 -> 100
2561 optional int32 confidence_pctg = 1;
2562 // Peak acceleration of the drop, in 1/1000s of a g.
2563 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002564 // Duration of freefall in ms
2565 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002566}
2567
2568/**
2569 * Log bucketed battery charge cycles.
2570 *
2571 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002572 * a given charge point. For example, if 10 cycle buckets are
2573 * initialized, bucket 1 is the lowest 1/10th of the battery,
2574 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002575 *
2576 * Logged from:
2577 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2578 */
2579message ChargeCyclesReported {
2580 optional int32 cycle_bucket_1 = 1;
2581 optional int32 cycle_bucket_2 = 2;
2582 optional int32 cycle_bucket_3 = 3;
2583 optional int32 cycle_bucket_4 = 4;
2584 optional int32 cycle_bucket_5 = 5;
2585 optional int32 cycle_bucket_6 = 6;
2586 optional int32 cycle_bucket_7 = 7;
2587 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002588 optional int32 cycle_bucket_9 = 9;
2589 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002590}
2591
2592/**
Howard Roa46b6582018-09-18 16:45:02 -07002593 * Log battery health snapshot.
2594 *
2595 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2596 * are snapshotted periodically over 24hrs.
2597 */
2598message BatteryHealthSnapshot {
2599 enum BatterySnapshotType {
2600 UNKNOWN = 0;
2601 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2602 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2603 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2604 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2605 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2606 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2607 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2608 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2609 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2610 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2611 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2612 }
2613 optional BatterySnapshotType type = 1;
2614 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002615 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002616 // Voltage Battery Voltage, in microVolts.
2617 optional int32 voltage_micro_volt = 3;
2618 // Current Battery current, in microAmps.
2619 optional int32 current_micro_amps = 4;
2620 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2621 optional int32 open_circuit_micro_volt = 5;
2622 // Resistance Battery Resistance, in microOhms.
2623 optional int32 resistance_micro_ohm = 6;
2624 // Level Battery Level, as % of full.
2625 optional int32 level_percent = 7;
2626}
2627
2628/**
2629 * Log slow I/O operations on the primary storage.
2630 */
2631message SlowIo {
2632 // Classifications of IO Operations.
2633 enum IoOperation {
2634 UNKNOWN = 0;
2635 READ = 1;
2636 WRITE = 2;
2637 UNMAP = 3;
2638 SYNC = 4;
2639 }
2640 optional IoOperation operation = 1;
2641
2642 // The number of slow IO operations of this type over 24 hours.
2643 optional int32 count = 2;
2644}
2645
2646/**
2647 * Log battery caused shutdown with the last recorded voltage.
2648 */
2649message BatteryCausedShutdown {
2650 // The last recorded battery voltage prior to shutdown.
2651 optional int32 last_recorded_micro_volt = 1;
2652}
2653
2654/**
Tej Singha72344992019-04-17 18:55:08 -07002655 * Logs when ThermalService receives throttling events.
2656 *
2657 * Logged from:
2658 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2659 */
2660message ThermalThrottlingSeverityStateChanged {
2661 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2662 optional android.os.TemperatureTypeEnum sensor_type = 1;
2663
2664 // The name of the temperature source. Eg. CPU0
2665 optional string sensor_name = 2;
2666
2667 // Temperature in tenths of a degree C.
2668 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2669 optional int32 temperature_deci_celsius = 3;
2670
2671 // Relative severity of the throttling, see enum definition.
2672 optional android.os.ThrottlingSeverityEnum severity = 4;
2673}
2674
2675/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002676 * Logs the duration of a davey (jank of >=700ms) when it occurs
2677 *
2678 * Logged from:
2679 * frameworks/base/libs/hwui/JankTracker.cpp
2680 */
2681message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002682 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002683 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002684
Tej Singhbb8554a2018-01-26 11:59:14 -08002685 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002686 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002687}
2688
2689/**
Bookatze5885242017-10-24 20:10:31 -07002690 * Logs phone signal strength changes.
2691 *
2692 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002693 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002694 */
2695message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002696 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2697 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002698}
2699
Yangster4ccebea2018-10-09 17:09:02 -07002700
2701/**
2702 * Logs when the phone state, sim state or signal strength changes
2703 *
2704 * Logged from:
2705 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2706 */
2707message PhoneServiceStateChanged {
2708 optional android.telephony.ServiceStateEnum state = 1;
2709 optional android.telephony.SimStateEnum sim_state = 2;
2710 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2711}
2712
2713/**
2714 * Logs when the phone becomes on or off.
2715 *
2716 * Logged from:
2717 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2718 */
2719message PhoneStateChanged {
2720 enum State {
2721 OFF = 0;
2722 ON = 1;
2723 }
2724 optional State state = 1;
2725}
2726
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002727message BackGesture {
2728 enum BackType {
2729 DEFAULT_BACK_TYPE = 0;
2730 COMPLETED = 1;
2731 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2732 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2733 INCOMPLETE = 4;
2734 }
2735 optional BackType type = 1;
2736
2737 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2738 enum WindowHorizontalLocation {
2739 DEFAULT_LOCATION = 0;
2740 LEFT = 1;
2741 RIGHT = 2;
2742 }
2743 optional WindowHorizontalLocation x_location = 3;
2744}
2745
2746message ExclusionRectStateChanged {
2747 optional string component_name = 1; // if not available, simply packageName
2748 optional int32 requested_height = 2; // px
2749 optional int32 rejected_height = 3; // px
2750
2751 enum WindowHorizontalLocation {
2752 DEFAULT_LOCATION = 0;
2753 LEFT = 1;
2754 RIGHT = 2;
2755 }
2756 optional WindowHorizontalLocation x_location = 4;
2757 optional bool landscape = 5;
2758 optional bool splitscreen = 6;
2759 optional int32 duration_millis = 7;
2760}
2761
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002762message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002763 optional android.stats.launcher.LauncherAction action = 1;
2764 optional android.stats.launcher.LauncherState src_state = 2;
2765 optional android.stats.launcher.LauncherState dst_state = 3;
2766 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002767 optional bool is_swipe_up_enabled = 5;
2768}
2769
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002770message StyleUIChanged {
2771 optional android.stats.style.Action action = 1;
2772 optional int32 color_package_hash = 2;
2773 optional int32 font_package_hash = 3;
2774 optional int32 shape_package_hash = 4;
2775 optional int32 clock_package_hash = 5;
2776 optional int32 launcher_grid = 6;
2777 optional int32 wallpaper_category_hash = 7;
2778 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002779 optional int32 color_preference = 9;
2780 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002781}
2782
David Chenc28b2bb2017-10-24 12:52:52 -07002783/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002784 * Logs when Settings UI has changed.
2785 *
2786 * Logged from:
2787 * packages/apps/Settings
2788 */
2789message SettingsUIChanged {
2790 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002791 * Where this SettingsUIChange event comes from. For example, if
2792 * it's a PAGE_VISIBLE event, where the page is opened from.
2793 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002794 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002795
2796 /**
2797 * What the UI action is.
2798 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002799 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002800
2801 /**
2802 * Where the action is happening
2803 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002804 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002805
2806 /**
2807 * What preference changed in this event.
2808 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002809 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002810
2811 /**
2812 * The new value of the changed preference.
2813 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002814 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002815}
2816
2817/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002818 * Logs basic timing information about touch events.
2819 * Reported at most every 5 minutes while device is being interacted with.
2820 *
2821 * Logged from:
2822 * frameworks/native/services/inputflinger
2823 */
2824message TouchEventReported {
2825 /**
2826 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002827 * and the standard deviation of the time spent processing touchscreen events
2828 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002829 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002830 * On supported devices, the starting point is taken during the hard interrupt inside the
2831 * kernel touch driver. On all other devices, the starting point is taken inside
2832 * the kernel's input event subsystem upon receipt of the input event.
2833 * The ending point is taken inside InputDispatcher, just after the input event
2834 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002835 */
2836 // Minimum value
2837 optional float latency_min_micros = 1;
2838 // Maximum value
2839 optional float latency_max_micros = 2;
2840 // Average value
2841 optional float latency_mean_micros = 3;
2842 // Standard deviation
2843 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002844 // Number of touch events (input_event) in this report
2845 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002846}
2847
2848/**
Philip Quinn0eded622019-01-29 12:46:28 -08002849 * Logs gesture classification and timing information for touch events.
2850 *
2851 * Logged from:
2852 * frameworks/base/core/java/android/view/GestureDetector.java
2853 * frameworks/base/core/java/android/view/View.java
2854 */
2855message TouchGestureClassified {
2856 // The source of the classification (e.g. Java class name).
2857 optional string source = 1;
2858
2859 enum Classification {
2860 UNKNOWN_CLASSIFICATION = 0;
2861 SINGLE_TAP = 1;
2862 DOUBLE_TAP = 2;
2863 LONG_PRESS = 3;
2864 DEEP_PRESS = 4;
2865 SCROLL = 5;
2866 }
2867 // The classification of the gesture.
2868 optional Classification classification = 2;
2869
2870 // The interval from the start of a touch event stream until the
2871 // classification was made.
2872 optional int32 latency_millis = 3;
2873
2874 // The distance from the location of the first touch event to the
2875 // location of the touch event when the classification was made.
2876 optional float displacement_px = 4;
2877}
2878
2879/**
David Chenc28b2bb2017-10-24 12:52:52 -07002880 * Logs that a setting was updated.
2881 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002882 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002883 * The tag and is_default allow resetting of settings to default values based on the specified
2884 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2885 */
2886message SettingChanged {
2887 // The name of the setting.
2888 optional string setting = 1;
2889
2890 // The change being imposed on this setting. May represent a number, eg "3".
2891 optional string value = 2;
2892
2893 // The new value of this setting. For most settings, this is same as value. For some settings,
2894 // value is +X or -X where X represents an element in a set. For example, if the previous value
2895 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2896 // The +/- feature is currently only used for location_providers_allowed.
2897 optional string new_value = 3;
2898
2899 // The previous value of this setting.
2900 optional string prev_value = 4;
2901
2902 // The tag used with the is_default for resetting sets of settings. This is generally null.
2903 optional string tag = 5;
2904
Bookatz90867622018-01-31 15:05:57 -08002905 // True if this setting with tag should be resettable.
2906 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002907
David Chenbd789912018-03-16 17:19:55 -07002908 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002909 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002910
2911 enum ChangeReason {
2912 UPDATED = 1; // Updated can be an insertion or an update.
2913 DELETED = 2;
2914 }
2915 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002916}
Chenjie Yub3dda412017-10-24 13:41:59 -07002917
Chenjie Yu05013b32017-11-21 10:21:41 -08002918/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002919 * Logs activity going to foreground or background
2920 *
2921 * Logged from:
2922 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2923 */
2924message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002925 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002926 optional string pkg_name = 2;
2927 optional string class_name = 3;
2928
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002929 enum State {
2930 BACKGROUND = 0;
2931 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002932 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002933 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002934}
David Chenc8a43242017-10-17 16:23:28 -07002935
2936/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002937 * Logs when a volume entered low Storage state.
2938 * Logged from:
2939 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2940 */
2941message LowStorageStateChanged {
2942 // Volume that ran out of storage.
2943 optional string volume_description = 1;
2944
2945 enum State {
2946 UNKNOWN = 0;
2947 OFF = 1;
2948 ON = 2;
2949 }
2950 optional State state = 2;
2951}
2952
2953/**
2954 * Logs when an app is downgraded.
2955 * Logged from:
2956 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2957 */
2958message AppDowngraded {
2959 optional string package_name = 1;
2960 // Size of the package (all data) before being downgraded.
2961 optional int64 size_in_bytes_before = 2;
2962 // Size of the package (all data) after being downgraded.
2963 optional int64 size_in_bytes_after = 3;
2964
2965 optional bool aggressive = 4;
2966}
2967
2968/**
2969 * Logs when an app is optimized after being downgraded.
2970 * Logged from:
2971 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2972 */
2973message AppOptimizedAfterDowngraded {
2974 optional string package_name = 1;
2975}
2976
2977/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002978 * Logs whenever an app is installed on external storage.
2979 * Logged from:
2980 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2981 */
2982message AppInstallOnExternalStorageReported {
2983 // The type of external storage.
2984 optional android.stats.storage.ExternalStorageType storage_type = 1;
2985 // The name of the package that is installed on the sd card.
2986 optional string package_name = 2;
2987}
2988
2989/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002990 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002991 * Logged from:
2992 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2993 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002994message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002995 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002996
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002997 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002998
2999 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003000 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003001 optional string process_name = 3;
3002
3003 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003004 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003005
3006 optional string package_name = 5;
3007
3008 enum InstantApp {
3009 UNAVAILABLE = 0;
3010 FALSE = 1;
3011 TRUE = 2;
3012 }
3013 optional InstantApp is_instant_app = 6;
3014
3015 enum ForegroundState {
3016 UNKNOWN = 0;
3017 BACKGROUND = 1;
3018 FOREGROUND = 2;
3019 }
3020 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003021
3022 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003023}
David Chen9e3808c2017-11-20 17:25:34 -08003024
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003025/**
3026 * Logs when a WTF (What a Terrible Failure) happened.
3027 * Logged from:
3028 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3029 */
3030message WTFOccurred {
3031 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003032
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003033 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035 // The name of the process.
3036 // system_server if it is not by an app
3037 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003038
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003039 // The pid if available. -1 means not available.
3040 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003041
3042 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043}
3044
3045/**
3046 * Logs when system server reports low memory.
3047 * Logged from:
3048 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3049 */
3050message LowMemReported {
3051}
3052
3053/**
3054 * Logs when an app ANR (App Not Responding) occurs.
3055 * Logged from:
3056 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3057 */
3058message ANROccurred {
3059 optional int32 uid = 1 [(is_uid) = true];
3060
3061 optional string process_name = 2;
3062
3063 optional string short_component_name = 3;
3064
3065 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003066
3067 enum InstantApp {
3068 UNAVAILABLE = 0;
3069 FALSE = 1;
3070 TRUE = 2;
3071 }
3072 optional InstantApp is_instant_app = 5;
3073
3074 enum ForegroundState {
3075 UNKNOWN = 0;
3076 BACKGROUND = 1;
3077 FOREGROUND = 2;
3078 }
3079 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003080
3081 optional android.server.ErrorSource error_source = 7;
3082
3083 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003084}
3085
Bookatza7020bd2018-08-28 16:29:35 -07003086/**
3087 * Logs when the vibrator state changes.
3088 * Logged from:
3089 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3090 */
3091message VibratorStateChanged {
3092 repeated AttributionNode attribution_node = 1;
3093
3094 enum State {
3095 OFF = 0;
3096 ON = 1;
3097 }
3098 optional State state = 2;
3099
3100 // Duration (in milliseconds) requested to keep the vibrator on.
3101 // Only applicable for State == ON.
3102 optional int64 duration_millis = 3;
3103}
3104
David Chen0a368b22017-12-06 16:28:16 -08003105/*
3106 * Allows other apps to push events into statsd.
3107 * Logged from:
3108 * frameworks/base/core/java/android/util/StatsLog.java
3109 */
David Chen0b5c90c2018-01-25 16:51:49 -08003110message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003111 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003112 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003113
3114 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3115 optional int32 label = 2;
3116
3117 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3118 // predicates for the metrics).
3119 enum State {
3120 UNKNOWN = 0;
3121 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3122 STOP = 2;
3123 START = 3;
3124 }
3125 optional State state = 3;
3126}
3127
David Chen9e3808c2017-11-20 17:25:34 -08003128/**
Bookatz7948c872018-09-04 12:58:33 -07003129 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3130 * For example, this could be due to the user manually changing the time.
3131 *
3132 * Logged from:
3133 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3134 */
3135message WallClockTimeShifted {
3136 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3137 optional int64 wall_clock_timestamp_millis = 1;
3138}
3139
3140/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003141 * Logs when statsd detects an anomaly.
3142 *
3143 * Logged from:
3144 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3145 */
3146message AnomalyDetected {
3147 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003148 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003149
Yangster-mac94e197c2018-01-02 16:03:03 -08003150 // Id of the config whose anomaly detection alert fired.
3151 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003152
Yangster-mac94e197c2018-01-02 16:03:03 -08003153 // Id of the alert (i.e. name of the anomaly that was detected).
3154 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003155}
3156
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003157message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003158 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003159 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003160
3161 // The app package name.
3162 optional string pkg_name = 2;
3163
3164 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003165 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003166 WARM = 1;
3167 HOT = 2;
3168 COLD = 3;
3169 }
3170 // The transition type.
3171 optional TransitionType type = 3;
3172
3173 // The activity name.
3174 optional string activity_name = 4;
3175
3176 // The name of the calling app. Empty if not set.
3177 optional string calling_pkg_name = 5;
3178
3179 // Whether the app is an instant app.
3180 optional bool is_instant_app = 6;
3181
3182 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003183 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003184
Bookatz80d11a02018-01-16 10:46:35 -08003185 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003186
David Chen0b5c90c2018-01-25 16:51:49 -08003187 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003188 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003189 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003190 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003191 optional int32 bind_application_delay_millis = 11;
3192 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003193
3194 // Empty if not set.
3195 optional string launch_token = 13;
3196
Calin Juravle759fbda2018-02-20 19:52:30 +00003197 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003198 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003199
3200 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003201 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003202}
3203
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003204message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003206 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003207
3208 // The app package name.
3209 optional string pkg_name = 2;
3210
3211 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003212 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213 WARM = 1;
3214 HOT = 2;
3215 COLD = 3;
3216 }
3217 // The transition type.
3218 optional TransitionType type = 3;
3219
3220 // The activity name.
3221 optional string activity_name = 4;
3222}
3223
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003224message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003225 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003226 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003227
3228 // The app package name.
3229 optional string pkg_name = 2;
3230
3231 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003232 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003233 WITH_BUNDLE = 1;
3234 WITHOUT_BUNDLE = 2;
3235 }
3236 // The transition type.
3237 optional TransitionType type = 3;
3238
3239 // The activity name.
3240 optional string activity_name = 4;
3241
3242 optional bool transition_process_running = 5;
3243
3244 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003245 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003246}
3247
Bookatz8fcd09a2017-12-18 13:01:10 -08003248/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003249 * Logs a picture-in-picture action
3250 * Logged from:
3251 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3252 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3253 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3254 */
3255message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003256 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003257 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003258
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003259 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003260
Chenjie Yu52cacc62017-12-08 18:11:45 -08003261 enum State {
3262 ENTERED = 1;
3263 EXPANDED_TO_FULL_SCREEN = 2;
3264 MINIMIZED = 3;
3265 DISMISSED = 4;
3266 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003267 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003268}
3269
3270/**
Chenjie Yue8904192017-12-08 19:12:57 -08003271 * Logs overlay action
3272 * Logged from:
3273 * services/core/java/com/android/server/wm/Session.java
3274 */
3275message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003276 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003277
tsaichristine5adc7e02020-01-14 17:07:39 -08003278 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003279
3280 optional bool using_alert_window = 3;
3281
3282 enum State {
3283 ENTERED = 1;
3284 EXITED = 2;
3285 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003286 optional State state = 4 [
3287 (state_field_option).option = EXCLUSIVE_STATE,
3288 (state_field_option).nested = false,
3289 (state_field_option).default_state_value = 2
3290 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003291}
3292
Adam Bookatz38767932020-02-05 12:13:40 -08003293/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003294 * Logs foreground service starts and stops.
3295 * Note that this is not when a service starts or stops, but when it is
3296 * considered foreground.
3297 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003298 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003299 */
3300message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003301 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003302 // package_name + "/" + class_name
3303 optional string short_name = 2;
3304
3305 enum State {
3306 ENTER = 1;
3307 EXIT = 2;
3308 }
3309 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003310
3311 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3312 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3313 optional bool allow_while_in_use_permission = 4;
3314}
3315
3316/**
3317 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3318 * A foreground service session is any continuous period during which the uid holds at least one
3319 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3320 * Accesses initiated while the uid is in the TOP state are ignored.
3321 * Sessions with no attempted accesses are not logged.
3322 * Logged from
3323 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3324 */
3325message ForegroundServiceAppOpSessionEnded {
3326 optional int32 uid = 1 [(is_uid) = true];
3327
3328 // The operation's name.
3329 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3330 // Only these named ops are actually logged.
3331 enum AppOpName {
3332 OP_NONE = -1; // Also represents UNKNOWN.
3333 OP_COARSE_LOCATION = 0;
3334 OP_FINE_LOCATION = 1;
3335 OP_CAMERA = 26;
3336 OP_RECORD_AUDIO = 27;
3337 }
3338 optional AppOpName app_op_name = 2 [default = OP_NONE];
3339
3340 // The uid's permission mode for accessing the AppOp during this fgs session.
3341 enum Mode {
3342 MODE_UNKNOWN = 0;
3343 MODE_ALLOWED = 1; // Always allowed
3344 MODE_IGNORED = 2; // Denied
3345 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3346 }
3347 optional Mode app_op_mode = 3;
3348
3349 // Number of times this AppOp was requested and allowed.
3350 optional int32 count_ops_accepted = 4;
3351 // Number of times this AppOp was requested but denied.
3352 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003353}
3354
Chenjie Yue8904192017-12-08 19:12:57 -08003355/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003356 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3357 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3358 * attributed back to the parent (host) uid. One example is Chrome.
3359 *
3360 * Logged from:
3361 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3362 */
3363message IsolatedUidChanged {
3364 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003365 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003366 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003367 optional int32 parent_uid = 1;
3368
3369 optional int32 isolated_uid = 2;
3370
3371 // We expect an isolated uid to be removed before if it's used for another parent uid.
3372 enum Event {
3373 REMOVED = 0;
3374 CREATED = 1;
3375 }
3376 optional Event event = 3;
3377}
3378
3379/*
3380 * Logs the reception of an incoming network packet causing the main system to wake up for
3381 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3382 * and processed by WakeupController.cpp.
3383 */
3384message PacketWakeupOccurred {
3385 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3386 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003387 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003388 // The interface name on which the packet was received.
3389 optional string iface = 2;
3390 // The ethertype value of the packet.
3391 optional int32 ethertype = 3;
3392 // String representation of the destination MAC address of the packet.
3393 optional string destination_hardware_address = 4;
3394 // String representation of the source address of the packet if this was an IP packet.
3395 optional string source_ip = 5;
3396 // String representation of the destination address of the packet if this was an IP packet.
3397 optional string destination_ip = 6;
3398 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3399 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3400 // families.
3401 optional int32 ip_next_header = 7;
3402 // The source port if this was a TCP or UDP packet.
3403 optional int32 source_port = 8;
3404 // The destination port if this was a TCP or UDP packet.
3405 optional int32 destination_port = 9;
3406}
3407
3408/*
3409 * Logs the memory stats for an app on startup.
3410 * Logged from:
3411 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3412 */
3413message AppStartMemoryStateCaptured {
3414 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003415 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003416
3417 // The process name.
3418 optional string process_name = 2;
3419
3420 // The activity name.
3421 optional string activity_name = 3;
3422
3423 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003424 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003425
3426 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003427 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003428
3429 // RSS
3430 optional int64 rss_in_bytes = 6;
3431
3432 // CACHE
3433 optional int64 cache_in_bytes = 7;
3434
3435 // SWAP
3436 optional int64 swap_in_bytes = 8;
3437}
3438
3439/*
3440 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3441 * for LMK event.
3442 * Logged from:
3443 * system/core/lmkd/lmkd.c
3444 */
3445message LmkStateChanged {
3446 enum State {
3447 UNKNOWN = 0;
3448 START = 1;
3449 STOP = 2;
3450 }
3451 optional State state = 1;
3452}
3453
3454/*
3455 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3456 * Logged from:
3457 * system/core/lmkd/lmkd.c
3458 */
3459message LmkKillOccurred {
3460 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003461 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003462
3463 // The process name.
3464 optional string process_name = 2;
3465
3466 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003467 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003468
3469 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003470 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003471
3472 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003473 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003474
3475 // RSS
3476 optional int64 rss_in_bytes = 6;
3477
3478 // CACHE
3479 optional int64 cache_in_bytes = 7;
3480
3481 // SWAP
3482 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003483
3484 // The elapsed real time of start of the process.
3485 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003486
3487 // Min oom adj score considered by lmkd.
3488 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003489}
3490
Rajeev Kumar51b54602018-03-01 12:18:26 -08003491/*
3492 * Logs when the ActivityManagerService detects that an app died.
3493 *
3494 * Logged from:
3495 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3496 */
3497message AppDied {
3498 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003499 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003500}
3501
Howard Ro21a039c2018-08-06 14:55:47 -07003502/**
3503 * An atom for generic metrics logging. Available from Android Q.
3504 */
3505message GenericAtom {
3506 // The uid of the application that sent this custom atom.
3507 optional int32 uid = 1 [(is_uid) = true];
3508
3509 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003510 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003511}
3512
Tej Singhd6d6d772018-09-05 17:41:25 -07003513/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003514 * Atom for simple logging of user interaction and impression events, such as "the user touched
3515 * this button" or "this dialog was displayed".
3516 * Keep the UI event stream clean: don't use for system or background events.
3517 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003518 *
3519 * Logged from:
3520 * frameworks/base/services/core/java/com/android/server/
3521 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003522 */
3523message UiEventReported {
3524 // The event_id.
3525 optional int32 event_id = 1;
3526 // The event's source or target uid and package, if applicable.
3527 // For example, the package posting a notification, or the destination package of a share.
3528 optional int32 uid = 2 [(is_uid) = true];
3529 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003530 // An identifier used to disambiguate which logs refer to a particular instance of some
3531 // UI element. Useful when there might be multiple instances simultaneously active.
3532 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003533}
3534
3535/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003536 * Reports a notification was created or updated.
3537 *
3538 * Logged from:
3539 * frameworks/base/services/core/java/com/android/server/notification/
3540 */
3541message NotificationReported {
3542 // The event_id (as for UiEventReported).
3543 optional int32 event_id = 1;
3544 // The notifying app's uid and package.
3545 optional int32 uid = 2 [(is_uid) = true];
3546 optional string package_name = 3;
3547 // A small system-assigned identifier for the notification.
3548 // Locally probably-unique, but expect collisions across users and/or days.
3549 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003550 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3551 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003552
3553 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003554 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3555 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3556 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003557
3558 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003559 optional string category = 10; // App-assigned notification category (API-defined strings)
3560 optional int32 style = 11; // App-assigned notification style
3561 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003562
3563 // Ordering, importance and interruptiveness
3564
Will Brockman7614f6962020-02-10 19:43:03 -05003565 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003566
Will Brockman7614f6962020-02-10 19:43:03 -05003567 optional android.stats.sysui.NotificationImportance importance = 14;
3568 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003569
3570 enum NotificationImportanceExplanation {
3571 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3572 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3573 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3574 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3575 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3576 // Like _APP, but based on pre-channels priority signal.
3577 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3578 }
3579
Will Brockman7614f6962020-02-10 19:43:03 -05003580 optional NotificationImportanceExplanation importance_source = 16;
3581 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3582 optional NotificationImportanceExplanation importance_initial_source = 18;
3583 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3584 optional int32 assistant_hash = 20;
3585 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003586}
3587
3588message Notification {
3589 // The notifying app's uid and package.
3590 optional int32 uid = 1 [(is_uid) = true];
3591 optional string package_name = 2;
3592 // A small system-assigned identifier for the notification.
3593 optional int32 instance_id = 3;
3594
3595 // Grouping information.
3596 optional int32 group_instance_id = 4;
3597 optional bool is_group_summary = 5;
3598
3599 // The section of the shade that the notification is in.
3600 // See NotificationSectionsManager.PriorityBucket.
3601 enum NotificationSection {
3602 SECTION_UNKNOWN = 0;
3603 SECTION_PEOPLE = 1;
3604 SECTION_ALERTING = 2;
3605 SECTION_SILENT = 3;
3606 }
3607 optional NotificationSection section = 6;
3608}
3609
3610message NotificationList {
3611 repeated Notification notifications = 1; // An ordered sequence of notifications.
3612}
3613
3614/**
3615 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3616 *
3617 * Logged from:
3618 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3619 */
3620message NotificationPanelReported {
3621 // The event_id (as for UiEventReported).
3622 optional int32 event_id = 1;
3623 optional int32 num_notifications = 2;
3624 // The notifications in the panel, in the order that they appear there.
3625 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3626}
3627
3628/**
3629 * Reports a notification channel, or channel group, was created, updated, or deleted.
3630 *
3631 * Logged from:
3632 * frameworks/base/services/core/java/com/android/server/notification/
3633 */
3634message NotificationChannelModified {
3635 // The event_id (as for UiEventReported).
3636 optional int32 event_id = 1;
3637 // The notifying app's uid and package.
3638 optional int32 uid = 2 [(is_uid) = true];
3639 optional string package_name = 3;
3640 // App-assigned notification channel ID or channel-group ID
3641 optional string channel_id = 4;
3642 // Previous importance setting, if applicable
3643 optional android.stats.sysui.NotificationImportance old_importance = 5;
3644 // New importance setting
3645 optional android.stats.sysui.NotificationImportance importance = 6;
3646}
3647
3648
3649/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003650 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003651 *
3652 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003653 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003654 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003655message BiometricAcquired {
3656 // Biometric modality that was acquired.
3657 optional android.hardware.biometrics.ModalityEnum modality = 1;
3658 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3659 optional int32 user = 2;
3660 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3661 optional bool is_crypto = 3;
3662 // Action that the device is performing. Acquired messages are only expected for enroll and
3663 // authenticate. Other actions may indicate an error.
3664 optional android.hardware.biometrics.ActionEnum action = 4;
3665 // The client that this acquisition was received for.
3666 optional android.hardware.biometrics.ClientEnum client = 5;
3667 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3668 optional int32 acquire_info = 6;
3669 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3670 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003671 // Dictates if this message should trigger additional debugging.
3672 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003673}
3674
3675/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003676 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003677 *
3678 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003679 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003680 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003681message BiometricAuthenticated {
3682 // Biometric modality that was used.
3683 optional android.hardware.biometrics.ModalityEnum modality = 1;
3684 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3685 optional int32 user = 2;
3686 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3687 // storage.
3688 optional bool is_crypto = 3;
3689 // The client that this acquisition was received for.
3690 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003691 // If authentication requires user confirmation. See BiometricPrompt's
3692 // setRequireConfirmation(bool) method.
3693 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003694
Kevin Chyn1741a072019-01-17 11:54:40 -08003695 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003696 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003697 REJECTED = 1;
3698 PENDING_CONFIRMATION = 2;
3699 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003700 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003701
3702 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003703 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003704 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3705 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3706 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3707 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003708 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003709 // Dictates if this message should trigger additional debugging.
3710 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003711}
3712
3713/**
3714 * Logs when a biometric error occurs.
3715 *
3716 * Logged from:
3717 * frameworks/base/services/core/java/com/android/server/biometrics
3718 */
3719message BiometricErrorOccurred {
3720 // Biometric modality that was used.
3721 optional android.hardware.biometrics.ModalityEnum modality = 1;
3722 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3723 optional int32 user = 2;
3724 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3725 optional bool is_crypto = 3;
3726 // Action that the device is performing.
3727 optional android.hardware.biometrics.ActionEnum action = 4;
3728 // The client that this acquisition was received for.
3729 optional android.hardware.biometrics.ClientEnum client = 5;
3730 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3731 // are unique to modality.
3732 optional int32 error_info = 6;
3733 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3734 // by the vendor and not specified by the HIDL interface.
3735 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003736 // Dictates if this message should trigger additional debugging.
3737 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003738 // Time spent during the authentication attempt.
3739 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003740}
3741
3742/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003743 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003744 * Logged from:
3745 * frameworks/base/services/core/java/com/android/server/biometrics
3746 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003747message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003748 // Biometric modality.
3749 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003750 // Type of issue detected.
3751 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003752 // Dictates if this message should trigger additional debugging.
3753 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003754}
Howard Ro688ae182018-09-25 00:09:36 -07003755
joshmccloskey6f952b22019-03-25 20:59:35 -07003756/**
3757 * Logs when a biometric enrollment occurs.
3758 *
3759 * Logged from:
3760 * frameworks/base/services/core/java/com/android/server/biometrics
3761 */
3762message BiometricEnrolled {
3763 // Biometric modality that was used.
3764 optional android.hardware.biometrics.ModalityEnum modality = 1;
3765 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3766 optional int32 user = 2;
3767 // The amount of time the enrollment took in milliseconds.
3768 optional int64 latency_millis = 3;
3769 // Whether or not the enrollment was successful.
3770 optional bool success = 4;
3771}
3772
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003773/*
Tej Singh0d176952019-01-16 19:10:54 -08003774 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003775 */
Tej Singh0d176952019-01-16 19:10:54 -08003776message FlagFlipUpdateOccurred {
3777 // If the event is from a flag config package, specify the package name.
3778 optional string flag_flip_package_name = 1;
3779
3780 // The order id of the package
3781 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003782}
3783
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003784/**
3785 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003786 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003787 */
3788message TrainExperimentIds {
3789 repeated int64 experiment_id = 1;
3790}
3791
Yangster-macb89807e2018-11-15 21:10:57 -08003792/*
3793 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003794 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003795 */
3796message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003797 // Name of the train.
3798 optional string train_name = 1;
3799 // Version code for a "train" of packages that need to be installed atomically
3800 optional int64 train_version_code = 2;
3801 // After installation of this package, device requires a restart.
3802 optional bool requires_staging = 3;
3803 // Rollback should be enabled for this install.
3804 optional bool rollback_enabled = 4;
3805 // Requires low latency monitoring if possible.
3806 optional bool requires_low_latency_monitor = 5;
3807
Yangster-macb89807e2018-11-15 21:10:57 -08003808 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003809 UNKNOWN = 0;
3810 INSTALL_REQUESTED = 1;
3811 INSTALL_STARTED = 2;
3812 INSTALL_STAGED_NOT_READY = 3;
3813 INSTALL_STAGED_READY = 4;
3814 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003815 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3816 // and INSTALL_FAILURE_COMMIT.
3817 INSTALL_FAILURE = 6 [deprecated = true];
3818 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003819 INSTALL_CANCELLED = 7;
3820 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003821 INSTALLER_ROLLBACK_INITIATED = 9;
3822 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3823 INSTALLER_ROLLBACK_STAGED = 11;
3824 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3825 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3826 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3827 INSTALLER_ROLLBACK_SUCCESS = 15;
3828 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003829 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3830 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3831 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3832 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3833 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3834 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003835 INSTALL_FAILURE_DOWNLOAD = 23;
3836 INSTALL_FAILURE_STATE_MISMATCH = 24;
3837 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003838 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003839 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003840 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003841 // Possible experiment ids for monitoring this push.
3842 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3843 // user id
3844 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003845 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003846 // Whether or not this is a rollback event
3847 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003848}
3849
Tej Singhc9203082019-05-03 13:42:23 -07003850/* Test atom, is not logged anywhere */
3851message TestAtomReported {
3852 repeated AttributionNode attribution_node = 1;
3853 optional int32 int_field = 2;
3854 optional int64 long_field = 3;
3855 optional float float_field = 4;
3856 optional string string_field = 5;
3857 optional bool boolean_field = 6;
3858 enum State {
3859 UNKNOWN = 0;
3860 OFF = 1;
3861 ON = 2;
3862 }
3863 optional State state = 7;
3864 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3865}
3866
Maggie Whitefc1aa592018-11-28 21:55:23 -08003867/** Represents USB port overheat event. */
3868message UsbPortOverheatEvent {
3869 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3870 optional int32 plug_temperature_deci_c = 1;
3871
3872 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3873 optional int32 max_temperature_deci_c = 2;
3874
3875 /* Time between USB plug event and overheat threshold trip, in seconds. */
3876 optional int32 time_to_overheat_secs = 3;
3877
3878 /* Time between overheat threshold trip and hysteresis, in seconds. */
3879 optional int32 time_to_hysteresis_secs = 4;
3880
3881 /* Time between hysteresis and active mitigation ending, in seconds. */
3882 optional int32 time_to_inactive_secs = 5;
3883};
3884
Maggie White8735b852019-01-18 11:40:49 -08003885/**
3886 * Logs total effective full charge and discharge cycles on a battery.
3887 * Here are some examples of one effective cycle:
3888 * 1) the battery charges from 0% to 100% and drains back to 0%,
3889 * 2) charging from 50% to 100% and draining back to 50% twice.
3890 * Pulled from:
3891 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3892 */
3893message BatteryCycleCount {
3894 /* Number of total charge and discharge cycles on the system battery. */
3895 optional int32 cycle_count = 1;
3896}
3897
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003898/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003899 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3900 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003901 * Pulled from:
3902 * StatsCompanionService
3903 */
3904
Carmen Agimof12dec122019-03-06 16:14:38 +00003905message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003906
Carmen Agimof12dec122019-03-06 16:14:38 +00003907 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003908 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003909 PUBLIC = 1;
3910 PRIVATE = 2;
3911 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003912 }
3913
Carmen Agimof12dec122019-03-06 16:14:38 +00003914 // The type of external storage.
3915 optional android.stats.storage.ExternalStorageType storage_type = 1;
3916 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3917 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003918 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003919 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003920}
3921
Yangster-macb89807e2018-11-15 21:10:57 -08003922/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003923 * Logs when a connection becomes available and lost.
3924 * Logged in StatsCompanionService.java
3925 */
3926message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003927 // Id of the network.
3928 optional int32 net_id = 1;
3929
3930 enum State {
3931 UNKNOWN = 0;
3932 CONNECTED = 1;
3933 DISCONNECTED = 2;
3934 }
3935 // Connected state of a network.
3936 optional State state = 2;
3937}
3938
3939/**
3940 * Logs when a service starts and stops.
3941 * Logged from:
3942 * services/core/java/com/android/server/am/ActiveServices.java
3943 */
3944message ServiceStateChanged {
3945
3946 optional int32 uid = 1 [(is_uid) = true];
3947
3948 optional string package_name = 2;
3949
3950 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003951
3952 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003953 START = 1;
3954 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003955 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003956
3957 optional State state = 4;
3958}
3959
3960/**
3961 * Logs when a service is launched.
3962 * Logged from:
3963 * services/core/java/com/android/server/am/ActiveServices.java
3964 */
3965message ServiceLaunchReported {
3966
3967 optional int32 uid = 1 [(is_uid) = true];
3968
3969 optional string package_name = 2;
3970
3971 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003972}
Howard Ro688ae182018-09-25 00:09:36 -07003973
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003974/**
3975 * Logs when a hidden API is used.
3976 *
3977 * Logged from:
3978 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3979 */
3980message HiddenApiUsed {
3981 // The uid of the app making the hidden access.
3982 optional int32 uid = 1 [(is_uid) = true];
3983
3984 // Signature of the method or field accessed.
3985 optional string signature = 2;
3986
3987 enum AccessMethod {
3988 NONE = 0;
3989 REFLECTION = 1;
3990 JNI = 2;
3991 LINKING = 3;
3992 }
3993
3994 // Type of access.
3995 optional AccessMethod access_method = 3;
3996
3997 // Whether the access was prevented or not.
3998 optional bool access_denied = 4;
3999}
4000
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004001/**
4002 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4003 * - When user sees privacy chip
4004 * - When user clicks privacy chip
4005 * - How does the user exit the Privacy Dialog
4006 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004007 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4008 */
4009message PrivacyIndicatorsInteracted {
4010
4011 enum Type {
4012 UNKNOWN = 0;
4013 CHIP_VIEWED = 1;
4014 CHIP_CLICKED = 2;
4015 DIALOG_PRIVACY_SETTINGS = 3;
4016 DIALOG_DISMISS = 4;
4017 DIALOG_LINE_ITEM = 5;
4018 }
4019
tsaichristine5adc7e02020-01-14 17:07:39 -08004020 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004021
4022 // Used if the type is LINE_ITEM
4023 optional string package_name = 2;
4024}
4025
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004026/**
4027 * Logs information about a package that is moved from the internal to external storage and vice
4028 * versa.
4029 * It logs the package name, the type of the external storage where the package is installed
4030 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4031 * and the move type: if it's from internal to external or the other way around.
4032 *
4033 * Logged from:
4034 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4035 */
4036message AppMovedStorageReported {
4037 enum MoveType {
4038 UNKNOWN = 0;
4039 TO_EXTERNAL = 1;
4040 TO_INTERNAL = 2;
4041 }
4042 // The type of the external storage.
4043 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4044 // The type of move.
4045 optional MoveType move_type = 2;
4046 // The name of the package that was moved.
4047 optional string package_name = 3;
4048}
4049
jianjin8f2dee02019-03-29 14:03:08 -07004050/**
4051 * Logs when system server watchdog occurs.
4052 * Logged from:
4053 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4054 */
4055message SystemServerWatchdogOccurred {
4056 optional string subject = 1;
4057}
4058
4059/**
4060 * Logs when new file added to tombstones.
4061 * Logged from:
4062 * frameworks/base/core/java/com/android/server/BootReceiver.java
4063 */
4064message TombStoneOccurred {
4065}
4066
Hai Zhang5d3328d2019-04-13 21:25:06 +08004067/*
4068 * Information about a role request
4069 *
4070 * Logged from:
4071 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4072 */
4073message RoleRequestResultReported {
4074 // UID of application requesting the role
4075 optional int32 requesting_uid = 1;
4076
4077 // Package name of application requesting the role
4078 optional string requesting_package_name = 2;
4079
4080 // The role to be granted
4081 optional string role_name = 3;
4082
4083 // The count of applications qualifying for the role
4084 optional int32 qualifying_count = 4;
4085
4086 // UID of application current granted the role
4087 optional int32 current_uid = 5;
4088
4089 // Package name of application current granted the role
4090 optional string current_package_name = 6;
4091
4092 // UID of another application that user chose to grant the role to, instead of the requesting
4093 // application
4094 optional int32 granted_another_uid = 7;
4095
4096 // Package name of another application that user chose to grant the role to, instead of the
4097 // requesting application
4098 optional string granted_another_package_name = 8;
4099
4100 enum Result {
4101 UNDEFINED = 0;
4102 // role request was ignored
4103 IGNORED = 1;
4104 // role request was ignored because it's already granted
4105 IGNORED_ALREADY_GRANTED = 2;
4106 // role request was ignored because the application isn't qualified
4107 IGNORED_NOT_QUALIFIED = 3;
4108 // role request was ignored because user said it should be always denied
4109 IGNORED_USER_ALWAYS_DENIED = 4;
4110 // role was granted by user action
4111 USER_GRANTED = 5;
4112 // role was denied by user action
4113 USER_DENIED = 6;
4114 // role was denied by user granting another application the role
4115 USER_DENIED_GRANTED_ANOTHER = 7;
4116 // role was denied and set to be always denied by the user
4117 USER_DENIED_WITH_ALWAYS = 8;
4118 }
4119 // The result of the role request
4120 optional Result result = 9;
4121}
4122
Mark Tabrya824a642019-11-05 12:26:12 -08004123/**
4124 * Logs when a Vehicle Maps Service client's connection state has changed
4125 *
4126 * Logged from:
4127 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4128 */
4129message VmsClientConnectionStateChanged {
4130 // The UID of the VMS client app
4131 optional int32 uid = 1 [(is_uid) = true];
4132
4133 enum State {
4134 UNKNOWN = 0;
4135 // Attempting to connect to the client
4136 CONNECTING = 1;
4137 // Client connection established
4138 CONNECTED = 2;
4139 // Client connection closed unexpectedly
4140 DISCONNECTED = 3;
4141 // Client connection closed by VMS
4142 TERMINATED = 4;
4143 // Error establishing the client connection
4144 CONNECTION_ERROR = 5;
4145 }
4146
4147 optional State state = 2;
4148}
4149
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004150/**
4151 * Logs when MediaProvider has successfully finished scanning a storage volume.
4152 *
4153 * Logged from:
4154 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4155 */
4156message MediaProviderScanEvent {
4157 enum Reason {
4158 // Scan triggered due to unknown reason
4159 UNKNOWN = 0;
4160 // Scan triggered due to storage volume being mounted
4161 MOUNTED = 1;
4162 // Scan triggered due to explicit user action or app request
4163 DEMAND = 2;
4164 // Scan triggered due to idle maintenance
4165 IDLE = 3;
4166 }
4167
4168 // Volume type that this event pertains to
4169 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4170 // Reason why this scan was triggered
4171 optional Reason reason = 2;
4172 // Total number of files scanned
4173 optional int64 item_count = 3;
4174 // Duration of scan, normalized per file
4175 optional float normalized_duration_millis = 4;
4176 // Number of database inserts, normalized per file
4177 optional float normalized_insert_count = 5;
4178 // Number of database updates, normalized per file
4179 optional float normalized_update_count = 6;
4180 // Number of database deletes, normalized per file
4181 optional float normalized_delete_count = 7;
4182}
4183
4184/**
4185 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4186 *
4187 * Logged from:
4188 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4189 */
4190message MediaProviderDeletionEvent {
4191 // Volume type that this event pertains to
4192 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4193 // Device timestamp when this deletion event occurred
4194 optional int64 timestamp_millis = 2;
4195 // App that requested deletion
4196 optional string package_name = 3;
4197 // Number of items that were deleted
4198 optional int32 item_count = 4;
4199}
4200
4201/**
4202 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4203 *
4204 * Logged from:
4205 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4206 */
4207message MediaProviderPermissionEvent {
4208 enum Result {
4209 UNKNOWN = 0;
4210 USER_GRANTED = 1;
4211 AUTO_GRANTED = 2;
4212 USER_DENIED = 3;
4213 USER_DENIED_WITH_PREJUDICE = 4;
4214 AUTO_DENIED = 5;
4215 }
4216
4217 // Volume type that this event pertains to
4218 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4219 // Device timestamp when this permission event occurred
4220 optional int64 timestamp_millis = 2;
4221 // App that requested permission
4222 optional string package_name = 3;
4223 // Number of items that were requested
4224 optional int32 item_count = 4;
4225 // Result of this request
4226 optional Result result = 5;
4227}
4228
4229/**
4230 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4231 *
4232 * Logged from:
4233 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4234 */
4235message MediaProviderSchemaChange {
4236 // Volume type that this event pertains to
4237 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4238 // Old database version code
4239 optional int32 version_from = 2;
4240 // New database version code
4241 optional int32 version_to = 3;
4242 // Total number of files in database
4243 optional int64 item_count = 4;
4244 // Duration of schema change, normalized per file
4245 optional float normalized_duration_millis = 5;
4246}
4247
4248/**
4249 * Logs when MediaProvider has finished an idle maintenance job.
4250 *
4251 * Logged from:
4252 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4253 */
4254message MediaProviderIdleMaintenance {
4255 // Volume type that this event pertains to
4256 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4257
4258 // Total number of files in database
4259 optional int64 item_count = 2;
4260 // Duration of idle maintenance, normalized per file
4261 optional float normalized_duration_millis = 3;
4262 // Number of thumbnails found to be stale, normalized per file
4263 optional float normalized_stale_thumbnails = 4;
4264 // Number of items found to be expired, normalized per file
4265 optional float normalized_expired_media = 5;
4266}
4267
Keun young Park3e033cb2019-12-18 11:27:35 -08004268/**
4269 * Represents boot time event with duration in ms.
4270 *
4271 * Logged from: bootstat and various system server components. Check each enums for details.
4272 */
4273message BootTimeEventDuration {
4274 enum DurationEvent {
4275 UNKNOWN = 0;
4276 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4277 ABSOLUTE_BOOT_TIME = 1;
4278 // Bootloader's 1st stage execution time.
4279 // Logged from bootstat.
4280 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4281 // Bootloader's 1st stage loading time.
4282 // Logged from bootstat.
4283 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4284 // Bootloader's kernel loading time.
4285 // Logged from bootstat.
4286 BOOTLOADER_KERNEL_LOAD = 4;
4287 // Bootloader's 2nd stage execution time.
4288 // Logged from bootstat.
4289 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4290 // Bootloader's 2nd stage loading time.
4291 // Logged from bootstat.
4292 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4293 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4294 // for locked device.
4295 // Logged from bootstat.
4296 BOOTLOADER_UI_WAIT = 7;
4297 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4298 // Logged from bootstat.
4299 BOOTLOADER_TOTAL = 8;
4300 // Shutdown duration inside init for the reboot before the current boot up.
4301 // Logged from f/b/services/.../BootReceiver.java.
4302 SHUTDOWN_DURATION = 9;
4303 // Total time for mounting of disk devices during bootup.
4304 // Logged from f/b/services/.../BootReceiver.java.
4305 MOUNT_DEFAULT_DURATION = 10;
4306 // Total time for early stage mounting of disk devices during bootup.
4307 // Logged from f/b/services/.../BootReceiver.java.
4308 MOUNT_EARLY_DURATION = 11;
4309 // Total time for late stage mounting of disk devices during bootup.
4310 // Logged from f/b/services/.../BootReceiver.java.
4311 MOUNT_LATE_DURATION = 12;
4312 // Average time to scan non-system app after OTA
4313 // Logged from f/b/services/.../PackageManagerService.java
4314 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4315 // Time to initialize Package manager after OTA
4316 // Logged from f/b/services/.../PackageManagerService.java
4317 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4318 // Time to scan all system app from Package manager after OTA
4319 // Logged from f/b/services/.../PackageManagerService.java
4320 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4321 // Init's total time for cold boot stage.
4322 // Logged from bootstat.
4323 COLDBOOT_WAIT = 16;
4324 // Init's total time for initializing selinux.
4325 // Logged from bootstat.
4326 SELINUX_INIT = 17;
4327 // Time since last factory reset.
4328 // Logged from bootstat.
4329 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004330 // Init's total time spent for completing the 1st stage.
4331 // Logged from bootstat.
4332 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004333 }
4334
4335 // Type of the event.
4336 optional DurationEvent event = 1;
4337 // Duration of the event in ms.
4338 optional int64 duration_millis = 2;
4339}
4340
4341/**
4342 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4343 * since boot-up.
4344 *
4345 * Logged from: bootstat and various system server components. Check each enums for details.
4346 */
4347message BootTimeEventElapsedTime {
4348 enum ElapsedTimeEvent {
4349 UNKNOWN = 0;
4350 // Time when init starts 1st stage. Logged from bootstat.
4351 ANDROID_INIT_STAGE_1 = 1;
4352 // Time when sys.boot_completed prop is set.
4353 // Logged from bootstat.
4354 BOOT_COMPLETE = 2;
4355 // BOOT_COMPLETE for encrypted device.
4356 BOOT_COMPLETE_ENCRYPTION = 3;
4357 // BOOT_COMPLETE for device with no encryption.
4358 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4359 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004360 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004361 // BOOT_COMPLETE after factory reset.
4362 FACTORY_RESET_BOOT_COMPLETE = 6;
4363 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4364 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004365 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4366 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004367 // BOOT_COMPLETE after OTA.
4368 OTA_BOOT_COMPLETE = 9;
4369 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4370 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004371 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4372 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004373 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4374 // Logged from f/b/services/.../UserController.java
4375 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4376 // Time when the system starts sending BOOT_COMPLETED broadcast.
4377 // Logged from f/b/services/.../UserController.java
4378 FRAMEWORK_BOOT_COMPLETED = 13;
4379 // Time when the package manager starts init.
4380 // Logged from f/b/services/.../SystemServer.java
4381 PACKAGE_MANAGER_INIT_START = 14;
4382 // Time when package manager is ready
4383 // Logged from f/b/services/.../SystemServer.java
4384 PACKAGE_MANAGER_INIT_READY = 15;
4385 // Represents the time when user has entered unlock credential for system with user pin.
4386 // Logged from bootstat.
4387 POST_DECRYPT = 16;
4388 // Represents the start of zygote's init.
4389 // Logged from zygote itself.
4390 ZYGOTE_INIT_START = 17;
4391 // Represents the start of secondary zygote's init.
4392 // TODO: add logging to zygote
4393 SECONDARY_ZYGOTE_INIT_START = 18;
4394 // Represents the start of system server's init.
4395 // Logged from f/b/services/.../SystemServer.java
4396 SYSTEM_SERVER_INIT_START = 19;
4397 // Represents the completion of system server's init.
4398 // Logged from f/b/services/.../SystemServer.java
4399 SYSTEM_SERVER_READY = 20;
4400 // Represents the start of launcher during boot-up.
4401 // TODO: add logging
4402 LAUNCHER_START = 21;
4403 // Represents the completion of launcher's initial rendering. User can use other apps from
4404 // launcher from this point.
4405 // TODO: add logging
4406 LAUNCHER_SHOWN = 22;
4407 }
4408
4409 // Type of the event.
4410 optional ElapsedTimeEvent event = 1;
4411 // Time since bootup for the event.
4412 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4413 optional int64 time_millis = 2;
4414}
4415
4416/**
4417 * Boot time events with UTC time.
4418 *
4419 * Logged from: bootstat and various system server components. Check each enums for details.
4420 */
4421message BootTimeEventUtcTime {
4422 enum UtcTimeEvent {
4423 UNKNOWN = 0;
4424 // Time of the bootstat's marking of 1st boot after the last factory reset.
4425 // Logged from bootstat.
4426 FACTORY_RESET_RESET_TIME = 1;
4427 // The time when bootstat records FACTORY_RESET_* events. This is close to
4428 // BOOT_COMPLETE time for the current bootup.
4429 // Logged from bootstat.
4430 FACTORY_RESET_CURRENT_TIME = 2;
4431 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4432 // Logged from bootstat.
4433 FACTORY_RESET_RECORD_VALUE = 3;
4434 }
4435
4436 // Type of the event.
4437 optional UtcTimeEvent event = 1;
4438 // UTC time for the event.
4439 optional int64 utc_time_secs = 2;
4440}
4441
4442/**
4443 * Boot time events representing specific error code during bootup.
4444 * Meaning of error code can be different per each event type.
4445 *
4446 * Logged from: bootstat and various system server components. Check each enums for details.
4447 */
4448message BootTimeEventErrorCode {
4449 enum ErrorCodeEvent {
4450 UNKNOWN = 0;
4451 // Linux error code for time() call to get the current UTC time.
4452 // Logged from bootstat.
4453 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4454 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4455 // as UMOUNT_STAT_* from init/reboot.cpp.
4456 // Logged from f/b/services/.../BootReceiver.java.
4457 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004458 // Reprepsents fie system mounting error code of /data partition for the current boot.
4459 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004460 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004461 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004462 }
4463
4464 // Type of the event.
4465 optional ErrorCodeEvent event = 1;
4466 // error code defined per each event type.
4467 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4468 // FS_MGR_FS_STAT.
4469 optional int32 error_code = 2;
4470}
4471
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004472/**
4473 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4474 * after an OTA.
4475 *
4476 * Logged from:
4477 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4478 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4479 */
4480message SnapshotMergeReported {
4481 // Keep in sync with
4482 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4483 enum UpdateState {
4484 // No update or merge is in progress.
4485 NONE = 0;
4486 // An update is applying; snapshots may already exist.
4487 INITIATED = 1;
4488 // An update is pending, but has not been successfully booted yet.
4489 UNVERIFIED = 2;
4490 // The kernel is merging in the background.
4491 MERGING = 3;
4492 // Post-merge cleanup steps could not be completed due to a transient
4493 // error, but the next reboot will finish any pending operations.
4494 MERGE_NEEDS_REBOOT = 4;
4495 // Merging is complete, and needs to be acknowledged.
4496 MERGE_COMPLETED = 5;
4497 // Merging failed due to an unrecoverable error.
4498 MERGE_FAILED = 6;
4499 // The update was implicitly cancelled, either by a rollback or a flash
4500 // operation via fastboot. This state can only be returned by WaitForMerge.
4501 CANCELLED = 7;
4502 };
4503
4504 // Status of the update after the merge attempts.
4505 optional UpdateState final_state = 1;
4506
4507 // Time to complete a merge operation in milliseconds.
4508 // A negative value corresponds to the case in which the merge operation
4509 // was interrupted and resumed (e.g. in case of a system reboot during the
4510 // merge).
4511 optional int64 duration_millis = 2;
4512
4513 // Number of reboots that occurred after issuing and before completing the
4514 // merge of all the snapshot devices.
4515 optional int32 intermediate_reboots = 3;
4516}
4517
Chenjie Yubbcbc602018-02-05 16:51:52 -08004518//////////////////////////////////////////////////////////////////////
4519// Pulled atoms below this line //
4520//////////////////////////////////////////////////////////////////////
4521
4522/**
David Chenc8a43242017-10-17 16:23:28 -07004523 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4524 *
4525 * Pulled from:
4526 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4527 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004528message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004529 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004530
4531 optional int64 rx_bytes = 2;
4532
4533 optional int64 rx_packets = 3;
4534
4535 optional int64 tx_bytes = 4;
4536
4537 optional int64 tx_packets = 5;
4538}
4539
4540/**
4541 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4542 *
4543 * Pulled from:
4544 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004546message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004547 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004548
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004549 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4550 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004551
4552 optional int64 rx_bytes = 3;
4553
4554 optional int64 rx_packets = 4;
4555
4556 optional int64 tx_bytes = 5;
4557
4558 optional int64 tx_packets = 6;
4559}
4560
4561/**
4562 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4563 *
4564 * Pulled from:
4565 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4566 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004567message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004568 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004569
4570 optional int64 rx_bytes = 2;
4571
4572 optional int64 rx_packets = 3;
4573
4574 optional int64 tx_bytes = 4;
4575
4576 optional int64 tx_packets = 5;
4577}
4578
4579/**
4580 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4581 *
4582 * Pulled from:
4583 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4584 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004585message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004586 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004587
Yao Chenc40a19d2018-03-15 16:48:25 -07004588 // 1 denotes foreground and 0 denotes background. This is called Set in
4589 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004590 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004591
4592 optional int64 rx_bytes = 3;
4593
4594 optional int64 rx_packets = 4;
4595
4596 optional int64 tx_bytes = 5;
4597
4598 optional int64 tx_packets = 6;
4599}
4600
4601/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004602 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4603 *
4604 * Pulled from:
4605 * StatsCompanionService
4606 */
4607message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004608 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004609
4610 optional int64 rx_bytes = 2;
4611
4612 optional int64 tx_bytes = 3;
4613}
4614
4615/**
David Chenc8a43242017-10-17 16:23:28 -07004616 * Pulls the kernel wakelock durations. This atom is adapted from
4617 * android/internal/os/KernelWakelockStats.java
4618 *
4619 * Pulled from:
4620 * StatsCompanionService using KernelWakelockReader.
4621 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004622message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004623 optional string name = 1;
4624
4625 optional int32 count = 2;
4626
4627 optional int32 version = 3;
4628
Yangster-maca8a30442018-10-13 23:46:34 -07004629 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004630}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004631
Chenjie Yu05013b32017-11-21 10:21:41 -08004632/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004633 * Pulls low power state information. If power.stats HAL is not available, this
4634 * includes platform and subsystem sleep state information,
4635 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4636 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004637 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004638 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004639 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4640 * as defined in:
4641 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004642 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004643message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004644 // Subsystem name
4645 optional string subsystem_name = 1;
4646 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4647 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004648 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4649 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004650 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004651 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004652 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004653 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004654 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004655}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004656
Chenjie Yu05013b32017-11-21 10:21:41 -08004657/**
Bookatz92da2832018-11-01 18:10:03 -07004658 * Pulls on-device power measurement information.
4659 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4660 * Pulled from:
4661 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4662 */
4663message OnDevicePowerMeasurement {
4664 // Name of the subsystem (to which the rail belongs).
4665 optional string subsystem_name = 1;
4666
4667 // Rail name. The rail lies within the subsystem.
4668 optional string rail_name = 2;
4669
4670 // Time (in ms since boot) at which the rail energy value was measured.
4671 // This may differ slightly from the time that statsd logs this information.
4672 optional uint64 measurement_timestamp_millis = 3;
4673
4674 // Accumulated energy used via the rail since device boot in uWs.
4675 optional uint64 energy_microwatt_secs = 4;
4676}
4677
4678/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004679 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004680 * Pulls the time the cpu spend on the frequency index. Frequency index
4681 * starts from highest to lowest. The value should be monotonically
4682 * increasing since boot. However, if there is a cpu
4683 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004684 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004685message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004686 optional uint32 cluster = 1;
4687 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004688 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004689}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004690
Chenjie Yu05013b32017-11-21 10:21:41 -08004691/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004692 * Pulls Cpu Time Per Uid.
4693 * Note that isolated process uid time should be attributed to host uids.
4694 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004695message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004696 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004697 optional uint64 user_time_micros = 2;
4698 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004699}
4700
4701/**
4702 * Pulls Cpu Time Per Uid per frequency.
4703 * Note that isolated process uid time should be attributed to host uids.
4704 * For each uid, we order the time by descending frequencies.
4705 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004706message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004707 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004708 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004709 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004710}
Hugo Benichi884970e2017-11-14 22:42:46 +09004711
Chenjie Yu05013b32017-11-21 10:21:41 -08004712/**
4713 * Pulls Wifi Controller Activity Energy Info
4714 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004715message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004716 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004717 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004718 // stack reported state
4719 // TODO: replace this with proto enum
4720 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004721 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004722 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004723 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004724 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004725 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004726 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004727 // product of current(mA), voltage(V) and time(ms)
4728 optional uint64 controller_energy_used = 6;
4729}
4730
4731/**
4732 * Pulls Modem Activity Energy Info
4733 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004734message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004735 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004736 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004737 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004738 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004739 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004740 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004741 /**
4742 * Tx power index
4743 * index 0 = tx_power < 0dBm
4744 * index 1 = 0dBm < tx_power < 5dBm
4745 * index 2 = 5dBm < tx_power < 15dBm
4746 * index 3 = 15dBm < tx_power < 20dBm
4747 * index 4 = tx_power > 20dBm
4748 */
4749 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004750 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004751 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004752 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004753 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004754 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004755 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004758 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004759 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004760 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004761 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004762 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004763}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004764
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004765/**
4766 * Pulls Bluetooth Activity Energy Info
4767 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4768 */
4769message BluetoothActivityInfo {
4770 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004771 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004772 // bluetooth stack state
4773 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004774 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004776 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004777 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004778 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004779 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004780 // product of current(mA), voltage(V) and time(ms)
4781 optional uint64 energy_used = 6;
4782}
4783
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004784/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004785 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004786 *
4787 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004788 */
4789message ProcessMemoryState {
4790 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004791 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004792
4793 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004794 // Usually package name, "system" for system server.
4795 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004796 optional string process_name = 2;
4797
Rafal Slawikda51b932018-12-13 16:31:33 +00004798 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004799 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004800
4801 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004802 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004803
4804 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004805 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004806
Rajeev Kumar90235992018-01-29 11:06:48 -08004807 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004808 // Value is read from memory.stat, field total_rss if per-app memory
4809 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004810 optional int64 rss_in_bytes = 6;
4811
4812 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004813 // Value is read from memory.stat, field total_cache if per-app memory
4814 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004815 optional int64 cache_in_bytes = 7;
4816
4817 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004818 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004819 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004820 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004821
Rafal Slawik203c3db2019-09-25 19:53:01 +01004822 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004823 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004824
Rafal Slawik203c3db2019-09-25 19:53:01 +01004825 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4826 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004827
Rafal Slawik203c3db2019-09-25 19:53:01 +01004828 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4829 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004830}
4831
4832/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004833 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004834 *
4835 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4836 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004837 *
4838 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004839 */
4840message ProcessMemoryHighWaterMark {
4841 // The uid if available. -1 means not available.
4842 optional int32 uid = 1 [(is_uid) = true];
4843
Rafal Slawikda51b932018-12-13 16:31:33 +00004844 // The process name.
4845 // Usually package name or process cmdline.
4846 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004847 optional string process_name = 2;
4848
Rafal Slawik239b6802019-09-09 18:46:01 +01004849 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4850 // computed by converting kilobytes to bytes.
4851 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4852
Rafal Slawik3bea8952018-11-15 12:39:33 +00004853 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4854 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004855 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004856}
4857
4858/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004859 * Logs the memory stats for a process.
4860 *
4861 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4862 * and for selected native processes.
4863 */
4864message ProcessMemorySnapshot {
4865 // The uid if available. -1 means not available.
4866 optional int32 uid = 1 [(is_uid) = true];
4867
4868 // The process name.
4869 // Usually package name or process cmdline.
4870 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4871 optional string process_name = 2;
4872
4873 // The pid of the process.
4874 // Allows to disambiguate instances of the process.
4875 optional int32 pid = 3;
4876
4877 // The current OOM score adjustment value.
4878 // Read from ProcessRecord for managed processes.
4879 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4880 optional int32 oom_score_adj = 4;
4881
4882 // The current RSS of the process.
4883 // VmRSS from /proc/pid/status.
4884 optional int32 rss_in_kilobytes = 5;
4885
4886 // The current anon RSS of the process.
4887 // RssAnon from /proc/pid/status.
4888 optional int32 anon_rss_in_kilobytes = 6;
4889
4890 // The current swap size of the process.
4891 // VmSwap from /proc/pid/status.
4892 optional int32 swap_in_kilobytes = 7;
4893
4894 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4895 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4896}
4897
4898/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004899 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004900 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004901message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004902 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004903}
4904
4905/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004906 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004907 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004908message SystemUptime {
4909 // Milliseconds since the system was booted.
4910 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4911 // for external input).
4912 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004913 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004914}
4915
4916/*
4917 * Reads from /proc/uid_concurrent_active_time which has the format:
4918 * active: X (X is # cores)
4919 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4920 * [uid1]: [time-0] [time-1] [time-2] ... ...
4921 * ...
4922 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4923 * The file contains a monotonically increasing count of time for a single boot.
4924 */
4925message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004926 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004927 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004928}
4929
4930/**
4931 * Reads from /proc/uid_concurrent_policy_time which has the format:
4932 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4933 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4934 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4935 * ...
4936 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4937 * The file contains a monotonically increasing count of time for a single boot.
4938 */
4939message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004940 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004941 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004942 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004943}
4944
4945/*
4946 * Pulls free disk space, for data, system partition and temporary directory.
4947 */
4948message DiskSpace {
4949 // available bytes in data partition
4950 optional uint64 data_available_bytes = 1;
4951 // available bytes in system partition
4952 optional uint64 system_available_bytes = 2;
4953 // available bytes in download cache or temp directories
4954 optional uint64 temp_available_bytes = 3;
4955}
Tej Singhbf972d92018-01-10 20:51:13 -08004956
4957/**
4958 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004959 *
4960 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004961 */
4962message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004963 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004964}
4965
4966/**
4967 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004968 * Pulled from:
4969 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004970 */
4971message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004972 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004973}
4974
4975/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004976 * Pulls battery voltage.
4977 * Pulled from:
4978 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4979 */
4980message BatteryVoltage {
4981 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004982 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004983}
4984
4985/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004986 * Pulls battery level (percent full, from 0 to 100).
4987 *
4988 * Pulled from:
4989 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4990 */
4991message BatteryLevel {
4992 // Battery level. Should be in [0, 100].
4993 optional int32 battery_level = 1;
4994}
4995
4996/**
Tej Singhd89137e2018-03-26 14:51:40 -07004997 * Pulls the temperature of various parts of the device.
4998 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004999 *
Maggie White442b6312019-04-05 16:26:44 -07005000 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005001 */
5002message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005003 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005004 optional android.os.TemperatureTypeEnum sensor_location = 1;
5005
5006 // The name of the temperature source. Eg. CPU0
5007 optional string sensor_name = 2;
5008
Tej Singhd89137e2018-03-26 14:51:40 -07005009 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005010 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005011 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005012
5013 // Relative severity of the throttling, see enum definition.
5014 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005015}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005016
5017/**
5018 * Pulls the statistics of calls to Binder.
5019 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005020 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5021 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005022 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005023 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005024 */
5025message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005026 // UID of the process responsible for the binder transaction. It will be set if the process
5027 // executing the binder transaction attribute the transaction to another uid using
5028 // Binder.setThreadWorkSource().
5029 //
5030 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005031 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005032 // UID of the process executing the binder transaction.
5033 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005034 // Fully qualified class name of the API call.
5035 //
5036 // This is a system server class name.
5037 //
5038 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5039 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5040 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5041 // commonly used APIs.
5042 optional string service_class_name = 2;
5043 // Method name of the API call. It can also be a transaction code if we cannot
5044 // resolve it to a name. See Binder#getTransactionName.
5045 //
5046 // This is a system server method name.
5047 optional string service_method_name = 3;
5048 // Total number of API calls.
5049 optional int64 call_count = 4;
5050 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5051 optional bool screen_interactive = 13;
5052 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5053 // call_count will be equal to recorded_call_count.
5054 //
5055 // If recorded_call_count is different than call_count, it means data collection has been
5056 // sampled. All the fields below will be sampled in this case.
5057 optional int64 recorded_call_count = 12;
5058 // Number of exceptions thrown by the API.
5059 optional int64 recorded_exception_count = 5;
5060 // Total latency of all API calls.
5061 // Average can be computed using total_latency_micros / recorded_call_count.
5062 optional int64 recorded_total_latency_micros = 6;
5063 // Maximum latency of one API call.
5064 optional int64 recorded_max_latency_micros = 7;
5065 // Total CPU usage of all API calls.
5066 // Average can be computed using total_cpu_micros / recorded_call_count.
5067 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5068 optional int64 recorded_total_cpu_micros = 8;
5069 // Maximum CPU usage of one API call.
5070 optional int64 recorded_max_cpu_micros = 9;
5071 // Maximum parcel reply size of one API call.
5072 optional int64 recorded_max_reply_size_bytes = 10;
5073 // Maximum parcel request size of one API call.
5074 optional int64 recorded_max_request_size_bytes = 11;
5075}
5076
5077/**
5078 * Pulls the statistics of exceptions during calls to Binder.
5079 *
5080 * Binder stats are cumulative from boot unless somebody reset the data using
5081 * > adb shell dumpsys binder_calls_stats --reset
5082 */
5083message BinderCallsExceptions {
5084 // Exception class name, e.g. java.lang.IllegalArgumentException.
5085 //
5086 // This is an exception class name thrown by the system server.
5087 optional string exception_class_name = 1;
5088 // Total number of exceptions.
5089 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005090}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005091
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005092/**
5093 * Pulls the statistics of message dispatching on HandlerThreads.
5094 *
5095 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5096 * config on the device.
5097 *
5098 * Next tag: 11
5099 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005100message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005101 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005102 optional int32 uid = 1 [(is_uid) = true];
5103
5104 // Fully qualified class name of the handler target class.
5105 //
5106 // This field does not contain PII. This is a system server class name.
5107 optional string handler_class_name = 2;
5108
5109 // The name of the thread that runs the Looper.
5110 //
5111 // This field does not contain PII. This is a system server thread name.
5112 optional string looper_thread_name = 3;
5113
5114 // The name of the dispatched message.
5115 //
5116 // This field does not contain PII. This is a system server constant or class
5117 // name.
5118 optional string message_name = 4;
5119
5120 // Total number of successfully dispatched messages.
5121 optional int64 message_count = 5;
5122
5123 // Total number of messages that failed dispatching.
5124 optional int64 exception_count = 6;
5125
5126 // Total number of processed messages we have data recorded for. If we
5127 // collected data for all the messages, message_count will be equal to
5128 // recorded_message_count.
5129 //
5130 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005131 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005132 optional int64 recorded_message_count = 7;
5133
5134 // Total latency of all processed messages.
5135 // Average can be computed using recorded_total_latency_micros /
5136 // recorded_message_count.
5137 optional int64 recorded_total_latency_micros = 8;
5138
5139 // Total CPU usage of all processed message.
5140 // Average can be computed using recorded_total_cpu_micros /
5141 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005142 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005143 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005144
5145 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5146 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005147
5148 // Max recorded CPU usage of all processed messages.
5149 optional int64 recorded_max_cpu_micros = 11;
5150
5151 // Max recorded latency of all processed messages.
5152 optional int64 recorded_max_latency_micros = 12;
5153
5154 // Total number of messages we tracked the dispatching delay for. If we
5155 // collected data for all the messages, message_count will be equal to
5156 // recorded_delay_message_count.
5157 //
5158 // If recorded_delay_message_count is different than message_count, it means data
5159 // collection has been sampled or/and not all messages specified the target dispatch time.
5160 // The fields below will be sampled in this case.
5161 optional int64 recorded_delay_message_count = 13;
5162
5163 // Total dispatching delay of all processed messages.
5164 // Calculated as a difference between the target dispatching time (Message.when)
5165 // and the actual dispatching time.
5166 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5167 optional int64 recorded_total_delay_millis = 14;
5168
5169 // Max dispatching delay of all processed messages.
5170 // Calculated as a difference between the target dispatching time (Message.when)
5171 // and the actual dispatching time.
5172 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005173}
Tej Singh86dc9db2018-09-06 00:39:57 +00005174
5175/**
5176 * Pulls disk information, such as write speed and latency.
5177 */
5178message DiskStats {
5179 // Time taken to open, write 512B to, and close a file.
5180 // -1 if error performing the check.
5181 optional int64 data_write_latency_millis = 1;
5182
5183 optional bool file_based_encryption = 2;
5184
5185 // Recent disk write speed in kB/s.
5186 // -1 if error querying storageed.
5187 // 0 if data is unavailable.
5188 optional int32 recent_disk_write_speed = 3;
5189}
5190
5191
5192/**
5193 * Free and total bytes of the Data, Cache, and System partition.
5194 */
5195message DirectoryUsage {
5196 enum Directory {
5197 UNKNOWN = 0;
5198 DATA = 1;
5199 CACHE = 2;
5200 SYSTEM = 3;
5201 }
5202 optional Directory directory = 1;
5203 optional int64 free_bytes = 2;
5204 optional int64 total_bytes = 3;
5205}
5206
5207
5208/**
5209 * Size of an application: apk size, data size, and cache size.
5210 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5211 * Information is only reported for apps with the primary user (user 0).
5212 * Sizes are aggregated by package name.
5213 */
5214message AppSize {
5215 // Including uids will involve modifying diskstats logic.
5216 optional string package_name = 1;
5217 // App size in bytes. -1 if unavailable.
5218 optional int64 app_size_bytes = 2;
5219 // App data size in bytes. -1 if unavailable.
5220 optional int64 app_data_size_bytes = 3;
5221 // App cache size in bytes. -1 if unavailable.
5222 optional int64 app_cache_size_bytes = 4;
5223 // Time that the cache file was produced.
5224 // Uses System.currentTimeMillis(), which is wall clock time.
5225 optional int64 cache_time_millis = 5;
5226}
5227
5228
5229/**
5230 * Size of a particular category. Eg: photos, videos.
5231 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5232 */
5233message CategorySize {
5234 enum Category {
5235 UNKNOWN = 0;
5236 APP_SIZE = 1;
5237 APP_DATA_SIZE = 2;
5238 APP_CACHE_SIZE = 3;
5239 PHOTOS = 4;
5240 VIDEOS = 5;
5241 AUDIO = 6;
5242 DOWNLOADS = 7;
5243 SYSTEM = 8;
5244 OTHER = 9;
5245 }
5246 optional Category category = 1;
5247 // Category size in bytes.
5248 optional int64 size_bytes = 2;
5249 // Time that the cache file was produced.
5250 // Uses System.currentTimeMillis(), which is wall clock time.
5251 optional int64 cache_time_millis = 3;
5252}
Tej Singhd6d6d772018-09-05 17:41:25 -07005253
5254/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005255 * Pulls per uid I/O stats. The stats are cumulative since boot.
5256 *
5257 * Read/write bytes are I/O events from a storage device
5258 * Read/write chars are data requested by read/write syscalls, and can be
5259 * satisfied by caching.
5260 *
5261 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5262 */
5263message DiskIo {
5264 optional int32 uid = 1 [(is_uid) = true];
5265 optional int64 fg_chars_read = 2;
5266 optional int64 fg_chars_write = 3;
5267 optional int64 fg_bytes_read = 4;
5268 optional int64 fg_bytes_write = 5;
5269 optional int64 bg_chars_read = 6;
5270 optional int64 bg_chars_write = 7;
5271 optional int64 bg_bytes_read = 8;
5272 optional int64 bg_bytes_write = 9;
5273 optional int64 fg_fsync = 10;
5274 optional int64 bg_fsync= 11;
5275}
5276
5277
5278/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005279 * Pulls the number of fingerprints for each user.
5280 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005281 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005282 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005283message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005284 // The associated user. Eg: 0 for owners, 10+ for others.
5285 // Defined in android/os/UserHandle.java
5286 optional int32 user = 1;
5287 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005288 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005289}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005290
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005291/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005292 * Pulls the number of faces for each user.
5293 *
5294 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5295 */
5296message NumFacesEnrolled {
5297 // The associated user. Eg: 0 for owners, 10+ for others.
5298 // Defined in android/os/UserHandle.java
5299 optional int32 user = 1;
5300 // Number of faces registered to that user.
5301 optional int32 num_faces_enrolled = 2;
5302}
5303/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005304 * A mapping of role holder -> role
5305 */
5306message RoleHolder {
5307 // uid of the role holder
5308 optional int32 uid = 1 [(is_uid) = true];
5309
5310 // package name of the role holder
5311 optional string package_name = 2;
5312
5313 // the role held
5314 optional string role = 3;
5315}
5316
Yangsteraf9aee72018-10-12 09:26:16 -07005317message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005318 // These are all in byte resolution.
5319 optional int64 min = 1 [deprecated = true];
5320 optional int64 average = 2 [deprecated = true];
5321 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005322
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005323 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5324 // int64 fields.
5325 optional int32 mean_kb = 4;
5326 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005327}
5328
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005329// A reduced subset of process states; reducing the number of possible states allows more
5330// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5331enum ProcessStateAggregated {
5332 PROCESS_STATE_UNKNOWN = 0;
5333 // Persistent system process.
5334 PROCESS_STATE_PERSISTENT = 1;
5335 // Top activity; actually any visible activity.
5336 PROCESS_STATE_TOP = 2;
5337 // Process binding to top or a foreground service.
5338 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5339 // Processing running a foreground service.
5340 PROCESS_STATE_FGS = 4;
5341 // Important foreground process (ime, wallpaper, etc).
5342 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5343 // Important background process.
5344 PROCESS_STATE_BACKGROUND = 6;
5345 // Process running a receiver.
5346 PROCESS_STATE_RECEIVER = 7;
5347 // All kinds of cached processes.
5348 PROCESS_STATE_CACHED = 8;
5349}
5350
5351// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005352message ProcessStatsStateProto {
5353 optional android.service.procstats.ScreenState screen_state = 1;
5354
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005355 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005356
5357 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5358 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005359 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5360
5361 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005362
5363 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005364 optional int64 duration_millis = 4 [deprecated = true];
5365 // Same as above, but with minute resolution so it fits into an int32.
5366 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005367
5368 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005369 optional int64 realtime_duration_millis = 9 [deprecated = true];
5370 // Same as above, but with minute resolution so it fits into an int32.
5371 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005372
5373 // # of samples taken
5374 optional int32 sample_size = 5;
5375
5376 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005377 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005378
5379 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005380 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005381
5382 // RSS is memory resident for this process
5383 optional AggStats rss = 8;
5384}
5385
5386// Next Tag: 7
5387message ProcessStatsProto {
5388 // Name of process.
5389 optional string process = 1;
5390
5391 // Uid of the process.
5392 optional int32 uid = 2;
5393
5394 // Information about how often kills occurred
5395 message Kill {
5396 // Count of excessive CPU kills
5397 optional int32 cpu = 1;
5398
5399 // Count of kills when cached
5400 optional int32 cached = 2;
5401
5402 // PSS stats during cached kill
5403 optional AggStats cached_pss = 3;
5404 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005405 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005406
5407 // Time and memory spent in various states.
5408 repeated ProcessStatsStateProto states = 5;
5409
5410 // Total time process has been running... screen_state, memory_state, and process_state
5411 // will not be set.
5412 optional ProcessStatsStateProto total_running_state = 6;
5413}
5414
5415message PackageServiceOperationStatsProto {
5416 // Operate enum: Started, Foreground, Bound, Executing
5417 optional android.service.procstats.ServiceOperationState operation = 1;
5418
5419 // Number of times the service was in this operation.
5420 optional int32 count = 2;
5421
5422 // Information about a state the service can be in.
5423 message StateStats {
5424 // Screen state enum.
5425 optional android.service.procstats.ScreenState screen_state = 1;
5426 // Memory state enum.
5427 optional android.service.procstats.MemoryState memory_state = 2;
5428
5429 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005430 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005431 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005432 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005433 }
5434 repeated StateStats state_stats = 3;
5435}
5436
5437message PackageServiceStatsProto {
5438 // Name of service component.
5439 optional string service_name = 1;
5440
5441 // The operation stats.
5442 // The package_name, package_uid, package_version, service_name will not be set to save space.
5443 repeated PackageServiceOperationStatsProto operation_stats = 2;
5444}
5445
5446message PackageAssociationSourceProcessStatsProto {
5447 // Uid of the process.
5448 optional int32 process_uid = 1;
5449 // Process name.
5450 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005451 // Package name.
5452 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005453 // Total count of the times this association appeared.
5454 optional int32 total_count = 3;
5455
5456 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005457 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005458
5459 // Total count of the times this association became actively impacting its target process.
5460 optional int32 active_count = 5;
5461
5462 // Information on one source in this association.
5463 message StateStats {
5464 // Process state enum.
5465 optional android.service.procstats.ProcessState process_state = 1;
5466 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005467 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005468 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005469 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005470 }
5471 repeated StateStats active_state_stats = 6;
5472}
5473
5474message PackageAssociationProcessStatsProto {
5475 // Name of the target component.
5476 optional string component_name = 1;
5477 // Information on one source in this association.
5478 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5479}
5480
5481
5482message ProcessStatsPackageProto {
5483 // Name of package.
5484 optional string package = 1;
5485
5486 // Uid of the package.
5487 optional int32 uid = 2;
5488
5489 // Version of the package.
5490 optional int64 version = 3;
5491
5492 // Stats for each process running with the package loaded in to it.
5493 repeated ProcessStatsProto process_stats = 4;
5494
5495 // Stats for each of the package's services.
5496 repeated PackageServiceStatsProto service_stats = 5;
5497
5498 // Stats for each association with the package.
5499 repeated PackageAssociationProcessStatsProto association_stats = 6;
5500}
5501
5502message ProcessStatsSectionProto {
5503 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005504 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005505
5506 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005507 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005508
5509 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005510 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005511
5512 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005513 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005514
5515 // System runtime library. e.g. "libdvm.so", "libart.so".
5516 optional string runtime = 5;
5517
5518 // whether kernel reports swapped pss.
5519 optional bool has_swapped_pss = 6;
5520
5521 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5522 enum Status {
5523 STATUS_UNKNOWN = 0;
5524 STATUS_COMPLETE = 1;
5525 STATUS_PARTIAL = 2;
5526 STATUS_SHUTDOWN = 3;
5527 STATUS_SYSPROPS = 4;
5528 }
5529 repeated Status status = 7;
5530
Chenjie Yub2ecc792019-01-17 10:27:26 -08005531 // Number of pages available of various types and sizes, representation fragmentation.
5532 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5533
Yangsteraf9aee72018-10-12 09:26:16 -07005534 // Stats for each process.
5535 repeated ProcessStatsProto process_stats = 8;
5536
5537 // Stats for each package.
5538 repeated ProcessStatsPackageProto package_stats = 9;
5539}
5540
Chenjie Yub2ecc792019-01-17 10:27:26 -08005541message ProcessStatsAvailablePagesProto {
5542 // Node these pages are in (as per /proc/pagetypeinfo)
5543 optional int32 node = 1;
5544
5545 // Zone these pages are in (as per /proc/pagetypeinfo)
5546 optional string zone = 2;
5547
5548 // Label for the type of these pages (as per /proc/pagetypeinfo)
5549 optional string label = 3;
5550
5551 // Distribution of number of pages available by order size. First entry in array is
5552 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5553 repeated int32 pages_per_order = 4;
5554}
5555
Chenjie Yu12e5e672018-09-14 15:54:59 -07005556/**
5557 * Pulled from ProcessStatsService.java
5558 */
5559message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005560 optional ProcessStatsSectionProto proc_stats_section = 1;
5561}
5562
Chenjie Yuf910b7802019-01-11 16:08:20 -08005563/**
5564 * Pulled from ProcessStatsService.java
5565 */
5566message ProcStatsPkgProc {
5567 optional ProcessStatsSectionProto proc_stats_section = 1;
5568}
5569
Chris Wrencdea3b72019-11-22 16:58:17 -05005570// Next Tag: 2
5571message PackageRemoteViewInfoProto {
5572 optional string package_name = 1;
5573 // add per-package additional info here (like channels)
5574}
5575
5576// Next Tag: 2
5577message NotificationRemoteViewsProto {
5578 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5579}
5580
5581/**
5582 * Pulled from NotificationManagerService.java
5583 */
5584message NotificationRemoteViews {
5585 optional NotificationRemoteViewsProto notification_remote_views = 1;
5586}
5587
Yotam Aron74299972020-01-16 16:20:58 +02005588/**
5589 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5590 */
5591message PackageNotificationPreferences {
5592 // Uid under which the package is installed.
5593 optional int32 uid = 1;
5594 // Notification importance, which specifies when and how a notification is displayed.
5595 // Specified under core/java/android/app/NotificationManager.java.
5596 optional int32 importance = 2;
5597 // Lockscreen visibility as set by the user.
5598 optional int32 visibility = 3;
5599 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5600 // PreferencesHelper.java)
5601 optional int32 user_locked_fields = 4;
5602}
5603
5604/**
5605 * Atom that contains a list of a package's channel preferences, pulled from
5606 * NotificationManagerService.java.
5607 */
5608message PackageNotificationChannelPreferences {
5609 // Uid under which the package is installed.
5610 optional int32 uid = 1;
5611 // Channel's ID. Should always be available.
5612 optional string channel_id = 2;
5613 // Channel's name. Should always be available.
5614 optional string channel_name = 3;
5615 // Channel's description. Optionally set by the channel creator.
5616 optional string description = 4;
5617 // Notification importance, which specifies when and how a notification is displayed. Specified
5618 // under core/java/android/app/NotificationManager.java.
5619 optional int32 importance = 5;
5620 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5621 // at core/java/android/app/NotificationChannel.java
5622 optional int32 user_locked_fields = 6;
5623 // Indicates if the channel was deleted by the app.
5624 optional bool is_deleted = 7;
5625}
5626
5627/**
5628 * Atom that contains a list of a package's channel group preferences, pulled from
5629 * NotificationManagerService.java.
5630 */
5631message PackageNotificationChannelGroupPreferences {
5632 // Uid under which the package is installed.
5633 optional int32 uid = 1;
5634 // Channel Group's ID. Should always be available.
5635 optional string group_id = 2;
5636 // Channel Group's name. Should always be available.
5637 optional string group_name = 3;
5638 // Channel Group's description. Optionally set by group creator.
5639 optional string description = 4;
5640 // Indicates if notifications from this channel group are blocked.
5641 optional bool is_blocked = 5;
5642 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5643 // at core/java/android/app/NotificationChannelGroup.java
5644 optional int32 user_locked_fields = 6;
5645}
5646
Yangsteraf9aee72018-10-12 09:26:16 -07005647message PowerProfileProto {
5648 optional double cpu_suspend = 1;
5649
5650 optional double cpu_idle = 2;
5651
5652 optional double cpu_active = 3;
5653
5654 message CpuCluster {
5655 optional int32 id = 1;
5656 optional double cluster_power = 2;
5657 optional int32 cores = 3;
5658 repeated int64 speed = 4;
5659 repeated double core_power = 5;
5660 }
5661
5662 repeated CpuCluster cpu_cluster = 40;
5663
5664 optional double wifi_scan = 4;
5665
5666 optional double wifi_on = 5;
5667
5668 optional double wifi_active = 6;
5669
5670 optional double wifi_controller_idle = 7;
5671
5672 optional double wifi_controller_rx = 8;
5673
5674 optional double wifi_controller_tx = 9;
5675
5676 repeated double wifi_controller_tx_levels = 10;
5677
5678 optional double wifi_controller_operating_voltage = 11;
5679
5680 optional double bluetooth_controller_idle = 12;
5681
5682 optional double bluetooth_controller_rx = 13;
5683
5684 optional double bluetooth_controller_tx = 14;
5685
5686 optional double bluetooth_controller_operating_voltage = 15;
5687
5688 optional double modem_controller_sleep = 16;
5689
5690 optional double modem_controller_idle = 17;
5691
5692 optional double modem_controller_rx = 18;
5693
5694 repeated double modem_controller_tx = 19;
5695
5696 optional double modem_controller_operating_voltage = 20;
5697
5698 optional double gps_on = 21;
5699
5700 repeated double gps_signal_quality_based = 22;
5701
5702 optional double gps_operating_voltage = 23;
5703
5704 optional double bluetooth_on = 24;
5705
5706 optional double bluetooth_active = 25;
5707
5708 optional double bluetooth_at_cmd = 26;
5709
5710 optional double ambient_display = 27;
5711
5712 optional double screen_on = 28;
5713
5714 optional double radio_on = 29;
5715
5716 optional double radio_scanning = 30;
5717
5718 optional double radio_active = 31;
5719
5720 optional double screen_full = 32;
5721
5722 optional double audio = 33;
5723
5724 optional double video = 34;
5725
5726 optional double flashlight = 35;
5727
5728 optional double memory = 36;
5729
5730 optional double camera = 37;
5731
5732 optional double wifi_batched_scan = 38;
5733
5734 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005735}
Chenjie Yuab530202018-09-26 12:39:20 -07005736
5737/**
5738 * power_profile.xml and other constants for power model calculations.
5739 * Pulled from PowerProfile.java
5740 */
5741message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005742 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005743}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005744
5745/**
arangelovd5db50e2018-10-12 20:24:39 +01005746 * Logs when a user restriction was added or removed.
5747 *
5748 * Logged from:
5749 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5750 */
5751message UserRestrictionChanged {
5752 // The raw string of the user restriction as defined in UserManager.
5753 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5754 optional string restriction = 1;
5755 // Whether the restriction is enabled or disabled.
5756 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005757}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005758
5759/**
5760 * Pulls process user time and system time. Puller takes a snapshot of all pids
5761 * in the system and returns cpu stats for those that are working at the time.
5762 * Dead pids will be dropped. Kernel processes are excluded.
5763 * Min cool-down is 5 sec.
5764 */
5765message ProcessCpuTime {
5766 optional int32 uid = 1 [(is_uid) = true];
5767
5768 optional string process_name = 2;
5769 // Process cpu time in user space, cumulative from boot/process start
5770 optional int64 user_time_millis = 3;
5771 // Process cpu time in system space, cumulative from boot/process start
5772 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005773}
Misha Wagner5a51e002018-10-03 15:04:09 +01005774
5775/**
5776 * Pulls the CPU usage for each thread.
5777 *
5778 * Read from /proc/$PID/task/$TID/time_in_state files.
5779 *
5780 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5781 * time_in_state files not being present on some phones, have not been addressed. These should be
5782 * considered before a public release.
5783 */
5784message CpuTimePerThreadFreq {
5785 // UID that owns the process.
5786 optional int32 uid = 1 [(is_uid) = true];
5787 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005788 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005789 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005790 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005791 // Name of the process taken from `/proc/$PID/cmdline`.
5792 optional string process_name = 4;
5793 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5794 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005795
5796 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5797 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5798 // frequencies are given here as the alternative is sending eight separate atoms. This method
5799 // significantly reduces the amount of data created
5800 optional int32 frequency1_khz = 6;
5801 optional int32 time1_millis = 7;
5802 optional int32 frequency2_khz = 8;
5803 optional int32 time2_millis = 9;
5804 optional int32 frequency3_khz = 10;
5805 optional int32 time3_millis = 11;
5806 optional int32 frequency4_khz = 12;
5807 optional int32 time4_millis = 13;
5808 optional int32 frequency5_khz = 14;
5809 optional int32 time5_millis = 15;
5810 optional int32 frequency6_khz = 16;
5811 optional int32 time6_millis = 17;
5812 optional int32 frequency7_khz = 18;
5813 optional int32 time7_millis = 19;
5814 optional int32 frequency8_khz = 20;
5815 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005816}
Bookatz75ee60422018-11-09 12:27:37 -08005817
5818/**
Bookatz366a4432018-11-20 09:42:33 -08005819 * Pulls information about the device's build.
5820 */
5821message BuildInformation {
5822 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5823 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5824 optional string fingerprint = 1;
5825
5826 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5827 optional string brand = 2;
5828
5829 // Build.PRODUCT. The name of the overall product.
5830 optional string product = 3;
5831
5832 // Build.DEVICE. The name of the industrial design.
5833 optional string device = 4;
5834
5835 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5836 optional string version_release = 5;
5837
5838 // Build.ID. E.g. a label like "M4-rc20".
5839 optional string id = 6;
5840
5841 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5842 // represent this build.
5843 optional string version_incremental = 7;
5844
5845 // Build.TYPE. The type of build, like "user" or "eng".
5846 optional string type = 8;
5847
5848 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5849 optional string tags = 9;
5850}
5851
5852/**
Adam He420947c2019-01-23 15:59:09 -08005853 * Logs information about mismatched caller for content capture.
5854 *
5855 * Logged from:
5856 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5857 */
5858message ContentCaptureCallerMismatchReported {
5859 optional string intended_package = 1;
5860 optional string calling_package = 2;
5861}
5862
5863/**
5864 * Logs information about content capture service events.
5865 *
5866 * Logged from:
5867 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5868 */
5869message ContentCaptureServiceEvents {
5870 // The type of event.
5871 enum Event {
5872 UNKNOWN = 0;
5873 ON_CONNECTED = 1;
5874 ON_DISCONNECTED = 2;
5875 SET_WHITELIST = 3;
5876 SET_DISABLED = 4;
5877 ON_USER_DATA_REMOVED = 5;
5878 }
5879 optional Event event = 1;
5880 // component/package of content capture service.
5881 optional string service_info = 2;
5882 // component/package of target.
5883 // it's a concatenated list of component/package for SET_WHITELIST event
5884 // separated by " ".
5885 optional string target_info = 3;
5886}
5887
5888/**
5889 * Logs information about content capture session events.
5890 *
5891 * Logged from:
5892 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5893 */
5894message ContentCaptureSessionEvents {
5895 // The type of event.
5896 enum Event {
5897 UNKNOWN = 0;
5898 ON_SESSION_STARTED = 1;
5899 ON_SESSION_FINISHED = 2;
5900 SESSION_NOT_CREATED = 3;
5901 }
5902 optional int32 session_id = 1;
5903 optional Event event = 2;
5904 // (n/a on session finished)
5905 optional int32 state_flags = 3;
5906 // component/package of content capture service.
5907 optional string service_info = 4;
5908 // component/package of app.
5909 // (n/a on session finished)
5910 optional string app_info = 5;
5911 optional bool is_child_session = 6;
5912}
5913
5914/**
5915 * Logs information about session being flushed.
5916 *
5917 * Logged from:
5918 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5919 */
5920message ContentCaptureFlushed {
5921 optional int32 session_id = 1;
5922 // component/package of content capture service.
5923 optional string service_info = 2;
5924 // component/package of app.
5925 optional string app_info = 3;
5926 // session start/finish events
5927 optional int32 child_session_started = 4;
5928 optional int32 child_session_finished = 5;
5929 // count of view events.
5930 optional int32 view_appeared_count = 6;
5931 optional int32 view_disappeared_count = 7;
5932 optional int32 view_text_changed_count = 8;
5933
5934 // Flush stats.
5935 optional int32 max_events = 9;
5936 optional int32 idle_flush_freq = 10;
5937 optional int32 text_flush_freq = 11;
5938 optional int32 flush_reason = 12;
5939}
5940
5941/**
Bookatz75ee60422018-11-09 12:27:37 -08005942 * Pulls on-device BatteryStats power use calculations for the overall device.
5943 */
5944message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005945 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5946 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5947 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5948 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005949}
5950
5951/**
5952 * Pulls on-device BatteryStats power use calculations broken down by uid.
5953 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5954 * that is attributed to non-uid items. They must all be included to get the total power use.
5955 */
5956message DeviceCalculatedPowerBlameUid {
5957 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5958 optional int32 uid = 1 [(is_uid) = true];
5959
Bookatz3dbc13a2018-12-21 12:16:51 -08005960 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5961 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5962 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005963}
5964
5965/**
5966 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5967 * drain type.
5968 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5969 * is attributed uids. They must all be included to get the total power use.
5970 */
5971message DeviceCalculatedPowerBlameOther {
5972 // The type of item whose power use is being reported.
5973 enum DrainType {
5974 AMBIENT_DISPLAY = 0;
5975 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5976 BLUETOOTH = 2;
5977 CAMERA = 3;
5978 // Cell-standby
5979 CELL = 4;
5980 FLASHLIGHT = 5;
5981 IDLE = 6;
5982 MEMORY = 7;
5983 // Amount that total computed drain exceeded the drain estimated using the
5984 // battery level changes and capacity.
5985 OVERCOUNTED = 8;
5986 PHONE = 9;
5987 SCREEN = 10;
5988 // Amount that total computed drain was below the drain estimated using the
5989 // battery level changes and capacity.
5990 UNACCOUNTED = 11;
5991 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5992 WIFI = 13;
5993 }
5994 optional DrainType drain_type = 1;
5995
Bookatz3dbc13a2018-12-21 12:16:51 -08005996 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5997 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5998 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005999}
arangelov4e994062018-11-13 16:12:38 +00006000
6001/**
6002 * Logs device policy features.
6003 *
6004 * Logged from:
6005 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6006 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6007 */
6008message DevicePolicyEvent {
6009 // The event id - unique for each event.
6010 optional android.stats.devicepolicy.EventId event_id = 1;
6011 // The admin package name.
6012 optional string admin_package_name = 2;
6013 // A generic integer parameter.
6014 optional int32 integer_value = 3;
6015 // A generic boolean parameter.
6016 optional bool boolean_value = 4;
6017 // A parameter specifying a time period in milliseconds.
6018 optional uint64 time_period_millis = 5;
6019 // A parameter specifying a list of package names, bundle extras or string parameters.
6020 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6021}
shawnlinea5b66b2018-11-13 15:05:29 +08006022
6023/**
6024 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6025 *
6026 * Logged from:
6027 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6028 */
6029message DocsUILaunchReported {
6030 optional android.stats.docsui.LaunchAction launch_action = 1;
6031 optional bool has_initial_uri = 2;
6032 optional android.stats.docsui.MimeType mime_type = 3;
6033 optional android.stats.docsui.Root initial_root = 4;
6034}
6035
6036/**
6037 * Logs root/app visited event in file managers/picker. Call this when the user
6038 * taps on root/app in hamburger menu.
6039 *
6040 * Logged from:
6041 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6042 */
6043message DocsUIRootVisitedReported {
6044 optional android.stats.docsui.ContextScope scope = 1;
6045 optional android.stats.docsui.Root root = 2;
6046}
6047
6048/**
6049 * Logs file operation stats. Call this when a file operation has completed.
6050 *
6051 * Logged from:
6052 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6053 */
6054message DocsUIFileOperationReported {
6055 optional android.stats.docsui.Provider provider = 1;
6056 optional android.stats.docsui.FileOperation file_op = 2;
6057}
6058
6059/**
6060 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6061 * mode.
6062 *
6063 * Logged from:
6064 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6065 */
6066message DocsUIFileOperationCopyMoveModeReported {
6067 optional android.stats.docsui.FileOperation file_op = 1;
6068 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6069}
6070
6071
6072/**
6073 * Logs file sub operation stats. Call this when a file operation has failed.
6074 *
6075 * Logged from:
6076 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6077 */
6078message DocsUIFileOperationFailureReported {
6079 optional android.stats.docsui.Authority authority = 1;
6080 optional android.stats.docsui.SubFileOperation sub_op = 2;
6081}
6082
6083/**
6084* Logs the cancellation of a file operation. Call this when a job is canceled
6085*
6086* Logged from:
6087* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6088*/
6089message DocsUIFileOperationCanceledReported {
6090 optional android.stats.docsui.FileOperation file_op = 1;
6091}
6092
6093/**
6094 * Logs startup time in milliseconds.
6095 *
6096 * Logged from:
6097 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6098 */
6099message DocsUIStartupMsReported {
6100 optional int32 startup_millis = 1;
6101}
6102
6103/**
6104 * Logs the action that was started by user.
6105 *
6106 * Logged from:
6107 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6108 */
6109message DocsUIUserActionReported {
6110 optional android.stats.docsui.UserAction action = 1;
6111}
6112
6113/**
6114 * Logs the invalid type when invalid scoped access is requested.
6115 *
6116 * Logged from:
6117 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6118 */
6119message DocsUIInvalidScopedAccessRequestReported {
6120 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006121}
Ben Murdochbab399f62018-12-06 11:01:38 +00006122
6123/**
shawnlina75e82d2019-01-07 10:31:12 +08006124 * Logs the package name that launches docsui picker mode.
6125 *
6126 * Logged from:
6127 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6128 */
6129message DocsUIPickerLaunchedFromReported {
6130 optional string package_name = 1;
6131}
6132
6133/**
6134 * Logs the search type.
6135 *
6136 * Logged from:
6137 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6138 */
6139message DocsUISearchTypeReported {
6140 optional android.stats.docsui.SearchType search_type = 1;
6141}
6142
6143/**
6144 * Logs the search mode.
6145 *
6146 * Logged from:
6147 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6148 */
6149message DocsUISearchModeReported {
6150 optional android.stats.docsui.SearchMode search_mode = 1;
6151}
6152
6153/**
6154 * Logs the pick result information.
6155 *
6156 * Logged from:
6157 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6158 */
6159message DocsUIPickResultReported {
6160 optional int32 total_action_count = 1;
6161 optional int64 duration_millis = 2;
6162 optional int32 file_count= 3;
6163 optional bool is_searching = 4;
6164 optional android.stats.docsui.Root picked_from = 5;
6165 optional android.stats.docsui.MimeType mime_type = 6;
6166 optional int32 repeatedly_pick_times = 7;
6167}
6168
6169/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006170 * Logs when an app's memory is compacted.
6171 *
6172 * Logged from:
6173 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6174 */
6175message AppCompacted {
6176 // The pid of the process being compacted.
6177 optional int32 pid = 1;
6178
6179 // The name of the process being compacted.
6180 optional string process_name = 2;
6181
6182 // The type of compaction.
6183 enum Action {
6184 UNKNOWN = 0;
6185 SOME = 1;
6186 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006187 PERSISTENT = 3;
6188 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006189 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006190 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006191
6192 // Total RSS in kilobytes consumed by the process prior to compaction.
6193 optional int64 before_rss_total_kilobytes = 4;
6194
6195 // File RSS in kilobytes consumed by the process prior to compaction.
6196 optional int64 before_rss_file_kilobytes = 5;
6197
6198 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6199 optional int64 before_rss_anon_kilobytes = 6;
6200
6201 // Swap in kilobytes consumed by the process prior to compaction.
6202 optional int64 before_swap_kilobytes = 7;
6203
6204 // Total RSS in kilobytes consumed by the process after compaction.
6205 optional int64 after_rss_total_kilobytes = 8;
6206
6207 // File RSS in kilobytes consumed by the process after compaction.
6208 optional int64 after_rss_file_kilobytes = 9;
6209
6210 // Anonymous RSS in kilobytes consumed by the process after compaction.
6211 optional int64 after_rss_anon_kilobytes = 10;
6212
6213 // Swap in kilobytes consumed by the process after compaction.
6214 optional int64 after_swap_kilobytes = 11;
6215
6216 // The time taken to perform compaction in milliseconds.
6217 optional int64 time_to_compact_millis = 12;
6218
6219 // The last compaction action performed for this app.
6220 optional Action last_action = 13;
6221
Ben Murdoch01720b82018-12-19 18:03:44 +00006222 // The last time that compaction was attempted on this process in milliseconds
6223 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6224 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006225
Ben Murdoch885c21b2019-03-15 18:02:04 +00006226 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006227 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006228
6229 // The process state at the time of compaction.
6230 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006231
6232 // Free ZRAM in kilobytes before compaction.
6233 optional int64 before_zram_free_kilobytes = 17;
6234
6235 // Free ZRAM in kilobytes after compaction.
6236 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006237}
lifr157fc552018-12-12 16:38:04 +08006238
6239/**
lifrb6b90b62019-03-29 00:40:17 +08006240 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6241 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6242 *
lifr1f74b052019-04-16 22:16:30 +08006243 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6244 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6245 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6246 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006247 */
6248message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006249 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006250
lifr1f74b052019-04-16 22:16:30 +08006251 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006252
6253 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006254 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006255
lifr1f74b052019-04-16 22:16:30 +08006256 // Only valid for event_type = EVENT_GETADDRINFO.
6257 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006258
lifr1f74b052019-04-16 22:16:30 +08006259 // Flags passed to android_res_nsend() defined in multinetwork.h
6260 // Only valid for event_type = EVENT_RESNSEND.
6261 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006262
lifrad9becc2019-05-20 11:04:41 +08006263 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006264
6265 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006266 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006267
6268 // Additional pass-through fields opaque to statsd.
6269 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006270 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006271
6272 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6273 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006274}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006275
6276/**
6277 * Logs when a data stall event occurs.
6278 *
6279 * Log from:
6280 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6281 */
6282message DataStallEvent {
6283 // Data stall evaluation type.
6284 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6285 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6286 optional int32 evaluation_type = 1;
6287 // See definition in data_stall_event.proto.
6288 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6289 // See definition in data_stall_event.proto.
6290 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6291 // See definition in data_stall_event.proto.
6292 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6293 // See definition in data_stall_event.proto.
6294 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6295 // See definition in data_stall_event.proto.
6296 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6297}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006298
6299/*
6300 * Logs when RescueParty resets some set of experiment flags.
6301 *
6302 * Logged from:
6303 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6304 */
6305message RescuePartyResetReported {
6306 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6307 optional int32 rescue_level = 1;
6308}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006309
6310/**
6311 * Logs when signed config is received from an APK, and if that config was applied successfully.
6312 * Logged from:
6313 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6314 */
6315message SignedConfigReported {
6316 enum Type {
6317 UNKNOWN_TYPE = 0;
6318 GLOBAL_SETTINGS = 1;
6319 }
6320 optional Type type = 1;
6321
6322 // The final status of the signed config received.
6323 enum Status {
6324 UNKNOWN_STATUS = 0;
6325 APPLIED = 1;
6326 BASE64_FAILURE_CONFIG = 2;
6327 BASE64_FAILURE_SIGNATURE = 3;
6328 SECURITY_EXCEPTION = 4;
6329 INVALID_CONFIG = 5;
6330 OLD_CONFIG = 6;
6331 SIGNATURE_CHECK_FAILED = 7;
6332 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006333 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006334 }
6335 optional Status status = 2;
6336
6337 // The version of the signed config processed.
6338 optional int32 version = 3;
6339
6340 // The package name that the config was extracted from.
6341 optional string from_package = 4;
6342
6343 enum Key {
6344 NO_KEY = 0;
6345 DEBUG = 1;
6346 PRODUCTION = 2;
6347 }
6348 // Which key was used to verify the config.
6349 optional Key verified_with = 5;
6350}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006351
6352/*
6353 * Logs GNSS Network-Initiated (NI) location events.
6354 *
6355 * Logged from:
6356 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6357 */
6358message GnssNiEventReported {
6359 // The type of GnssNiEvent.
6360 enum EventType {
6361 UNKNOWN = 0;
6362 NI_REQUEST = 1;
6363 NI_RESPONSE = 2;
6364 }
6365 optional EventType event_type = 1;
6366
6367 // An ID generated by HAL to associate NI notifications and UI responses.
6368 optional int32 notification_id = 2;
6369
6370 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006371 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006372
6373 // NI requires notification.
6374 optional bool need_notify = 4;
6375
6376 // NI requires verification.
6377 optional bool need_verify = 5;
6378
6379 // NI requires privacy override, no notification/minimal trace.
6380 optional bool privacy_override = 6;
6381
6382 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6383 // seconds.
6384 optional int32 timeout = 7;
6385
6386 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006387 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006388
6389 // String representing the requester of the network inititated location request.
6390 optional string requestor_id = 9;
6391
6392 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6393 // network initiated location request.
6394 optional string text = 10;
6395
6396 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006397 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006398
6399 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006400 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006401
6402 // True if SUPL ES is enabled.
6403 optional bool is_supl_es_enabled = 13;
6404
6405 // True if GNSS location is enabled.
6406 optional bool is_location_enabled = 14;
6407
6408 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006409 optional android.server.location.GnssUserResponseType user_response = 15;
6410}
6411
6412/**
6413 * Logs GNSS non-framework (NFW) location notification.
6414 *
6415 * Logged from:
6416 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6417 */
6418message GnssNfwNotificationReported {
6419 // Package name of the Android proxy application representing the non-framework entity that
6420 // requested location. Set to empty string if unknown.
6421 optional string proxy_app_package_name = 1;
6422
6423 // Protocol stack that initiated the non-framework location request.
6424 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6425
6426 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6427 // set to empty string. This field is opaque to the framework and used for logging purposes.
6428 optional string other_protocol_stack_name = 3;
6429
6430 // Source initiating/receiving the location information.
6431 optional android.server.location.NfwRequestor requestor = 4;
6432
6433 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6434 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6435 // and used for logging purposes.
6436 optional string requestor_id = 5;
6437
6438 // Indicates whether location information was provided for this request.
6439 optional android.server.location.NfwResponseType response_type = 6;
6440
6441 // True if the device is in user initiated emergency session.
6442 optional bool in_emergency_mode = 7;
6443
6444 // True if cached location is provided.
6445 optional bool is_cached_location = 8;
6446
6447 // True if proxy app permission mismatch between framework and GNSS HAL.
6448 optional bool is_permission_mismatched = 9;
6449}
6450
6451/**
6452 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6453 *
6454 * Logged from:
6455 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6456 */
6457message GnssConfigurationReported {
6458 // SUPL host name.
6459 optional string supl_host = 1;
6460
6461 // SUPL port number.
6462 optional int32 supl_port = 2;
6463
6464 // C2K host name.
6465 optional string c2k_host = 3;
6466
6467 // C2K port number.
6468 optional int32 c2k_port = 4;
6469
6470 // The SUPL version requested by Carrier.
6471 optional int32 supl_ver = 5;
6472
6473 // The SUPL mode.
6474 optional android.server.location.SuplMode supl_mode = 6;
6475
6476 // True if NI emergency SUPL restrictions is enabled.
6477 optional bool supl_es = 7;
6478
6479 // LTE Positioning Profile settings
6480 optional android.server.location.LppProfile lpp_profile = 8;
6481
6482 // Positioning protocol on A-Glonass system.
6483 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6484
6485 // True if emergency PDN is used. Otherwise, regular PDN is used.
6486 optional bool use_emergency_pdn_for_emergency_supl= 10;
6487
6488 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6489 optional android.server.location.GpsLock gps_lock = 11;
6490
6491 // Number of seconds to extend the emergency session duration post emergency call.
6492 optional int32 es_extension_sec = 12;
6493
6494 // The full list of package names of proxy Android applications representing the non-framework
6495 // location access entities (on/off the device) for which the framework user has granted
6496 // non-framework location access permission. The package names are concatenated in one string
6497 // with spaces as separators.
6498 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006499}
Jack Yu95b64f32018-12-13 18:26:11 +08006500
6501/**
6502 * Logs when a NFC device's error occurred.
6503 * Logged from:
6504 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6505 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6506 */
6507message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006508 enum Type {
6509 UNKNOWN = 0;
6510 CMD_TIMEOUT = 1;
6511 ERROR_NOTIFICATION = 2;
6512 AID_OVERFLOW = 3;
6513 }
6514 optional Type type = 1;
6515 // If it's nci cmd timeout, log the timeout command.
6516 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006517
Alex Salod7c3eef2019-01-25 14:43:27 -08006518 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006519}
6520
6521/**
6522 * Logs when a NFC device's state changed event
6523 * Logged from:
6524 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6525 */
6526message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006527 enum State {
6528 UNKNOWN = 0;
6529 OFF = 1;
6530 ON = 2;
6531 ON_LOCKED = 3; // Secure Nfc enabled.
6532 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6533 }
6534 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006535}
6536
6537/**
6538 * Logs when a NFC Beam Transaction occurred.
6539 * Logged from:
6540 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6541 */
6542message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006543 enum Operation {
6544 UNKNOWN = 0;
6545 SEND = 1;
6546 RECEIVE = 2;
6547 }
6548 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006549}
6550
6551/**
6552 * Logs when a NFC Card Emulation Transaction occurred.
6553 * Logged from:
6554 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6555 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6556 */
6557message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006558 enum Category {
6559 UNKNOWN = 0;
6560 HCE_PAYMENT = 1;
6561 HCE_OTHER = 2;
6562 OFFHOST = 3;
6563 }
6564 // Transaction belongs to HCE payment or HCE other category, or offhost.
6565 optional Category category = 1;
6566 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6567 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006568}
6569
6570/**
6571 * Logs when a NFC Tag event occurred.
6572 * Logged from:
6573 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6574 */
6575message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006576 enum Type {
6577 UNKNOWN = 0;
6578 URL = 1;
6579 BT_PAIRING = 2;
6580 PROVISION = 3;
6581 WIFI_CONNECT = 4;
6582 APP_LAUNCH = 5;
6583 OTHERS = 6;
6584 }
6585 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006586}
6587
6588/**
6589 * Logs when Hce transaction triggered
6590 * Logged from:
6591 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6592 */
6593message NfcHceTransactionOccurred {
6594 // The latency period(in microseconds) it took for the first HCE data
6595 // exchange.
6596 optional uint32 latency_micros = 1;
6597}
6598
6599/**
6600 * Logs when SecureElement state event changed
6601 * Logged from:
6602 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6603 */
6604message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006605 enum State {
6606 UNKNOWN = 0;
6607 INITIALIZED = 1;
6608 DISCONNECTED = 2;
6609 CONNECTED = 3;
6610 HALCRASH = 4;
6611 }
6612 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006613
Alex Salod7c3eef2019-01-25 14:43:27 -08006614 optional string state_change_reason = 2;
6615 // SIMx or eSEx.
6616 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006617}
6618
6619/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006620 * Information about a permission grant request
6621 */
6622message PermissionGrantRequestResultReported {
6623 // unique value identifying an API call. A API call might result in multiple of these atoms
6624 optional int64 request_id = 1;
6625
6626 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006627 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006628
6629 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006630 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006631
6632 // The permission to be granted
6633 optional string permission_name = 4;
6634
6635 // If the permission was explicitly requested via the API or added by the system
6636 optional bool is_implicit = 5;
6637
6638 enum Result {
6639 UNDEFINED = 0;
6640 // permission request was ignored
6641 IGNORED = 1;
6642 // permission request was ignored because it was user fixed
6643 IGNORED_USER_FIXED = 2;
6644 // permission request was ignored because it was policy fixed
6645 IGNORED_POLICY_FIXED = 3;
6646 // permission was granted by user action
6647 USER_GRANTED = 4;
6648 // permission was automatically granted
6649 AUTO_GRANTED = 5;
6650 // permission was denied by user action
6651 USER_DENIED = 6;
6652 // permission was denied with prejudice by the user
6653 USER_DENIED_WITH_PREJUDICE = 7;
6654 // permission was automatically denied
6655 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006656 // permission request was ignored because permission is restricted
6657 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006658 // one time permission was granted by user action
6659 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006660 // user ignored request by leaving the request screen without choosing any option
6661 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006662 // user granted the permission after being linked to settings
6663 USER_GRANTED_IN_SETTINGS = 12;
6664 // user denied the permission after being linked to settings
6665 USER_DENIED_IN_SETTINGS = 13;
6666 // user denied the permission with prejudice after being linked to settings
6667 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6668 // permission was automatically revoked after one-time permission expired
6669 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006670 // permission was automatically revoked for unused app
6671 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006672 }
6673 // The result of the permission grant
6674 optional Result result = 6;
6675}
6676
6677/**
Jack Yu95b64f32018-12-13 18:26:11 +08006678 * Logs when Omapi API used
6679 * Logged from:
6680 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6681 */
6682message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006683 enum Operation {
6684 UNKNOWN = 0;
6685 OPEN_CHANNEL = 1;
6686 }
6687 optional Operation operation = 1;
6688 // SIMx or eSEx.
6689 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006690
Alex Salod7c3eef2019-01-25 14:43:27 -08006691 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006692}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006693
6694/**
Alex Saloa060aee2019-01-21 14:36:41 -08006695 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6696 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006697 * Logged from:
6698 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6699 */
6700message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006701 optional int64 dispatch_latency_millis = 1;
6702}
6703
6704/**
6705 * Logs AttentionManagerService attention check result.
6706 *
6707 * Logged from:
6708 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6709 */
6710message AttentionManagerServiceResultReported {
6711 // See core/java/android/service/attention/AttentionService.java
6712 enum AttentionCheckResult {
6713 UNKNOWN = 20;
6714 ATTENTION_SUCCESS_ABSENT = 0;
6715 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006716 ATTENTION_FAILURE_UNKNOWN = 2;
6717 ATTENTION_FAILURE_CANCELLED = 3;
6718 ATTENTION_FAILURE_PREEMPTED = 4;
6719 ATTENTION_FAILURE_TIMED_OUT = 5;
6720 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006721 }
6722 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006723}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006724
6725/**
6726 * Logs when an adb connection changes state.
6727 *
6728 * Logged from:
6729 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6730 */
6731message AdbConnectionChanged {
6732 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6733 // previously selected for this system.
6734 optional int64 last_connection_time_millis = 1;
6735
6736 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6737 // to reconnect via adb without user interaction.
6738 optional int64 auth_window_millis = 2;
6739
6740 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6741 optional android.debug.AdbConnectionStateEnum state = 3;
6742
6743 // True if the 'always allow' option was selected for this system.
6744 optional bool always_allow = 4;
6745}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006746
6747/*
6748 * Logs the reported speech DSP status.
6749 *
6750 * Logged from:
6751 * Vendor audio implementation.
6752 */
6753message SpeechDspStatReported {
6754 // The total Speech DSP uptime in milliseconds.
6755 optional int32 total_uptime_millis = 1;
6756 // The total Speech DSP downtime in milliseconds.
6757 optional int32 total_downtime_millis = 2;
6758 optional int32 total_crash_count = 3;
6759 optional int32 total_recover_count = 4;
6760}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006761
6762/**
6763 * Logs USB connector contaminant status.
6764 *
6765 * Logged from: USB Service.
6766 */
6767message UsbContaminantReported {
6768 optional string id = 1;
6769 optional android.service.usb.ContaminantPresenceStatus status = 2;
6770}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006771
6772/**
6773 * This atom is for debugging purpose.
6774 */
6775message DebugElapsedClock {
6776 // Monotically increasing value for each pull.
6777 optional int64 pull_count = 1;
6778 // Time from System.elapsedRealtime.
6779 optional int64 elapsed_clock_millis = 2;
6780 // Time from System.elapsedRealtime.
6781 optional int64 same_elapsed_clock_millis = 3;
6782 // Diff between current elapsed time and elapsed time from previous pull.
6783 optional int64 elapsed_clock_diff_millis = 4;
6784
6785 enum Type {
6786 TYPE_UNKNOWN = 0;
6787 ALWAYS_PRESENT = 1;
6788 PRESENT_ON_ODD_PULLS = 2;
6789 }
6790 // Type of behavior for the pulled data.
6791 optional Type type = 5;
6792}
6793
6794/**
6795 * This atom is for debugging purpose.
6796 */
6797message DebugFailingElapsedClock {
6798 // Monotically increasing value for each pull.
6799 optional int64 pull_count = 1;
6800 // Time from System.elapsedRealtime.
6801 optional int64 elapsed_clock_millis = 2;
6802 // Time from System.elapsedRealtime.
6803 optional int64 same_elapsed_clock_millis = 3;
6804 // Diff between current elapsed time and elapsed time from previous pull.
6805 optional int64 elapsed_clock_diff_millis = 4;
6806}
Steven Wuacef6bb2019-01-23 14:21:17 -05006807
6808/** Logs System UI bubbles event changed.
6809 *
6810 * Logged from:
6811 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6812 */
6813message BubbleUIChanged {
6814
6815 // The app package that is posting the bubble.
6816 optional string package_name = 1;
6817
6818 // The notification channel that is posting the bubble.
6819 optional string notification_channel = 2;
6820
6821 // The notification id associated with the posted bubble.
6822 optional int32 notification_id = 3;
6823
6824 // The position of the bubble within the bubble stack.
6825 optional int32 position = 4;
6826
6827 // The total number of bubbles within the bubble stack.
6828 optional int32 total_number = 5;
6829
6830 // User interactions with the bubble.
6831 enum Action {
6832 UNKNOWN = 0;
6833 POSTED = 1;
6834 UPDATED = 2;
6835 EXPANDED = 3;
6836 COLLAPSED = 4;
6837 DISMISSED = 5;
6838 STACK_DISMISSED = 6;
6839 STACK_MOVED = 7;
6840 HEADER_GO_TO_APP = 8;
6841 HEADER_GO_TO_SETTINGS = 9;
6842 PERMISSION_OPT_IN = 10;
6843 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006844 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006845 SWIPE_LEFT = 13;
6846 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006847 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006848 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006849 }
6850 optional Action action = 6;
6851
6852 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6853 optional float normalized_x_position = 7;
6854 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006855
6856 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6857 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006858
6859 // Whether the bubble is an on-going one.
6860 optional bool is_ongoing = 10;
6861
6862 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006863 // This is deprecated and the value should be ignored.
6864 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006865}
Kweku Adams8845d012018-12-11 20:06:45 -08006866
6867/**
Steven Wu552f63f2019-02-05 13:41:36 -05006868 * Logs System UI bubbles developer errors.
6869 *
6870 * Logged from:
6871 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6872 */
6873message BubbleDeveloperErrorReported {
6874
6875 // The app package that is posting the bubble.
6876 optional string package_name = 1;
6877
6878 // Bubble developer error type enums.
6879 enum Error {
6880 UNKNOWN = 0;
6881 ACTIVITY_INFO_MISSING = 1;
6882 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6883 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6884 }
6885 optional Error error = 2 [default = UNKNOWN];
6886}
6887
6888/**
Kweku Adams8845d012018-12-11 20:06:45 -08006889 * Logs that a constraint for a scheduled job has changed.
6890 *
6891 * Logged from:
6892 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6893 */
6894message ScheduledJobConstraintChanged {
6895 repeated AttributionNode attribution_node = 1;
6896
6897 // Name of the job.
6898 optional string job_name = 2;
6899
6900 optional com.android.server.job.ConstraintEnum constraint = 3;
6901
6902 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006903 UNKNOWN = 0;
6904 UNSATISFIED = 1;
6905 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006906 }
6907 optional State state = 4;
6908}
Alex Salod7c3eef2019-01-25 14:43:27 -08006909
6910/**
6911 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6912 * returns true.
6913 *
6914 * Logged from:
6915 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6916 */
6917message ScreenTimeoutExtensionReported {
6918 // Describes how many times in a row did the power manager reset the screen off timeout.
6919 optional uint32 consecutive_timeout_extended_count = 1;
6920}
Hui Yu885aca12019-01-10 17:11:34 -08006921
6922/*
6923* Logs number of milliseconds it takes to start a process.
6924* The definition of app process start time is from the app launch time to
6925* the time that Zygote finished forking the app process and loaded the
6926* application package's java classes.
6927
6928* This metric is different from AppStartOccurred which is for foreground
6929* activity only.
6930
6931* ProcessStartTime can report all processes (both foreground and background)
6932* start time.
6933*
6934* Logged from:
6935* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6936*/
6937message ProcessStartTime {
6938 // The uid of the ProcessRecord.
6939 optional int32 uid = 1 [(is_uid) = true];
6940
6941 // The process pid.
6942 optional int32 pid = 2;
6943
6944 // The process name.
6945 // Usually package name, "system" for system server.
6946 // Provided by ActivityManagerService.
6947 optional string process_name = 3;
6948
6949 enum StartType {
6950 UNKNOWN = 0;
6951 WARM = 1;
6952 HOT = 2;
6953 COLD = 3;
6954 }
6955
6956 // The start type.
6957 optional StartType type = 4;
6958
6959 // The elapsed realtime at the start of the process.
6960 optional int64 process_start_time_millis = 5;
6961
6962 // Number of milliseconds it takes to reach bind application.
6963 optional int32 bind_application_delay_millis = 6;
6964
6965 // Number of milliseconds it takes to finish start of the process.
6966 optional int32 process_start_delay_millis = 7;
6967
6968 // hostingType field in ProcessRecord, the component type such as "activity",
6969 // "service", "content provider", "broadcast" or other strings.
6970 optional string hosting_type = 8;
6971
6972 // hostingNameStr field in ProcessRecord. The component class name that runs
6973 // in this process.
6974 optional string hosting_name = 9;
6975}
6976
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006977/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006978 * Track Media Codec usage
6979 * Logged from:
6980 * frameworks/av/media/libstagefright/MediaCodec.cpp
6981 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6982 */
6983message MediametricsCodecReported {
6984 optional int64 timestamp_nanos = 1;
6985 optional string package_name = 2;
6986 optional int64 package_version_code = 3;
6987 optional int64 media_apex_version = 4;
6988
6989 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6990}
6991
6992/**
6993 * Track Media Extractor (pulling video/audio streams out of containers) usage
6994 * Logged from:
6995 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6996 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6997 */
6998message MediametricsExtractorReported {
6999 optional int64 timestamp_nanos = 1;
7000 optional string package_name = 2;
7001 optional int64 package_version_code = 3;
7002 optional int64 media_apex_version = 4;
7003
7004 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7005}
7006
7007/**
7008 * Track how we arbitrate between microphone/input requests.
7009 * Logged from
7010 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7011 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7012 */
7013message MediametricsAudiopolicyReported {
7014 optional int64 timestamp_nanos = 1;
7015 optional string package_name = 2;
7016 optional int64 package_version_code = 3;
7017 optional int64 media_apex_version = 4;
7018
7019 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7020}
7021
7022/**
7023 * Track how we arbitrate between microphone requests.
7024 * Logged from
7025 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7026 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7027 */
7028message MediametricsAudiorecordReported {
7029 optional int64 timestamp_nanos = 1;
7030 optional string package_name = 2;
7031 optional int64 package_version_code = 3;
7032 optional int64 media_apex_version = 4;
7033
7034 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7035}
7036
7037/**
7038 * Track how we arbitrate between microphone/input requests.
7039 * Logged from
7040 * frameworks/av/media/libnblog/ReportPerformance.cpp
7041 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7042 */
7043message MediametricsAudiothreadReported {
7044 optional int64 timestamp_nanos = 1;
7045 optional string package_name = 2;
7046 optional int64 package_version_code = 3;
7047 optional int64 media_apex_version = 4;
7048
7049 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7050}
7051
7052/**
7053 * Track how we arbitrate between microphone/input requests.
7054 * Logged from
7055 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7056 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7057 */
7058message MediametricsAudiotrackReported {
7059 optional int64 timestamp_nanos = 1;
7060 optional string package_name = 2;
7061 optional int64 package_version_code = 3;
7062 optional int64 media_apex_version = 4;
7063
7064 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7065}
7066
7067/**
7068 * Track information about DRM framework performance
7069 * Logged from
7070 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7071 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7072 */
7073message MediametricsMediadrmReported {
7074 optional int64 timestamp_nanos = 1;
7075 optional string package_name = 2;
7076 optional int64 package_version_code = 3;
7077 optional int64 media_apex_version = 4;
7078
7079 // vendor+description tell about which DRM plugin is in use on this device
7080 optional string vendor = 5;
7081 optional string description = 6;
7082 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7083 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7084}
7085
7086/**
7087 * Track information about the widevine DRM plugin performance
7088 * Logged from
7089 * vendor/widevine/libwvdrmengine/cdm/metrics
7090 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7091 */
7092message MediametricsDrmWidevineReported {
7093 optional int64 timestamp_nanos = 1;
7094 optional string package_name = 2;
7095 optional int64 package_version_code = 3;
7096 optional int64 media_apex_version = 4;
7097
7098 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7099}
7100
7101/**
7102 * Track information about recordings (e.g. camcorder)
7103 * Logged from
7104 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7105 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7106 */
7107message MediametricsRecorderReported {
7108 optional int64 timestamp_nanos = 1;
7109 optional string package_name = 2;
7110 optional int64 package_version_code = 3;
7111 optional int64 media_apex_version = 4;
7112
7113 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7114}
7115
7116/**
7117 * Track Media Player usage
7118 * Logged from:
7119 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7120 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7121 */
7122message MediametricsNuPlayerReported {
7123 optional int64 timestamp_nanos = 1;
7124 optional string package_name = 2;
7125 optional int64 package_version_code = 3;
7126 optional int64 media_apex_version = 4;
7127
7128 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7129}
7130
7131/**
Robert Shiha4beed32019-08-19 14:15:23 -07007132 * Track Legacy DRM usage
7133 * Logged from
7134 * frameworks/av/drm/drmserver/DrmManager.cpp
7135 */
7136message MediametricsDrmManagerReported {
7137 optional int64 timestamp_nanos = 1;
7138 optional string package_name = 2;
7139 optional int64 package_version_code = 3;
7140 optional int64 media_apex_version = 4;
7141
7142 enum Method {
7143 METHOD_NOT_FOUND = -1;
7144 GET_CONSTRAINTS = 0;
7145 GET_METADATA = 1;
7146 CAN_HANDLE = 2;
7147 PROCESS_DRM_INFO = 3;
7148 ACQUIRE_DRM_INFO = 4;
7149 SAVE_RIGHTS = 5;
7150 GET_ORIGINAL_MIME_TYPE = 6;
7151 GET_DRM_OBJECT_TYPE = 7;
7152 CHECK_RIGHTS_STATUS = 8;
7153 REMOVE_RIGHTS = 9;
7154 REMOVE_ALL_RIGHTS = 10;
7155 OPEN_CONVERT_SESSION = 11;
7156 OPEN_DECRYPT_SESSION = 12;
7157 }
7158
7159 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7160 optional string plugin_id = 5;
7161 optional string description = 6;
7162 optional Method method = 7;
7163 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007164
7165 optional int64 get_constraints_count = 9;
7166 optional int64 get_metadata_count = 10;
7167 optional int64 can_handle_count = 11;
7168 optional int64 process_drm_info_count = 12;
7169 optional int64 acquire_drm_info_count = 13;
7170 optional int64 save_rights_count = 14;
7171 optional int64 get_original_mime_type_count = 15;
7172 optional int64 get_drm_object_type_count = 16;
7173 optional int64 check_rights_status_count = 17;
7174 optional int64 remove_rights_count = 18;
7175 optional int64 remove_all_rights_count = 19;
7176 optional int64 open_convert_session_count = 20;
7177 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007178}
7179
7180/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007181 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007182 * Pulled from: StatsCompanionService
7183*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007184message DangerousPermissionState {
7185 // Name of the permission
7186 optional string permission_name = 1;
7187
7188 // Uid of the package
7189 optional int32 uid = 2 [(is_uid) = true];
7190
7191 // Package requesting the permission
7192 optional string package_name = 3;
7193
7194 // If the permission is granted to the uid
7195 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007196
7197 // Permission flags as per android.content.pm.PermissionFlags
7198 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007199}
7200
Michael Groover4a0ca942019-01-24 17:41:25 -08007201/**
7202 * Logs when a package is denied access to a device identifier based on the new access requirements.
7203 *
7204 * Logged from:
7205 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7206 */
7207message DeviceIdentifierAccessDenied {
7208 // The name of the package denied access to the requested device identifier.
7209 optional string package_name = 1;
7210
7211 // The name of the device identifier method the package attempted to invoke.
7212 optional string method_name = 2;
7213
7214 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007215 // Starting from Android 11, this boolean is not set and will always be false.
7216 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007217
7218 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007219 // Starting from Android 11, this boolean is not set and will always be false.
7220 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007221}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007222
7223/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007224 * Pulls the ongoing mainline install train version code.
7225 * Pulled from StatsCompanionService
7226 */
7227message TrainInfo {
7228 optional int64 train_version_code = 1;
7229
7230 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007231
7232 optional string train_name = 3;
7233
7234 enum Status {
7235 UNKNOWN = 0;
7236 INSTALL_REQUESTED = 1;
7237 INSTALL_STARTED = 2;
7238 INSTALL_STAGED_NOT_READY = 3;
7239 INSTALL_STAGED_READY = 4;
7240 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007241 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7242 // and INSTALL_FAILURE_COMMIT.
7243 INSTALL_FAILURE = 6 [deprecated = true];
7244 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007245 INSTALL_CANCELLED = 7;
7246 INSTALLER_ROLLBACK_REQUESTED = 8;
7247 INSTALLER_ROLLBACK_INITIATED = 9;
7248 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7249 INSTALLER_ROLLBACK_STAGED = 11;
7250 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7251 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7252 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7253 INSTALLER_ROLLBACK_SUCCESS = 15;
7254 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007255 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7256 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7257 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7258 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7259 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7260 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007261 INSTALL_FAILURE_DOWNLOAD = 23;
7262 INSTALL_FAILURE_STATE_MISMATCH = 24;
7263 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007264 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007265 }
7266 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007267}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007268
7269/**
7270 * Logs the gesture stage changed event.
7271 *
7272 * Logged from:
7273 * frameworks/base/packages/SystemUI/
7274 */
7275message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007276 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007277}
7278
7279/**
7280 * Logs the feedback type.
7281 *
7282 * Logged from:
7283 * frameworks/base/packages/SystemUI/
7284 */
7285message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007286 // Whether or not the gesture was used.
7287 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007288}
7289
7290/**
7291 * Logs the progress.
7292 *
7293 * Logged from:
7294 * frameworks/base/packages/SystemUI/
7295 */
7296message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007297 // [0,100] progress for the assist gesture.
7298 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007299}
Neil Fullerdb14b482019-02-05 19:44:44 +00007300
7301/*
7302 * Information about the time zone data on a device.
7303 */
7304message TimeZoneDataInfo {
7305 // A version identifier for the data set on device. e.g. "2018i"
7306 optional string tzdb_version = 1;
7307}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007308
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007309/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007310 * Logs the GPU stats global health information.
7311 *
7312 * Logged from:
7313 * frameworks/native/services/gpuservice/gpustats/
7314 */
7315message GpuStatsGlobalInfo {
7316 // Package name of the gpu driver.
7317 optional string driver_package_name = 1;
7318
7319 // Version name of the gpu driver.
7320 optional string driver_version_name = 2;
7321
7322 // Version code of the gpu driver.
7323 optional int64 driver_version_code = 3;
7324
7325 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7326 optional int64 driver_build_time = 4;
7327
7328 // Total count of the gl driver gets loaded.
7329 optional int64 gl_loading_count = 5;
7330
7331 // Total count of the gl driver fails to be loaded.
7332 optional int64 gl_loading_failure_count = 6;
7333
7334 // Total count of the Vulkan driver gets loaded.
7335 optional int64 vk_loading_count = 7;
7336
7337 // Total count of the Vulkan driver fails to be loaded.
7338 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007339
7340 // Api version of the system Vulkan driver.
7341 optional int32 vulkan_version = 9;
7342
7343 // Api version of the system CPU Vulkan driver.
7344 optional int32 cpu_vulkan_version = 10;
7345
7346 // Api version of the system GLES driver.
7347 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007348
7349 // Total count of the angle driver gets loaded.
7350 optional int64 angle_loading_count = 12;
7351
7352 // Total count of the angle driver fails to be loaded.
7353 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007354}
7355
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007356/**
7357 * GPU driver loading time info.
7358 */
7359message GpuDriverLoadingTime {
7360 // List of all the driver loading times for this app. The list size is
7361 // capped at 50.
7362 repeated int64 driver_loading_time = 1;
7363}
7364
7365/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007366 * Logs the GPU stats per app health information.
7367 *
7368 * Logged from:
7369 * frameworks/native/services/gpuservice/gpustats/
7370 */
7371message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007372 // Package name of the application that loads the gpu driver. Total number
7373 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007374 optional string app_package_name = 1;
7375
7376 // Version code of the gpu driver this app loads.
7377 optional int64 driver_version_code = 2;
7378
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007379 // gl driver loading time info.
7380 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7381 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007382
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007383 // Vulkan driver loading time info.
7384 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7385 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007386
7387 // Angle driver loading time info.
7388 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7389 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007390
7391 // CPU Vulkan implementation is in use.
7392 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007393
7394 // App is not doing pre-rotation correctly.
7395 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007396
7397 // App creates GLESv1 context.
7398 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007399}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007400
7401/*
7402 * Logs the size of the system ion heap.
7403 *
7404 * Pulled from StatsCompanionService.
7405 */
7406message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007407 // Deprecated due to limited support of ion stats in debugfs.
7408 // Use `IonHeapSize` instead.
7409 option deprecated = true;
7410
Rafal Slawikd4e87572019-03-12 13:08:38 +00007411 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007412 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007413 optional int64 size_in_bytes = 1;
7414}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007415
Rafal Slawik77987ed2019-06-17 12:28:23 +01007416/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007417 * Logs the total size of the ion heap.
7418 *
7419 * Pulled from StatsCompanionService.
7420 */
7421message IonHeapSize {
7422 // Total size of all ion heaps in kilobytes.
7423 // Read from: /sys/kernel/ion/total_heaps_kb.
7424 optional int32 total_size_kb = 1;
7425}
7426
7427/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007428 * Logs the per-process size of the system ion heap.
7429 *
7430 * Pulled from StatsCompanionService.
7431 */
7432message ProcessSystemIonHeapSize {
7433 // The uid if available. -1 means not available.
7434 optional int32 uid = 1 [(is_uid) = true];
7435
7436 // The process name (from /proc/PID/cmdline).
7437 optional string process_name = 2;
7438
7439 // Sum of sizes of all allocations.
7440 optional int32 total_size_in_kilobytes = 3;
7441
7442 // Number of allocations.
7443 optional int32 allocation_count = 4;
7444
7445 // Size of the largest allocation.
7446 optional int32 max_size_in_kilobytes = 5;
7447}
7448
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007449/**
7450 * Push network stack events.
7451 *
7452 * Log from:
7453 * frameworks/base/packages/NetworkStack/
7454 */
7455message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007456 // The id that indicates the event reported from NetworkStack.
7457 optional int32 event_id = 1;
7458 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007459 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7460}
Carmen Agimofa769c152019-03-04 14:39:14 +00007461
7462/**
7463 * Logs the apps that are installed on the external storage.
7464 * Pulled from:
7465 * StatsCompanionService
7466 */
7467message AppsOnExternalStorageInfo {
7468 // The type of the external storage.
7469 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7470 // The name of the package that is installed on the external storage.
7471 optional string package_name = 2;
7472}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007473
7474/**
7475 * Logs the settings related to Face.
7476 * Logged from:
7477 * frameworks/base/services/core/java/com/android/server/stats
7478 */
7479message FaceSettings {
7480 // Whether or not face unlock is allowed on Keyguard.
7481 optional bool unlock_keyguard_enabled = 1;
7482 // Whether or not face unlock dismisses the Keyguard.
7483 optional bool unlock_dismisses_keyguard = 2;
7484 // Whether or not face unlock requires attention.
7485 optional bool unlock_attention_required = 3;
7486 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7487 optional bool unlock_app_enabled = 4;
7488 // Whether or not face unlock always requires user confirmation.
7489 optional bool unlock_always_require_confirmation = 5;
7490 // Whether or not a diverse set of poses are required during enrollment.
7491 optional bool unlock_diversity_required = 6;
7492}
Maggie White442b6312019-04-05 16:26:44 -07007493
7494/**
7495 * Logs cooling devices maintained by the kernel.
7496 *
7497 * Pulled from StatsCompanionService.java
7498 */
7499message CoolingDevice {
7500 // The type of cooling device being reported. Eg. CPU, GPU...
7501 optional android.os.CoolingTypeEnum device_location = 1;
7502 // The name of the cooling device source. Eg. CPU0
7503 optional string device_name = 2;
7504 // Current throttle state of the cooling device. The value can any unsigned
7505 // integer between 0 and max_state defined in its driver. 0 means device is
7506 // not in throttling, higher value means deeper throttling.
7507 optional int32 state = 3;
7508}
Ben Blount763a5d52019-04-10 11:48:58 -07007509
7510/**
7511 * Intelligence has several counter-type events that don't warrant a
7512 * full separate atom. These are primarily API call counters but also include
7513 * counters for feature usage and specific failure modes.
7514 *
7515 * Logged from the Intelligence mainline module.
7516 */
7517message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007518 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007519 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007520 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007521 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007522 // How many times the event occured (to report a batch of high frequency events).
7523 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007524 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007525 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007526}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007527
7528/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007529 * Logs when Car Power state changed.
7530 *
7531 * Logged from:
7532 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7533 */
7534message CarPowerStateChanged {
7535 // States come from CpmsState in CarPowerManagementService.java.
7536 enum State {
7537 WAIT_FOR_VHAL = 0;
7538 ON = 1;
7539 SHUTDOWN_PREPARE = 2;
7540 WAIT_FOR_FINISH = 3;
7541 SUSPEND = 4;
7542 SIMULATE_SLEEP = 5;
7543 }
7544 optional State state = 1;
7545}
7546
7547/**
7548 * Logs whether GarageMode is entered.
7549 *
7550 * Logged from:
7551 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7552 */
7553message GarageModeInfo {
7554 // Whether GarageMode is entered.
7555 optional bool is_garage_mode = 1;
7556}
Martijn Coenencd95d462019-04-25 17:09:45 +02007557
7558/**
7559 * Historical app ops data per package.
7560 */
7561message AppOps {
7562 // Uid of the package requesting the op
7563 optional int32 uid = 1 [(is_uid) = true];
7564
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007565 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007566 optional string package_name = 2;
7567
7568 // operation id; maps to the OP_* constants in AppOpsManager.java
7569 optional int32 op_id = 3;
7570
7571 // The number of times the op was granted while the app was in the
7572 // foreground (only for trusted requests)
7573 optional int64 trusted_foreground_granted_count = 4;
7574
7575 // The number of times the op was granted while the app was in the
7576 // background (only for trusted requests)
7577 optional int64 trusted_background_granted_count = 5;
7578
7579 // The number of times the op was rejected while the app was in the
7580 // foreground (only for trusted requests)
7581 optional int64 trusted_foreground_rejected_count = 6;
7582
7583 // The number of times the op was rejected while the app was in the
7584 // background (only for trusted requests)
7585 optional int64 trusted_background_rejected_count = 7;
7586
7587 // For long-running operations, total duration of the operation
7588 // while the app was in the foreground (only for trusted requests)
7589 optional int64 trusted_foreground_duration_millis = 8;
7590
7591 // For long-running operations, total duration of the operation
7592 // while the app was in the background (only for trusted requests)
7593 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007594
7595 // Whether AppOps is guarded by Runtime permission
7596 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007597}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007598
7599/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007600 * Historical app ops data per package and features.
7601 */
7602message AppFeaturesOps {
7603 // Uid of the package requesting the op
7604 optional int32 uid = 1 [(is_uid) = true];
7605
7606 // Name of the package performing the op
7607 optional string package_name = 2;
7608
7609 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7610 // Features must be provided through manifest using <feature> tag available in R and above.
7611 optional string feature_id = 3;
7612
7613 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7614 optional string op = 4;
7615
7616 // The number of times the op was granted while the app was in the
7617 // foreground (only for trusted requests)
7618 optional int64 trusted_foreground_granted_count = 5;
7619
7620 // The number of times the op was granted while the app was in the
7621 // background (only for trusted requests)
7622 optional int64 trusted_background_granted_count = 6;
7623
7624 // The number of times the op was rejected while the app was in the
7625 // foreground (only for trusted requests)
7626 optional int64 trusted_foreground_rejected_count = 7;
7627
7628 // The number of times the op was rejected while the app was in the
7629 // background (only for trusted requests)
7630 optional int64 trusted_background_rejected_count = 8;
7631
7632 // For long-running operations, total duration of the operation
7633 // while the app was in the foreground (only for trusted requests)
7634 optional int64 trusted_foreground_duration_millis = 9;
7635
7636 // For long-running operations, total duration of the operation
7637 // while the app was in the background (only for trusted requests)
7638 optional int64 trusted_background_duration_millis = 10;
7639
7640 // Whether AppOps is guarded by Runtime permission
7641 optional bool is_runtime_permission = 11;
7642}
7643
7644/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007645 * Location Manager API Usage information(e.g. API under usage,
7646 * API call's parameters).
7647 * Logged from:
7648 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7649 */
7650message LocationManagerApiUsageReported {
7651
7652 // Indicating if usage starts or usage ends.
7653 optional android.stats.location.UsageState state = 1;
7654
7655 // LocationManagerService's API in use.
7656 // We can identify which API from LocationManager is
7657 // invoking current LMS API by the combination of
7658 // API parameter(e.g. is_listener_null, is_intent_null,
7659 // is_location_request_null)
7660 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7661
7662 // Name of the package calling the API.
7663 optional string calling_package_name = 3;
7664
7665 // Type of the location provider.
7666 optional android.stats.location.ProviderType provider = 4;
7667
7668 // Quality of the location request
7669 optional android.stats.location.LocationRequestQuality quality = 5;
7670
7671 // The desired interval for active location updates, in milliseconds.
7672 // Bucketized to reduce cardinality.
7673 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7674
7675 // Minimum distance between location updates, in meters.
7676 // Bucketized to reduce cardinality.
7677 optional android.stats.location.SmallestDisplacementBucket
7678 bucketized_smallest_displacement = 7;
7679
7680 // The number of location updates.
7681 optional int64 num_updates = 8;
7682
7683 // The request expiration time, in millisecond since boot.
7684 // Bucketized to reduce cardinality.
7685 optional android.stats.location.ExpirationBucket
7686 bucketized_expire_in = 9;
7687
7688 // Type of Callback passed in for this API.
7689 optional android.stats.location.CallbackType callback_type = 10;
7690
7691 // The radius of the central point of the alert
7692 // region, in meters. Only for API REQUEST_GEOFENCE.
7693 // Bucketized to reduce cardinality.
7694 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7695
7696 // Activity Importance of API caller.
7697 // Categorized to 3 types that are interesting from location's perspective.
7698 optional android.stats.location.ActivityImportance activiy_importance = 12;
7699}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007700
7701/**
7702 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7703 */
7704message ReviewPermissionsFragmentResultReported {
7705 // unique value identifying a permission group change. A permission group change might result
7706 // in multiple of these atoms
7707 optional int64 change_id = 1;
7708
7709 // UID of package the permission belongs to
7710 optional int32 uid = 2 [(is_uid) = true];
7711
7712 // Name of package the permission belongs to
7713 optional string package_name = 3;
7714
7715 // The permission to be granted
7716 optional string permission_name = 4;
7717
7718 // The result of the permission grant
7719 optional bool permission_granted = 5;
7720}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007721
7722/**
7723* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7724* Logged from: RuntimePermissionUpdgradeController
7725*/
7726message RuntimePermissionsUpgradeResult {
7727 // Permission granted as result of upgrade
7728 optional string permission_name = 1;
7729
7730 // UID of package granted permission
7731 optional int32 uid = 2 [(is_uid) = true];
7732
7733 // Name of package granted permission
7734 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007735}
7736
7737/**
7738* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7739*/
7740message GrantPermissionsActivityButtonActions {
7741 // Permission granted as result of upgrade
7742 optional string permission_group_name = 1;
7743
7744 // UID of package granted permission
7745 optional int32 uid = 2 [(is_uid) = true];
7746
7747 // Name of package requesting permission
7748 optional string package_name = 3;
7749
7750 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7751 // LABEL_ constants in GrantPermissionActivity.java
7752 optional int32 buttons_presented = 4;
7753
7754 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7755 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007756
7757 // id which identifies single session of user interacting with permission controller
7758 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007759}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007760
7761/**
7762 * Information about LocationAccessCheck notification presented to user
7763 */
7764message LocationAccessCheckNotificationAction {
7765
7766 // id which identifies single session of user interacting with permission controller
7767 optional int64 session_id = 1;
7768
7769 // Uid of package for which location access check is presented
7770 optional int32 package_uid = 2;
7771
7772 // Name of package for which location access check is presented
7773 optional string package_name = 3;
7774
7775 enum Result {
7776 UNDEFINED = 0;
7777 // notification was presented to the user
7778 NOTIFICATION_PRESENTED = 1;
7779 // notification was declined by the user
7780 NOTIFICATION_DECLINED = 2;
7781 // notification was clicked by the user
7782 NOTIFICATION_CLICKED = 3;
7783 }
7784
7785 // View / interaction recorded
7786 optional Result result = 4;
7787}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007788
7789/**
7790 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7791 */
7792message AppPermissionFragmentActionReported {
7793 // id which identifies single session of user interacting with permission controller
7794 optional int64 session_id = 1;
7795
7796 // unique value identifying a permission group change. A permission group change might result
7797 // in multiple of these atoms
7798 optional int64 change_id = 2;
7799
7800 // UID of package the permission belongs to
7801 optional int32 uid = 3 [(is_uid) = true];
7802
7803 // Name of package the permission belongs to
7804 optional string package_name = 4;
7805
7806 // The permission to be granted
7807 optional string permission_name = 5;
7808
7809 // The result of the permission grant
7810 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007811
7812 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7813 optional int32 permission_flags = 7;
7814
7815 enum Button {
7816 UNDEFINED = 0;
7817 // Allow button
7818 ALLOW = 1;
7819 // Deny button
7820 DENY = 2;
7821 // Ask every time button
7822 ASK_EVERY_TIME = 3;
7823 // Allow all the time button
7824 ALLOW_ALWAYS = 4;
7825 // Allow only while using the app button
7826 ALLOW_FOREGROUND = 5;
7827 // Same is Deny button but shown in while in use dialog
7828 DENY_FOREGROUND = 6;
7829 }
7830
7831 // Button pressed in the dialog
7832 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007833}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007834
7835/**
7836* Information about a AppPermissionFragment viewed by user
7837*/
7838message AppPermissionFragmentViewed {
7839 // id which identifies single session of user interacting with permission controller
7840 optional int64 session_id = 1;
7841
7842 // UID of package for which permissions are viewed
7843 optional int32 uid = 2 [(is_uid) = true];
7844
7845 // Name of package for which permissions are viewed
7846 optional string package_name = 3;
7847
7848 // Permission group viewed
7849 optional string permission_group_name = 4;
7850}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007851
7852/**
7853* Information about a AppPermissionsFragment viewed by user
7854*/
7855message AppPermissionsFragmentViewed {
7856 // id which identifies single session of user interacting with permission controller
7857 optional int64 session_id = 1;
7858
7859 // id which identifies single view as every view might have several logging records
7860 // with different package information attached
7861 optional int64 view_id = 2;
7862
7863 // Permission group viewed
7864 optional string permission_group_name = 3;
7865
7866 // UID of package for which permissions are viewed
7867 optional int32 uid = 4 [(is_uid) = true];
7868
7869 // Name of package for which permissions are viewed
7870 optional string package_name = 5;
7871
7872 // Category in which permission is included
7873 enum Category {
7874 UNDEFINED = 0;
7875 ALLOWED = 1;
7876 ALLOWED_FOREGROUND = 2;
7877 DENIED = 3;
7878 }
7879 optional Category category = 6;
7880}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007881
7882/**
7883* Information about a PermissionAppsFragment viewed by user.
7884* Logged from ui/handheld/PermissionAppsFragment.java
7885*/
7886message PermissionAppsFragmentViewed {
7887 // id which identifies single session of user interacting with permission controller
7888 optional int64 session_id = 1;
7889
7890 // id which identifies single view as every view might have several logging records
7891 // with different package information attached
7892 optional int64 view_id = 2;
7893
7894 // Permission group viewed
7895 optional string permission_group_name = 3;
7896
7897 // UID of package for which permissions are viewed
7898 optional int32 uid = 4 [(is_uid) = true];
7899
7900 // Name of package for which permissions are viewed
7901 optional string package_name = 5;
7902
7903 // Category in which app is included
7904 enum Category {
7905 UNDEFINED = 0;
7906 ALLOWED = 1;
7907 ALLOWED_FOREGROUND = 2;
7908 DENIED = 3;
7909 }
7910 optional Category category = 6;
7911}
Tony Make2b1b672019-07-29 16:59:47 +01007912
7913/**
7914 * Logs when there is a smart selection related event.
7915 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7916 * Logged from: TextClassifierEventLogger.java
7917 */
7918message TextSelectionEvent {
7919 // A session ID.
7920 optional string session_id = 1;
7921
7922 // Event type of this event.
7923 optional android.stats.textclassifier.EventType event_type = 2;
7924
Tony Mak9c84bd22019-12-09 07:27:25 +00007925 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007926 optional string model_name = 3;
7927
7928 // Type of widget that was involved in triggering this event.
7929 optional android.stats.textclassifier.WidgetType widget_type = 4;
7930
7931 // Index of this event in a session.
7932 optional int32 event_index = 5;
7933
7934 // Entity type that is involved.
7935 optional string entity_type = 6;
7936
7937 // Relative word index of the start of the selection.
7938 optional int32 relative_word_start_index = 7;
7939
7940 // Relative word (exclusive) index of the end of the selection.
7941 optional int32 relative_word_end_index = 8;
7942
7943 // Relative word index of the start of the smart selection.
7944 optional int32 relative_suggested_word_start_index = 9;
7945
7946 // Relative word (exclusive) index of the end of the smart selection.
7947 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007948
7949 // Name of source package.
7950 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007951}
7952
7953/**
7954 * Logs when there is a smart linkify related event.
7955 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7956 * Logged from: TextClassifierEventLogger.java
7957 */
7958message TextLinkifyEvent {
7959 // A session ID.
7960 optional string session_id = 1;
7961
7962 // Event type of this event.
7963 optional android.stats.textclassifier.EventType event_type = 2;
7964
Tony Mak9c84bd22019-12-09 07:27:25 +00007965 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007966 optional string model_name = 3;
7967
7968 // Type of widget that was involved in triggering this event.
7969 optional android.stats.textclassifier.WidgetType widget_type = 4;
7970
7971 // Index of this event in a session.
7972 optional int32 event_index = 5;
7973
7974 // Entity type that is involved.
7975 optional string entity_type = 6;
7976
7977 // Number of links detected.
7978 optional int32 num_links = 7;
7979
7980 // The total length of all links.
7981 optional int32 linked_text_length = 8;
7982
7983 // Length of input text.
7984 optional int32 text_length = 9;
7985
7986 // Time spent on generating links in ms.
7987 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007988
7989 // Name of source package.
7990 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007991}
7992
7993/**
7994 * Logs when there is a conversation actions related event.
7995 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7996 * Logged from: TextClassifierEventLogger.java
7997 */
7998message ConversationActionsEvent {
7999 // A session ID.
8000 optional string session_id = 1;
8001
8002 // Event type of this event.
8003 optional android.stats.textclassifier.EventType event_type = 2;
8004
Tony Mak9c84bd22019-12-09 07:27:25 +00008005 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008006 optional string model_name = 3;
8007
8008 // Type of widget that was involved in triggering this event.
8009 optional android.stats.textclassifier.WidgetType widget_type = 4;
8010
8011 // The first entity type that is involved.
8012 optional string first_entity_type = 5;
8013
8014 // The second entity type that is involved.
8015 optional string second_entity_type = 6;
8016
8017 // The third entity type that is involved.
8018 optional string third_entity_type = 7;
8019
8020 // The score of the first entity type.
8021 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008022
8023 // Name of source package.
8024 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008025
8026 // Name of the annotator model that is involved in this event.
8027 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008028}
8029
8030/**
8031 * Logs when there is a language detection related event.
8032 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8033 * Logged from: TextClassifierEventLogger.java
8034 */
8035message LanguageDetectionEvent {
8036 // A session ID.
8037 optional string session_id = 1;
8038
8039 // Event type of this event.
8040 optional android.stats.textclassifier.EventType event_type = 2;
8041
Tony Mak9c84bd22019-12-09 07:27:25 +00008042 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008043 optional string model_name = 3;
8044
8045 // Type of widget that was involved in triggering this event.
8046 optional android.stats.textclassifier.WidgetType widget_type = 4;
8047
8048 // Detected language.
8049 optional string language_tag = 5;
8050
8051 // Score of the detected language.
8052 optional float score = 6;
8053
8054 // Position of this action.
8055 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008056
8057 // Name of source package.
8058 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008059}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008060
8061/**
8062 * Information about an OTA update attempt by update_engine.
8063 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8064 */
8065message UpdateEngineUpdateAttemptReported {
8066 // The number of attempts for the update engine to apply a given payload.
8067 optional int32 attempt_number = 1;
8068
8069 optional android.stats.otaupdate.PayloadType payload_type = 2;
8070
8071 // The total time in minutes for the update engine to apply a given payload.
8072 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8073 // it's increased when the system is sleeping.
8074 optional int32 duration_boottime_in_minutes = 3;
8075
8076 // The total time in minutes for the update engine to apply a given payload.
8077 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8078 // and it's not increased when the system is sleeping.
8079 optional int32 duration_monotonic_in_minutes = 4;
8080
8081 // The size of the payload in MiBs.
8082 optional int32 payload_size_mib = 5;
8083
8084 // The attempt result reported by the update engine for an OTA update.
8085 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8086
8087 // The error code reported by the update engine after an OTA update attempt
8088 // on A/B devices.
8089 optional android.stats.otaupdate.ErrorCode error_code = 7;
8090
8091 // The build fingerprint of the source system. The value is read from a
8092 // system property when the device takes the update. e.g.
8093 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8094 optional string source_fingerprint = 8;
8095}
8096
8097/**
8098 * Information about all the attempts the device make before finishing the
8099 * successful update.
8100 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8101 */
8102message UpdateEngineSuccessfulUpdateReported {
8103 // The number of attempts for the update engine to apply the payload for a
8104 // successful update.
8105 optional int32 attempt_count = 1;
8106
8107 optional android.stats.otaupdate.PayloadType payload_type = 2;
8108
8109 optional int32 payload_size_mib = 3;
8110
8111 // The total number of bytes downloaded by update_engine since the last
8112 // successful update.
8113 optional int32 total_bytes_downloaded_mib = 4;
8114
8115 // The ratio in percentage of the over-downloaded bytes compared to the
8116 // total bytes needed to successfully install the update. e.g. 200 if we
8117 // download 200MiB in total for a 100MiB package.
8118 optional int32 download_overhead_percentage = 5;
8119
8120 // The total time in minutes for the update engine to apply the payload for a
8121 // successful update.
8122 optional int32 total_duration_minutes = 6;
8123
8124 // The number of reboot of the device during a successful update.
8125 optional int32 reboot_count = 7;
8126}
Alec Mourie088e762019-07-02 13:10:55 -07008127
8128/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008129 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8130 * key to indicate whether it was successful or not.
8131 *
8132 * Logged from:
8133 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8134 */
8135message RebootEscrowRecoveryReported {
8136 optional bool successful = 1;
8137}
8138
8139/**
Alec Mourie088e762019-07-02 13:10:55 -07008140 * Global display pipeline metrics reported by SurfaceFlinger.
8141 * Pulled from:
8142 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8143 */
8144message SurfaceflingerStatsGlobalInfo {
8145 // Total number of frames presented during the tracing period
8146 optional int64 total_frames = 1;
8147 // Total number of frames missed
8148 optional int64 missed_frames = 2;
8149 // Total number of frames that fell back to client composition
8150 optional int64 client_composition_frames = 3;
8151 // Total time the display was turned on
8152 optional int64 display_on_millis = 4;
8153 // Total time that was spent performing animations.
8154 // This is derived from the present-to-present layer histogram
8155 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008156 // Total number of event connections tracked by SurfaceFlinger at the time
8157 // of this pull. If this number grows prohibitively large, then this can
8158 // cause jank due to resource contention.
8159 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008160 // Set of timings measured from when SurfaceFlinger began compositing a
8161 // frame, until the frame was requested to be presented to the display. This
8162 // measures SurfaceFlinger's total CPU walltime on the critical path per
8163 // frame.
8164 optional FrameTimingHistogram frame_duration = 7
8165 [(android.os.statsd.log_mode) = MODE_BYTES];
8166 // Set of timings measured from when SurfaceFlinger first began using the
8167 // GPU to composite a frame, until the GPU has finished compositing that
8168 // frame. This measures the total additional time SurfaceFlinger needed to
8169 // perform due to falling back into GPU composition.
8170 optional FrameTimingHistogram render_engine_timing = 8
8171 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008172}
8173
8174/**
8175 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8176 * The number of layers uploaded will be restricted due to size limitations.
8177 * Pulled from:
8178 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8179 */
8180message SurfaceflingerStatsLayerInfo {
8181 // The layer for this set of metrics
8182 // For now we can infer that the package name is included in the layer
8183 // name.
8184 optional string layer_name = 1;
8185 // Total number of frames presented
8186 optional int64 total_frames = 2;
8187 // Total number of dropped frames while latching a buffer for this layer.
8188 optional int64 dropped_frames = 3;
8189 // Set of timings measured between successive presentation timestamps.
8190 optional FrameTimingHistogram present_to_present = 4
8191 [(android.os.statsd.log_mode) = MODE_BYTES];
8192 // Set of timings measured from when an app queued a buffer for
8193 // presentation, until the buffer was actually presented to the
8194 // display.
8195 optional FrameTimingHistogram post_to_present = 5
8196 [(android.os.statsd.log_mode) = MODE_BYTES];
8197 // Set of timings measured from when a buffer is ready to be presented,
8198 // until the buffer was actually presented to the display.
8199 optional FrameTimingHistogram acquire_to_present = 6
8200 [(android.os.statsd.log_mode) = MODE_BYTES];
8201 // Set of timings measured from when a buffer was latched by
8202 // SurfaceFlinger, until the buffer was presented to the display
8203 optional FrameTimingHistogram latch_to_present = 7
8204 [(android.os.statsd.log_mode) = MODE_BYTES];
8205 // Set of timings measured from the desired presentation to the actual
8206 // presentation time
8207 optional FrameTimingHistogram desired_to_present = 8
8208 [(android.os.statsd.log_mode) = MODE_BYTES];
8209 // Set of timings measured from when an app queued a buffer for
8210 // presentation, until the buffer was ready to be presented.
8211 optional FrameTimingHistogram post_to_acquire = 9
8212 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008213 // Frames missed latch because the acquire fence didn't fire
8214 optional int64 late_acquire_frames = 10;
8215 // Frames latched early because the desired present time was bad
8216 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008217}
8218
8219/**
8220 * Histogram of frame counts bucketed by time in milliseconds.
8221 * Because of size limitations, we hard-cap the number of buckets, with
8222 * buckets for corresponding to larger milliseconds being less precise.
8223 */
8224message FrameTimingHistogram {
8225 // Timings in milliseconds that describes a set of histogram buckets
8226 repeated int32 time_millis_buckets = 1;
8227 // Number of frames that match to each time_millis, i.e. the bucket
8228 // contents
8229 // It's required that len(time_millis) == len(frame_count)
8230 repeated int64 frame_counts = 2;
8231}
Emilian Peev6729f372019-08-29 09:14:09 -07008232
Emilian Peev6729f372019-08-29 09:14:09 -07008233/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008234 * Janky event as reported by SurfaceFlinger.
8235 * This event is intended to be consumed by a Perfetto subscriber for
8236 * automated trace collection.
8237 *
8238 * Logged from:
8239 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8240 */
8241message DisplayJankReported {
8242 // Informational field for how long the janky event lasted in milliseconds
8243 optional int64 event_duration_millis = 1;
8244 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8245 // the display on time.
8246 optional int32 present_deadlines_missed = 2;
8247}
8248
8249/**
Emilian Peev6729f372019-08-29 09:14:09 -07008250 * Information about camera facing and API level usage.
8251 * Logged from:
8252 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8253 */
8254message CameraActionEvent {
8255 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008256 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008257
8258 // Camera API level used
8259 optional int32 api_level = 2;
8260
8261 // Name of client package
8262 optional string package_name = 3;
8263
8264 // Camera facing
8265 enum Facing {
8266 UNKNOWN = 0;
8267 BACK = 1;
8268 FRONT = 2;
8269 EXTERNAL = 3;
8270 }
8271 optional Facing facing = 4;
8272}
atrost01a20932019-08-28 15:40:37 +01008273
8274/**
8275 * Logs when a compatibility change is affecting an app.
8276 *
8277 * Logged from:
8278 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8279 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8280 */
8281message AppCompatibilityChangeReported {
8282 // The UID of the app being affected by the compatibilty change.
8283 optional int32 uid = 1 [(is_uid) = true];
8284
8285 // The ID of the change affecting the app.
8286 optional int64 change_id = 2;
8287
8288 enum State {
8289 UNKNOWN_STATE = 0;
8290 ENABLED = 1;
8291 DISABLED = 2;
8292 LOGGED = 3;
8293 }
8294
8295 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8296 // logged otherwise.
8297 optional State state = 3;
8298
8299 enum Source {
8300 UNKNOWN_SOURCE = 0;
8301 APP_PROCESS = 1;
8302 SYSTEM_SERVER = 2;
8303 }
8304
8305 // Where it was logged from.
8306 optional Source source = 4;
8307
8308}
Hector Dearman40579f62019-11-01 13:19:30 +00008309
8310/**
8311 * Logged from
8312 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8313 */
8314message PerfettoUploaded {
8315 enum Event {
8316 PERFETTO_UNDEFINED = 0;
8317 PERFETTO_TRACE_BEGIN = 1;
8318 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8319 PERFETTO_ON_CONNECT = 3;
8320 PERFETTO_ON_TRACING_DISABLED = 4;
8321 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8322 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8323 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8324 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8325 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8326 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8327 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8328 PERFETTO_TRIGGER_BEGIN = 12;
8329 PERFETTO_TRIGGER_SUCCESS = 13;
8330 PERFETTO_TRIGGER_FAILURE = 14;
8331 PERFETTO_HIT_GUARDRAILS = 15;
8332 PERFETTO_ON_TIMEOUT = 16;
8333 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8334 }
8335
8336 // Which stage of the pipeline we are reporting from.
8337 optional Event event = 1;
8338
8339 // UUID matching the one set inside the SystemInfo trace packet.
8340 optional int64 trace_uuid_lsb = 2;
8341 optional int64 trace_uuid_msb = 3;
8342}
Mark Tabrya824a642019-11-05 12:26:12 -08008343
8344/**
8345 * Pulls client metrics on data transferred via Vehicle Maps Service.
8346 * Metrics are keyed by uid + layer.
8347 *
8348 * Pulled from:
8349 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8350 */
8351message VmsClientStats {
8352 // UID of the VMS client app
8353 optional int32 uid = 1 [(is_uid) = true];
8354
8355 // VMS layer definition
8356 optional int32 layer_type = 2;
8357 optional int32 layer_channel = 3;
8358 optional int32 layer_version = 4;
8359
8360 // Bytes and packets sent by the client for the layer
8361 optional int64 tx_bytes = 5;
8362 optional int64 tx_packets = 6;
8363
8364 // Bytes and packets received by the client for the layer
8365 optional int64 rx_bytes = 7;
8366 optional int64 rx_packets = 8;
8367
8368 // Bytes and packets dropped due to client error
8369 optional int64 dropped_bytes = 9;
8370 optional int64 dropped_packets = 10;
8371}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008372
8373/**
8374 * State of a dangerous permission requested by a package - sampled
8375 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8376*/
8377message DangerousPermissionStateSampled {
8378 // Name of the permission
8379 optional string permission_name = 1;
8380
8381 // Uid of the package
8382 optional int32 uid = 2 [(is_uid) = true];
8383
8384 // If the permission is granted to the uid
8385 optional bool is_granted = 3;
8386
8387 // Permission flags as per android.content.pm.PermissionFlags
8388 optional int32 permission_flags = 4;
8389}
8390
Stan Iliev637ba5e2019-08-16 13:43:08 -04008391/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008392 * HWUI stats for a given app.
8393 */
8394message GraphicsStats {
8395 // The package name of the app
8396 optional string package_name = 1;
8397
8398 // The version code of the app
8399 optional int64 version_code = 2;
8400
8401 // The start & end timestamps in UTC as
8402 // milliseconds since January 1, 1970
8403 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008404 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008405
Stan Ilievb6517192020-02-18 10:12:42 -05008406 optional int64 end_millis = 4;
8407
8408 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8409 enum PipelineType {
8410 UNKNOWN = 0;
8411 GL = 1;
8412 VULKAN = 2;
8413 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008414
8415 // HWUI renders pipeline type: GL or Vulkan.
8416 optional PipelineType pipeline = 5;
8417
8418 // Distinct frame count.
8419 optional int32 total_frames = 6;
8420
8421 // Number of "missed vsync" events.
8422 optional int32 missed_vsync_count = 7;
8423
8424 // Number of frames in triple-buffering scenario (high input latency)
8425 optional int32 high_input_latency_count = 8;
8426
8427 // Number of "slow UI thread" events.
8428 optional int32 slow_ui_thread_count = 9;
8429
8430 // Number of "slow bitmap upload" events.
8431 optional int32 slow_bitmap_upload_count = 10;
8432
8433 // Number of "slow draw" events.
8434 optional int32 slow_draw_count = 11;
8435
8436 // Number of frames that missed their deadline (aka, visibly janked)
8437 optional int32 missed_deadline_count = 12;
8438
8439 // The frame time histogram for the package
8440 optional FrameTimingHistogram cpu_histogram = 13
8441 [(android.os.statsd.log_mode) = MODE_BYTES];
8442
8443 // The gpu frame time histogram for the package
8444 optional FrameTimingHistogram gpu_histogram = 14
8445 [(android.os.statsd.log_mode) = MODE_BYTES];
8446
8447 // UI mainline module version.
8448 optional int64 version_ui_module = 15;
8449
8450 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8451 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8452 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8453 // more apps are running / rendering.
8454 optional bool is_today = 16;
8455}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008456
8457/**
8458 * Message related to dangerous (runtime) app ops access
8459 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008460message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008461 // Uid of the package accessing app op
8462 optional int32 uid = 1 [(is_uid) = true];
8463
8464 // Name of the package accessing app op
8465 optional string package_name = 2;
8466
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008467 // operation string id per OPSTR_ constants in AppOpsManager.java
8468 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008469
8470 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8471 // Features must be provided through manifest using <feature> tag available in R and above.
8472 optional string feature_id = 4;
8473
8474 // message related to app op access, limited to 600 chars by API
8475 optional string message = 5;
8476
8477 enum SamplingStrategy {
8478 DEFAULT = 0;
8479 UNIFORM = 1;
8480 RARELY_USED = 2;
8481 }
8482
8483 // sampling strategy used to collect this message
8484 optional SamplingStrategy sampling_strategy = 6;
8485}
8486
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008487/*
8488 * Logs userspace reboot outcome and duration.
8489 *
8490 * Logged from:
8491 * frameworks/base/core/java/com/android/server/BootReceiver.java
8492 */
8493message UserspaceRebootReported {
8494 // Possible outcomes of userspace reboot.
8495 enum Outcome {
8496 // Default value in case platform failed to determine the outcome.
8497 OUTCOME_UNKNOWN = 0;
8498 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8499 SUCCESS = 1;
8500 // Userspace reboot shutdown sequence was aborted.
8501 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8502 // Remounting userdata into checkpointing mode failed.
8503 FAILED_USERDATA_REMOUNT = 3;
8504 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8505 // reboot.
8506 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8507 }
8508 // Outcome of userspace reboot. Always set.
8509 optional Outcome outcome = 1;
8510 // Duration of userspace reboot in case it has a successful outcome.
8511 // Duration is measured as time between userspace reboot was initiated and until boot completed
8512 // (e.g. sys.boot_completed=1).
8513 optional int64 duration_millis = 2;
8514 // State of primary user's (user0) credential encryption storage.
8515 enum UserEncryptionState {
8516 // Default value.
8517 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8518 // Credential encrypted storage is unlocked.
8519 UNLOCKED = 1;
8520 // Credential encrypted storage is locked.
8521 LOCKED = 2;
8522 }
8523 // State of primary user's encryption storage at the moment boot completed. Always set.
8524 optional UserEncryptionState user_encryption_state = 3;
8525}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008526
8527/*
8528 * Logs integrity check information during each install.
8529 *
8530 * Logged from:
8531 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8532 */
8533message IntegrityCheckResultReported {
8534 optional string package_name = 1;
8535 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008536 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008537 optional string installer_package_name = 4;
8538 enum Response {
8539 UNKNOWN = 0;
8540 ALLOWED = 1;
8541 REJECTED = 2;
8542 FORCE_ALLOWED = 3;
8543 }
8544 optional Response response = 5;
8545 // An estimate on the cause of the response. This will only be populated for
8546 // REJECTED and FORCE_ALLOWED
8547 optional bool caused_by_app_cert_rule = 6;
8548 optional bool caused_by_installer_rule = 7;
8549}
8550
8551/**
8552 * Logs the information about the rules and the provider whenever rules are
8553 * pushed into AppIntegrityManager.
8554 *
8555 * Logged from:
8556 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8557 */
8558message IntegrityRulesPushed {
8559 optional bool success = 1;
8560 // Package name of the app that pushed the rules.
8561 optional string rule_provider = 2;
8562 // Version string of arbitrary format provided by the rule provider to
8563 // identify the rules.
8564 optional string rule_version = 3;
8565}
Jordan Liubedfa702019-12-20 15:08:45 -08008566
8567/**
8568 * Logs when a cell broadcast message is received on the device.
8569 *
8570 * Logged from CellBroadcastService module:
8571 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8572 */
8573message CellBroadcastMessageReported {
8574 // The type of Cell Broadcast message
8575 enum CbType {
8576 UNKNOWN_TYPE = 0;
8577 GSM = 1;
8578 CDMA = 2;
8579 CDMA_SPC = 3;
8580 }
8581
8582 // GSM, CDMA, CDMA-SCP
8583 optional CbType type = 1;
8584}
8585
8586/**
8587 * Logs when an error occurs while handling a cell broadcast message;
8588 *
8589 * Logged from CellBroadcastService module:
8590 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8591 */
8592message CellBroadcastMessageError {
8593 // The type of error raised when trying to handle a cell broadcast message
8594 enum ErrorType {
8595 UNKNOWN_TYPE = 0;
8596 CDMA_DECODING_ERROR = 1;
8597 CDMA_SCP_EMPTY = 2;
8598 CDMA_SCP_HANDLING_ERROR = 3;
8599 GSM_INVALID_HEADER_LENGTH = 4;
8600 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8601 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8602 GSM_INVALID_PDU = 7;
8603 GSM_INVALID_GEO_FENCING_DATA = 8;
8604 GSM_UMTS_INVALID_WAC = 9;
8605 FAILED_TO_INSERT_TO_DB = 10;
8606 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8607 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8608 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8609 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8610 }
8611
8612 // What kind of error occurred
8613 optional ErrorType type = 1;
8614
8615 // Exception message (or log message) associated with the error (max 1000 chars)
8616 optional string exception_message = 2;
8617}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008618
8619/**
8620 * Logs when the SDK Extensions test app has polled the current version.
8621 * This is atom ID 354.
8622 *
8623 * Logged from:
8624 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8625 */
8626message SdkExtensionStatus {
8627 enum ApiCallStatus {
8628 CALL_NOT_ATTEMPTED = 0;
8629 CALL_SUCCESSFUL = 1;
8630 CALL_FAILED = 2;
8631 }
8632
8633 optional ApiCallStatus result = 1;
8634
8635 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8636 optional int32 r_extension_version = 2;
8637
8638 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8639 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8640 optional int32 failed_call_symbol = 3;
8641}
Marco Ballesio497aff42020-01-24 08:39:42 -08008642
8643/**
8644 * Logs when an app is frozen or unfrozen.
8645 *
8646 * Logged from:
8647 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8648 */
8649message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008650 // The type of event.
8651 enum Action {
8652 UNKNOWN = 0;
8653 FREEZE_APP = 1;
8654 UNFREEZE_APP = 2;
8655 }
8656 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008657
Blake Kragten6ce382a2020-01-16 20:20:46 -08008658 // Pid of the process being frozen.
8659 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008660
Blake Kragten6ce382a2020-01-16 20:20:46 -08008661 // Name of the process being frozen.
8662 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008663
Blake Kragten6ce382a2020-01-16 20:20:46 -08008664 // Time since last unfrozen.
8665 optional int64 time_unfrozen_millis = 4;
8666}
8667
8668/**
8669 * Logs gnss stats from location service provider
8670 *
8671 * Pulled from:
8672 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8673 */
8674
8675message GnssStats {
8676 // Number of location reports since boot
8677 optional int64 location_reports = 1;
8678
8679 // Total pulled reports of Location failures since boot
8680 optional int64 location_failure_reports = 2;
8681
8682 // Number of time to first fix reports since boot
8683 optional int64 time_to_first_fix_reports = 3;
8684
8685 // Total pulled reported time to first fix (in milli-seconds) since boot
8686 optional int64 time_to_first_fix_milli_s = 4;
8687
8688 // Number of position accuracy reports since boot
8689 optional int64 position_accuracy_reports = 5;
8690
8691 // Total pulled reported position accuracy (in meters) since boot
8692 optional int64 position_accuracy_meters = 6;
8693
8694 // Number of top 4 average CN0 reports since boot
8695 optional int64 top_four_average_cn0_reports = 7;
8696
8697 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8698 optional int64 top_four_average_cn0_db_mhz = 8;
8699
8700 // Number of l5 top 4 average CN0 reports since boot
8701 optional int64 l5_top_four_average_cn0_reports = 9;
8702
8703 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8704 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8705
8706 // Total number of sv status messages reports since boot
8707 optional int64 sv_status_reports = 11;
8708
8709 // Total number of sv status messages reports, where sv is used in fix since boot
8710 optional int64 sv_status_reports_used_in_fix = 12;
8711
8712 // Total number of L5 sv status messages reports since boot
8713 optional int64 l5_sv_status_reports = 13;
8714
8715 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8716 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008717}
Kweku Adams12752132020-02-18 15:36:48 -08008718
8719/**
8720 * Logs when an app is moved to a different standby bucket.
8721 *
8722 * Logged from:
8723 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8724 */
8725message AppStandbyBucketChanged {
8726 optional string package_name = 1;
8727
8728 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8729 optional int32 user_id = 2;
8730
8731 // These enum values match the constants defined in UsageStatsManager.java.
8732 enum Bucket {
8733 BUCKET_UNKNOWN = 0;
8734 BUCKET_EXEMPTED = 5;
8735 BUCKET_ACTIVE = 10;
8736 BUCKET_WORKING_SET = 20;
8737 BUCKET_FREQUENT = 30;
8738 BUCKET_RARE = 40;
8739 BUCKET_RESTRICTED = 45;
8740 BUCKET_NEVER = 50;
8741 }
8742 optional Bucket bucket = 3;
8743
8744 enum MainReason {
8745 MAIN_UNKNOWN = 0;
8746 MAIN_DEFAULT = 0x0100;
8747 MAIN_TIMEOUT = 0x0200;
8748 MAIN_USAGE = 0x0300;
8749 MAIN_FORCED_BY_USER = 0x0400;
8750 MAIN_PREDICTED = 0x0500;
8751 MAIN_FORCED_BY_SYSTEM = 0x0600;
8752 }
8753 optional MainReason main_reason = 4;
8754
8755 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8756 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8757 // UsageStatsManager.java.
8758 optional int32 sub_reason = 5;
8759}