blob: 9645a466ec16c5c45f3598bea2be16902d4a1633 [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 Brockman7fb79442020-02-27 14:34:24 -0500383 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
384 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
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;
Will Brockmane3753842020-03-03 16:29:34 -05003603 SECTION_HEADS_UP = 1;
3604 SECTION_PEOPLE = 2;
3605 SECTION_ALERTING = 3;
3606 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003607 }
3608 optional NotificationSection section = 6;
3609}
3610
3611message NotificationList {
3612 repeated Notification notifications = 1; // An ordered sequence of notifications.
3613}
3614
3615/**
3616 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3617 *
3618 * Logged from:
3619 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3620 */
3621message NotificationPanelReported {
3622 // The event_id (as for UiEventReported).
3623 optional int32 event_id = 1;
3624 optional int32 num_notifications = 2;
3625 // The notifications in the panel, in the order that they appear there.
3626 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3627}
3628
3629/**
3630 * Reports a notification channel, or channel group, was created, updated, or deleted.
3631 *
3632 * Logged from:
3633 * frameworks/base/services/core/java/com/android/server/notification/
3634 */
3635message NotificationChannelModified {
3636 // The event_id (as for UiEventReported).
3637 optional int32 event_id = 1;
3638 // The notifying app's uid and package.
3639 optional int32 uid = 2 [(is_uid) = true];
3640 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003641 // Hash of app-assigned notification channel ID or channel-group ID
3642 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003643 // Previous importance setting, if applicable
3644 optional android.stats.sysui.NotificationImportance old_importance = 5;
3645 // New importance setting
3646 optional android.stats.sysui.NotificationImportance importance = 6;
3647}
3648
3649
3650/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003651 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003652 *
3653 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003654 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003655 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003656message BiometricAcquired {
3657 // Biometric modality that was acquired.
3658 optional android.hardware.biometrics.ModalityEnum modality = 1;
3659 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3660 optional int32 user = 2;
3661 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3662 optional bool is_crypto = 3;
3663 // Action that the device is performing. Acquired messages are only expected for enroll and
3664 // authenticate. Other actions may indicate an error.
3665 optional android.hardware.biometrics.ActionEnum action = 4;
3666 // The client that this acquisition was received for.
3667 optional android.hardware.biometrics.ClientEnum client = 5;
3668 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3669 optional int32 acquire_info = 6;
3670 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3671 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003672 // Dictates if this message should trigger additional debugging.
3673 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003674}
3675
3676/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003677 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003678 *
3679 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003680 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003681 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003682message BiometricAuthenticated {
3683 // Biometric modality that was used.
3684 optional android.hardware.biometrics.ModalityEnum modality = 1;
3685 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3686 optional int32 user = 2;
3687 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3688 // storage.
3689 optional bool is_crypto = 3;
3690 // The client that this acquisition was received for.
3691 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003692 // If authentication requires user confirmation. See BiometricPrompt's
3693 // setRequireConfirmation(bool) method.
3694 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003695
Kevin Chyn1741a072019-01-17 11:54:40 -08003696 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003697 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003698 REJECTED = 1;
3699 PENDING_CONFIRMATION = 2;
3700 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003701 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003702
3703 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003704 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003705 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3706 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3707 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3708 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003709 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003710 // Dictates if this message should trigger additional debugging.
3711 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003712}
3713
3714/**
3715 * Logs when a biometric error occurs.
3716 *
3717 * Logged from:
3718 * frameworks/base/services/core/java/com/android/server/biometrics
3719 */
3720message BiometricErrorOccurred {
3721 // Biometric modality that was used.
3722 optional android.hardware.biometrics.ModalityEnum modality = 1;
3723 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3724 optional int32 user = 2;
3725 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3726 optional bool is_crypto = 3;
3727 // Action that the device is performing.
3728 optional android.hardware.biometrics.ActionEnum action = 4;
3729 // The client that this acquisition was received for.
3730 optional android.hardware.biometrics.ClientEnum client = 5;
3731 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3732 // are unique to modality.
3733 optional int32 error_info = 6;
3734 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3735 // by the vendor and not specified by the HIDL interface.
3736 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003737 // Dictates if this message should trigger additional debugging.
3738 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003739 // Time spent during the authentication attempt.
3740 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003741}
3742
3743/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003744 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003745 * Logged from:
3746 * frameworks/base/services/core/java/com/android/server/biometrics
3747 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003748message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003749 // Biometric modality.
3750 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003751 // Type of issue detected.
3752 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003753 // Dictates if this message should trigger additional debugging.
3754 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003755}
Howard Ro688ae182018-09-25 00:09:36 -07003756
joshmccloskey6f952b22019-03-25 20:59:35 -07003757/**
3758 * Logs when a biometric enrollment occurs.
3759 *
3760 * Logged from:
3761 * frameworks/base/services/core/java/com/android/server/biometrics
3762 */
3763message BiometricEnrolled {
3764 // Biometric modality that was used.
3765 optional android.hardware.biometrics.ModalityEnum modality = 1;
3766 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3767 optional int32 user = 2;
3768 // The amount of time the enrollment took in milliseconds.
3769 optional int64 latency_millis = 3;
3770 // Whether or not the enrollment was successful.
3771 optional bool success = 4;
3772}
3773
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003774/*
Tej Singh0d176952019-01-16 19:10:54 -08003775 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003776 */
Tej Singh0d176952019-01-16 19:10:54 -08003777message FlagFlipUpdateOccurred {
3778 // If the event is from a flag config package, specify the package name.
3779 optional string flag_flip_package_name = 1;
3780
3781 // The order id of the package
3782 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003783}
3784
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003785/**
3786 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003787 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003788 */
3789message TrainExperimentIds {
3790 repeated int64 experiment_id = 1;
3791}
3792
Yangster-macb89807e2018-11-15 21:10:57 -08003793/*
3794 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003795 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003796 */
3797message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003798 // Name of the train.
3799 optional string train_name = 1;
3800 // Version code for a "train" of packages that need to be installed atomically
3801 optional int64 train_version_code = 2;
3802 // After installation of this package, device requires a restart.
3803 optional bool requires_staging = 3;
3804 // Rollback should be enabled for this install.
3805 optional bool rollback_enabled = 4;
3806 // Requires low latency monitoring if possible.
3807 optional bool requires_low_latency_monitor = 5;
3808
Yangster-macb89807e2018-11-15 21:10:57 -08003809 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003810 UNKNOWN = 0;
3811 INSTALL_REQUESTED = 1;
3812 INSTALL_STARTED = 2;
3813 INSTALL_STAGED_NOT_READY = 3;
3814 INSTALL_STAGED_READY = 4;
3815 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003816 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3817 // and INSTALL_FAILURE_COMMIT.
3818 INSTALL_FAILURE = 6 [deprecated = true];
3819 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003820 INSTALL_CANCELLED = 7;
3821 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003822 INSTALLER_ROLLBACK_INITIATED = 9;
3823 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3824 INSTALLER_ROLLBACK_STAGED = 11;
3825 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3826 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3827 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3828 INSTALLER_ROLLBACK_SUCCESS = 15;
3829 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003830 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3831 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3832 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3833 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3834 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3835 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003836 INSTALL_FAILURE_DOWNLOAD = 23;
3837 INSTALL_FAILURE_STATE_MISMATCH = 24;
3838 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003839 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003840 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003841 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003842 // Possible experiment ids for monitoring this push.
3843 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3844 // user id
3845 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003846 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003847 // Whether or not this is a rollback event
3848 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003849}
3850
Tej Singhc9203082019-05-03 13:42:23 -07003851/* Test atom, is not logged anywhere */
3852message TestAtomReported {
3853 repeated AttributionNode attribution_node = 1;
3854 optional int32 int_field = 2;
3855 optional int64 long_field = 3;
3856 optional float float_field = 4;
3857 optional string string_field = 5;
3858 optional bool boolean_field = 6;
3859 enum State {
3860 UNKNOWN = 0;
3861 OFF = 1;
3862 ON = 2;
3863 }
3864 optional State state = 7;
3865 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3866}
3867
Maggie Whitefc1aa592018-11-28 21:55:23 -08003868/** Represents USB port overheat event. */
3869message UsbPortOverheatEvent {
3870 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3871 optional int32 plug_temperature_deci_c = 1;
3872
3873 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3874 optional int32 max_temperature_deci_c = 2;
3875
3876 /* Time between USB plug event and overheat threshold trip, in seconds. */
3877 optional int32 time_to_overheat_secs = 3;
3878
3879 /* Time between overheat threshold trip and hysteresis, in seconds. */
3880 optional int32 time_to_hysteresis_secs = 4;
3881
3882 /* Time between hysteresis and active mitigation ending, in seconds. */
3883 optional int32 time_to_inactive_secs = 5;
3884};
3885
Maggie White8735b852019-01-18 11:40:49 -08003886/**
3887 * Logs total effective full charge and discharge cycles on a battery.
3888 * Here are some examples of one effective cycle:
3889 * 1) the battery charges from 0% to 100% and drains back to 0%,
3890 * 2) charging from 50% to 100% and draining back to 50% twice.
3891 * Pulled from:
3892 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3893 */
3894message BatteryCycleCount {
3895 /* Number of total charge and discharge cycles on the system battery. */
3896 optional int32 cycle_count = 1;
3897}
3898
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003899/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003900 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3901 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003902 * Pulled from:
3903 * StatsCompanionService
3904 */
3905
Carmen Agimof12dec122019-03-06 16:14:38 +00003906message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003907
Carmen Agimof12dec122019-03-06 16:14:38 +00003908 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003909 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003910 PUBLIC = 1;
3911 PRIVATE = 2;
3912 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003913 }
3914
Carmen Agimof12dec122019-03-06 16:14:38 +00003915 // The type of external storage.
3916 optional android.stats.storage.ExternalStorageType storage_type = 1;
3917 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3918 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003919 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003920 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003921}
3922
Yangster-macb89807e2018-11-15 21:10:57 -08003923/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003924 * Logs when a connection becomes available and lost.
3925 * Logged in StatsCompanionService.java
3926 */
3927message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003928 // Id of the network.
3929 optional int32 net_id = 1;
3930
3931 enum State {
3932 UNKNOWN = 0;
3933 CONNECTED = 1;
3934 DISCONNECTED = 2;
3935 }
3936 // Connected state of a network.
3937 optional State state = 2;
3938}
3939
3940/**
3941 * Logs when a service starts and stops.
3942 * Logged from:
3943 * services/core/java/com/android/server/am/ActiveServices.java
3944 */
3945message ServiceStateChanged {
3946
3947 optional int32 uid = 1 [(is_uid) = true];
3948
3949 optional string package_name = 2;
3950
3951 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003952
3953 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003954 START = 1;
3955 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003956 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003957
3958 optional State state = 4;
3959}
3960
3961/**
3962 * Logs when a service is launched.
3963 * Logged from:
3964 * services/core/java/com/android/server/am/ActiveServices.java
3965 */
3966message ServiceLaunchReported {
3967
3968 optional int32 uid = 1 [(is_uid) = true];
3969
3970 optional string package_name = 2;
3971
3972 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003973}
Howard Ro688ae182018-09-25 00:09:36 -07003974
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003975/**
3976 * Logs when a hidden API is used.
3977 *
3978 * Logged from:
3979 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3980 */
3981message HiddenApiUsed {
3982 // The uid of the app making the hidden access.
3983 optional int32 uid = 1 [(is_uid) = true];
3984
3985 // Signature of the method or field accessed.
3986 optional string signature = 2;
3987
3988 enum AccessMethod {
3989 NONE = 0;
3990 REFLECTION = 1;
3991 JNI = 2;
3992 LINKING = 3;
3993 }
3994
3995 // Type of access.
3996 optional AccessMethod access_method = 3;
3997
3998 // Whether the access was prevented or not.
3999 optional bool access_denied = 4;
4000}
4001
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004002/**
4003 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4004 * - When user sees privacy chip
4005 * - When user clicks privacy chip
4006 * - How does the user exit the Privacy Dialog
4007 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004008 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4009 */
4010message PrivacyIndicatorsInteracted {
4011
4012 enum Type {
4013 UNKNOWN = 0;
4014 CHIP_VIEWED = 1;
4015 CHIP_CLICKED = 2;
4016 DIALOG_PRIVACY_SETTINGS = 3;
4017 DIALOG_DISMISS = 4;
4018 DIALOG_LINE_ITEM = 5;
4019 }
4020
tsaichristine5adc7e02020-01-14 17:07:39 -08004021 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004022
4023 // Used if the type is LINE_ITEM
4024 optional string package_name = 2;
4025}
4026
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004027/**
4028 * Logs information about a package that is moved from the internal to external storage and vice
4029 * versa.
4030 * It logs the package name, the type of the external storage where the package is installed
4031 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4032 * and the move type: if it's from internal to external or the other way around.
4033 *
4034 * Logged from:
4035 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4036 */
4037message AppMovedStorageReported {
4038 enum MoveType {
4039 UNKNOWN = 0;
4040 TO_EXTERNAL = 1;
4041 TO_INTERNAL = 2;
4042 }
4043 // The type of the external storage.
4044 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4045 // The type of move.
4046 optional MoveType move_type = 2;
4047 // The name of the package that was moved.
4048 optional string package_name = 3;
4049}
4050
jianjin8f2dee02019-03-29 14:03:08 -07004051/**
4052 * Logs when system server watchdog occurs.
4053 * Logged from:
4054 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4055 */
4056message SystemServerWatchdogOccurred {
4057 optional string subject = 1;
4058}
4059
4060/**
4061 * Logs when new file added to tombstones.
4062 * Logged from:
4063 * frameworks/base/core/java/com/android/server/BootReceiver.java
4064 */
4065message TombStoneOccurred {
4066}
4067
Hai Zhang5d3328d2019-04-13 21:25:06 +08004068/*
4069 * Information about a role request
4070 *
4071 * Logged from:
4072 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4073 */
4074message RoleRequestResultReported {
4075 // UID of application requesting the role
4076 optional int32 requesting_uid = 1;
4077
4078 // Package name of application requesting the role
4079 optional string requesting_package_name = 2;
4080
4081 // The role to be granted
4082 optional string role_name = 3;
4083
4084 // The count of applications qualifying for the role
4085 optional int32 qualifying_count = 4;
4086
4087 // UID of application current granted the role
4088 optional int32 current_uid = 5;
4089
4090 // Package name of application current granted the role
4091 optional string current_package_name = 6;
4092
4093 // UID of another application that user chose to grant the role to, instead of the requesting
4094 // application
4095 optional int32 granted_another_uid = 7;
4096
4097 // Package name of another application that user chose to grant the role to, instead of the
4098 // requesting application
4099 optional string granted_another_package_name = 8;
4100
4101 enum Result {
4102 UNDEFINED = 0;
4103 // role request was ignored
4104 IGNORED = 1;
4105 // role request was ignored because it's already granted
4106 IGNORED_ALREADY_GRANTED = 2;
4107 // role request was ignored because the application isn't qualified
4108 IGNORED_NOT_QUALIFIED = 3;
4109 // role request was ignored because user said it should be always denied
4110 IGNORED_USER_ALWAYS_DENIED = 4;
4111 // role was granted by user action
4112 USER_GRANTED = 5;
4113 // role was denied by user action
4114 USER_DENIED = 6;
4115 // role was denied by user granting another application the role
4116 USER_DENIED_GRANTED_ANOTHER = 7;
4117 // role was denied and set to be always denied by the user
4118 USER_DENIED_WITH_ALWAYS = 8;
4119 }
4120 // The result of the role request
4121 optional Result result = 9;
4122}
4123
Mark Tabrya824a642019-11-05 12:26:12 -08004124/**
4125 * Logs when a Vehicle Maps Service client's connection state has changed
4126 *
4127 * Logged from:
4128 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4129 */
4130message VmsClientConnectionStateChanged {
4131 // The UID of the VMS client app
4132 optional int32 uid = 1 [(is_uid) = true];
4133
4134 enum State {
4135 UNKNOWN = 0;
4136 // Attempting to connect to the client
4137 CONNECTING = 1;
4138 // Client connection established
4139 CONNECTED = 2;
4140 // Client connection closed unexpectedly
4141 DISCONNECTED = 3;
4142 // Client connection closed by VMS
4143 TERMINATED = 4;
4144 // Error establishing the client connection
4145 CONNECTION_ERROR = 5;
4146 }
4147
4148 optional State state = 2;
4149}
4150
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004151/**
4152 * Logs when MediaProvider has successfully finished scanning a storage volume.
4153 *
4154 * Logged from:
4155 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4156 */
4157message MediaProviderScanEvent {
4158 enum Reason {
4159 // Scan triggered due to unknown reason
4160 UNKNOWN = 0;
4161 // Scan triggered due to storage volume being mounted
4162 MOUNTED = 1;
4163 // Scan triggered due to explicit user action or app request
4164 DEMAND = 2;
4165 // Scan triggered due to idle maintenance
4166 IDLE = 3;
4167 }
4168
4169 // Volume type that this event pertains to
4170 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4171 // Reason why this scan was triggered
4172 optional Reason reason = 2;
4173 // Total number of files scanned
4174 optional int64 item_count = 3;
4175 // Duration of scan, normalized per file
4176 optional float normalized_duration_millis = 4;
4177 // Number of database inserts, normalized per file
4178 optional float normalized_insert_count = 5;
4179 // Number of database updates, normalized per file
4180 optional float normalized_update_count = 6;
4181 // Number of database deletes, normalized per file
4182 optional float normalized_delete_count = 7;
4183}
4184
4185/**
4186 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4187 *
4188 * Logged from:
4189 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4190 */
4191message MediaProviderDeletionEvent {
4192 // Volume type that this event pertains to
4193 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4194 // Device timestamp when this deletion event occurred
4195 optional int64 timestamp_millis = 2;
4196 // App that requested deletion
4197 optional string package_name = 3;
4198 // Number of items that were deleted
4199 optional int32 item_count = 4;
4200}
4201
4202/**
4203 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4204 *
4205 * Logged from:
4206 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4207 */
4208message MediaProviderPermissionEvent {
4209 enum Result {
4210 UNKNOWN = 0;
4211 USER_GRANTED = 1;
4212 AUTO_GRANTED = 2;
4213 USER_DENIED = 3;
4214 USER_DENIED_WITH_PREJUDICE = 4;
4215 AUTO_DENIED = 5;
4216 }
4217
4218 // Volume type that this event pertains to
4219 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4220 // Device timestamp when this permission event occurred
4221 optional int64 timestamp_millis = 2;
4222 // App that requested permission
4223 optional string package_name = 3;
4224 // Number of items that were requested
4225 optional int32 item_count = 4;
4226 // Result of this request
4227 optional Result result = 5;
4228}
4229
4230/**
4231 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4232 *
4233 * Logged from:
4234 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4235 */
4236message MediaProviderSchemaChange {
4237 // Volume type that this event pertains to
4238 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4239 // Old database version code
4240 optional int32 version_from = 2;
4241 // New database version code
4242 optional int32 version_to = 3;
4243 // Total number of files in database
4244 optional int64 item_count = 4;
4245 // Duration of schema change, normalized per file
4246 optional float normalized_duration_millis = 5;
4247}
4248
4249/**
4250 * Logs when MediaProvider has finished an idle maintenance job.
4251 *
4252 * Logged from:
4253 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4254 */
4255message MediaProviderIdleMaintenance {
4256 // Volume type that this event pertains to
4257 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4258
4259 // Total number of files in database
4260 optional int64 item_count = 2;
4261 // Duration of idle maintenance, normalized per file
4262 optional float normalized_duration_millis = 3;
4263 // Number of thumbnails found to be stale, normalized per file
4264 optional float normalized_stale_thumbnails = 4;
4265 // Number of items found to be expired, normalized per file
4266 optional float normalized_expired_media = 5;
4267}
4268
Keun young Park3e033cb2019-12-18 11:27:35 -08004269/**
4270 * Represents boot time event with duration in ms.
4271 *
4272 * Logged from: bootstat and various system server components. Check each enums for details.
4273 */
4274message BootTimeEventDuration {
4275 enum DurationEvent {
4276 UNKNOWN = 0;
4277 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4278 ABSOLUTE_BOOT_TIME = 1;
4279 // Bootloader's 1st stage execution time.
4280 // Logged from bootstat.
4281 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4282 // Bootloader's 1st stage loading time.
4283 // Logged from bootstat.
4284 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4285 // Bootloader's kernel loading time.
4286 // Logged from bootstat.
4287 BOOTLOADER_KERNEL_LOAD = 4;
4288 // Bootloader's 2nd stage execution time.
4289 // Logged from bootstat.
4290 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4291 // Bootloader's 2nd stage loading time.
4292 // Logged from bootstat.
4293 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4294 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4295 // for locked device.
4296 // Logged from bootstat.
4297 BOOTLOADER_UI_WAIT = 7;
4298 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4299 // Logged from bootstat.
4300 BOOTLOADER_TOTAL = 8;
4301 // Shutdown duration inside init for the reboot before the current boot up.
4302 // Logged from f/b/services/.../BootReceiver.java.
4303 SHUTDOWN_DURATION = 9;
4304 // Total time for mounting of disk devices during bootup.
4305 // Logged from f/b/services/.../BootReceiver.java.
4306 MOUNT_DEFAULT_DURATION = 10;
4307 // Total time for early stage mounting of disk devices during bootup.
4308 // Logged from f/b/services/.../BootReceiver.java.
4309 MOUNT_EARLY_DURATION = 11;
4310 // Total time for late stage mounting of disk devices during bootup.
4311 // Logged from f/b/services/.../BootReceiver.java.
4312 MOUNT_LATE_DURATION = 12;
4313 // Average time to scan non-system app after OTA
4314 // Logged from f/b/services/.../PackageManagerService.java
4315 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4316 // Time to initialize Package manager after OTA
4317 // Logged from f/b/services/.../PackageManagerService.java
4318 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4319 // Time to scan all system app from Package manager after OTA
4320 // Logged from f/b/services/.../PackageManagerService.java
4321 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4322 // Init's total time for cold boot stage.
4323 // Logged from bootstat.
4324 COLDBOOT_WAIT = 16;
4325 // Init's total time for initializing selinux.
4326 // Logged from bootstat.
4327 SELINUX_INIT = 17;
4328 // Time since last factory reset.
4329 // Logged from bootstat.
4330 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004331 // Init's total time spent for completing the 1st stage.
4332 // Logged from bootstat.
4333 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004334 }
4335
4336 // Type of the event.
4337 optional DurationEvent event = 1;
4338 // Duration of the event in ms.
4339 optional int64 duration_millis = 2;
4340}
4341
4342/**
4343 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4344 * since boot-up.
4345 *
4346 * Logged from: bootstat and various system server components. Check each enums for details.
4347 */
4348message BootTimeEventElapsedTime {
4349 enum ElapsedTimeEvent {
4350 UNKNOWN = 0;
4351 // Time when init starts 1st stage. Logged from bootstat.
4352 ANDROID_INIT_STAGE_1 = 1;
4353 // Time when sys.boot_completed prop is set.
4354 // Logged from bootstat.
4355 BOOT_COMPLETE = 2;
4356 // BOOT_COMPLETE for encrypted device.
4357 BOOT_COMPLETE_ENCRYPTION = 3;
4358 // BOOT_COMPLETE for device with no encryption.
4359 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4360 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004361 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004362 // BOOT_COMPLETE after factory reset.
4363 FACTORY_RESET_BOOT_COMPLETE = 6;
4364 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4365 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004366 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4367 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004368 // BOOT_COMPLETE after OTA.
4369 OTA_BOOT_COMPLETE = 9;
4370 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4371 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004372 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4373 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004374 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4375 // Logged from f/b/services/.../UserController.java
4376 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4377 // Time when the system starts sending BOOT_COMPLETED broadcast.
4378 // Logged from f/b/services/.../UserController.java
4379 FRAMEWORK_BOOT_COMPLETED = 13;
4380 // Time when the package manager starts init.
4381 // Logged from f/b/services/.../SystemServer.java
4382 PACKAGE_MANAGER_INIT_START = 14;
4383 // Time when package manager is ready
4384 // Logged from f/b/services/.../SystemServer.java
4385 PACKAGE_MANAGER_INIT_READY = 15;
4386 // Represents the time when user has entered unlock credential for system with user pin.
4387 // Logged from bootstat.
4388 POST_DECRYPT = 16;
4389 // Represents the start of zygote's init.
4390 // Logged from zygote itself.
4391 ZYGOTE_INIT_START = 17;
4392 // Represents the start of secondary zygote's init.
4393 // TODO: add logging to zygote
4394 SECONDARY_ZYGOTE_INIT_START = 18;
4395 // Represents the start of system server's init.
4396 // Logged from f/b/services/.../SystemServer.java
4397 SYSTEM_SERVER_INIT_START = 19;
4398 // Represents the completion of system server's init.
4399 // Logged from f/b/services/.../SystemServer.java
4400 SYSTEM_SERVER_READY = 20;
4401 // Represents the start of launcher during boot-up.
4402 // TODO: add logging
4403 LAUNCHER_START = 21;
4404 // Represents the completion of launcher's initial rendering. User can use other apps from
4405 // launcher from this point.
4406 // TODO: add logging
4407 LAUNCHER_SHOWN = 22;
4408 }
4409
4410 // Type of the event.
4411 optional ElapsedTimeEvent event = 1;
4412 // Time since bootup for the event.
4413 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4414 optional int64 time_millis = 2;
4415}
4416
4417/**
4418 * Boot time events with UTC time.
4419 *
4420 * Logged from: bootstat and various system server components. Check each enums for details.
4421 */
4422message BootTimeEventUtcTime {
4423 enum UtcTimeEvent {
4424 UNKNOWN = 0;
4425 // Time of the bootstat's marking of 1st boot after the last factory reset.
4426 // Logged from bootstat.
4427 FACTORY_RESET_RESET_TIME = 1;
4428 // The time when bootstat records FACTORY_RESET_* events. This is close to
4429 // BOOT_COMPLETE time for the current bootup.
4430 // Logged from bootstat.
4431 FACTORY_RESET_CURRENT_TIME = 2;
4432 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4433 // Logged from bootstat.
4434 FACTORY_RESET_RECORD_VALUE = 3;
4435 }
4436
4437 // Type of the event.
4438 optional UtcTimeEvent event = 1;
4439 // UTC time for the event.
4440 optional int64 utc_time_secs = 2;
4441}
4442
4443/**
4444 * Boot time events representing specific error code during bootup.
4445 * Meaning of error code can be different per each event type.
4446 *
4447 * Logged from: bootstat and various system server components. Check each enums for details.
4448 */
4449message BootTimeEventErrorCode {
4450 enum ErrorCodeEvent {
4451 UNKNOWN = 0;
4452 // Linux error code for time() call to get the current UTC time.
4453 // Logged from bootstat.
4454 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4455 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4456 // as UMOUNT_STAT_* from init/reboot.cpp.
4457 // Logged from f/b/services/.../BootReceiver.java.
4458 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004459 // Reprepsents fie system mounting error code of /data partition for the current boot.
4460 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004461 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004462 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004463 }
4464
4465 // Type of the event.
4466 optional ErrorCodeEvent event = 1;
4467 // error code defined per each event type.
4468 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4469 // FS_MGR_FS_STAT.
4470 optional int32 error_code = 2;
4471}
4472
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004473/**
4474 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4475 * after an OTA.
4476 *
4477 * Logged from:
4478 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4479 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4480 */
4481message SnapshotMergeReported {
4482 // Keep in sync with
4483 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4484 enum UpdateState {
4485 // No update or merge is in progress.
4486 NONE = 0;
4487 // An update is applying; snapshots may already exist.
4488 INITIATED = 1;
4489 // An update is pending, but has not been successfully booted yet.
4490 UNVERIFIED = 2;
4491 // The kernel is merging in the background.
4492 MERGING = 3;
4493 // Post-merge cleanup steps could not be completed due to a transient
4494 // error, but the next reboot will finish any pending operations.
4495 MERGE_NEEDS_REBOOT = 4;
4496 // Merging is complete, and needs to be acknowledged.
4497 MERGE_COMPLETED = 5;
4498 // Merging failed due to an unrecoverable error.
4499 MERGE_FAILED = 6;
4500 // The update was implicitly cancelled, either by a rollback or a flash
4501 // operation via fastboot. This state can only be returned by WaitForMerge.
4502 CANCELLED = 7;
4503 };
4504
4505 // Status of the update after the merge attempts.
4506 optional UpdateState final_state = 1;
4507
4508 // Time to complete a merge operation in milliseconds.
4509 // A negative value corresponds to the case in which the merge operation
4510 // was interrupted and resumed (e.g. in case of a system reboot during the
4511 // merge).
4512 optional int64 duration_millis = 2;
4513
4514 // Number of reboots that occurred after issuing and before completing the
4515 // merge of all the snapshot devices.
4516 optional int32 intermediate_reboots = 3;
4517}
4518
Chenjie Yubbcbc602018-02-05 16:51:52 -08004519//////////////////////////////////////////////////////////////////////
4520// Pulled atoms below this line //
4521//////////////////////////////////////////////////////////////////////
4522
4523/**
David Chenc8a43242017-10-17 16:23:28 -07004524 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4525 *
4526 * Pulled from:
4527 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4528 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004529message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004530 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004531
4532 optional int64 rx_bytes = 2;
4533
4534 optional int64 rx_packets = 3;
4535
4536 optional int64 tx_bytes = 4;
4537
4538 optional int64 tx_packets = 5;
4539}
4540
4541/**
4542 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4543 *
4544 * Pulled from:
4545 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4546 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004547message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004548 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004549
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004550 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4551 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004552
4553 optional int64 rx_bytes = 3;
4554
4555 optional int64 rx_packets = 4;
4556
4557 optional int64 tx_bytes = 5;
4558
4559 optional int64 tx_packets = 6;
4560}
4561
4562/**
4563 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4564 *
4565 * Pulled from:
4566 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4567 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004568message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004569 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004570
4571 optional int64 rx_bytes = 2;
4572
4573 optional int64 rx_packets = 3;
4574
4575 optional int64 tx_bytes = 4;
4576
4577 optional int64 tx_packets = 5;
4578}
4579
4580/**
4581 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4582 *
4583 * Pulled from:
4584 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4585 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004586message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004587 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004588
Yao Chenc40a19d2018-03-15 16:48:25 -07004589 // 1 denotes foreground and 0 denotes background. This is called Set in
4590 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004591 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004592
4593 optional int64 rx_bytes = 3;
4594
4595 optional int64 rx_packets = 4;
4596
4597 optional int64 tx_bytes = 5;
4598
4599 optional int64 tx_packets = 6;
4600}
4601
4602/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004603 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4604 *
4605 * Pulled from:
4606 * StatsCompanionService
4607 */
4608message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004609 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004610
4611 optional int64 rx_bytes = 2;
4612
4613 optional int64 tx_bytes = 3;
4614}
4615
4616/**
David Chenc8a43242017-10-17 16:23:28 -07004617 * Pulls the kernel wakelock durations. This atom is adapted from
4618 * android/internal/os/KernelWakelockStats.java
4619 *
4620 * Pulled from:
4621 * StatsCompanionService using KernelWakelockReader.
4622 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004623message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004624 optional string name = 1;
4625
4626 optional int32 count = 2;
4627
4628 optional int32 version = 3;
4629
Yangster-maca8a30442018-10-13 23:46:34 -07004630 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004631}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004632
Chenjie Yu05013b32017-11-21 10:21:41 -08004633/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004634 * Pulls low power state information. If power.stats HAL is not available, this
4635 * includes platform and subsystem sleep state information,
4636 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4637 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004638 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004639 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004640 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4641 * as defined in:
4642 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004643 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004644message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004645 // Subsystem name
4646 optional string subsystem_name = 1;
4647 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4648 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004649 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4650 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004651 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004652 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004653 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004654 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004655 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004656}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004657
Chenjie Yu05013b32017-11-21 10:21:41 -08004658/**
Bookatz92da2832018-11-01 18:10:03 -07004659 * Pulls on-device power measurement information.
4660 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4661 * Pulled from:
4662 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4663 */
4664message OnDevicePowerMeasurement {
4665 // Name of the subsystem (to which the rail belongs).
4666 optional string subsystem_name = 1;
4667
4668 // Rail name. The rail lies within the subsystem.
4669 optional string rail_name = 2;
4670
4671 // Time (in ms since boot) at which the rail energy value was measured.
4672 // This may differ slightly from the time that statsd logs this information.
4673 optional uint64 measurement_timestamp_millis = 3;
4674
4675 // Accumulated energy used via the rail since device boot in uWs.
4676 optional uint64 energy_microwatt_secs = 4;
4677}
4678
4679/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004680 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004681 * Pulls the time the cpu spend on the frequency index. Frequency index
4682 * starts from highest to lowest. The value should be monotonically
4683 * increasing since boot. However, if there is a cpu
4684 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004685 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004686message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004687 optional uint32 cluster = 1;
4688 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004689 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004690}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004691
Chenjie Yu05013b32017-11-21 10:21:41 -08004692/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004693 * Pulls Cpu Time Per Uid.
4694 * Note that isolated process uid time should be attributed to host uids.
4695 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004696message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004697 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004698 optional uint64 user_time_micros = 2;
4699 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004700}
4701
4702/**
4703 * Pulls Cpu Time Per Uid per frequency.
4704 * Note that isolated process uid time should be attributed to host uids.
4705 * For each uid, we order the time by descending frequencies.
4706 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004707message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004708 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004709 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004710 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004711}
Hugo Benichi884970e2017-11-14 22:42:46 +09004712
Chenjie Yu05013b32017-11-21 10:21:41 -08004713/**
4714 * Pulls Wifi Controller Activity Energy Info
4715 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004716message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004717 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004718 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004719 // stack reported state
4720 // TODO: replace this with proto enum
4721 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004722 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004723 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004724 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004725 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004726 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004727 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004728 // product of current(mA), voltage(V) and time(ms)
4729 optional uint64 controller_energy_used = 6;
4730}
4731
4732/**
4733 * Pulls Modem Activity Energy Info
4734 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004735message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004736 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004737 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004738 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004739 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004740 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004741 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004742 /**
4743 * Tx power index
4744 * index 0 = tx_power < 0dBm
4745 * index 1 = 0dBm < tx_power < 5dBm
4746 * index 2 = 5dBm < tx_power < 15dBm
4747 * index 3 = 15dBm < tx_power < 20dBm
4748 * index 4 = tx_power > 20dBm
4749 */
4750 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004751 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004752 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004753 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004754 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004755 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004756 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004757 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004758 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004759 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004760 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004761 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004762 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004763 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004764}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004765
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004766/**
4767 * Pulls Bluetooth Activity Energy Info
4768 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4769 */
4770message BluetoothActivityInfo {
4771 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004772 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004773 // bluetooth stack state
4774 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004775 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004776 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004777 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004778 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004779 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004780 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004781 // product of current(mA), voltage(V) and time(ms)
4782 optional uint64 energy_used = 6;
4783}
4784
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004785/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004786 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004787 *
4788 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004789 */
4790message ProcessMemoryState {
4791 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004792 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004793
4794 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004795 // Usually package name, "system" for system server.
4796 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004797 optional string process_name = 2;
4798
Rafal Slawikda51b932018-12-13 16:31:33 +00004799 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004800 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004801
4802 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004803 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004804
4805 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004806 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004807
Rajeev Kumar90235992018-01-29 11:06:48 -08004808 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004809 // Value is read from memory.stat, field total_rss if per-app memory
4810 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004811 optional int64 rss_in_bytes = 6;
4812
4813 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004814 // Value is read from memory.stat, field total_cache if per-app memory
4815 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004816 optional int64 cache_in_bytes = 7;
4817
4818 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004819 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004820 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004821 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004822
Rafal Slawik203c3db2019-09-25 19:53:01 +01004823 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004824 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004825
Rafal Slawik203c3db2019-09-25 19:53:01 +01004826 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4827 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004828
Rafal Slawik203c3db2019-09-25 19:53:01 +01004829 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4830 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004831}
4832
4833/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004834 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004835 *
4836 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4837 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004838 *
4839 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004840 */
4841message ProcessMemoryHighWaterMark {
4842 // The uid if available. -1 means not available.
4843 optional int32 uid = 1 [(is_uid) = true];
4844
Rafal Slawikda51b932018-12-13 16:31:33 +00004845 // The process name.
4846 // Usually package name or process cmdline.
4847 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004848 optional string process_name = 2;
4849
Rafal Slawik239b6802019-09-09 18:46:01 +01004850 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4851 // computed by converting kilobytes to bytes.
4852 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4853
Rafal Slawik3bea8952018-11-15 12:39:33 +00004854 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4855 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004856 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004857}
4858
4859/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004860 * Logs the memory stats for a process.
4861 *
4862 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4863 * and for selected native processes.
4864 */
4865message ProcessMemorySnapshot {
4866 // The uid if available. -1 means not available.
4867 optional int32 uid = 1 [(is_uid) = true];
4868
4869 // The process name.
4870 // Usually package name or process cmdline.
4871 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4872 optional string process_name = 2;
4873
4874 // The pid of the process.
4875 // Allows to disambiguate instances of the process.
4876 optional int32 pid = 3;
4877
4878 // The current OOM score adjustment value.
4879 // Read from ProcessRecord for managed processes.
4880 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4881 optional int32 oom_score_adj = 4;
4882
4883 // The current RSS of the process.
4884 // VmRSS from /proc/pid/status.
4885 optional int32 rss_in_kilobytes = 5;
4886
4887 // The current anon RSS of the process.
4888 // RssAnon from /proc/pid/status.
4889 optional int32 anon_rss_in_kilobytes = 6;
4890
4891 // The current swap size of the process.
4892 // VmSwap from /proc/pid/status.
4893 optional int32 swap_in_kilobytes = 7;
4894
4895 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4896 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4897}
4898
4899/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004900 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004901 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004902message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004903 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004904}
4905
4906/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004907 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004908 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004909message SystemUptime {
4910 // Milliseconds since the system was booted.
4911 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4912 // for external input).
4913 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004914 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004915}
4916
4917/*
4918 * Reads from /proc/uid_concurrent_active_time which has the format:
4919 * active: X (X is # cores)
4920 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4921 * [uid1]: [time-0] [time-1] [time-2] ... ...
4922 * ...
4923 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4924 * The file contains a monotonically increasing count of time for a single boot.
4925 */
4926message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004927 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004928 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004929}
4930
4931/**
4932 * Reads from /proc/uid_concurrent_policy_time which has the format:
4933 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4934 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4935 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4936 * ...
4937 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4938 * The file contains a monotonically increasing count of time for a single boot.
4939 */
4940message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004941 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004942 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004943 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004944}
4945
4946/*
4947 * Pulls free disk space, for data, system partition and temporary directory.
4948 */
4949message DiskSpace {
4950 // available bytes in data partition
4951 optional uint64 data_available_bytes = 1;
4952 // available bytes in system partition
4953 optional uint64 system_available_bytes = 2;
4954 // available bytes in download cache or temp directories
4955 optional uint64 temp_available_bytes = 3;
4956}
Tej Singhbf972d92018-01-10 20:51:13 -08004957
4958/**
4959 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004960 *
4961 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004962 */
4963message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004964 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004965}
4966
4967/**
4968 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004969 * Pulled from:
4970 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004971 */
4972message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004973 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004974}
4975
4976/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004977 * Pulls battery voltage.
4978 * Pulled from:
4979 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4980 */
4981message BatteryVoltage {
4982 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004983 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004984}
4985
4986/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004987 * Pulls battery level (percent full, from 0 to 100).
4988 *
4989 * Pulled from:
4990 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4991 */
4992message BatteryLevel {
4993 // Battery level. Should be in [0, 100].
4994 optional int32 battery_level = 1;
4995}
4996
4997/**
Tej Singhd89137e2018-03-26 14:51:40 -07004998 * Pulls the temperature of various parts of the device.
4999 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005000 *
Maggie White442b6312019-04-05 16:26:44 -07005001 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005002 */
5003message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005004 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005005 optional android.os.TemperatureTypeEnum sensor_location = 1;
5006
5007 // The name of the temperature source. Eg. CPU0
5008 optional string sensor_name = 2;
5009
Tej Singhd89137e2018-03-26 14:51:40 -07005010 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005011 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005012 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005013
5014 // Relative severity of the throttling, see enum definition.
5015 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005016}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005017
5018/**
5019 * Pulls the statistics of calls to Binder.
5020 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005021 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5022 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005023 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005024 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005025 */
5026message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005027 // UID of the process responsible for the binder transaction. It will be set if the process
5028 // executing the binder transaction attribute the transaction to another uid using
5029 // Binder.setThreadWorkSource().
5030 //
5031 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005032 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005033 // UID of the process executing the binder transaction.
5034 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005035 // Fully qualified class name of the API call.
5036 //
5037 // This is a system server class name.
5038 //
5039 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5040 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5041 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5042 // commonly used APIs.
5043 optional string service_class_name = 2;
5044 // Method name of the API call. It can also be a transaction code if we cannot
5045 // resolve it to a name. See Binder#getTransactionName.
5046 //
5047 // This is a system server method name.
5048 optional string service_method_name = 3;
5049 // Total number of API calls.
5050 optional int64 call_count = 4;
5051 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5052 optional bool screen_interactive = 13;
5053 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5054 // call_count will be equal to recorded_call_count.
5055 //
5056 // If recorded_call_count is different than call_count, it means data collection has been
5057 // sampled. All the fields below will be sampled in this case.
5058 optional int64 recorded_call_count = 12;
5059 // Number of exceptions thrown by the API.
5060 optional int64 recorded_exception_count = 5;
5061 // Total latency of all API calls.
5062 // Average can be computed using total_latency_micros / recorded_call_count.
5063 optional int64 recorded_total_latency_micros = 6;
5064 // Maximum latency of one API call.
5065 optional int64 recorded_max_latency_micros = 7;
5066 // Total CPU usage of all API calls.
5067 // Average can be computed using total_cpu_micros / recorded_call_count.
5068 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5069 optional int64 recorded_total_cpu_micros = 8;
5070 // Maximum CPU usage of one API call.
5071 optional int64 recorded_max_cpu_micros = 9;
5072 // Maximum parcel reply size of one API call.
5073 optional int64 recorded_max_reply_size_bytes = 10;
5074 // Maximum parcel request size of one API call.
5075 optional int64 recorded_max_request_size_bytes = 11;
5076}
5077
5078/**
5079 * Pulls the statistics of exceptions during calls to Binder.
5080 *
5081 * Binder stats are cumulative from boot unless somebody reset the data using
5082 * > adb shell dumpsys binder_calls_stats --reset
5083 */
5084message BinderCallsExceptions {
5085 // Exception class name, e.g. java.lang.IllegalArgumentException.
5086 //
5087 // This is an exception class name thrown by the system server.
5088 optional string exception_class_name = 1;
5089 // Total number of exceptions.
5090 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005091}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005092
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005093/**
5094 * Pulls the statistics of message dispatching on HandlerThreads.
5095 *
5096 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5097 * config on the device.
5098 *
5099 * Next tag: 11
5100 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005101message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005102 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005103 optional int32 uid = 1 [(is_uid) = true];
5104
5105 // Fully qualified class name of the handler target class.
5106 //
5107 // This field does not contain PII. This is a system server class name.
5108 optional string handler_class_name = 2;
5109
5110 // The name of the thread that runs the Looper.
5111 //
5112 // This field does not contain PII. This is a system server thread name.
5113 optional string looper_thread_name = 3;
5114
5115 // The name of the dispatched message.
5116 //
5117 // This field does not contain PII. This is a system server constant or class
5118 // name.
5119 optional string message_name = 4;
5120
5121 // Total number of successfully dispatched messages.
5122 optional int64 message_count = 5;
5123
5124 // Total number of messages that failed dispatching.
5125 optional int64 exception_count = 6;
5126
5127 // Total number of processed messages we have data recorded for. If we
5128 // collected data for all the messages, message_count will be equal to
5129 // recorded_message_count.
5130 //
5131 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005132 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005133 optional int64 recorded_message_count = 7;
5134
5135 // Total latency of all processed messages.
5136 // Average can be computed using recorded_total_latency_micros /
5137 // recorded_message_count.
5138 optional int64 recorded_total_latency_micros = 8;
5139
5140 // Total CPU usage of all processed message.
5141 // Average can be computed using recorded_total_cpu_micros /
5142 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005143 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005144 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005145
5146 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5147 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005148
5149 // Max recorded CPU usage of all processed messages.
5150 optional int64 recorded_max_cpu_micros = 11;
5151
5152 // Max recorded latency of all processed messages.
5153 optional int64 recorded_max_latency_micros = 12;
5154
5155 // Total number of messages we tracked the dispatching delay for. If we
5156 // collected data for all the messages, message_count will be equal to
5157 // recorded_delay_message_count.
5158 //
5159 // If recorded_delay_message_count is different than message_count, it means data
5160 // collection has been sampled or/and not all messages specified the target dispatch time.
5161 // The fields below will be sampled in this case.
5162 optional int64 recorded_delay_message_count = 13;
5163
5164 // Total dispatching delay of all processed messages.
5165 // Calculated as a difference between the target dispatching time (Message.when)
5166 // and the actual dispatching time.
5167 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5168 optional int64 recorded_total_delay_millis = 14;
5169
5170 // Max dispatching delay of all processed messages.
5171 // Calculated as a difference between the target dispatching time (Message.when)
5172 // and the actual dispatching time.
5173 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005174}
Tej Singh86dc9db2018-09-06 00:39:57 +00005175
5176/**
5177 * Pulls disk information, such as write speed and latency.
5178 */
5179message DiskStats {
5180 // Time taken to open, write 512B to, and close a file.
5181 // -1 if error performing the check.
5182 optional int64 data_write_latency_millis = 1;
5183
5184 optional bool file_based_encryption = 2;
5185
5186 // Recent disk write speed in kB/s.
5187 // -1 if error querying storageed.
5188 // 0 if data is unavailable.
5189 optional int32 recent_disk_write_speed = 3;
5190}
5191
5192
5193/**
5194 * Free and total bytes of the Data, Cache, and System partition.
5195 */
5196message DirectoryUsage {
5197 enum Directory {
5198 UNKNOWN = 0;
5199 DATA = 1;
5200 CACHE = 2;
5201 SYSTEM = 3;
5202 }
5203 optional Directory directory = 1;
5204 optional int64 free_bytes = 2;
5205 optional int64 total_bytes = 3;
5206}
5207
5208
5209/**
5210 * Size of an application: apk size, data size, and cache size.
5211 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5212 * Information is only reported for apps with the primary user (user 0).
5213 * Sizes are aggregated by package name.
5214 */
5215message AppSize {
5216 // Including uids will involve modifying diskstats logic.
5217 optional string package_name = 1;
5218 // App size in bytes. -1 if unavailable.
5219 optional int64 app_size_bytes = 2;
5220 // App data size in bytes. -1 if unavailable.
5221 optional int64 app_data_size_bytes = 3;
5222 // App cache size in bytes. -1 if unavailable.
5223 optional int64 app_cache_size_bytes = 4;
5224 // Time that the cache file was produced.
5225 // Uses System.currentTimeMillis(), which is wall clock time.
5226 optional int64 cache_time_millis = 5;
5227}
5228
5229
5230/**
5231 * Size of a particular category. Eg: photos, videos.
5232 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5233 */
5234message CategorySize {
5235 enum Category {
5236 UNKNOWN = 0;
5237 APP_SIZE = 1;
5238 APP_DATA_SIZE = 2;
5239 APP_CACHE_SIZE = 3;
5240 PHOTOS = 4;
5241 VIDEOS = 5;
5242 AUDIO = 6;
5243 DOWNLOADS = 7;
5244 SYSTEM = 8;
5245 OTHER = 9;
5246 }
5247 optional Category category = 1;
5248 // Category size in bytes.
5249 optional int64 size_bytes = 2;
5250 // Time that the cache file was produced.
5251 // Uses System.currentTimeMillis(), which is wall clock time.
5252 optional int64 cache_time_millis = 3;
5253}
Tej Singhd6d6d772018-09-05 17:41:25 -07005254
5255/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005256 * Pulls per uid I/O stats. The stats are cumulative since boot.
5257 *
5258 * Read/write bytes are I/O events from a storage device
5259 * Read/write chars are data requested by read/write syscalls, and can be
5260 * satisfied by caching.
5261 *
5262 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5263 */
5264message DiskIo {
5265 optional int32 uid = 1 [(is_uid) = true];
5266 optional int64 fg_chars_read = 2;
5267 optional int64 fg_chars_write = 3;
5268 optional int64 fg_bytes_read = 4;
5269 optional int64 fg_bytes_write = 5;
5270 optional int64 bg_chars_read = 6;
5271 optional int64 bg_chars_write = 7;
5272 optional int64 bg_bytes_read = 8;
5273 optional int64 bg_bytes_write = 9;
5274 optional int64 fg_fsync = 10;
5275 optional int64 bg_fsync= 11;
5276}
5277
5278
5279/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005280 * Pulls the number of fingerprints for each user.
5281 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005282 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005283 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005284message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005285 // The associated user. Eg: 0 for owners, 10+ for others.
5286 // Defined in android/os/UserHandle.java
5287 optional int32 user = 1;
5288 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005289 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005290}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005291
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005292/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005293 * Pulls the number of faces for each user.
5294 *
5295 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5296 */
5297message NumFacesEnrolled {
5298 // The associated user. Eg: 0 for owners, 10+ for others.
5299 // Defined in android/os/UserHandle.java
5300 optional int32 user = 1;
5301 // Number of faces registered to that user.
5302 optional int32 num_faces_enrolled = 2;
5303}
5304/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005305 * A mapping of role holder -> role
5306 */
5307message RoleHolder {
5308 // uid of the role holder
5309 optional int32 uid = 1 [(is_uid) = true];
5310
5311 // package name of the role holder
5312 optional string package_name = 2;
5313
5314 // the role held
5315 optional string role = 3;
5316}
5317
Yangsteraf9aee72018-10-12 09:26:16 -07005318message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005319 // These are all in byte resolution.
5320 optional int64 min = 1 [deprecated = true];
5321 optional int64 average = 2 [deprecated = true];
5322 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005323
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005324 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5325 // int64 fields.
5326 optional int32 mean_kb = 4;
5327 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005328}
5329
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005330// A reduced subset of process states; reducing the number of possible states allows more
5331// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5332enum ProcessStateAggregated {
5333 PROCESS_STATE_UNKNOWN = 0;
5334 // Persistent system process.
5335 PROCESS_STATE_PERSISTENT = 1;
5336 // Top activity; actually any visible activity.
5337 PROCESS_STATE_TOP = 2;
5338 // Process binding to top or a foreground service.
5339 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5340 // Processing running a foreground service.
5341 PROCESS_STATE_FGS = 4;
5342 // Important foreground process (ime, wallpaper, etc).
5343 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5344 // Important background process.
5345 PROCESS_STATE_BACKGROUND = 6;
5346 // Process running a receiver.
5347 PROCESS_STATE_RECEIVER = 7;
5348 // All kinds of cached processes.
5349 PROCESS_STATE_CACHED = 8;
5350}
5351
5352// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005353message ProcessStatsStateProto {
5354 optional android.service.procstats.ScreenState screen_state = 1;
5355
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005356 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005357
5358 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5359 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005360 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5361
5362 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005363
5364 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005365 optional int64 duration_millis = 4 [deprecated = true];
5366 // Same as above, but with minute resolution so it fits into an int32.
5367 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005368
5369 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005370 optional int64 realtime_duration_millis = 9 [deprecated = true];
5371 // Same as above, but with minute resolution so it fits into an int32.
5372 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005373
5374 // # of samples taken
5375 optional int32 sample_size = 5;
5376
5377 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005378 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005379
5380 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005381 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005382
5383 // RSS is memory resident for this process
5384 optional AggStats rss = 8;
5385}
5386
5387// Next Tag: 7
5388message ProcessStatsProto {
5389 // Name of process.
5390 optional string process = 1;
5391
5392 // Uid of the process.
5393 optional int32 uid = 2;
5394
5395 // Information about how often kills occurred
5396 message Kill {
5397 // Count of excessive CPU kills
5398 optional int32 cpu = 1;
5399
5400 // Count of kills when cached
5401 optional int32 cached = 2;
5402
5403 // PSS stats during cached kill
5404 optional AggStats cached_pss = 3;
5405 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005406 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005407
5408 // Time and memory spent in various states.
5409 repeated ProcessStatsStateProto states = 5;
5410
5411 // Total time process has been running... screen_state, memory_state, and process_state
5412 // will not be set.
5413 optional ProcessStatsStateProto total_running_state = 6;
5414}
5415
5416message PackageServiceOperationStatsProto {
5417 // Operate enum: Started, Foreground, Bound, Executing
5418 optional android.service.procstats.ServiceOperationState operation = 1;
5419
5420 // Number of times the service was in this operation.
5421 optional int32 count = 2;
5422
5423 // Information about a state the service can be in.
5424 message StateStats {
5425 // Screen state enum.
5426 optional android.service.procstats.ScreenState screen_state = 1;
5427 // Memory state enum.
5428 optional android.service.procstats.MemoryState memory_state = 2;
5429
5430 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005431 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005432 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005433 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005434 }
5435 repeated StateStats state_stats = 3;
5436}
5437
5438message PackageServiceStatsProto {
5439 // Name of service component.
5440 optional string service_name = 1;
5441
5442 // The operation stats.
5443 // The package_name, package_uid, package_version, service_name will not be set to save space.
5444 repeated PackageServiceOperationStatsProto operation_stats = 2;
5445}
5446
5447message PackageAssociationSourceProcessStatsProto {
5448 // Uid of the process.
5449 optional int32 process_uid = 1;
5450 // Process name.
5451 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005452 // Package name.
5453 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005454 // Total count of the times this association appeared.
5455 optional int32 total_count = 3;
5456
5457 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005458 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005459
5460 // Total count of the times this association became actively impacting its target process.
5461 optional int32 active_count = 5;
5462
5463 // Information on one source in this association.
5464 message StateStats {
5465 // Process state enum.
5466 optional android.service.procstats.ProcessState process_state = 1;
5467 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005468 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005469 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005470 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005471 }
5472 repeated StateStats active_state_stats = 6;
5473}
5474
5475message PackageAssociationProcessStatsProto {
5476 // Name of the target component.
5477 optional string component_name = 1;
5478 // Information on one source in this association.
5479 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5480}
5481
5482
5483message ProcessStatsPackageProto {
5484 // Name of package.
5485 optional string package = 1;
5486
5487 // Uid of the package.
5488 optional int32 uid = 2;
5489
5490 // Version of the package.
5491 optional int64 version = 3;
5492
5493 // Stats for each process running with the package loaded in to it.
5494 repeated ProcessStatsProto process_stats = 4;
5495
5496 // Stats for each of the package's services.
5497 repeated PackageServiceStatsProto service_stats = 5;
5498
5499 // Stats for each association with the package.
5500 repeated PackageAssociationProcessStatsProto association_stats = 6;
5501}
5502
5503message ProcessStatsSectionProto {
5504 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005505 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005506
5507 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005508 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005509
5510 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005511 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005512
5513 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005514 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005515
5516 // System runtime library. e.g. "libdvm.so", "libart.so".
5517 optional string runtime = 5;
5518
5519 // whether kernel reports swapped pss.
5520 optional bool has_swapped_pss = 6;
5521
5522 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5523 enum Status {
5524 STATUS_UNKNOWN = 0;
5525 STATUS_COMPLETE = 1;
5526 STATUS_PARTIAL = 2;
5527 STATUS_SHUTDOWN = 3;
5528 STATUS_SYSPROPS = 4;
5529 }
5530 repeated Status status = 7;
5531
Chenjie Yub2ecc792019-01-17 10:27:26 -08005532 // Number of pages available of various types and sizes, representation fragmentation.
5533 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5534
Yangsteraf9aee72018-10-12 09:26:16 -07005535 // Stats for each process.
5536 repeated ProcessStatsProto process_stats = 8;
5537
5538 // Stats for each package.
5539 repeated ProcessStatsPackageProto package_stats = 9;
5540}
5541
Chenjie Yub2ecc792019-01-17 10:27:26 -08005542message ProcessStatsAvailablePagesProto {
5543 // Node these pages are in (as per /proc/pagetypeinfo)
5544 optional int32 node = 1;
5545
5546 // Zone these pages are in (as per /proc/pagetypeinfo)
5547 optional string zone = 2;
5548
5549 // Label for the type of these pages (as per /proc/pagetypeinfo)
5550 optional string label = 3;
5551
5552 // Distribution of number of pages available by order size. First entry in array is
5553 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5554 repeated int32 pages_per_order = 4;
5555}
5556
Chenjie Yu12e5e672018-09-14 15:54:59 -07005557/**
5558 * Pulled from ProcessStatsService.java
5559 */
5560message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005561 optional ProcessStatsSectionProto proc_stats_section = 1;
5562}
5563
Chenjie Yuf910b7802019-01-11 16:08:20 -08005564/**
5565 * Pulled from ProcessStatsService.java
5566 */
5567message ProcStatsPkgProc {
5568 optional ProcessStatsSectionProto proc_stats_section = 1;
5569}
5570
Chris Wrencdea3b72019-11-22 16:58:17 -05005571// Next Tag: 2
5572message PackageRemoteViewInfoProto {
5573 optional string package_name = 1;
5574 // add per-package additional info here (like channels)
5575}
5576
5577// Next Tag: 2
5578message NotificationRemoteViewsProto {
5579 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5580}
5581
5582/**
5583 * Pulled from NotificationManagerService.java
5584 */
5585message NotificationRemoteViews {
5586 optional NotificationRemoteViewsProto notification_remote_views = 1;
5587}
5588
Yotam Aron74299972020-01-16 16:20:58 +02005589/**
5590 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5591 */
5592message PackageNotificationPreferences {
5593 // Uid under which the package is installed.
5594 optional int32 uid = 1;
5595 // Notification importance, which specifies when and how a notification is displayed.
5596 // Specified under core/java/android/app/NotificationManager.java.
5597 optional int32 importance = 2;
5598 // Lockscreen visibility as set by the user.
5599 optional int32 visibility = 3;
5600 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5601 // PreferencesHelper.java)
5602 optional int32 user_locked_fields = 4;
5603}
5604
5605/**
5606 * Atom that contains a list of a package's channel preferences, pulled from
5607 * NotificationManagerService.java.
5608 */
5609message PackageNotificationChannelPreferences {
5610 // Uid under which the package is installed.
5611 optional int32 uid = 1;
5612 // Channel's ID. Should always be available.
5613 optional string channel_id = 2;
5614 // Channel's name. Should always be available.
5615 optional string channel_name = 3;
5616 // Channel's description. Optionally set by the channel creator.
5617 optional string description = 4;
5618 // Notification importance, which specifies when and how a notification is displayed. Specified
5619 // under core/java/android/app/NotificationManager.java.
5620 optional int32 importance = 5;
5621 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5622 // at core/java/android/app/NotificationChannel.java
5623 optional int32 user_locked_fields = 6;
5624 // Indicates if the channel was deleted by the app.
5625 optional bool is_deleted = 7;
5626}
5627
5628/**
5629 * Atom that contains a list of a package's channel group preferences, pulled from
5630 * NotificationManagerService.java.
5631 */
5632message PackageNotificationChannelGroupPreferences {
5633 // Uid under which the package is installed.
5634 optional int32 uid = 1;
5635 // Channel Group's ID. Should always be available.
5636 optional string group_id = 2;
5637 // Channel Group's name. Should always be available.
5638 optional string group_name = 3;
5639 // Channel Group's description. Optionally set by group creator.
5640 optional string description = 4;
5641 // Indicates if notifications from this channel group are blocked.
5642 optional bool is_blocked = 5;
5643 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5644 // at core/java/android/app/NotificationChannelGroup.java
5645 optional int32 user_locked_fields = 6;
5646}
5647
Yangsteraf9aee72018-10-12 09:26:16 -07005648message PowerProfileProto {
5649 optional double cpu_suspend = 1;
5650
5651 optional double cpu_idle = 2;
5652
5653 optional double cpu_active = 3;
5654
5655 message CpuCluster {
5656 optional int32 id = 1;
5657 optional double cluster_power = 2;
5658 optional int32 cores = 3;
5659 repeated int64 speed = 4;
5660 repeated double core_power = 5;
5661 }
5662
5663 repeated CpuCluster cpu_cluster = 40;
5664
5665 optional double wifi_scan = 4;
5666
5667 optional double wifi_on = 5;
5668
5669 optional double wifi_active = 6;
5670
5671 optional double wifi_controller_idle = 7;
5672
5673 optional double wifi_controller_rx = 8;
5674
5675 optional double wifi_controller_tx = 9;
5676
5677 repeated double wifi_controller_tx_levels = 10;
5678
5679 optional double wifi_controller_operating_voltage = 11;
5680
5681 optional double bluetooth_controller_idle = 12;
5682
5683 optional double bluetooth_controller_rx = 13;
5684
5685 optional double bluetooth_controller_tx = 14;
5686
5687 optional double bluetooth_controller_operating_voltage = 15;
5688
5689 optional double modem_controller_sleep = 16;
5690
5691 optional double modem_controller_idle = 17;
5692
5693 optional double modem_controller_rx = 18;
5694
5695 repeated double modem_controller_tx = 19;
5696
5697 optional double modem_controller_operating_voltage = 20;
5698
5699 optional double gps_on = 21;
5700
5701 repeated double gps_signal_quality_based = 22;
5702
5703 optional double gps_operating_voltage = 23;
5704
5705 optional double bluetooth_on = 24;
5706
5707 optional double bluetooth_active = 25;
5708
5709 optional double bluetooth_at_cmd = 26;
5710
5711 optional double ambient_display = 27;
5712
5713 optional double screen_on = 28;
5714
5715 optional double radio_on = 29;
5716
5717 optional double radio_scanning = 30;
5718
5719 optional double radio_active = 31;
5720
5721 optional double screen_full = 32;
5722
5723 optional double audio = 33;
5724
5725 optional double video = 34;
5726
5727 optional double flashlight = 35;
5728
5729 optional double memory = 36;
5730
5731 optional double camera = 37;
5732
5733 optional double wifi_batched_scan = 38;
5734
5735 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005736}
Chenjie Yuab530202018-09-26 12:39:20 -07005737
5738/**
5739 * power_profile.xml and other constants for power model calculations.
5740 * Pulled from PowerProfile.java
5741 */
5742message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005743 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005744}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005745
5746/**
arangelovd5db50e2018-10-12 20:24:39 +01005747 * Logs when a user restriction was added or removed.
5748 *
5749 * Logged from:
5750 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5751 */
5752message UserRestrictionChanged {
5753 // The raw string of the user restriction as defined in UserManager.
5754 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5755 optional string restriction = 1;
5756 // Whether the restriction is enabled or disabled.
5757 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005758}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005759
5760/**
5761 * Pulls process user time and system time. Puller takes a snapshot of all pids
5762 * in the system and returns cpu stats for those that are working at the time.
5763 * Dead pids will be dropped. Kernel processes are excluded.
5764 * Min cool-down is 5 sec.
5765 */
5766message ProcessCpuTime {
5767 optional int32 uid = 1 [(is_uid) = true];
5768
5769 optional string process_name = 2;
5770 // Process cpu time in user space, cumulative from boot/process start
5771 optional int64 user_time_millis = 3;
5772 // Process cpu time in system space, cumulative from boot/process start
5773 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005774}
Misha Wagner5a51e002018-10-03 15:04:09 +01005775
5776/**
5777 * Pulls the CPU usage for each thread.
5778 *
5779 * Read from /proc/$PID/task/$TID/time_in_state files.
5780 *
5781 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5782 * time_in_state files not being present on some phones, have not been addressed. These should be
5783 * considered before a public release.
5784 */
5785message CpuTimePerThreadFreq {
5786 // UID that owns the process.
5787 optional int32 uid = 1 [(is_uid) = true];
5788 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005789 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005790 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005791 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005792 // Name of the process taken from `/proc/$PID/cmdline`.
5793 optional string process_name = 4;
5794 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5795 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005796
5797 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5798 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5799 // frequencies are given here as the alternative is sending eight separate atoms. This method
5800 // significantly reduces the amount of data created
5801 optional int32 frequency1_khz = 6;
5802 optional int32 time1_millis = 7;
5803 optional int32 frequency2_khz = 8;
5804 optional int32 time2_millis = 9;
5805 optional int32 frequency3_khz = 10;
5806 optional int32 time3_millis = 11;
5807 optional int32 frequency4_khz = 12;
5808 optional int32 time4_millis = 13;
5809 optional int32 frequency5_khz = 14;
5810 optional int32 time5_millis = 15;
5811 optional int32 frequency6_khz = 16;
5812 optional int32 time6_millis = 17;
5813 optional int32 frequency7_khz = 18;
5814 optional int32 time7_millis = 19;
5815 optional int32 frequency8_khz = 20;
5816 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005817}
Bookatz75ee60422018-11-09 12:27:37 -08005818
5819/**
Bookatz366a4432018-11-20 09:42:33 -08005820 * Pulls information about the device's build.
5821 */
5822message BuildInformation {
5823 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5824 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5825 optional string fingerprint = 1;
5826
5827 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5828 optional string brand = 2;
5829
5830 // Build.PRODUCT. The name of the overall product.
5831 optional string product = 3;
5832
5833 // Build.DEVICE. The name of the industrial design.
5834 optional string device = 4;
5835
5836 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5837 optional string version_release = 5;
5838
5839 // Build.ID. E.g. a label like "M4-rc20".
5840 optional string id = 6;
5841
5842 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5843 // represent this build.
5844 optional string version_incremental = 7;
5845
5846 // Build.TYPE. The type of build, like "user" or "eng".
5847 optional string type = 8;
5848
5849 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5850 optional string tags = 9;
5851}
5852
5853/**
Adam He420947c2019-01-23 15:59:09 -08005854 * Logs information about mismatched caller for content capture.
5855 *
5856 * Logged from:
5857 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5858 */
5859message ContentCaptureCallerMismatchReported {
5860 optional string intended_package = 1;
5861 optional string calling_package = 2;
5862}
5863
5864/**
5865 * Logs information about content capture service events.
5866 *
5867 * Logged from:
5868 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5869 */
5870message ContentCaptureServiceEvents {
5871 // The type of event.
5872 enum Event {
5873 UNKNOWN = 0;
5874 ON_CONNECTED = 1;
5875 ON_DISCONNECTED = 2;
5876 SET_WHITELIST = 3;
5877 SET_DISABLED = 4;
5878 ON_USER_DATA_REMOVED = 5;
5879 }
5880 optional Event event = 1;
5881 // component/package of content capture service.
5882 optional string service_info = 2;
5883 // component/package of target.
5884 // it's a concatenated list of component/package for SET_WHITELIST event
5885 // separated by " ".
5886 optional string target_info = 3;
5887}
5888
5889/**
5890 * Logs information about content capture session events.
5891 *
5892 * Logged from:
5893 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5894 */
5895message ContentCaptureSessionEvents {
5896 // The type of event.
5897 enum Event {
5898 UNKNOWN = 0;
5899 ON_SESSION_STARTED = 1;
5900 ON_SESSION_FINISHED = 2;
5901 SESSION_NOT_CREATED = 3;
5902 }
5903 optional int32 session_id = 1;
5904 optional Event event = 2;
5905 // (n/a on session finished)
5906 optional int32 state_flags = 3;
5907 // component/package of content capture service.
5908 optional string service_info = 4;
5909 // component/package of app.
5910 // (n/a on session finished)
5911 optional string app_info = 5;
5912 optional bool is_child_session = 6;
5913}
5914
5915/**
5916 * Logs information about session being flushed.
5917 *
5918 * Logged from:
5919 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5920 */
5921message ContentCaptureFlushed {
5922 optional int32 session_id = 1;
5923 // component/package of content capture service.
5924 optional string service_info = 2;
5925 // component/package of app.
5926 optional string app_info = 3;
5927 // session start/finish events
5928 optional int32 child_session_started = 4;
5929 optional int32 child_session_finished = 5;
5930 // count of view events.
5931 optional int32 view_appeared_count = 6;
5932 optional int32 view_disappeared_count = 7;
5933 optional int32 view_text_changed_count = 8;
5934
5935 // Flush stats.
5936 optional int32 max_events = 9;
5937 optional int32 idle_flush_freq = 10;
5938 optional int32 text_flush_freq = 11;
5939 optional int32 flush_reason = 12;
5940}
5941
5942/**
Bookatz75ee60422018-11-09 12:27:37 -08005943 * Pulls on-device BatteryStats power use calculations for the overall device.
5944 */
5945message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005946 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5947 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5948 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5949 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005950}
5951
5952/**
5953 * Pulls on-device BatteryStats power use calculations broken down by uid.
5954 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5955 * that is attributed to non-uid items. They must all be included to get the total power use.
5956 */
5957message DeviceCalculatedPowerBlameUid {
5958 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5959 optional int32 uid = 1 [(is_uid) = true];
5960
Bookatz3dbc13a2018-12-21 12:16:51 -08005961 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5962 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5963 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005964}
5965
5966/**
5967 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5968 * drain type.
5969 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5970 * is attributed uids. They must all be included to get the total power use.
5971 */
5972message DeviceCalculatedPowerBlameOther {
5973 // The type of item whose power use is being reported.
5974 enum DrainType {
5975 AMBIENT_DISPLAY = 0;
5976 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5977 BLUETOOTH = 2;
5978 CAMERA = 3;
5979 // Cell-standby
5980 CELL = 4;
5981 FLASHLIGHT = 5;
5982 IDLE = 6;
5983 MEMORY = 7;
5984 // Amount that total computed drain exceeded the drain estimated using the
5985 // battery level changes and capacity.
5986 OVERCOUNTED = 8;
5987 PHONE = 9;
5988 SCREEN = 10;
5989 // Amount that total computed drain was below the drain estimated using the
5990 // battery level changes and capacity.
5991 UNACCOUNTED = 11;
5992 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5993 WIFI = 13;
5994 }
5995 optional DrainType drain_type = 1;
5996
Bookatz3dbc13a2018-12-21 12:16:51 -08005997 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5998 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5999 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006000}
arangelov4e994062018-11-13 16:12:38 +00006001
6002/**
6003 * Logs device policy features.
6004 *
6005 * Logged from:
6006 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6007 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6008 */
6009message DevicePolicyEvent {
6010 // The event id - unique for each event.
6011 optional android.stats.devicepolicy.EventId event_id = 1;
6012 // The admin package name.
6013 optional string admin_package_name = 2;
6014 // A generic integer parameter.
6015 optional int32 integer_value = 3;
6016 // A generic boolean parameter.
6017 optional bool boolean_value = 4;
6018 // A parameter specifying a time period in milliseconds.
6019 optional uint64 time_period_millis = 5;
6020 // A parameter specifying a list of package names, bundle extras or string parameters.
6021 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6022}
shawnlinea5b66b2018-11-13 15:05:29 +08006023
6024/**
6025 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6026 *
6027 * Logged from:
6028 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6029 */
6030message DocsUILaunchReported {
6031 optional android.stats.docsui.LaunchAction launch_action = 1;
6032 optional bool has_initial_uri = 2;
6033 optional android.stats.docsui.MimeType mime_type = 3;
6034 optional android.stats.docsui.Root initial_root = 4;
6035}
6036
6037/**
6038 * Logs root/app visited event in file managers/picker. Call this when the user
6039 * taps on root/app in hamburger menu.
6040 *
6041 * Logged from:
6042 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6043 */
6044message DocsUIRootVisitedReported {
6045 optional android.stats.docsui.ContextScope scope = 1;
6046 optional android.stats.docsui.Root root = 2;
6047}
6048
6049/**
6050 * Logs file operation stats. Call this when a file operation has completed.
6051 *
6052 * Logged from:
6053 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6054 */
6055message DocsUIFileOperationReported {
6056 optional android.stats.docsui.Provider provider = 1;
6057 optional android.stats.docsui.FileOperation file_op = 2;
6058}
6059
6060/**
6061 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6062 * mode.
6063 *
6064 * Logged from:
6065 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6066 */
6067message DocsUIFileOperationCopyMoveModeReported {
6068 optional android.stats.docsui.FileOperation file_op = 1;
6069 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6070}
6071
6072
6073/**
6074 * Logs file sub operation stats. Call this when a file operation has failed.
6075 *
6076 * Logged from:
6077 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6078 */
6079message DocsUIFileOperationFailureReported {
6080 optional android.stats.docsui.Authority authority = 1;
6081 optional android.stats.docsui.SubFileOperation sub_op = 2;
6082}
6083
6084/**
6085* Logs the cancellation of a file operation. Call this when a job is canceled
6086*
6087* Logged from:
6088* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6089*/
6090message DocsUIFileOperationCanceledReported {
6091 optional android.stats.docsui.FileOperation file_op = 1;
6092}
6093
6094/**
6095 * Logs startup time in milliseconds.
6096 *
6097 * Logged from:
6098 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6099 */
6100message DocsUIStartupMsReported {
6101 optional int32 startup_millis = 1;
6102}
6103
6104/**
6105 * Logs the action that was started by user.
6106 *
6107 * Logged from:
6108 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6109 */
6110message DocsUIUserActionReported {
6111 optional android.stats.docsui.UserAction action = 1;
6112}
6113
6114/**
6115 * Logs the invalid type when invalid scoped access is requested.
6116 *
6117 * Logged from:
6118 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6119 */
6120message DocsUIInvalidScopedAccessRequestReported {
6121 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006122}
Ben Murdochbab399f62018-12-06 11:01:38 +00006123
6124/**
shawnlina75e82d2019-01-07 10:31:12 +08006125 * Logs the package name that launches docsui picker mode.
6126 *
6127 * Logged from:
6128 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6129 */
6130message DocsUIPickerLaunchedFromReported {
6131 optional string package_name = 1;
6132}
6133
6134/**
6135 * Logs the search type.
6136 *
6137 * Logged from:
6138 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6139 */
6140message DocsUISearchTypeReported {
6141 optional android.stats.docsui.SearchType search_type = 1;
6142}
6143
6144/**
6145 * Logs the search mode.
6146 *
6147 * Logged from:
6148 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6149 */
6150message DocsUISearchModeReported {
6151 optional android.stats.docsui.SearchMode search_mode = 1;
6152}
6153
6154/**
6155 * Logs the pick result information.
6156 *
6157 * Logged from:
6158 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6159 */
6160message DocsUIPickResultReported {
6161 optional int32 total_action_count = 1;
6162 optional int64 duration_millis = 2;
6163 optional int32 file_count= 3;
6164 optional bool is_searching = 4;
6165 optional android.stats.docsui.Root picked_from = 5;
6166 optional android.stats.docsui.MimeType mime_type = 6;
6167 optional int32 repeatedly_pick_times = 7;
6168}
6169
6170/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006171 * Logs when an app's memory is compacted.
6172 *
6173 * Logged from:
6174 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6175 */
6176message AppCompacted {
6177 // The pid of the process being compacted.
6178 optional int32 pid = 1;
6179
6180 // The name of the process being compacted.
6181 optional string process_name = 2;
6182
6183 // The type of compaction.
6184 enum Action {
6185 UNKNOWN = 0;
6186 SOME = 1;
6187 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006188 PERSISTENT = 3;
6189 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006190 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006191 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006192
6193 // Total RSS in kilobytes consumed by the process prior to compaction.
6194 optional int64 before_rss_total_kilobytes = 4;
6195
6196 // File RSS in kilobytes consumed by the process prior to compaction.
6197 optional int64 before_rss_file_kilobytes = 5;
6198
6199 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6200 optional int64 before_rss_anon_kilobytes = 6;
6201
6202 // Swap in kilobytes consumed by the process prior to compaction.
6203 optional int64 before_swap_kilobytes = 7;
6204
6205 // Total RSS in kilobytes consumed by the process after compaction.
6206 optional int64 after_rss_total_kilobytes = 8;
6207
6208 // File RSS in kilobytes consumed by the process after compaction.
6209 optional int64 after_rss_file_kilobytes = 9;
6210
6211 // Anonymous RSS in kilobytes consumed by the process after compaction.
6212 optional int64 after_rss_anon_kilobytes = 10;
6213
6214 // Swap in kilobytes consumed by the process after compaction.
6215 optional int64 after_swap_kilobytes = 11;
6216
6217 // The time taken to perform compaction in milliseconds.
6218 optional int64 time_to_compact_millis = 12;
6219
6220 // The last compaction action performed for this app.
6221 optional Action last_action = 13;
6222
Ben Murdoch01720b82018-12-19 18:03:44 +00006223 // The last time that compaction was attempted on this process in milliseconds
6224 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6225 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006226
Ben Murdoch885c21b2019-03-15 18:02:04 +00006227 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006228 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006229
6230 // The process state at the time of compaction.
6231 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006232
6233 // Free ZRAM in kilobytes before compaction.
6234 optional int64 before_zram_free_kilobytes = 17;
6235
6236 // Free ZRAM in kilobytes after compaction.
6237 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006238}
lifr157fc552018-12-12 16:38:04 +08006239
6240/**
lifrb6b90b62019-03-29 00:40:17 +08006241 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6242 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6243 *
lifr1f74b052019-04-16 22:16:30 +08006244 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6245 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6246 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6247 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006248 */
6249message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006250 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006251
lifr1f74b052019-04-16 22:16:30 +08006252 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006253
6254 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006255 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006256
lifr1f74b052019-04-16 22:16:30 +08006257 // Only valid for event_type = EVENT_GETADDRINFO.
6258 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006259
lifr1f74b052019-04-16 22:16:30 +08006260 // Flags passed to android_res_nsend() defined in multinetwork.h
6261 // Only valid for event_type = EVENT_RESNSEND.
6262 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006263
lifrad9becc2019-05-20 11:04:41 +08006264 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006265
6266 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006267 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006268
6269 // Additional pass-through fields opaque to statsd.
6270 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006271 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006272
6273 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6274 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006275}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006276
6277/**
6278 * Logs when a data stall event occurs.
6279 *
6280 * Log from:
6281 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6282 */
6283message DataStallEvent {
6284 // Data stall evaluation type.
6285 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6286 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6287 optional int32 evaluation_type = 1;
6288 // See definition in data_stall_event.proto.
6289 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6290 // See definition in data_stall_event.proto.
6291 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6292 // See definition in data_stall_event.proto.
6293 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6294 // See definition in data_stall_event.proto.
6295 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6296 // See definition in data_stall_event.proto.
6297 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6298}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006299
6300/*
6301 * Logs when RescueParty resets some set of experiment flags.
6302 *
6303 * Logged from:
6304 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6305 */
6306message RescuePartyResetReported {
6307 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6308 optional int32 rescue_level = 1;
6309}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006310
6311/**
6312 * Logs when signed config is received from an APK, and if that config was applied successfully.
6313 * Logged from:
6314 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6315 */
6316message SignedConfigReported {
6317 enum Type {
6318 UNKNOWN_TYPE = 0;
6319 GLOBAL_SETTINGS = 1;
6320 }
6321 optional Type type = 1;
6322
6323 // The final status of the signed config received.
6324 enum Status {
6325 UNKNOWN_STATUS = 0;
6326 APPLIED = 1;
6327 BASE64_FAILURE_CONFIG = 2;
6328 BASE64_FAILURE_SIGNATURE = 3;
6329 SECURITY_EXCEPTION = 4;
6330 INVALID_CONFIG = 5;
6331 OLD_CONFIG = 6;
6332 SIGNATURE_CHECK_FAILED = 7;
6333 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006334 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006335 }
6336 optional Status status = 2;
6337
6338 // The version of the signed config processed.
6339 optional int32 version = 3;
6340
6341 // The package name that the config was extracted from.
6342 optional string from_package = 4;
6343
6344 enum Key {
6345 NO_KEY = 0;
6346 DEBUG = 1;
6347 PRODUCTION = 2;
6348 }
6349 // Which key was used to verify the config.
6350 optional Key verified_with = 5;
6351}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006352
6353/*
6354 * Logs GNSS Network-Initiated (NI) location events.
6355 *
6356 * Logged from:
6357 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6358 */
6359message GnssNiEventReported {
6360 // The type of GnssNiEvent.
6361 enum EventType {
6362 UNKNOWN = 0;
6363 NI_REQUEST = 1;
6364 NI_RESPONSE = 2;
6365 }
6366 optional EventType event_type = 1;
6367
6368 // An ID generated by HAL to associate NI notifications and UI responses.
6369 optional int32 notification_id = 2;
6370
6371 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006372 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006373
6374 // NI requires notification.
6375 optional bool need_notify = 4;
6376
6377 // NI requires verification.
6378 optional bool need_verify = 5;
6379
6380 // NI requires privacy override, no notification/minimal trace.
6381 optional bool privacy_override = 6;
6382
6383 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6384 // seconds.
6385 optional int32 timeout = 7;
6386
6387 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006388 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006389
6390 // String representing the requester of the network inititated location request.
6391 optional string requestor_id = 9;
6392
6393 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6394 // network initiated location request.
6395 optional string text = 10;
6396
6397 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006398 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006399
6400 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006401 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006402
6403 // True if SUPL ES is enabled.
6404 optional bool is_supl_es_enabled = 13;
6405
6406 // True if GNSS location is enabled.
6407 optional bool is_location_enabled = 14;
6408
6409 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006410 optional android.server.location.GnssUserResponseType user_response = 15;
6411}
6412
6413/**
6414 * Logs GNSS non-framework (NFW) location notification.
6415 *
6416 * Logged from:
6417 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6418 */
6419message GnssNfwNotificationReported {
6420 // Package name of the Android proxy application representing the non-framework entity that
6421 // requested location. Set to empty string if unknown.
6422 optional string proxy_app_package_name = 1;
6423
6424 // Protocol stack that initiated the non-framework location request.
6425 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6426
6427 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6428 // set to empty string. This field is opaque to the framework and used for logging purposes.
6429 optional string other_protocol_stack_name = 3;
6430
6431 // Source initiating/receiving the location information.
6432 optional android.server.location.NfwRequestor requestor = 4;
6433
6434 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6435 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6436 // and used for logging purposes.
6437 optional string requestor_id = 5;
6438
6439 // Indicates whether location information was provided for this request.
6440 optional android.server.location.NfwResponseType response_type = 6;
6441
6442 // True if the device is in user initiated emergency session.
6443 optional bool in_emergency_mode = 7;
6444
6445 // True if cached location is provided.
6446 optional bool is_cached_location = 8;
6447
6448 // True if proxy app permission mismatch between framework and GNSS HAL.
6449 optional bool is_permission_mismatched = 9;
6450}
6451
6452/**
6453 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6454 *
6455 * Logged from:
6456 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6457 */
6458message GnssConfigurationReported {
6459 // SUPL host name.
6460 optional string supl_host = 1;
6461
6462 // SUPL port number.
6463 optional int32 supl_port = 2;
6464
6465 // C2K host name.
6466 optional string c2k_host = 3;
6467
6468 // C2K port number.
6469 optional int32 c2k_port = 4;
6470
6471 // The SUPL version requested by Carrier.
6472 optional int32 supl_ver = 5;
6473
6474 // The SUPL mode.
6475 optional android.server.location.SuplMode supl_mode = 6;
6476
6477 // True if NI emergency SUPL restrictions is enabled.
6478 optional bool supl_es = 7;
6479
6480 // LTE Positioning Profile settings
6481 optional android.server.location.LppProfile lpp_profile = 8;
6482
6483 // Positioning protocol on A-Glonass system.
6484 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6485
6486 // True if emergency PDN is used. Otherwise, regular PDN is used.
6487 optional bool use_emergency_pdn_for_emergency_supl= 10;
6488
6489 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6490 optional android.server.location.GpsLock gps_lock = 11;
6491
6492 // Number of seconds to extend the emergency session duration post emergency call.
6493 optional int32 es_extension_sec = 12;
6494
6495 // The full list of package names of proxy Android applications representing the non-framework
6496 // location access entities (on/off the device) for which the framework user has granted
6497 // non-framework location access permission. The package names are concatenated in one string
6498 // with spaces as separators.
6499 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006500}
Jack Yu95b64f32018-12-13 18:26:11 +08006501
6502/**
6503 * Logs when a NFC device's error occurred.
6504 * Logged from:
6505 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6506 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6507 */
6508message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006509 enum Type {
6510 UNKNOWN = 0;
6511 CMD_TIMEOUT = 1;
6512 ERROR_NOTIFICATION = 2;
6513 AID_OVERFLOW = 3;
6514 }
6515 optional Type type = 1;
6516 // If it's nci cmd timeout, log the timeout command.
6517 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006518
Alex Salod7c3eef2019-01-25 14:43:27 -08006519 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006520}
6521
6522/**
6523 * Logs when a NFC device's state changed event
6524 * Logged from:
6525 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6526 */
6527message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006528 enum State {
6529 UNKNOWN = 0;
6530 OFF = 1;
6531 ON = 2;
6532 ON_LOCKED = 3; // Secure Nfc enabled.
6533 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6534 }
6535 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006536}
6537
6538/**
6539 * Logs when a NFC Beam Transaction occurred.
6540 * Logged from:
6541 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6542 */
6543message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006544 enum Operation {
6545 UNKNOWN = 0;
6546 SEND = 1;
6547 RECEIVE = 2;
6548 }
6549 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006550}
6551
6552/**
6553 * Logs when a NFC Card Emulation Transaction occurred.
6554 * Logged from:
6555 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6556 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6557 */
6558message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006559 enum Category {
6560 UNKNOWN = 0;
6561 HCE_PAYMENT = 1;
6562 HCE_OTHER = 2;
6563 OFFHOST = 3;
6564 }
6565 // Transaction belongs to HCE payment or HCE other category, or offhost.
6566 optional Category category = 1;
6567 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6568 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006569}
6570
6571/**
6572 * Logs when a NFC Tag event occurred.
6573 * Logged from:
6574 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6575 */
6576message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006577 enum Type {
6578 UNKNOWN = 0;
6579 URL = 1;
6580 BT_PAIRING = 2;
6581 PROVISION = 3;
6582 WIFI_CONNECT = 4;
6583 APP_LAUNCH = 5;
6584 OTHERS = 6;
6585 }
6586 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006587}
6588
6589/**
6590 * Logs when Hce transaction triggered
6591 * Logged from:
6592 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6593 */
6594message NfcHceTransactionOccurred {
6595 // The latency period(in microseconds) it took for the first HCE data
6596 // exchange.
6597 optional uint32 latency_micros = 1;
6598}
6599
6600/**
6601 * Logs when SecureElement state event changed
6602 * Logged from:
6603 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6604 */
6605message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006606 enum State {
6607 UNKNOWN = 0;
6608 INITIALIZED = 1;
6609 DISCONNECTED = 2;
6610 CONNECTED = 3;
6611 HALCRASH = 4;
6612 }
6613 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006614
Alex Salod7c3eef2019-01-25 14:43:27 -08006615 optional string state_change_reason = 2;
6616 // SIMx or eSEx.
6617 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006618}
6619
6620/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006621 * Information about a permission grant request
6622 */
6623message PermissionGrantRequestResultReported {
6624 // unique value identifying an API call. A API call might result in multiple of these atoms
6625 optional int64 request_id = 1;
6626
6627 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006628 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006629
6630 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006631 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006632
6633 // The permission to be granted
6634 optional string permission_name = 4;
6635
6636 // If the permission was explicitly requested via the API or added by the system
6637 optional bool is_implicit = 5;
6638
6639 enum Result {
6640 UNDEFINED = 0;
6641 // permission request was ignored
6642 IGNORED = 1;
6643 // permission request was ignored because it was user fixed
6644 IGNORED_USER_FIXED = 2;
6645 // permission request was ignored because it was policy fixed
6646 IGNORED_POLICY_FIXED = 3;
6647 // permission was granted by user action
6648 USER_GRANTED = 4;
6649 // permission was automatically granted
6650 AUTO_GRANTED = 5;
6651 // permission was denied by user action
6652 USER_DENIED = 6;
6653 // permission was denied with prejudice by the user
6654 USER_DENIED_WITH_PREJUDICE = 7;
6655 // permission was automatically denied
6656 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006657 // permission request was ignored because permission is restricted
6658 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006659 // one time permission was granted by user action
6660 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006661 // user ignored request by leaving the request screen without choosing any option
6662 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006663 // user granted the permission after being linked to settings
6664 USER_GRANTED_IN_SETTINGS = 12;
6665 // user denied the permission after being linked to settings
6666 USER_DENIED_IN_SETTINGS = 13;
6667 // user denied the permission with prejudice after being linked to settings
6668 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6669 // permission was automatically revoked after one-time permission expired
6670 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006671 // permission was automatically revoked for unused app
6672 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006673 }
6674 // The result of the permission grant
6675 optional Result result = 6;
6676}
6677
6678/**
Jack Yu95b64f32018-12-13 18:26:11 +08006679 * Logs when Omapi API used
6680 * Logged from:
6681 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6682 */
6683message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006684 enum Operation {
6685 UNKNOWN = 0;
6686 OPEN_CHANNEL = 1;
6687 }
6688 optional Operation operation = 1;
6689 // SIMx or eSEx.
6690 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006691
Alex Salod7c3eef2019-01-25 14:43:27 -08006692 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006693}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006694
6695/**
Alex Saloa060aee2019-01-21 14:36:41 -08006696 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6697 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006698 * Logged from:
6699 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6700 */
6701message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006702 optional int64 dispatch_latency_millis = 1;
6703}
6704
6705/**
6706 * Logs AttentionManagerService attention check result.
6707 *
6708 * Logged from:
6709 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6710 */
6711message AttentionManagerServiceResultReported {
6712 // See core/java/android/service/attention/AttentionService.java
6713 enum AttentionCheckResult {
6714 UNKNOWN = 20;
6715 ATTENTION_SUCCESS_ABSENT = 0;
6716 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006717 ATTENTION_FAILURE_UNKNOWN = 2;
6718 ATTENTION_FAILURE_CANCELLED = 3;
6719 ATTENTION_FAILURE_PREEMPTED = 4;
6720 ATTENTION_FAILURE_TIMED_OUT = 5;
6721 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006722 }
6723 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006724}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006725
6726/**
6727 * Logs when an adb connection changes state.
6728 *
6729 * Logged from:
6730 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6731 */
6732message AdbConnectionChanged {
6733 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6734 // previously selected for this system.
6735 optional int64 last_connection_time_millis = 1;
6736
6737 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6738 // to reconnect via adb without user interaction.
6739 optional int64 auth_window_millis = 2;
6740
6741 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6742 optional android.debug.AdbConnectionStateEnum state = 3;
6743
6744 // True if the 'always allow' option was selected for this system.
6745 optional bool always_allow = 4;
6746}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006747
6748/*
6749 * Logs the reported speech DSP status.
6750 *
6751 * Logged from:
6752 * Vendor audio implementation.
6753 */
6754message SpeechDspStatReported {
6755 // The total Speech DSP uptime in milliseconds.
6756 optional int32 total_uptime_millis = 1;
6757 // The total Speech DSP downtime in milliseconds.
6758 optional int32 total_downtime_millis = 2;
6759 optional int32 total_crash_count = 3;
6760 optional int32 total_recover_count = 4;
6761}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006762
6763/**
6764 * Logs USB connector contaminant status.
6765 *
6766 * Logged from: USB Service.
6767 */
6768message UsbContaminantReported {
6769 optional string id = 1;
6770 optional android.service.usb.ContaminantPresenceStatus status = 2;
6771}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006772
6773/**
6774 * This atom is for debugging purpose.
6775 */
6776message DebugElapsedClock {
6777 // Monotically increasing value for each pull.
6778 optional int64 pull_count = 1;
6779 // Time from System.elapsedRealtime.
6780 optional int64 elapsed_clock_millis = 2;
6781 // Time from System.elapsedRealtime.
6782 optional int64 same_elapsed_clock_millis = 3;
6783 // Diff between current elapsed time and elapsed time from previous pull.
6784 optional int64 elapsed_clock_diff_millis = 4;
6785
6786 enum Type {
6787 TYPE_UNKNOWN = 0;
6788 ALWAYS_PRESENT = 1;
6789 PRESENT_ON_ODD_PULLS = 2;
6790 }
6791 // Type of behavior for the pulled data.
6792 optional Type type = 5;
6793}
6794
6795/**
6796 * This atom is for debugging purpose.
6797 */
6798message DebugFailingElapsedClock {
6799 // Monotically increasing value for each pull.
6800 optional int64 pull_count = 1;
6801 // Time from System.elapsedRealtime.
6802 optional int64 elapsed_clock_millis = 2;
6803 // Time from System.elapsedRealtime.
6804 optional int64 same_elapsed_clock_millis = 3;
6805 // Diff between current elapsed time and elapsed time from previous pull.
6806 optional int64 elapsed_clock_diff_millis = 4;
6807}
Steven Wuacef6bb2019-01-23 14:21:17 -05006808
6809/** Logs System UI bubbles event changed.
6810 *
6811 * Logged from:
6812 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6813 */
6814message BubbleUIChanged {
6815
6816 // The app package that is posting the bubble.
6817 optional string package_name = 1;
6818
6819 // The notification channel that is posting the bubble.
6820 optional string notification_channel = 2;
6821
6822 // The notification id associated with the posted bubble.
6823 optional int32 notification_id = 3;
6824
6825 // The position of the bubble within the bubble stack.
6826 optional int32 position = 4;
6827
6828 // The total number of bubbles within the bubble stack.
6829 optional int32 total_number = 5;
6830
6831 // User interactions with the bubble.
6832 enum Action {
6833 UNKNOWN = 0;
6834 POSTED = 1;
6835 UPDATED = 2;
6836 EXPANDED = 3;
6837 COLLAPSED = 4;
6838 DISMISSED = 5;
6839 STACK_DISMISSED = 6;
6840 STACK_MOVED = 7;
6841 HEADER_GO_TO_APP = 8;
6842 HEADER_GO_TO_SETTINGS = 9;
6843 PERMISSION_OPT_IN = 10;
6844 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006845 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006846 SWIPE_LEFT = 13;
6847 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006848 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006849 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006850 }
6851 optional Action action = 6;
6852
6853 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6854 optional float normalized_x_position = 7;
6855 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006856
6857 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6858 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006859
6860 // Whether the bubble is an on-going one.
6861 optional bool is_ongoing = 10;
6862
6863 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006864 // This is deprecated and the value should be ignored.
6865 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006866}
Kweku Adams8845d012018-12-11 20:06:45 -08006867
6868/**
Steven Wu552f63f2019-02-05 13:41:36 -05006869 * Logs System UI bubbles developer errors.
6870 *
6871 * Logged from:
6872 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6873 */
6874message BubbleDeveloperErrorReported {
6875
6876 // The app package that is posting the bubble.
6877 optional string package_name = 1;
6878
6879 // Bubble developer error type enums.
6880 enum Error {
6881 UNKNOWN = 0;
6882 ACTIVITY_INFO_MISSING = 1;
6883 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6884 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6885 }
6886 optional Error error = 2 [default = UNKNOWN];
6887}
6888
6889/**
Kweku Adams8845d012018-12-11 20:06:45 -08006890 * Logs that a constraint for a scheduled job has changed.
6891 *
6892 * Logged from:
6893 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6894 */
6895message ScheduledJobConstraintChanged {
6896 repeated AttributionNode attribution_node = 1;
6897
6898 // Name of the job.
6899 optional string job_name = 2;
6900
6901 optional com.android.server.job.ConstraintEnum constraint = 3;
6902
6903 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006904 UNKNOWN = 0;
6905 UNSATISFIED = 1;
6906 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006907 }
6908 optional State state = 4;
6909}
Alex Salod7c3eef2019-01-25 14:43:27 -08006910
6911/**
6912 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6913 * returns true.
6914 *
6915 * Logged from:
6916 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6917 */
6918message ScreenTimeoutExtensionReported {
6919 // Describes how many times in a row did the power manager reset the screen off timeout.
6920 optional uint32 consecutive_timeout_extended_count = 1;
6921}
Hui Yu885aca12019-01-10 17:11:34 -08006922
6923/*
6924* Logs number of milliseconds it takes to start a process.
6925* The definition of app process start time is from the app launch time to
6926* the time that Zygote finished forking the app process and loaded the
6927* application package's java classes.
6928
6929* This metric is different from AppStartOccurred which is for foreground
6930* activity only.
6931
6932* ProcessStartTime can report all processes (both foreground and background)
6933* start time.
6934*
6935* Logged from:
6936* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6937*/
6938message ProcessStartTime {
6939 // The uid of the ProcessRecord.
6940 optional int32 uid = 1 [(is_uid) = true];
6941
6942 // The process pid.
6943 optional int32 pid = 2;
6944
6945 // The process name.
6946 // Usually package name, "system" for system server.
6947 // Provided by ActivityManagerService.
6948 optional string process_name = 3;
6949
6950 enum StartType {
6951 UNKNOWN = 0;
6952 WARM = 1;
6953 HOT = 2;
6954 COLD = 3;
6955 }
6956
6957 // The start type.
6958 optional StartType type = 4;
6959
6960 // The elapsed realtime at the start of the process.
6961 optional int64 process_start_time_millis = 5;
6962
6963 // Number of milliseconds it takes to reach bind application.
6964 optional int32 bind_application_delay_millis = 6;
6965
6966 // Number of milliseconds it takes to finish start of the process.
6967 optional int32 process_start_delay_millis = 7;
6968
6969 // hostingType field in ProcessRecord, the component type such as "activity",
6970 // "service", "content provider", "broadcast" or other strings.
6971 optional string hosting_type = 8;
6972
6973 // hostingNameStr field in ProcessRecord. The component class name that runs
6974 // in this process.
6975 optional string hosting_name = 9;
6976}
6977
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006978/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006979 * Track Media Codec usage
6980 * Logged from:
6981 * frameworks/av/media/libstagefright/MediaCodec.cpp
6982 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6983 */
6984message MediametricsCodecReported {
6985 optional int64 timestamp_nanos = 1;
6986 optional string package_name = 2;
6987 optional int64 package_version_code = 3;
6988 optional int64 media_apex_version = 4;
6989
6990 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6991}
6992
6993/**
6994 * Track Media Extractor (pulling video/audio streams out of containers) usage
6995 * Logged from:
6996 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6997 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6998 */
6999message MediametricsExtractorReported {
7000 optional int64 timestamp_nanos = 1;
7001 optional string package_name = 2;
7002 optional int64 package_version_code = 3;
7003 optional int64 media_apex_version = 4;
7004
7005 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7006}
7007
7008/**
7009 * Track how we arbitrate between microphone/input requests.
7010 * Logged from
7011 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7012 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7013 */
7014message MediametricsAudiopolicyReported {
7015 optional int64 timestamp_nanos = 1;
7016 optional string package_name = 2;
7017 optional int64 package_version_code = 3;
7018 optional int64 media_apex_version = 4;
7019
7020 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7021}
7022
7023/**
7024 * Track how we arbitrate between microphone requests.
7025 * Logged from
7026 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7027 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7028 */
7029message MediametricsAudiorecordReported {
7030 optional int64 timestamp_nanos = 1;
7031 optional string package_name = 2;
7032 optional int64 package_version_code = 3;
7033 optional int64 media_apex_version = 4;
7034
7035 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7036}
7037
7038/**
7039 * Track how we arbitrate between microphone/input requests.
7040 * Logged from
7041 * frameworks/av/media/libnblog/ReportPerformance.cpp
7042 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7043 */
7044message MediametricsAudiothreadReported {
7045 optional int64 timestamp_nanos = 1;
7046 optional string package_name = 2;
7047 optional int64 package_version_code = 3;
7048 optional int64 media_apex_version = 4;
7049
7050 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7051}
7052
7053/**
7054 * Track how we arbitrate between microphone/input requests.
7055 * Logged from
7056 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7057 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7058 */
7059message MediametricsAudiotrackReported {
7060 optional int64 timestamp_nanos = 1;
7061 optional string package_name = 2;
7062 optional int64 package_version_code = 3;
7063 optional int64 media_apex_version = 4;
7064
7065 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7066}
7067
7068/**
7069 * Track information about DRM framework performance
7070 * Logged from
7071 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7072 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7073 */
7074message MediametricsMediadrmReported {
7075 optional int64 timestamp_nanos = 1;
7076 optional string package_name = 2;
7077 optional int64 package_version_code = 3;
7078 optional int64 media_apex_version = 4;
7079
7080 // vendor+description tell about which DRM plugin is in use on this device
7081 optional string vendor = 5;
7082 optional string description = 6;
7083 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7084 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7085}
7086
7087/**
7088 * Track information about the widevine DRM plugin performance
7089 * Logged from
7090 * vendor/widevine/libwvdrmengine/cdm/metrics
7091 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7092 */
7093message MediametricsDrmWidevineReported {
7094 optional int64 timestamp_nanos = 1;
7095 optional string package_name = 2;
7096 optional int64 package_version_code = 3;
7097 optional int64 media_apex_version = 4;
7098
7099 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7100}
7101
7102/**
7103 * Track information about recordings (e.g. camcorder)
7104 * Logged from
7105 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7106 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7107 */
7108message MediametricsRecorderReported {
7109 optional int64 timestamp_nanos = 1;
7110 optional string package_name = 2;
7111 optional int64 package_version_code = 3;
7112 optional int64 media_apex_version = 4;
7113
7114 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7115}
7116
7117/**
7118 * Track Media Player usage
7119 * Logged from:
7120 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7121 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7122 */
7123message MediametricsNuPlayerReported {
7124 optional int64 timestamp_nanos = 1;
7125 optional string package_name = 2;
7126 optional int64 package_version_code = 3;
7127 optional int64 media_apex_version = 4;
7128
7129 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7130}
7131
7132/**
Robert Shiha4beed32019-08-19 14:15:23 -07007133 * Track Legacy DRM usage
7134 * Logged from
7135 * frameworks/av/drm/drmserver/DrmManager.cpp
7136 */
7137message MediametricsDrmManagerReported {
7138 optional int64 timestamp_nanos = 1;
7139 optional string package_name = 2;
7140 optional int64 package_version_code = 3;
7141 optional int64 media_apex_version = 4;
7142
7143 enum Method {
7144 METHOD_NOT_FOUND = -1;
7145 GET_CONSTRAINTS = 0;
7146 GET_METADATA = 1;
7147 CAN_HANDLE = 2;
7148 PROCESS_DRM_INFO = 3;
7149 ACQUIRE_DRM_INFO = 4;
7150 SAVE_RIGHTS = 5;
7151 GET_ORIGINAL_MIME_TYPE = 6;
7152 GET_DRM_OBJECT_TYPE = 7;
7153 CHECK_RIGHTS_STATUS = 8;
7154 REMOVE_RIGHTS = 9;
7155 REMOVE_ALL_RIGHTS = 10;
7156 OPEN_CONVERT_SESSION = 11;
7157 OPEN_DECRYPT_SESSION = 12;
7158 }
7159
7160 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7161 optional string plugin_id = 5;
7162 optional string description = 6;
7163 optional Method method = 7;
7164 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007165
7166 optional int64 get_constraints_count = 9;
7167 optional int64 get_metadata_count = 10;
7168 optional int64 can_handle_count = 11;
7169 optional int64 process_drm_info_count = 12;
7170 optional int64 acquire_drm_info_count = 13;
7171 optional int64 save_rights_count = 14;
7172 optional int64 get_original_mime_type_count = 15;
7173 optional int64 get_drm_object_type_count = 16;
7174 optional int64 check_rights_status_count = 17;
7175 optional int64 remove_rights_count = 18;
7176 optional int64 remove_all_rights_count = 19;
7177 optional int64 open_convert_session_count = 20;
7178 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007179}
7180
7181/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007182 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007183 * Pulled from: StatsCompanionService
7184*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007185message DangerousPermissionState {
7186 // Name of the permission
7187 optional string permission_name = 1;
7188
7189 // Uid of the package
7190 optional int32 uid = 2 [(is_uid) = true];
7191
7192 // Package requesting the permission
7193 optional string package_name = 3;
7194
7195 // If the permission is granted to the uid
7196 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007197
7198 // Permission flags as per android.content.pm.PermissionFlags
7199 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007200}
7201
Michael Groover4a0ca942019-01-24 17:41:25 -08007202/**
7203 * Logs when a package is denied access to a device identifier based on the new access requirements.
7204 *
7205 * Logged from:
7206 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7207 */
7208message DeviceIdentifierAccessDenied {
7209 // The name of the package denied access to the requested device identifier.
7210 optional string package_name = 1;
7211
7212 // The name of the device identifier method the package attempted to invoke.
7213 optional string method_name = 2;
7214
7215 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007216 // Starting from Android 11, this boolean is not set and will always be false.
7217 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007218
7219 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007220 // Starting from Android 11, this boolean is not set and will always be false.
7221 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007222}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007223
7224/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007225 * Pulls the ongoing mainline install train version code.
7226 * Pulled from StatsCompanionService
7227 */
7228message TrainInfo {
7229 optional int64 train_version_code = 1;
7230
7231 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007232
7233 optional string train_name = 3;
7234
7235 enum Status {
7236 UNKNOWN = 0;
7237 INSTALL_REQUESTED = 1;
7238 INSTALL_STARTED = 2;
7239 INSTALL_STAGED_NOT_READY = 3;
7240 INSTALL_STAGED_READY = 4;
7241 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007242 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7243 // and INSTALL_FAILURE_COMMIT.
7244 INSTALL_FAILURE = 6 [deprecated = true];
7245 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007246 INSTALL_CANCELLED = 7;
7247 INSTALLER_ROLLBACK_REQUESTED = 8;
7248 INSTALLER_ROLLBACK_INITIATED = 9;
7249 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7250 INSTALLER_ROLLBACK_STAGED = 11;
7251 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7252 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7253 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7254 INSTALLER_ROLLBACK_SUCCESS = 15;
7255 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007256 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7257 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7258 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7259 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7260 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7261 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007262 INSTALL_FAILURE_DOWNLOAD = 23;
7263 INSTALL_FAILURE_STATE_MISMATCH = 24;
7264 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007265 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007266 }
7267 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007268}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007269
7270/**
7271 * Logs the gesture stage changed event.
7272 *
7273 * Logged from:
7274 * frameworks/base/packages/SystemUI/
7275 */
7276message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007277 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007278}
7279
7280/**
7281 * Logs the feedback type.
7282 *
7283 * Logged from:
7284 * frameworks/base/packages/SystemUI/
7285 */
7286message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007287 // Whether or not the gesture was used.
7288 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007289}
7290
7291/**
7292 * Logs the progress.
7293 *
7294 * Logged from:
7295 * frameworks/base/packages/SystemUI/
7296 */
7297message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007298 // [0,100] progress for the assist gesture.
7299 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007300}
Neil Fullerdb14b482019-02-05 19:44:44 +00007301
7302/*
7303 * Information about the time zone data on a device.
7304 */
7305message TimeZoneDataInfo {
7306 // A version identifier for the data set on device. e.g. "2018i"
7307 optional string tzdb_version = 1;
7308}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007309
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007310/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007311 * Logs the GPU stats global health information.
7312 *
7313 * Logged from:
7314 * frameworks/native/services/gpuservice/gpustats/
7315 */
7316message GpuStatsGlobalInfo {
7317 // Package name of the gpu driver.
7318 optional string driver_package_name = 1;
7319
7320 // Version name of the gpu driver.
7321 optional string driver_version_name = 2;
7322
7323 // Version code of the gpu driver.
7324 optional int64 driver_version_code = 3;
7325
7326 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7327 optional int64 driver_build_time = 4;
7328
7329 // Total count of the gl driver gets loaded.
7330 optional int64 gl_loading_count = 5;
7331
7332 // Total count of the gl driver fails to be loaded.
7333 optional int64 gl_loading_failure_count = 6;
7334
7335 // Total count of the Vulkan driver gets loaded.
7336 optional int64 vk_loading_count = 7;
7337
7338 // Total count of the Vulkan driver fails to be loaded.
7339 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007340
7341 // Api version of the system Vulkan driver.
7342 optional int32 vulkan_version = 9;
7343
7344 // Api version of the system CPU Vulkan driver.
7345 optional int32 cpu_vulkan_version = 10;
7346
7347 // Api version of the system GLES driver.
7348 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007349
7350 // Total count of the angle driver gets loaded.
7351 optional int64 angle_loading_count = 12;
7352
7353 // Total count of the angle driver fails to be loaded.
7354 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007355}
7356
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007357/**
7358 * GPU driver loading time info.
7359 */
7360message GpuDriverLoadingTime {
7361 // List of all the driver loading times for this app. The list size is
7362 // capped at 50.
7363 repeated int64 driver_loading_time = 1;
7364}
7365
7366/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007367 * Logs the GPU stats per app health information.
7368 *
7369 * Logged from:
7370 * frameworks/native/services/gpuservice/gpustats/
7371 */
7372message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007373 // Package name of the application that loads the gpu driver. Total number
7374 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007375 optional string app_package_name = 1;
7376
7377 // Version code of the gpu driver this app loads.
7378 optional int64 driver_version_code = 2;
7379
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007380 // gl driver loading time info.
7381 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7382 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007383
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007384 // Vulkan driver loading time info.
7385 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7386 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007387
7388 // Angle driver loading time info.
7389 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7390 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007391
7392 // CPU Vulkan implementation is in use.
7393 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007394
7395 // App is not doing pre-rotation correctly.
7396 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007397
7398 // App creates GLESv1 context.
7399 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007400}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007401
7402/*
7403 * Logs the size of the system ion heap.
7404 *
7405 * Pulled from StatsCompanionService.
7406 */
7407message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007408 // Deprecated due to limited support of ion stats in debugfs.
7409 // Use `IonHeapSize` instead.
7410 option deprecated = true;
7411
Rafal Slawikd4e87572019-03-12 13:08:38 +00007412 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007413 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007414 optional int64 size_in_bytes = 1;
7415}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007416
Rafal Slawik77987ed2019-06-17 12:28:23 +01007417/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007418 * Logs the total size of the ion heap.
7419 *
7420 * Pulled from StatsCompanionService.
7421 */
7422message IonHeapSize {
7423 // Total size of all ion heaps in kilobytes.
7424 // Read from: /sys/kernel/ion/total_heaps_kb.
7425 optional int32 total_size_kb = 1;
7426}
7427
7428/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007429 * Logs the per-process size of the system ion heap.
7430 *
7431 * Pulled from StatsCompanionService.
7432 */
7433message ProcessSystemIonHeapSize {
7434 // The uid if available. -1 means not available.
7435 optional int32 uid = 1 [(is_uid) = true];
7436
7437 // The process name (from /proc/PID/cmdline).
7438 optional string process_name = 2;
7439
7440 // Sum of sizes of all allocations.
7441 optional int32 total_size_in_kilobytes = 3;
7442
7443 // Number of allocations.
7444 optional int32 allocation_count = 4;
7445
7446 // Size of the largest allocation.
7447 optional int32 max_size_in_kilobytes = 5;
7448}
7449
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007450/**
7451 * Push network stack events.
7452 *
7453 * Log from:
7454 * frameworks/base/packages/NetworkStack/
7455 */
7456message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007457 // The id that indicates the event reported from NetworkStack.
7458 optional int32 event_id = 1;
7459 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007460 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7461}
Carmen Agimofa769c152019-03-04 14:39:14 +00007462
7463/**
7464 * Logs the apps that are installed on the external storage.
7465 * Pulled from:
7466 * StatsCompanionService
7467 */
7468message AppsOnExternalStorageInfo {
7469 // The type of the external storage.
7470 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7471 // The name of the package that is installed on the external storage.
7472 optional string package_name = 2;
7473}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007474
7475/**
7476 * Logs the settings related to Face.
7477 * Logged from:
7478 * frameworks/base/services/core/java/com/android/server/stats
7479 */
7480message FaceSettings {
7481 // Whether or not face unlock is allowed on Keyguard.
7482 optional bool unlock_keyguard_enabled = 1;
7483 // Whether or not face unlock dismisses the Keyguard.
7484 optional bool unlock_dismisses_keyguard = 2;
7485 // Whether or not face unlock requires attention.
7486 optional bool unlock_attention_required = 3;
7487 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7488 optional bool unlock_app_enabled = 4;
7489 // Whether or not face unlock always requires user confirmation.
7490 optional bool unlock_always_require_confirmation = 5;
7491 // Whether or not a diverse set of poses are required during enrollment.
7492 optional bool unlock_diversity_required = 6;
7493}
Maggie White442b6312019-04-05 16:26:44 -07007494
7495/**
7496 * Logs cooling devices maintained by the kernel.
7497 *
7498 * Pulled from StatsCompanionService.java
7499 */
7500message CoolingDevice {
7501 // The type of cooling device being reported. Eg. CPU, GPU...
7502 optional android.os.CoolingTypeEnum device_location = 1;
7503 // The name of the cooling device source. Eg. CPU0
7504 optional string device_name = 2;
7505 // Current throttle state of the cooling device. The value can any unsigned
7506 // integer between 0 and max_state defined in its driver. 0 means device is
7507 // not in throttling, higher value means deeper throttling.
7508 optional int32 state = 3;
7509}
Ben Blount763a5d52019-04-10 11:48:58 -07007510
7511/**
7512 * Intelligence has several counter-type events that don't warrant a
7513 * full separate atom. These are primarily API call counters but also include
7514 * counters for feature usage and specific failure modes.
7515 *
7516 * Logged from the Intelligence mainline module.
7517 */
7518message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007519 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007520 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007521 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007522 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007523 // How many times the event occured (to report a batch of high frequency events).
7524 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007525 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007526 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007527}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007528
7529/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007530 * Logs when Car Power state changed.
7531 *
7532 * Logged from:
7533 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7534 */
7535message CarPowerStateChanged {
7536 // States come from CpmsState in CarPowerManagementService.java.
7537 enum State {
7538 WAIT_FOR_VHAL = 0;
7539 ON = 1;
7540 SHUTDOWN_PREPARE = 2;
7541 WAIT_FOR_FINISH = 3;
7542 SUSPEND = 4;
7543 SIMULATE_SLEEP = 5;
7544 }
7545 optional State state = 1;
7546}
7547
7548/**
7549 * Logs whether GarageMode is entered.
7550 *
7551 * Logged from:
7552 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7553 */
7554message GarageModeInfo {
7555 // Whether GarageMode is entered.
7556 optional bool is_garage_mode = 1;
7557}
Martijn Coenencd95d462019-04-25 17:09:45 +02007558
7559/**
7560 * Historical app ops data per package.
7561 */
7562message AppOps {
7563 // Uid of the package requesting the op
7564 optional int32 uid = 1 [(is_uid) = true];
7565
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007566 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007567 optional string package_name = 2;
7568
7569 // operation id; maps to the OP_* constants in AppOpsManager.java
7570 optional int32 op_id = 3;
7571
7572 // The number of times the op was granted while the app was in the
7573 // foreground (only for trusted requests)
7574 optional int64 trusted_foreground_granted_count = 4;
7575
7576 // The number of times the op was granted while the app was in the
7577 // background (only for trusted requests)
7578 optional int64 trusted_background_granted_count = 5;
7579
7580 // The number of times the op was rejected while the app was in the
7581 // foreground (only for trusted requests)
7582 optional int64 trusted_foreground_rejected_count = 6;
7583
7584 // The number of times the op was rejected while the app was in the
7585 // background (only for trusted requests)
7586 optional int64 trusted_background_rejected_count = 7;
7587
7588 // For long-running operations, total duration of the operation
7589 // while the app was in the foreground (only for trusted requests)
7590 optional int64 trusted_foreground_duration_millis = 8;
7591
7592 // For long-running operations, total duration of the operation
7593 // while the app was in the background (only for trusted requests)
7594 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007595
7596 // Whether AppOps is guarded by Runtime permission
7597 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007598}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007599
7600/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007601 * Historical app ops data per package and features.
7602 */
7603message AppFeaturesOps {
7604 // Uid of the package requesting the op
7605 optional int32 uid = 1 [(is_uid) = true];
7606
7607 // Name of the package performing the op
7608 optional string package_name = 2;
7609
7610 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7611 // Features must be provided through manifest using <feature> tag available in R and above.
7612 optional string feature_id = 3;
7613
7614 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7615 optional string op = 4;
7616
7617 // The number of times the op was granted while the app was in the
7618 // foreground (only for trusted requests)
7619 optional int64 trusted_foreground_granted_count = 5;
7620
7621 // The number of times the op was granted while the app was in the
7622 // background (only for trusted requests)
7623 optional int64 trusted_background_granted_count = 6;
7624
7625 // The number of times the op was rejected while the app was in the
7626 // foreground (only for trusted requests)
7627 optional int64 trusted_foreground_rejected_count = 7;
7628
7629 // The number of times the op was rejected while the app was in the
7630 // background (only for trusted requests)
7631 optional int64 trusted_background_rejected_count = 8;
7632
7633 // For long-running operations, total duration of the operation
7634 // while the app was in the foreground (only for trusted requests)
7635 optional int64 trusted_foreground_duration_millis = 9;
7636
7637 // For long-running operations, total duration of the operation
7638 // while the app was in the background (only for trusted requests)
7639 optional int64 trusted_background_duration_millis = 10;
7640
7641 // Whether AppOps is guarded by Runtime permission
7642 optional bool is_runtime_permission = 11;
7643}
7644
7645/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007646 * Location Manager API Usage information(e.g. API under usage,
7647 * API call's parameters).
7648 * Logged from:
7649 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7650 */
7651message LocationManagerApiUsageReported {
7652
7653 // Indicating if usage starts or usage ends.
7654 optional android.stats.location.UsageState state = 1;
7655
7656 // LocationManagerService's API in use.
7657 // We can identify which API from LocationManager is
7658 // invoking current LMS API by the combination of
7659 // API parameter(e.g. is_listener_null, is_intent_null,
7660 // is_location_request_null)
7661 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7662
7663 // Name of the package calling the API.
7664 optional string calling_package_name = 3;
7665
7666 // Type of the location provider.
7667 optional android.stats.location.ProviderType provider = 4;
7668
7669 // Quality of the location request
7670 optional android.stats.location.LocationRequestQuality quality = 5;
7671
7672 // The desired interval for active location updates, in milliseconds.
7673 // Bucketized to reduce cardinality.
7674 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7675
7676 // Minimum distance between location updates, in meters.
7677 // Bucketized to reduce cardinality.
7678 optional android.stats.location.SmallestDisplacementBucket
7679 bucketized_smallest_displacement = 7;
7680
7681 // The number of location updates.
7682 optional int64 num_updates = 8;
7683
7684 // The request expiration time, in millisecond since boot.
7685 // Bucketized to reduce cardinality.
7686 optional android.stats.location.ExpirationBucket
7687 bucketized_expire_in = 9;
7688
7689 // Type of Callback passed in for this API.
7690 optional android.stats.location.CallbackType callback_type = 10;
7691
7692 // The radius of the central point of the alert
7693 // region, in meters. Only for API REQUEST_GEOFENCE.
7694 // Bucketized to reduce cardinality.
7695 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7696
7697 // Activity Importance of API caller.
7698 // Categorized to 3 types that are interesting from location's perspective.
7699 optional android.stats.location.ActivityImportance activiy_importance = 12;
7700}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007701
7702/**
7703 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7704 */
7705message ReviewPermissionsFragmentResultReported {
7706 // unique value identifying a permission group change. A permission group change might result
7707 // in multiple of these atoms
7708 optional int64 change_id = 1;
7709
7710 // UID of package the permission belongs to
7711 optional int32 uid = 2 [(is_uid) = true];
7712
7713 // Name of package the permission belongs to
7714 optional string package_name = 3;
7715
7716 // The permission to be granted
7717 optional string permission_name = 4;
7718
7719 // The result of the permission grant
7720 optional bool permission_granted = 5;
7721}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007722
7723/**
7724* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7725* Logged from: RuntimePermissionUpdgradeController
7726*/
7727message RuntimePermissionsUpgradeResult {
7728 // Permission granted as result of upgrade
7729 optional string permission_name = 1;
7730
7731 // UID of package granted permission
7732 optional int32 uid = 2 [(is_uid) = true];
7733
7734 // Name of package granted permission
7735 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007736}
7737
7738/**
7739* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7740*/
7741message GrantPermissionsActivityButtonActions {
7742 // Permission granted as result of upgrade
7743 optional string permission_group_name = 1;
7744
7745 // UID of package granted permission
7746 optional int32 uid = 2 [(is_uid) = true];
7747
7748 // Name of package requesting permission
7749 optional string package_name = 3;
7750
7751 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7752 // LABEL_ constants in GrantPermissionActivity.java
7753 optional int32 buttons_presented = 4;
7754
7755 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7756 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007757
7758 // id which identifies single session of user interacting with permission controller
7759 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007760}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007761
7762/**
7763 * Information about LocationAccessCheck notification presented to user
7764 */
7765message LocationAccessCheckNotificationAction {
7766
7767 // id which identifies single session of user interacting with permission controller
7768 optional int64 session_id = 1;
7769
7770 // Uid of package for which location access check is presented
7771 optional int32 package_uid = 2;
7772
7773 // Name of package for which location access check is presented
7774 optional string package_name = 3;
7775
7776 enum Result {
7777 UNDEFINED = 0;
7778 // notification was presented to the user
7779 NOTIFICATION_PRESENTED = 1;
7780 // notification was declined by the user
7781 NOTIFICATION_DECLINED = 2;
7782 // notification was clicked by the user
7783 NOTIFICATION_CLICKED = 3;
7784 }
7785
7786 // View / interaction recorded
7787 optional Result result = 4;
7788}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007789
7790/**
7791 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7792 */
7793message AppPermissionFragmentActionReported {
7794 // id which identifies single session of user interacting with permission controller
7795 optional int64 session_id = 1;
7796
7797 // unique value identifying a permission group change. A permission group change might result
7798 // in multiple of these atoms
7799 optional int64 change_id = 2;
7800
7801 // UID of package the permission belongs to
7802 optional int32 uid = 3 [(is_uid) = true];
7803
7804 // Name of package the permission belongs to
7805 optional string package_name = 4;
7806
7807 // The permission to be granted
7808 optional string permission_name = 5;
7809
7810 // The result of the permission grant
7811 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007812
7813 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7814 optional int32 permission_flags = 7;
7815
7816 enum Button {
7817 UNDEFINED = 0;
7818 // Allow button
7819 ALLOW = 1;
7820 // Deny button
7821 DENY = 2;
7822 // Ask every time button
7823 ASK_EVERY_TIME = 3;
7824 // Allow all the time button
7825 ALLOW_ALWAYS = 4;
7826 // Allow only while using the app button
7827 ALLOW_FOREGROUND = 5;
7828 // Same is Deny button but shown in while in use dialog
7829 DENY_FOREGROUND = 6;
7830 }
7831
7832 // Button pressed in the dialog
7833 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007834}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007835
7836/**
7837* Information about a AppPermissionFragment viewed by user
7838*/
7839message AppPermissionFragmentViewed {
7840 // id which identifies single session of user interacting with permission controller
7841 optional int64 session_id = 1;
7842
7843 // UID of package for which permissions are viewed
7844 optional int32 uid = 2 [(is_uid) = true];
7845
7846 // Name of package for which permissions are viewed
7847 optional string package_name = 3;
7848
7849 // Permission group viewed
7850 optional string permission_group_name = 4;
7851}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007852
7853/**
7854* Information about a AppPermissionsFragment viewed by user
7855*/
7856message AppPermissionsFragmentViewed {
7857 // id which identifies single session of user interacting with permission controller
7858 optional int64 session_id = 1;
7859
7860 // id which identifies single view as every view might have several logging records
7861 // with different package information attached
7862 optional int64 view_id = 2;
7863
7864 // Permission group viewed
7865 optional string permission_group_name = 3;
7866
7867 // UID of package for which permissions are viewed
7868 optional int32 uid = 4 [(is_uid) = true];
7869
7870 // Name of package for which permissions are viewed
7871 optional string package_name = 5;
7872
7873 // Category in which permission is included
7874 enum Category {
7875 UNDEFINED = 0;
7876 ALLOWED = 1;
7877 ALLOWED_FOREGROUND = 2;
7878 DENIED = 3;
7879 }
7880 optional Category category = 6;
7881}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007882
7883/**
7884* Information about a PermissionAppsFragment viewed by user.
7885* Logged from ui/handheld/PermissionAppsFragment.java
7886*/
7887message PermissionAppsFragmentViewed {
7888 // id which identifies single session of user interacting with permission controller
7889 optional int64 session_id = 1;
7890
7891 // id which identifies single view as every view might have several logging records
7892 // with different package information attached
7893 optional int64 view_id = 2;
7894
7895 // Permission group viewed
7896 optional string permission_group_name = 3;
7897
7898 // UID of package for which permissions are viewed
7899 optional int32 uid = 4 [(is_uid) = true];
7900
7901 // Name of package for which permissions are viewed
7902 optional string package_name = 5;
7903
7904 // Category in which app is included
7905 enum Category {
7906 UNDEFINED = 0;
7907 ALLOWED = 1;
7908 ALLOWED_FOREGROUND = 2;
7909 DENIED = 3;
7910 }
7911 optional Category category = 6;
7912}
Tony Make2b1b672019-07-29 16:59:47 +01007913
7914/**
7915 * Logs when there is a smart selection related event.
7916 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7917 * Logged from: TextClassifierEventLogger.java
7918 */
7919message TextSelectionEvent {
7920 // A session ID.
7921 optional string session_id = 1;
7922
7923 // Event type of this event.
7924 optional android.stats.textclassifier.EventType event_type = 2;
7925
Tony Mak9c84bd22019-12-09 07:27:25 +00007926 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007927 optional string model_name = 3;
7928
7929 // Type of widget that was involved in triggering this event.
7930 optional android.stats.textclassifier.WidgetType widget_type = 4;
7931
7932 // Index of this event in a session.
7933 optional int32 event_index = 5;
7934
7935 // Entity type that is involved.
7936 optional string entity_type = 6;
7937
7938 // Relative word index of the start of the selection.
7939 optional int32 relative_word_start_index = 7;
7940
7941 // Relative word (exclusive) index of the end of the selection.
7942 optional int32 relative_word_end_index = 8;
7943
7944 // Relative word index of the start of the smart selection.
7945 optional int32 relative_suggested_word_start_index = 9;
7946
7947 // Relative word (exclusive) index of the end of the smart selection.
7948 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007949
7950 // Name of source package.
7951 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007952}
7953
7954/**
7955 * Logs when there is a smart linkify related event.
7956 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7957 * Logged from: TextClassifierEventLogger.java
7958 */
7959message TextLinkifyEvent {
7960 // A session ID.
7961 optional string session_id = 1;
7962
7963 // Event type of this event.
7964 optional android.stats.textclassifier.EventType event_type = 2;
7965
Tony Mak9c84bd22019-12-09 07:27:25 +00007966 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007967 optional string model_name = 3;
7968
7969 // Type of widget that was involved in triggering this event.
7970 optional android.stats.textclassifier.WidgetType widget_type = 4;
7971
7972 // Index of this event in a session.
7973 optional int32 event_index = 5;
7974
7975 // Entity type that is involved.
7976 optional string entity_type = 6;
7977
7978 // Number of links detected.
7979 optional int32 num_links = 7;
7980
7981 // The total length of all links.
7982 optional int32 linked_text_length = 8;
7983
7984 // Length of input text.
7985 optional int32 text_length = 9;
7986
7987 // Time spent on generating links in ms.
7988 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007989
7990 // Name of source package.
7991 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007992}
7993
7994/**
7995 * Logs when there is a conversation actions related event.
7996 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7997 * Logged from: TextClassifierEventLogger.java
7998 */
7999message ConversationActionsEvent {
8000 // A session ID.
8001 optional string session_id = 1;
8002
8003 // Event type of this event.
8004 optional android.stats.textclassifier.EventType event_type = 2;
8005
Tony Mak9c84bd22019-12-09 07:27:25 +00008006 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008007 optional string model_name = 3;
8008
8009 // Type of widget that was involved in triggering this event.
8010 optional android.stats.textclassifier.WidgetType widget_type = 4;
8011
8012 // The first entity type that is involved.
8013 optional string first_entity_type = 5;
8014
8015 // The second entity type that is involved.
8016 optional string second_entity_type = 6;
8017
8018 // The third entity type that is involved.
8019 optional string third_entity_type = 7;
8020
8021 // The score of the first entity type.
8022 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008023
8024 // Name of source package.
8025 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008026
8027 // Name of the annotator model that is involved in this event.
8028 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008029}
8030
8031/**
8032 * Logs when there is a language detection related event.
8033 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8034 * Logged from: TextClassifierEventLogger.java
8035 */
8036message LanguageDetectionEvent {
8037 // A session ID.
8038 optional string session_id = 1;
8039
8040 // Event type of this event.
8041 optional android.stats.textclassifier.EventType event_type = 2;
8042
Tony Mak9c84bd22019-12-09 07:27:25 +00008043 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008044 optional string model_name = 3;
8045
8046 // Type of widget that was involved in triggering this event.
8047 optional android.stats.textclassifier.WidgetType widget_type = 4;
8048
8049 // Detected language.
8050 optional string language_tag = 5;
8051
8052 // Score of the detected language.
8053 optional float score = 6;
8054
8055 // Position of this action.
8056 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008057
8058 // Name of source package.
8059 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008060}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008061
8062/**
8063 * Information about an OTA update attempt by update_engine.
8064 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8065 */
8066message UpdateEngineUpdateAttemptReported {
8067 // The number of attempts for the update engine to apply a given payload.
8068 optional int32 attempt_number = 1;
8069
8070 optional android.stats.otaupdate.PayloadType payload_type = 2;
8071
8072 // The total time in minutes for the update engine to apply a given payload.
8073 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8074 // it's increased when the system is sleeping.
8075 optional int32 duration_boottime_in_minutes = 3;
8076
8077 // The total time in minutes for the update engine to apply a given payload.
8078 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8079 // and it's not increased when the system is sleeping.
8080 optional int32 duration_monotonic_in_minutes = 4;
8081
8082 // The size of the payload in MiBs.
8083 optional int32 payload_size_mib = 5;
8084
8085 // The attempt result reported by the update engine for an OTA update.
8086 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8087
8088 // The error code reported by the update engine after an OTA update attempt
8089 // on A/B devices.
8090 optional android.stats.otaupdate.ErrorCode error_code = 7;
8091
8092 // The build fingerprint of the source system. The value is read from a
8093 // system property when the device takes the update. e.g.
8094 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8095 optional string source_fingerprint = 8;
8096}
8097
8098/**
8099 * Information about all the attempts the device make before finishing the
8100 * successful update.
8101 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8102 */
8103message UpdateEngineSuccessfulUpdateReported {
8104 // The number of attempts for the update engine to apply the payload for a
8105 // successful update.
8106 optional int32 attempt_count = 1;
8107
8108 optional android.stats.otaupdate.PayloadType payload_type = 2;
8109
8110 optional int32 payload_size_mib = 3;
8111
8112 // The total number of bytes downloaded by update_engine since the last
8113 // successful update.
8114 optional int32 total_bytes_downloaded_mib = 4;
8115
8116 // The ratio in percentage of the over-downloaded bytes compared to the
8117 // total bytes needed to successfully install the update. e.g. 200 if we
8118 // download 200MiB in total for a 100MiB package.
8119 optional int32 download_overhead_percentage = 5;
8120
8121 // The total time in minutes for the update engine to apply the payload for a
8122 // successful update.
8123 optional int32 total_duration_minutes = 6;
8124
8125 // The number of reboot of the device during a successful update.
8126 optional int32 reboot_count = 7;
8127}
Alec Mourie088e762019-07-02 13:10:55 -07008128
8129/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008130 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8131 * key to indicate whether it was successful or not.
8132 *
8133 * Logged from:
8134 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8135 */
8136message RebootEscrowRecoveryReported {
8137 optional bool successful = 1;
8138}
8139
8140/**
Alec Mourie088e762019-07-02 13:10:55 -07008141 * Global display pipeline metrics reported by SurfaceFlinger.
8142 * Pulled from:
8143 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8144 */
8145message SurfaceflingerStatsGlobalInfo {
8146 // Total number of frames presented during the tracing period
8147 optional int64 total_frames = 1;
8148 // Total number of frames missed
8149 optional int64 missed_frames = 2;
8150 // Total number of frames that fell back to client composition
8151 optional int64 client_composition_frames = 3;
8152 // Total time the display was turned on
8153 optional int64 display_on_millis = 4;
8154 // Total time that was spent performing animations.
8155 // This is derived from the present-to-present layer histogram
8156 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008157 // Total number of event connections tracked by SurfaceFlinger at the time
8158 // of this pull. If this number grows prohibitively large, then this can
8159 // cause jank due to resource contention.
8160 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008161 // Set of timings measured from when SurfaceFlinger began compositing a
8162 // frame, until the frame was requested to be presented to the display. This
8163 // measures SurfaceFlinger's total CPU walltime on the critical path per
8164 // frame.
8165 optional FrameTimingHistogram frame_duration = 7
8166 [(android.os.statsd.log_mode) = MODE_BYTES];
8167 // Set of timings measured from when SurfaceFlinger first began using the
8168 // GPU to composite a frame, until the GPU has finished compositing that
8169 // frame. This measures the total additional time SurfaceFlinger needed to
8170 // perform due to falling back into GPU composition.
8171 optional FrameTimingHistogram render_engine_timing = 8
8172 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008173}
8174
8175/**
8176 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8177 * The number of layers uploaded will be restricted due to size limitations.
8178 * Pulled from:
8179 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8180 */
8181message SurfaceflingerStatsLayerInfo {
8182 // The layer for this set of metrics
8183 // For now we can infer that the package name is included in the layer
8184 // name.
8185 optional string layer_name = 1;
8186 // Total number of frames presented
8187 optional int64 total_frames = 2;
8188 // Total number of dropped frames while latching a buffer for this layer.
8189 optional int64 dropped_frames = 3;
8190 // Set of timings measured between successive presentation timestamps.
8191 optional FrameTimingHistogram present_to_present = 4
8192 [(android.os.statsd.log_mode) = MODE_BYTES];
8193 // Set of timings measured from when an app queued a buffer for
8194 // presentation, until the buffer was actually presented to the
8195 // display.
8196 optional FrameTimingHistogram post_to_present = 5
8197 [(android.os.statsd.log_mode) = MODE_BYTES];
8198 // Set of timings measured from when a buffer is ready to be presented,
8199 // until the buffer was actually presented to the display.
8200 optional FrameTimingHistogram acquire_to_present = 6
8201 [(android.os.statsd.log_mode) = MODE_BYTES];
8202 // Set of timings measured from when a buffer was latched by
8203 // SurfaceFlinger, until the buffer was presented to the display
8204 optional FrameTimingHistogram latch_to_present = 7
8205 [(android.os.statsd.log_mode) = MODE_BYTES];
8206 // Set of timings measured from the desired presentation to the actual
8207 // presentation time
8208 optional FrameTimingHistogram desired_to_present = 8
8209 [(android.os.statsd.log_mode) = MODE_BYTES];
8210 // Set of timings measured from when an app queued a buffer for
8211 // presentation, until the buffer was ready to be presented.
8212 optional FrameTimingHistogram post_to_acquire = 9
8213 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008214 // Frames missed latch because the acquire fence didn't fire
8215 optional int64 late_acquire_frames = 10;
8216 // Frames latched early because the desired present time was bad
8217 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008218}
8219
8220/**
8221 * Histogram of frame counts bucketed by time in milliseconds.
8222 * Because of size limitations, we hard-cap the number of buckets, with
8223 * buckets for corresponding to larger milliseconds being less precise.
8224 */
8225message FrameTimingHistogram {
8226 // Timings in milliseconds that describes a set of histogram buckets
8227 repeated int32 time_millis_buckets = 1;
8228 // Number of frames that match to each time_millis, i.e. the bucket
8229 // contents
8230 // It's required that len(time_millis) == len(frame_count)
8231 repeated int64 frame_counts = 2;
8232}
Emilian Peev6729f372019-08-29 09:14:09 -07008233
Emilian Peev6729f372019-08-29 09:14:09 -07008234/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008235 * Janky event as reported by SurfaceFlinger.
8236 * This event is intended to be consumed by a Perfetto subscriber for
8237 * automated trace collection.
8238 *
8239 * Logged from:
8240 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8241 */
8242message DisplayJankReported {
8243 // Informational field for how long the janky event lasted in milliseconds
8244 optional int64 event_duration_millis = 1;
8245 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8246 // the display on time.
8247 optional int32 present_deadlines_missed = 2;
8248}
8249
8250/**
Emilian Peev6729f372019-08-29 09:14:09 -07008251 * Information about camera facing and API level usage.
8252 * Logged from:
8253 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8254 */
8255message CameraActionEvent {
8256 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008257 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008258
8259 // Camera API level used
8260 optional int32 api_level = 2;
8261
8262 // Name of client package
8263 optional string package_name = 3;
8264
8265 // Camera facing
8266 enum Facing {
8267 UNKNOWN = 0;
8268 BACK = 1;
8269 FRONT = 2;
8270 EXTERNAL = 3;
8271 }
8272 optional Facing facing = 4;
8273}
atrost01a20932019-08-28 15:40:37 +01008274
8275/**
8276 * Logs when a compatibility change is affecting an app.
8277 *
8278 * Logged from:
8279 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8280 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8281 */
8282message AppCompatibilityChangeReported {
8283 // The UID of the app being affected by the compatibilty change.
8284 optional int32 uid = 1 [(is_uid) = true];
8285
8286 // The ID of the change affecting the app.
8287 optional int64 change_id = 2;
8288
8289 enum State {
8290 UNKNOWN_STATE = 0;
8291 ENABLED = 1;
8292 DISABLED = 2;
8293 LOGGED = 3;
8294 }
8295
8296 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8297 // logged otherwise.
8298 optional State state = 3;
8299
8300 enum Source {
8301 UNKNOWN_SOURCE = 0;
8302 APP_PROCESS = 1;
8303 SYSTEM_SERVER = 2;
8304 }
8305
8306 // Where it was logged from.
8307 optional Source source = 4;
8308
8309}
Hector Dearman40579f62019-11-01 13:19:30 +00008310
8311/**
8312 * Logged from
8313 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8314 */
8315message PerfettoUploaded {
8316 enum Event {
8317 PERFETTO_UNDEFINED = 0;
8318 PERFETTO_TRACE_BEGIN = 1;
8319 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8320 PERFETTO_ON_CONNECT = 3;
8321 PERFETTO_ON_TRACING_DISABLED = 4;
8322 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8323 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8324 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8325 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8326 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8327 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8328 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8329 PERFETTO_TRIGGER_BEGIN = 12;
8330 PERFETTO_TRIGGER_SUCCESS = 13;
8331 PERFETTO_TRIGGER_FAILURE = 14;
8332 PERFETTO_HIT_GUARDRAILS = 15;
8333 PERFETTO_ON_TIMEOUT = 16;
8334 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8335 }
8336
8337 // Which stage of the pipeline we are reporting from.
8338 optional Event event = 1;
8339
8340 // UUID matching the one set inside the SystemInfo trace packet.
8341 optional int64 trace_uuid_lsb = 2;
8342 optional int64 trace_uuid_msb = 3;
8343}
Mark Tabrya824a642019-11-05 12:26:12 -08008344
8345/**
8346 * Pulls client metrics on data transferred via Vehicle Maps Service.
8347 * Metrics are keyed by uid + layer.
8348 *
8349 * Pulled from:
8350 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8351 */
8352message VmsClientStats {
8353 // UID of the VMS client app
8354 optional int32 uid = 1 [(is_uid) = true];
8355
8356 // VMS layer definition
8357 optional int32 layer_type = 2;
8358 optional int32 layer_channel = 3;
8359 optional int32 layer_version = 4;
8360
8361 // Bytes and packets sent by the client for the layer
8362 optional int64 tx_bytes = 5;
8363 optional int64 tx_packets = 6;
8364
8365 // Bytes and packets received by the client for the layer
8366 optional int64 rx_bytes = 7;
8367 optional int64 rx_packets = 8;
8368
8369 // Bytes and packets dropped due to client error
8370 optional int64 dropped_bytes = 9;
8371 optional int64 dropped_packets = 10;
8372}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008373
8374/**
8375 * State of a dangerous permission requested by a package - sampled
8376 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8377*/
8378message DangerousPermissionStateSampled {
8379 // Name of the permission
8380 optional string permission_name = 1;
8381
8382 // Uid of the package
8383 optional int32 uid = 2 [(is_uid) = true];
8384
8385 // If the permission is granted to the uid
8386 optional bool is_granted = 3;
8387
8388 // Permission flags as per android.content.pm.PermissionFlags
8389 optional int32 permission_flags = 4;
8390}
8391
Stan Iliev637ba5e2019-08-16 13:43:08 -04008392/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008393 * HWUI stats for a given app.
8394 */
8395message GraphicsStats {
8396 // The package name of the app
8397 optional string package_name = 1;
8398
8399 // The version code of the app
8400 optional int64 version_code = 2;
8401
8402 // The start & end timestamps in UTC as
8403 // milliseconds since January 1, 1970
8404 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008405 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008406
Stan Ilievb6517192020-02-18 10:12:42 -05008407 optional int64 end_millis = 4;
8408
8409 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8410 enum PipelineType {
8411 UNKNOWN = 0;
8412 GL = 1;
8413 VULKAN = 2;
8414 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008415
8416 // HWUI renders pipeline type: GL or Vulkan.
8417 optional PipelineType pipeline = 5;
8418
8419 // Distinct frame count.
8420 optional int32 total_frames = 6;
8421
8422 // Number of "missed vsync" events.
8423 optional int32 missed_vsync_count = 7;
8424
8425 // Number of frames in triple-buffering scenario (high input latency)
8426 optional int32 high_input_latency_count = 8;
8427
8428 // Number of "slow UI thread" events.
8429 optional int32 slow_ui_thread_count = 9;
8430
8431 // Number of "slow bitmap upload" events.
8432 optional int32 slow_bitmap_upload_count = 10;
8433
8434 // Number of "slow draw" events.
8435 optional int32 slow_draw_count = 11;
8436
8437 // Number of frames that missed their deadline (aka, visibly janked)
8438 optional int32 missed_deadline_count = 12;
8439
8440 // The frame time histogram for the package
8441 optional FrameTimingHistogram cpu_histogram = 13
8442 [(android.os.statsd.log_mode) = MODE_BYTES];
8443
8444 // The gpu frame time histogram for the package
8445 optional FrameTimingHistogram gpu_histogram = 14
8446 [(android.os.statsd.log_mode) = MODE_BYTES];
8447
8448 // UI mainline module version.
8449 optional int64 version_ui_module = 15;
8450
8451 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8452 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8453 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8454 // more apps are running / rendering.
8455 optional bool is_today = 16;
8456}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008457
8458/**
8459 * Message related to dangerous (runtime) app ops access
8460 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008461message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008462 // Uid of the package accessing app op
8463 optional int32 uid = 1 [(is_uid) = true];
8464
8465 // Name of the package accessing app op
8466 optional string package_name = 2;
8467
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008468 // operation string id per OPSTR_ constants in AppOpsManager.java
8469 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008470
8471 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8472 // Features must be provided through manifest using <feature> tag available in R and above.
8473 optional string feature_id = 4;
8474
8475 // message related to app op access, limited to 600 chars by API
8476 optional string message = 5;
8477
8478 enum SamplingStrategy {
8479 DEFAULT = 0;
8480 UNIFORM = 1;
8481 RARELY_USED = 2;
8482 }
8483
8484 // sampling strategy used to collect this message
8485 optional SamplingStrategy sampling_strategy = 6;
8486}
8487
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008488/*
8489 * Logs userspace reboot outcome and duration.
8490 *
8491 * Logged from:
8492 * frameworks/base/core/java/com/android/server/BootReceiver.java
8493 */
8494message UserspaceRebootReported {
8495 // Possible outcomes of userspace reboot.
8496 enum Outcome {
8497 // Default value in case platform failed to determine the outcome.
8498 OUTCOME_UNKNOWN = 0;
8499 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8500 SUCCESS = 1;
8501 // Userspace reboot shutdown sequence was aborted.
8502 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8503 // Remounting userdata into checkpointing mode failed.
8504 FAILED_USERDATA_REMOUNT = 3;
8505 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8506 // reboot.
8507 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8508 }
8509 // Outcome of userspace reboot. Always set.
8510 optional Outcome outcome = 1;
8511 // Duration of userspace reboot in case it has a successful outcome.
8512 // Duration is measured as time between userspace reboot was initiated and until boot completed
8513 // (e.g. sys.boot_completed=1).
8514 optional int64 duration_millis = 2;
8515 // State of primary user's (user0) credential encryption storage.
8516 enum UserEncryptionState {
8517 // Default value.
8518 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8519 // Credential encrypted storage is unlocked.
8520 UNLOCKED = 1;
8521 // Credential encrypted storage is locked.
8522 LOCKED = 2;
8523 }
8524 // State of primary user's encryption storage at the moment boot completed. Always set.
8525 optional UserEncryptionState user_encryption_state = 3;
8526}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008527
8528/*
8529 * Logs integrity check information during each install.
8530 *
8531 * Logged from:
8532 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8533 */
8534message IntegrityCheckResultReported {
8535 optional string package_name = 1;
8536 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008537 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008538 optional string installer_package_name = 4;
8539 enum Response {
8540 UNKNOWN = 0;
8541 ALLOWED = 1;
8542 REJECTED = 2;
8543 FORCE_ALLOWED = 3;
8544 }
8545 optional Response response = 5;
8546 // An estimate on the cause of the response. This will only be populated for
8547 // REJECTED and FORCE_ALLOWED
8548 optional bool caused_by_app_cert_rule = 6;
8549 optional bool caused_by_installer_rule = 7;
8550}
8551
8552/**
8553 * Logs the information about the rules and the provider whenever rules are
8554 * pushed into AppIntegrityManager.
8555 *
8556 * Logged from:
8557 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8558 */
8559message IntegrityRulesPushed {
8560 optional bool success = 1;
8561 // Package name of the app that pushed the rules.
8562 optional string rule_provider = 2;
8563 // Version string of arbitrary format provided by the rule provider to
8564 // identify the rules.
8565 optional string rule_version = 3;
8566}
Jordan Liubedfa702019-12-20 15:08:45 -08008567
8568/**
8569 * Logs when a cell broadcast message is received on the device.
8570 *
8571 * Logged from CellBroadcastService module:
8572 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8573 */
8574message CellBroadcastMessageReported {
8575 // The type of Cell Broadcast message
8576 enum CbType {
8577 UNKNOWN_TYPE = 0;
8578 GSM = 1;
8579 CDMA = 2;
8580 CDMA_SPC = 3;
8581 }
8582
8583 // GSM, CDMA, CDMA-SCP
8584 optional CbType type = 1;
8585}
8586
8587/**
8588 * Logs when an error occurs while handling a cell broadcast message;
8589 *
8590 * Logged from CellBroadcastService module:
8591 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8592 */
8593message CellBroadcastMessageError {
8594 // The type of error raised when trying to handle a cell broadcast message
8595 enum ErrorType {
8596 UNKNOWN_TYPE = 0;
8597 CDMA_DECODING_ERROR = 1;
8598 CDMA_SCP_EMPTY = 2;
8599 CDMA_SCP_HANDLING_ERROR = 3;
8600 GSM_INVALID_HEADER_LENGTH = 4;
8601 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8602 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8603 GSM_INVALID_PDU = 7;
8604 GSM_INVALID_GEO_FENCING_DATA = 8;
8605 GSM_UMTS_INVALID_WAC = 9;
8606 FAILED_TO_INSERT_TO_DB = 10;
8607 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8608 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8609 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8610 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8611 }
8612
8613 // What kind of error occurred
8614 optional ErrorType type = 1;
8615
8616 // Exception message (or log message) associated with the error (max 1000 chars)
8617 optional string exception_message = 2;
8618}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008619
8620/**
8621 * Logs when the SDK Extensions test app has polled the current version.
8622 * This is atom ID 354.
8623 *
8624 * Logged from:
8625 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8626 */
8627message SdkExtensionStatus {
8628 enum ApiCallStatus {
8629 CALL_NOT_ATTEMPTED = 0;
8630 CALL_SUCCESSFUL = 1;
8631 CALL_FAILED = 2;
8632 }
8633
8634 optional ApiCallStatus result = 1;
8635
8636 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8637 optional int32 r_extension_version = 2;
8638
8639 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8640 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8641 optional int32 failed_call_symbol = 3;
8642}
Marco Ballesio497aff42020-01-24 08:39:42 -08008643
8644/**
8645 * Logs when an app is frozen or unfrozen.
8646 *
8647 * Logged from:
8648 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8649 */
8650message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008651 // The type of event.
8652 enum Action {
8653 UNKNOWN = 0;
8654 FREEZE_APP = 1;
8655 UNFREEZE_APP = 2;
8656 }
8657 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008658
Blake Kragten6ce382a2020-01-16 20:20:46 -08008659 // Pid of the process being frozen.
8660 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008661
Blake Kragten6ce382a2020-01-16 20:20:46 -08008662 // Name of the process being frozen.
8663 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008664
Blake Kragten6ce382a2020-01-16 20:20:46 -08008665 // Time since last unfrozen.
8666 optional int64 time_unfrozen_millis = 4;
8667}
8668
8669/**
8670 * Logs gnss stats from location service provider
8671 *
8672 * Pulled from:
8673 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8674 */
8675
8676message GnssStats {
8677 // Number of location reports since boot
8678 optional int64 location_reports = 1;
8679
8680 // Total pulled reports of Location failures since boot
8681 optional int64 location_failure_reports = 2;
8682
8683 // Number of time to first fix reports since boot
8684 optional int64 time_to_first_fix_reports = 3;
8685
8686 // Total pulled reported time to first fix (in milli-seconds) since boot
8687 optional int64 time_to_first_fix_milli_s = 4;
8688
8689 // Number of position accuracy reports since boot
8690 optional int64 position_accuracy_reports = 5;
8691
8692 // Total pulled reported position accuracy (in meters) since boot
8693 optional int64 position_accuracy_meters = 6;
8694
8695 // Number of top 4 average CN0 reports since boot
8696 optional int64 top_four_average_cn0_reports = 7;
8697
8698 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8699 optional int64 top_four_average_cn0_db_mhz = 8;
8700
8701 // Number of l5 top 4 average CN0 reports since boot
8702 optional int64 l5_top_four_average_cn0_reports = 9;
8703
8704 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8705 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8706
8707 // Total number of sv status messages reports since boot
8708 optional int64 sv_status_reports = 11;
8709
8710 // Total number of sv status messages reports, where sv is used in fix since boot
8711 optional int64 sv_status_reports_used_in_fix = 12;
8712
8713 // Total number of L5 sv status messages reports since boot
8714 optional int64 l5_sv_status_reports = 13;
8715
8716 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8717 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008718}
Kweku Adams12752132020-02-18 15:36:48 -08008719
8720/**
8721 * Logs when an app is moved to a different standby bucket.
8722 *
8723 * Logged from:
8724 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8725 */
8726message AppStandbyBucketChanged {
8727 optional string package_name = 1;
8728
8729 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8730 optional int32 user_id = 2;
8731
8732 // These enum values match the constants defined in UsageStatsManager.java.
8733 enum Bucket {
8734 BUCKET_UNKNOWN = 0;
8735 BUCKET_EXEMPTED = 5;
8736 BUCKET_ACTIVE = 10;
8737 BUCKET_WORKING_SET = 20;
8738 BUCKET_FREQUENT = 30;
8739 BUCKET_RARE = 40;
8740 BUCKET_RESTRICTED = 45;
8741 BUCKET_NEVER = 50;
8742 }
8743 optional Bucket bucket = 3;
8744
8745 enum MainReason {
8746 MAIN_UNKNOWN = 0;
8747 MAIN_DEFAULT = 0x0100;
8748 MAIN_TIMEOUT = 0x0200;
8749 MAIN_USAGE = 0x0300;
8750 MAIN_FORCED_BY_USER = 0x0400;
8751 MAIN_PREDICTED = 0x0500;
8752 MAIN_FORCED_BY_SYSTEM = 0x0600;
8753 }
8754 optional MainReason main_reason = 4;
8755
8756 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8757 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8758 // UsageStatsManager.java.
8759 optional int32 sub_reason = 5;
8760}