blob: bd5bdc6c4f2f0799b9107dc8f4bf2e22f3cc46ea [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"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800128 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
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;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
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 =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800169 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 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"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800245 WatchdogRollbackOccurred watchdog_rollback_occurred =
246 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800247 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
248 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800249 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800250 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
251 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800252 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
253 151 [(module) = "bluetooth"];
254 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
255 152 [(module) = "bluetooth"];
256 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
257 153 [(module) = "bluetooth"];
258 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
259 154 [(module) = "bluetooth"];
260 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
261 155 [(module) = "bluetooth"];
262 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
263 156 [(module) = "bluetooth"];
264 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
265 157 [(module) = "bluetooth"];
266 BluetoothDeviceFailedContactCounterReported
267 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
268 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
269 159 [(module) = "bluetooth"];
270 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
271 160 [(module) = "bluetooth"];
272 BluetoothQualityReportReported bluetooth_quality_report_reported =
273 161 [(module) = "bluetooth"];
274 BluetoothDeviceInfoReported bluetooth_device_info_reported =
275 162 [(module) = "bluetooth"];
276 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
277 163 [(module) = "bluetooth"];
278 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
279 164 [(module) = "bluetooth"];
280 BluetoothBondStateChanged bluetooth_bond_state_changed =
281 165 [(module) = "bluetooth"];
282 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
283 166 [(module) = "bluetooth"];
284 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
285 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800286 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
287 168 [(module) = "framework"];
288 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700289 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800290 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800291 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800292 DeviceIdentifierAccessDenied device_identifier_access_denied =
293 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800294 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800295 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
296 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
297 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800298 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
299 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800300 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700301 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 180 [(module) = "permissioncontroller"];
303 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
304 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800305 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
307 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
308 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
309 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800310 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
311 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700312 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 188 [(module) = "intelligence"];
314 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
315 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800316 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800318 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
319 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
320 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
321 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
322 MediametricsCodecReported mediametrics_codec_reported = 195;
323 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
324 MediametricsExtractorReported mediametrics_extractor_reported = 197;
325 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
326 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
327 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700328 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800329 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
330 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800331 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800332 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
333 206 [(module) = "framework"];
334 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
335 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
336 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
337 LocationManagerApiUsageReported location_manager_api_usage_reported =
338 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100339 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800340 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100341 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800342 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100343 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800344 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100345 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800346 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100347 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100349 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800350 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100351 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800352 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100353 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800354 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800355 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
356 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
357 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
358 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800360 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700361 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
362 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100364 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800366 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800367 VmsClientConnectionStateChanged vms_client_connection_state_changed =
368 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800369 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
370 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700371 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800372 235 [(module) = "mediaprovider"];
373 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700374 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800375 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800376 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
377 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
378 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
379 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800380 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000382 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800383 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500384 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
385 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800386 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
387 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800388 CellBroadcastMessageReported cb_message_reported =
389 249 [(module) = "cellbroadcast"];
390 CellBroadcastMessageError cb_message_error =
391 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700392 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
393 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
394 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800395 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000396 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800397 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
398 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800399 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800400 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000401 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000402 }
David Chenc8a43242017-10-17 16:23:28 -0700403
David Chen6e3e6cb2018-01-03 16:14:06 -0800404 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700405 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700406 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800407 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
408 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
409 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
410 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
411 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
412 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800413 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800414 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
415 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800416 CpuTimePerUidFreq cpu_time_per_uid_freq =
417 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800418 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
419 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
420 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
421 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
422 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
423 SystemUptime system_uptime = 10015 [(module) = "framework"];
424 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
425 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000426 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800427 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
428 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800429 Temperature temperature = 10021 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800430 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800432 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 DiskStats disk_stats = 10025 [(module) = "framework"];
434 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
435 AppSize app_size = 10027 [(module) = "framework"];
436 CategorySize category_size = 10028 [(module) = "framework"];
437 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800438 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
440 DiskIo disk_io = 10032 [(module) = "framework"];
441 PowerProfile power_profile = 10033 [(module) = "framework"];
442 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
443 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
444 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700445 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
447 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
448 10040 [(module) = "framework"];
449 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
450 10041 [(module) = "framework"];
451 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800452 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800454 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
456 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
457 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
458 RoleHolder role_holder = 10049 [(module) = "framework"];
459 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800460 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
462 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800463 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
464 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800465 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
466 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
467 FaceSettings face_settings = 10058 [(module) = "framework"];
468 CoolingDevice cooling_device = 10059 [(module) = "framework"];
469 AppOps app_ops = 10060 [(module) = "framework"];
470 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700471 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
472 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800474 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
476 DangerousPermissionStateSampled dangerous_permission_state_sampled =
477 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400478 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000479 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000480 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200481 PackageNotificationPreferences package_notification_preferences =
482 10071 [(module) = "framework"];
483 PackageNotificationChannelPreferences package_notification_channel_preferences =
484 10072 [(module) = "framework"];
485 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
486 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800487 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800488 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700489 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
490 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
491 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
492 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700493 }
yroa1fe77c2018-02-26 14:22:54 -0800494
Bookatz76aafcf2018-09-17 16:17:10 -0700495 // DO NOT USE field numbers above 100,000 in AOSP.
496 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
497 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100498
499 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700500}
501
Yao Chend54f9dd2017-10-17 17:37:48 +0000502/**
Yangster-mac20877162017-12-22 17:19:39 -0800503 * This proto represents a node of an attribution chain.
504 * Note: All attribution chains are represented as a repeated field of type
505 * AttributionNode. It is understood that in such arrays, the order is that
506 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000507 */
Yangster-mac20877162017-12-22 17:19:39 -0800508message AttributionNode {
509 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800510 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800511
Yangster-mac20877162017-12-22 17:19:39 -0800512 // The (optional) string tag for an element in the attribution chain. If the
513 // element has no tag, it is encoded as an empty string.
514 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700515}
516
Yangster-mac48b3d622018-08-18 12:38:11 -0700517message KeyValuePair {
518 optional int32 key = 1;
519 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700520 int32 value_int = 2;
521 int64 value_long = 3;
522 string value_str = 4;
523 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700524 }
525}
526
527message KeyValuePairsAtom {
528 optional int32 uid = 1;
529 repeated KeyValuePair pairs = 2;
530}
531
Yao Chend54f9dd2017-10-17 17:37:48 +0000532/*
533 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800534 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 *
536 * RULES:
537 * - The field ids for each atom must start at 1, and count upwards by 1.
538 * Skipping field ids is not allowed.
539 * - These form an API, so renaming, renumbering or removing fields is
540 * not allowed between android releases. (This is not currently enforced,
541 * but there will be a tool to enforce this restriction).
542 * - The types must be built-in protocol buffer types, namely, no sub-messages
543 * are allowed (yet). The bytes type is also not allowed.
544 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800545 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000546 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800547 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000548 * - A field that is a uid should be a string field, tagged with the [xxx]
549 * annotation. The generated code on android will be represented by UIDs,
550 * and those UIDs will be translated in xxx to those strings.
551 *
552 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700553 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000554 * - If there is a UID, it goes first. Think in an object-oriented fashion.
555 * *****************************************************************************
556 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700557
Yao Chend54f9dd2017-10-17 17:37:48 +0000558/**
Tej Singha72344992019-04-17 18:55:08 -0700559 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700560 * Logs when the Thermal service HAL notifies the throttling start/stop events.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
564 */
565message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700566 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700567 optional android.os.TemperatureTypeEnum sensor_type = 1;
568
Maggie White442b6312019-04-05 16:26:44 -0700569 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700570 enum State {
571 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700572 START = 1; // START indicated that throttling was triggered.
573 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700574 }
Yangster-mace16189a2018-08-26 12:20:16 -0700575 optional State state = 2;
576
577 optional float temperature = 3;
578}
579
580/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000581 * Logs when the screen state changes.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
585 */
586message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800587 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800588 optional android.view.DisplayStateEnum state = 1
589 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700590}
Yao Chend54f9dd2017-10-17 17:37:48 +0000591
592/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700593 * Logs that the process state of the uid, as determined by ActivityManager
594 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
598 */
Bookatzc1a050a2017-10-10 15:49:28 -0700599message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800600 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000601
Bookatzdb026a22018-01-10 19:01:56 -0800602 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800603 optional android.app.ProcessStateEnum state = 2
604 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000605}
606
607/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700608 * Logs process state change of a process, as per the activity manager.
609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
612 */
613message ProcessStateChanged {
614 optional int32 uid = 1;
615 optional string process_name = 2;
616 optional string package_name = 3;
617 // TODO: remove this when validation is done
618 optional int64 version = 5;
619 // The state, from frameworks/base/core/proto/android/app/enums.proto.
620 optional android.app.ProcessStateEnum state = 4;
621}
622
623/**
624 * Logs when ActivityManagerService sleep state is changed.
625 *
626 * Logged from:
627 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
628 */
629message ActivityManagerSleepStateChanged {
630 // TODO: import frameworks proto
631 enum State {
632 UNKNOWN = 0;
633 ASLEEP = 1;
634 AWAKE = 2;
635 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800636 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700637}
638
639/**
640 * Logs when system memory state changes.
641 *
642 * Logged from:
643 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
644 */
645message MemoryFactorStateChanged {
646 // TODO: import frameworks proto
647 enum State {
648 MEMORY_UNKNOWN = 0;
649 NORMAL = 1; // normal.
650 MODERATE = 2; // moderate memory pressure.
651 LOW = 3; // low memory.
652 CRITICAL = 4; // critical memory.
653
654 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800655 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700656}
657
658/**
659 * Logs when app is using too much cpu, according to ActivityManagerService.
660 *
661 * Logged from:
662 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
663 */
664message ExcessiveCpuUsageReported {
665 optional int32 uid = 1;
666 optional string process_name = 2;
667 optional string package_name = 3;
668 // package version. TODO: remove this when validation is done
669 optional int64 version = 4;
670}
671
672/**
673 * Logs when a cached process is killed, along with its pss.
674 *
675 * Logged from:
676 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
677 */
678message CachedKillReported {
679 optional int32 uid = 1;
680 optional string process_name = 2;
681 optional string package_name = 3;
682 // TODO: remove this when validation is done
683 optional int64 version = 5;
684 optional int64 pss = 4;
685}
686
687/**
xshu2c3d9e42019-09-26 17:54:02 -0700688 * Logs the change in wifi health.
689 *
690 * Logged from:
691 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
692 */
693message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800694 enum Band {
695 UNKNOWN = 0;
696 // All of 2.4GHz band
697 BAND_2G = 1;
698 // Frequencies in the range of [5150, 5250) GHz
699 BAND_5G_LOW = 2;
700 // Frequencies in the range of [5250, 5725) GHz
701 BAND_5G_MIDDLE = 3;
702 // Frequencies in the range of [5725, 5850) GHz
703 BAND_5G_HIGH = 4;
704 // Frequencies in the range of [5925, 6425) GHz
705 BAND_6G_LOW = 5;
706 // Frequencies in the range of [6425, 6875) GHz
707 BAND_6G_MIDDLE = 6;
708 // Frequencies in the range of [6875, 7125) GHz
709 BAND_6G_HIGH = 7;
710 }
xshu2c3d9e42019-09-26 17:54:02 -0700711 // duration this stat is obtained over in milliseconds
712 optional int32 duration_millis = 1;
713 // whether wifi is classified as sufficient for the user's data traffic, determined
714 // by whether the calculated throughput exceeds the average demand within |duration_millis|
715 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700716 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800717 optional bool is_cell_data_available = 3;
718 // the Band bucket the connected network is on
719 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700720}
721
722/**
723 * Logged when wifi detects a significant change in connection failure rate.
724 *
725 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
726 *
727 */
728message WifiFailureStatReported {
729 enum AbnormalityType {
730 UNKNOWN = 0;
731 SIGNIFICANT_INCREASE = 1;
732 SIGNIFICANT_DECREASE = 2;
733 SIMPLY_HIGH = 3;
734 }
735 enum FailureType {
736 FAILURE_UNKNOWN = 0;
737 FAILURE_CONNECTION = 1;
738 FAILURE_ASSOCIATION_REJECTION = 2;
739 FAILURE_ASSOCIATION_TIMEOUT = 3;
740 FAILURE_AUTHENTICATION = 4;
741 FAILURE_NON_LOCAL_DISCONNECTION = 5;
742 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
743 }
744 // Reason for uploading this stat
745 optional AbnormalityType abnormality_type = 1;
746 // The particular type of failure
747 optional FailureType failure_type = 2;
748 // How many times we have encountered this combination of AbnormalityType and FailureType
749 optional int32 failure_count = 3;
750}
751
752/**
753 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
754 *
755 * Logged from:
756 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
757 */
758message WifiConnectionResultReported {
759 enum FailureCode {
760 FAILURE_UNKNOWN = 0;
761 FAILURE_ASSOCIATION_TIMEOUT = 1;
762 FAILURE_ASSOCIATION_REJECTION = 2;
763 FAILURE_AUTHENTICATION_GENERAL = 3;
764 FAILURE_AUTHENTICATION_EAP = 4;
765 FAILURE_DHCP = 5;
766 FAILURE_NETWORK_DISCONNECTION = 6;
767 FAILURE_ROAM_TIMEOUT = 7;
768 }
769 // true represents a successful connection
770 optional bool connection_result = 1;
771 // reason for the connection failure
772 optional FailureCode failure_code = 2;
773 // scan rssi before the connection attempt
774 optional int32 rssi = 3;
775}
776
777/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700778 * Logs when memory stats of a process is reported.
779 *
780 * Logged from:
781 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
782 */
783message ProcessMemoryStatReported {
784 optional int32 uid = 1;
785 optional string process_name = 2;
786 optional string package_name = 3;
787 //TODO: remove this when validation is done
788 optional int64 version = 9;
789 optional int64 pss = 4;
790 optional int64 uss = 5;
791 optional int64 rss = 6;
792 enum Type {
793 ADD_PSS_INTERNAL_SINGLE = 0;
794 ADD_PSS_INTERNAL_ALL_MEM = 1;
795 ADD_PSS_INTERNAL_ALL_POLL = 2;
796 ADD_PSS_EXTERNAL = 3;
797 ADD_PSS_EXTERNAL_SLOW = 4;
798 }
799 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800800 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700801}
802
803/**
Bookatzc1a050a2017-10-10 15:49:28 -0700804 * Logs that a process started, finished, crashed, or ANRed.
805 *
806 * Logged from:
807 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
808 */
809message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700810 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700811
David Chen0b5c90c2018-01-25 16:51:49 -0800812 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800813 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700814
Bookatzddccf0a2017-11-28 16:48:14 -0800815 // What lifecycle state the process changed to.
816 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800817 enum State {
818 FINISHED = 0;
819 STARTED = 1;
820 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800821 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800822 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700823}
824
Bookatzc1a050a2017-10-10 15:49:28 -0700825/**
826 * Logs when the ble scan state changes.
827 *
828 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700829 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700830 */
831message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800832 repeated AttributionNode attribution_node = 1
833 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700834
835 enum State {
836 OFF = 0;
837 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700838 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
839 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700840 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800841 optional State state = 2 [
842 (state_field_option).option = EXCLUSIVE_STATE,
843 (state_field_option).default_state_value = 0 /* State.OFF */,
844 (state_field_option).reset_state_value = 2 /* State.RESET */,
845 (state_field_option).nested = true
846 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700847
Bookatze5ec0b42018-03-26 13:34:56 -0700848 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800849 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700850 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800851 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700852 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700854}
855
856/**
857 * Logs reporting of a ble scan finding results.
858 *
859 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700860 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
Bookatzae6738e2018-09-13 11:38:56 -0700862// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700863message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800864 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700865
866 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800867 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700868}
869
870/**
871 * Logs when a sensor state changes.
872 *
873 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700874 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700875 */
876message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800877 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700878
Bookatzc1a050a2017-10-10 15:49:28 -0700879 // The id (int) of the sensor.
880 optional int32 sensor_id = 2;
881
882 enum State {
883 OFF = 0;
884 ON = 1;
885 }
886 optional State state = 3;
887}
888
Bookatzc1a050a2017-10-10 15:49:28 -0700889/**
890 * Logs when GPS state changes.
891 *
892 * Logged from:
893 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
894 */
895message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800896 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700897
898 enum State {
899 OFF = 0;
900 ON = 1;
901 }
902 optional State state = 2;
903}
904
Bookatz48d362e2018-11-06 15:49:08 -0800905/**
906 * Logs when GPS signal quality.
907 *
908 * Logged from:
909 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
910 */
911message GpsSignalQualityChanged {
912 optional android.server.location.GpsSignalQualityEnum level = 1;
913}
914
Bookatzc1a050a2017-10-10 15:49:28 -0700915
916/**
917 * Logs when a sync manager sync state changes.
918 *
919 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700920 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700921 */
922message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800923 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700924
David Chen0b5c90c2018-01-25 16:51:49 -0800925 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800926 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700927
928 enum State {
929 OFF = 0;
930 ON = 1;
931 }
932 optional State state = 3;
933}
934
Yangster-mac96353002018-09-05 11:18:55 -0700935/*
936 * Deferred job stats.
937 *
938 * Logged from:
939 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
940*/
941message DeferredJobStatsReported {
942 repeated AttributionNode attribution_node = 1;
943
944 // Number of jobs deferred.
945 optional int32 num_jobs_deferred = 2;
946
947 // Time since the last job runs.
948 optional int64 time_since_last_job_millis = 3;
949}
950
Bookatzc1a050a2017-10-10 15:49:28 -0700951/**
952 * Logs when a job scheduler job state changes.
953 *
954 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700955 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700956 */
957message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800958 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700959
960 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800961 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700962
963 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800964 FINISHED = 0;
965 STARTED = 1;
966 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700967 }
968 optional State state = 3;
969
Tej Singh33a412b2018-03-16 18:43:59 -0700970 // The reason a job has stopped.
971 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700972 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700973 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100974
975 // The standby bucket of the app that scheduled the job. These match the framework constants
976 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
977 // already assigned 0.
978 enum Bucket {
979 UNKNOWN = -1;
980 ACTIVE = 0;
981 WORKING_SET = 1;
982 FREQUENT = 2;
983 RARE = 3;
984 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800985 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100986 }
987 optional Bucket standby_bucket = 5 [default = UNKNOWN];
988
989 // The job id (as assigned by the app).
990 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -0800991
992 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
993 // constraints as they are always assumed to be set.
994 optional bool has_charging_constraint = 7;
995 optional bool has_battery_not_low_constraint = 8;
996 optional bool has_storage_not_low_constraint = 9;
997 optional bool has_timing_delay_constraint = 10;
998 optional bool has_deadline_constraint = 11;
999 optional bool has_idle_constraint = 12;
1000 optional bool has_connectivity_constraint = 13;
1001 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001002}
1003
1004/**
1005 * Logs when the audio state changes.
1006 *
1007 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001008 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001009 */
1010message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001012
1013 enum State {
1014 OFF = 0;
1015 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001016 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1017 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001018 }
1019 optional State state = 2;
1020}
1021
1022/**
1023 * Logs when the video codec state changes.
1024 *
1025 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001026 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001027 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001028message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001029 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001030
1031 enum State {
1032 OFF = 0;
1033 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001034 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1035 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001036 }
1037 optional State state = 2;
1038}
1039
1040/**
1041 * Logs when the flashlight state changes.
1042 *
1043 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001044 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001045 */
1046message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001048
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001052 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1053 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001054 }
1055 optional State state = 2;
1056}
1057
1058/**
1059 * Logs when the camera state changes.
1060 *
1061 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001062 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001063 */
1064message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001065 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001066
1067 enum State {
1068 OFF = 0;
1069 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001070 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1071 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001072 }
1073 optional State state = 2;
1074}
1075
1076/**
1077 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001078 *
1079 * Logged from:
1080 * TODO
1081 */
Bookatzd6746242017-10-24 18:39:35 -07001082message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001083 repeated AttributionNode attribution_node = 1
1084 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001085
Bookatz1a1b0462018-01-12 11:47:03 -08001086 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1087 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001088 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001089 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001090
1091 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001092 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001093
1094 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001095 RELEASE = 0;
1096 ACQUIRE = 1;
1097 CHANGE_RELEASE = 2;
1098 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001099 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001100 optional State state = 4 [
1101 (state_field_option).option = EXCLUSIVE_STATE,
1102 (state_field_option).default_state_value = 0,
1103 (state_field_option).nested = true
1104 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001105}
1106
1107/**
Bookatzc1a050a2017-10-10 15:49:28 -07001108 * Logs when a partial wakelock is considered 'long' (over 1 min).
1109 *
1110 * Logged from:
1111 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1112 */
1113message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001114 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001115
Yao Chend54f9dd2017-10-17 17:37:48 +00001116 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1117 optional string tag = 2;
1118
Bookatzc1a050a2017-10-10 15:49:28 -07001119 // TODO: I have no idea what this is.
1120 optional string history_tag = 3;
1121
1122 enum State {
1123 OFF = 0;
1124 ON = 1;
1125 }
1126 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001127}
1128
Bookatzc1a050a2017-10-10 15:49:28 -07001129/**
Bookatza66083f2018-09-20 17:24:00 -07001130 * Logs when the device is interactive, according to the PowerManager Notifier.
1131 *
1132 * Logged from:
1133 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1134 */
1135message InteractiveStateChanged {
1136 enum State {
1137 OFF = 0;
1138 ON = 1;
1139 }
1140 optional State state = 1;
1141}
1142
1143/**
Bookatzc1a050a2017-10-10 15:49:28 -07001144 * Logs Battery Saver state change.
1145 *
1146 * Logged from:
1147 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1148 */
1149message BatterySaverModeStateChanged {
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 1;
1155}
1156
1157/**
1158 * Logs Doze mode state change.
1159 *
1160 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001161 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001162 */
1163message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001164 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001165}
1166
1167
1168/**
1169 * Logs state change of Doze mode including maintenance windows.
1170 *
1171 * Logged from:
1172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1173 */
1174message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001175 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001176}
1177
1178/**
1179 * Logs screen brightness level.
1180 *
1181 * Logged from:
1182 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1183 */
1184message ScreenBrightnessChanged {
1185 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1186 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001187}
1188
1189/**
1190 * Logs battery level (percent full, from 0 to 100).
1191 *
1192 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001194 */
1195message BatteryLevelChanged {
1196 // Battery level. Should be in [0, 100].
1197 optional int32 battery_level = 1;
1198}
1199
1200/**
1201 * Logs change in charging status of the device.
1202 *
1203 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001204 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001205 */
1206message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001207 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1208 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001209}
1210
1211/**
1212 * Logs whether the device is plugged in, and what power source it is using.
1213 *
1214 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001215 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001216 */
1217message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001218 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1219 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001220}
1221
Bookatz8c6571b2017-10-24 15:04:41 -07001222/**
1223 * Logs when an app's wakeup alarm fires.
1224 *
1225 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001226 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001227 */
1228message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001229 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001230
1231 // Name of the wakeup alarm.
1232 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001233
1234 // Name of source package (for historical reasons, since BatteryStats tracked it).
1235 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001236
Ben Murdoch3389f1522019-05-21 15:05:34 +01001237 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001238 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001239}
1240
1241/**
1242 * Logs when an an app causes the mobile radio to change state.
1243 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1244 *
1245 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001246 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001247 */
1248message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001249 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001250
Bookatz1a1b0462018-01-12 11:47:03 -08001251 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1252 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001253}
1254
1255/**
1256 * Logs when an an app causes the wifi radio to change state.
1257 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1258 *
1259 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001260 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001261 */
1262message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001263 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001264
Bookatz1a1b0462018-01-12 11:47:03 -08001265 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1266 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001267}
1268
1269/**
1270 * Logs kernel wakeup reasons and aborts.
1271 *
1272 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001273 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001274 */
1275message KernelWakeupReported {
1276 // Name of the kernel wakeup reason (or abort).
1277 optional string wakeup_reason_name = 1;
1278
1279 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001280 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001281}
1282
1283/**
Bookatzda1798c2018-12-13 14:16:00 -08001284 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001285 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001286 *
1287 * Logged from:
1288 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1289 */
1290message WifiEnabledStateChanged {
1291 enum State {
1292 OFF = 0;
1293 ON = 1;
1294 }
1295 optional State state = 1;
1296}
1297
1298/**
tsaichristinececebdc2020-02-04 14:05:56 -08001299 * This atom is deprecated starting in R.
1300 *
Bookatzda1798c2018-12-13 14:16:00 -08001301 * 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 -08001302 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1303 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001304 *
1305 * Logged from:
1306 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1307 */
1308message WifiRunningStateChanged {
1309 repeated AttributionNode attribution_node = 1;
1310
1311 enum State {
1312 OFF = 0;
1313 ON = 1;
1314 }
1315 optional State state = 2;
1316}
1317
1318/**
Bookatze5885242017-10-24 20:10:31 -07001319 * Logs wifi locks held by an app.
1320 *
1321 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001322 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001323 */
1324message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001325 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001326
1327 enum State {
1328 OFF = 0;
1329 ON = 1;
1330 }
1331 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001332
1333 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1334 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001335}
1336
1337/**
1338 * Logs wifi signal strength changes.
1339 *
1340 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001341 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001342 */
1343message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001344 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1345 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001346}
1347
1348/**
1349 * Logs wifi scans performed by an app.
1350 *
1351 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001352 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001353 */
1354message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001355 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001356
1357 enum State {
1358 OFF = 0;
1359 ON = 1;
1360 }
1361 optional State state = 2;
1362}
1363
1364/**
Tej Singh4503e102018-01-04 14:35:01 -08001365 * Logs wifi multicast locks held by an app
1366 *
1367 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001368 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001369 */
1370message WifiMulticastLockStateChanged {
1371 repeated AttributionNode attribution_node = 1;
1372
1373 enum State {
1374 OFF = 0;
1375 ON = 1;
1376 }
1377 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001378
1379 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001380}
1381
1382/**
Tej Singh1ea42892018-01-19 09:27:00 -08001383 * Logs shutdown reason and duration on next boot.
1384 *
1385 * Logged from:
1386 * frameworks/base/core/java/com/android/server/BootReceiver.java
1387 */
1388message ShutdownSequenceReported {
1389 // True if shutdown is for a reboot. Default: false if we do not know.
1390 optional bool reboot = 1;
1391
1392 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1393 optional string reason = 2;
1394
1395 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1396 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001398
1399 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001400 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001401}
1402
Tej Singh6483ea42018-01-25 17:45:49 -08001403
1404/**
1405 * Logs boot reason and duration.
1406 *
1407 * Logged from:
1408 * system/core/bootstat/bootstat.cpp
1409 */
1410message BootSequenceReported {
1411 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1412 // Default: "<EMPTY>" if not available.
1413 optional string bootloader_reason = 1;
1414
1415 // Reason for system boot. Eg. bootloader, reboot,userrequested
1416 // Default: "<EMPTY>" if not available.
1417 optional string system_reason = 2;
1418
1419 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001420 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001421
1422 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001423 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001424
1425 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001426 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001427
1428 // Time since last boot in ms. Default: 0 if not available.
1429 optional int64 time_since_last_boot = 6;
1430}
1431
Tej Singhc477d9c2018-02-05 18:31:39 -08001432
1433/**
1434 * Logs call state and disconnect cause (if applicable).
1435 *
1436 * Logged from:
1437 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1438 */
1439message CallStateChanged {
1440 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1441 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1442 optional android.telecom.CallStateEnum call_state = 1;
1443
1444 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1445 // This value is only applicable when the call_state is DISCONNECTED, and
1446 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1447 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1448 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1449
1450 // True if the call is self-managed, which are apps that use the
1451 // telecom infrastructure to make their own calls.
1452 optional bool self_managed = 3;
1453
1454 // True if call is external. External calls are calls on connected Wear
1455 // devices but show up in Telecom so the user can pull them onto the device.
1456 optional bool external_call = 4;
1457}
1458
Tej Singh1ea42892018-01-19 09:27:00 -08001459/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001460 * Logs keyguard state. The keyguard is the lock screen.
1461 *
1462 * Logged from:
1463 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1464 */
1465message KeyguardStateChanged {
1466 enum State {
1467 UNKNOWN = 0;
1468 // The keyguard is hidden when the phone is unlocked.
1469 HIDDEN = 1;
1470 // The keyguard is shown when the phone is locked (screen turns off).
1471 SHOWN= 2;
1472 // The keyguard is occluded when something is overlaying the keyguard.
1473 // Eg. Opening the camera while on the lock screen.
1474 OCCLUDED = 3;
1475 }
1476 optional State state = 1;
1477}
1478
1479/**
1480 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1481 * prompts the user to enter a password (pattern, pin, etc).
1482 *
1483 * Logged from:
1484 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1485 */
1486
1487message KeyguardBouncerStateChanged {
1488 enum State {
1489 UNKNOWN = 0;
1490 // Bouncer is hidden, either as a result of successfully entering the
1491 // password, screen timing out, or user going back to lock screen.
1492 HIDDEN = 1;
1493 // This is when the user is being prompted to enter the password.
1494 SHOWN = 2;
1495 }
1496 optional State state = 1;
1497}
1498
1499/**
1500 * Logs the result of entering a password into the keyguard bouncer.
1501 *
1502 * Logged from:
1503 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1504 */
1505message KeyguardBouncerPasswordEntered {
1506 enum BouncerResult {
1507 UNKNOWN = 0;
1508 // The password entered was incorrect.
1509 FAILURE = 1;
1510 // The password entered was correct.
1511 SUCCESS = 2;
1512 }
1513 optional BouncerResult result = 1;
1514}
1515
Tej Singha883b372018-02-15 11:30:01 -08001516/*
1517 * Logs changes to the configuration of the device. The configuration is defined
1518 * in frameworks/base/core/java/android/content/res/Configuration.java
1519 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1520 * Please go there to interpret the possible values each field can be.
1521 *
1522 * Logged from:
1523 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1524 */
1525message ResourceConfigurationChanged {
1526 // Bit mask of color capabilities of the screen.
1527 // Contains information about the color gamut and hdr mode of the screen.
1528 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001529 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001530
1531 // The target screen density being rendered to.
1532 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001533 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001534
1535 // Current user preference for the scaling factor for fonts,
1536 // relative to the base density scaling.
1537 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001538 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001539
1540 // Flag indicating whether the hard keyboard is hidden.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // The type of keyboard attached to the device.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1546 optional int32 keyboard = 5;
1547
1548 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001550 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001551
1552 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1553 // 0 if undefined.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1555 optional int32 mcc = 7;
1556
1557 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1558 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1559 // MNC_ZERO symbol defined in Configuration.java.
1560 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1561 optional int32 mnc = 8;
1562
1563 // The kind of navigation available on the device.
1564 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1565 optional int32 navigation = 9;
1566
1567 // Flag indicating whether the navigation is available.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001569 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001570
1571 // Overall orientation of the screen.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1573 optional int32 orientation = 11;
1574
1575 // The current height of the available screen space, in dp units.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001578
1579 // Bit mask of overall layout of the screen.
1580 // Contains information about screen size, whether the screen is wider/taller
1581 // than normal, whether the screen layout is right-tl-left or left-to-right,
1582 // and whether the screen has a rounded shape.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001584 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001585
1586 // Current width of the available screen space, in dp units.
1587 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001588 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001589
1590 // The smallest screen size an application will see in normal operation.
1591 // This is the smallest value of both screenWidthDp and screenHeightDp
1592 // in portrait and landscape.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001595
1596 // The type of touch screen attached to the device.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1598 optional int32 touchscreen = 16;
1599
1600 // Bit mask of the ui mode.
1601 // Contains information about the overall ui mode of the device.
1602 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1603 // Also contains information about whether the device is in night mode.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001606}
1607
Tej Singheee317b2018-03-07 19:28:05 -08001608
1609/**
1610 * Logs changes in the connection state of the mobile radio.
1611 *
1612 * Logged from:
1613 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1614 */
1615message MobileConnectionStateChanged {
1616 // States are from the state machine DataConnection.java.
1617 enum State {
1618 UNKNOWN = 0;
1619 // The connection is inactive, or disconnected.
1620 INACTIVE = 1;
1621 // The connection is being activated, or connecting.
1622 ACTIVATING = 2;
1623 // The connection is active, or connected.
1624 ACTIVE = 3;
1625 // The connection is disconnecting.
1626 DISCONNECTING = 4;
1627 // The connection is disconnecting after creating a connection.
1628 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1629 }
1630 optional State state = 1;
1631 // For multi-sim phones, this distinguishes between the sim cards.
1632 optional int32 sim_slot_index = 2;
1633 // Used to identify the connection. Starts at 0 and increments by 1 for
1634 // every new network created. Resets whenever the device reboots.
1635 optional int32 data_connection_id = 3;
1636 // A bitmask for the capabilities of this connection.
1637 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1638 // Default value (if we have no information): 0
1639 optional int64 capabilities = 4;
1640 // If this connection has internet.
1641 // This just checks if the DEFAULT bit of capabilities is set.
1642 optional bool has_internet = 5;
1643}
1644
1645/**
1646 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1647 *
1648 * Logged from:
1649 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1650 */
1651message MobileRadioTechnologyChanged {
1652 optional android.telephony.NetworkTypeEnum state = 1;
1653 // For multi-sim phones, this distinguishes between the sim cards.
1654 optional int32 sim_slot_index = 2;
1655}
1656
Andrew Chantb56388b2018-03-22 21:07:33 -07001657/**
1658 * Logs the VID and PID of any connected USB devices.
1659 *
1660 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1661 *
1662 * Logged by Vendor.
1663 */
1664message UsbDeviceAttached {
1665 optional int32 vid = 1;
1666 optional int32 pid = 2;
1667 optional bool has_audio = 3;
1668 optional bool has_hid = 4;
1669 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001670 enum State {
1671 STATE_DISCONNECTED = 0;
1672 STATE_CONNECTED = 1;
1673 }
1674 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001675 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001676}
1677
Tej Singheee317b2018-03-07 19:28:05 -08001678
Tej Singhdd7bd352018-02-09 19:33:15 -08001679/**
Tej Singh5d991e12018-03-09 19:48:11 -08001680 * Logs when Bluetooth is enabled and disabled.
1681 *
1682 * Logged from:
1683 * services/core/java/com/android/server/BluetoothManagerService.java
1684 */
1685message BluetoothEnabledStateChanged {
1686 repeated AttributionNode attribution_node = 1;
1687 // Whether or not bluetooth is enabled on the device.
1688 enum State {
1689 UNKNOWN = 0;
1690 ENABLED = 1;
1691 DISABLED = 2;
1692 }
1693 optional State state = 2;
1694 // The reason for being enabled/disabled.
1695 // Eg. Airplane mode, crash, application request.
1696 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1697 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001698 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001699}
1700
1701/**
Jack Hed9837c82019-01-09 01:19:13 -08001702 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001703 *
1704 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001705 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1706 *
1707 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001708 */
1709message BluetoothConnectionStateChanged {
1710 // The state of the connection.
1711 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1712 optional android.bluetooth.ConnectionStateEnum state = 1;
1713 // An identifier that can be used to match connect and disconnect events.
1714 // Currently is last two bytes of a hash of a device level ID and
1715 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001716 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001717 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001718 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1719 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001720 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001721 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001722 // An identifier that can be used to match events for this device.
1723 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1724 // Salt: Randomly generated 256 bit value
1725 // Hash algorithm: HMAC-SHA256
1726 // Size: 32 byte
1727 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001728 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001729}
1730
1731/**
1732 * Logs when a Bluetooth device connects and disconnects over ACL
1733 *
1734 * Logged from:
1735 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1736 *
1737 * Next Tag: 3
1738 */
1739message BluetoothAclConnectionStateChanged {
1740 // An identifier that can be used to match events for this device.
1741 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1742 // Salt: Randomly generated 256 bit value
1743 // Hash algorithm: HMAC-SHA256
1744 // Size: 32 byte
1745 // Default: null or empty if the device identifier is not known
1746 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1747 // The state of the connection.
1748 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1749 optional android.bluetooth.ConnectionStateEnum state = 2;
1750}
1751
1752/**
1753 * Logs when a Bluetooth device connects and disconnects over SCO
1754 *
1755 * Logged from:
1756 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1757 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1758 *
1759 * Next Tag: 4
1760 */
1761message BluetoothScoConnectionStateChanged {
1762 // An identifier that can be used to match events for this device.
1763 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1764 // Salt: Randomly generated 256 bit value
1765 // Hash algorithm: HMAC-SHA256
1766 // Size: 32 byte
1767 // Default: null or empty if the device identifier is not known
1768 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1769 // The state of the connection.
1770 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1771 optional android.bluetooth.ConnectionStateEnum state = 2;
1772 // Codec used for this SCO connection
1773 // Default: UNKNOWN
1774 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001775}
1776
Jack Hec27040a2019-01-09 20:54:41 -08001777/**
1778 * Logged when active device of a profile changes
1779 *
1780 * Logged from:
1781 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1782 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1783 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1784 */
1785message BluetoothActiveDeviceChanged {
1786 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1787 // From android.bluetooth.BluetoothProfile
1788 optional int32 bt_profile = 1;
1789 // An identifier that can be used to match events for this new active device.
1790 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1791 // Salt: Randomly generated 256 bit value
1792 // Hash algorithm: HMAC-SHA256
1793 // Size: 32 byte
1794 // Default: null or empty if there is no active device for this profile
1795 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1796}
1797
Jack Heab86dbd22018-12-18 15:43:27 -08001798// Logs when there is an event affecting Bluetooth device's link layer connection.
1799// - This event is triggered when there is a related HCI command or event
1800// - Users of this metrics can deduce Bluetooth device's connection state from these events
1801// - HCI commands are logged before the command is sent, after receiving command status, and after
1802// receiving command complete
1803// - HCI events are logged when they arrive
1804//
1805// Low level log from system/bt
1806//
1807// Bluetooth classic commands:
1808// - CMD_CREATE_CONNECTION
1809// - CMD_DISCONNECT
1810// - CMD_CREATE_CONNECTION_CANCEL
1811// - CMD_ACCEPT_CONNECTION_REQUEST
1812// - CMD_REJECT_CONNECTION_REQUEST
1813// - CMD_SETUP_ESCO_CONNECTION
1814// - CMD_ACCEPT_ESCO_CONNECTION
1815// - CMD_REJECT_ESCO_CONNECTION
1816// - CMD_ENH_SETUP_ESCO_CONNECTION
1817// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1818//
1819// Bluetooth low energy commands:
1820// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1821// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1822// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1823// - CMD_BLE_CLEAR_WHITE_LIST
1824// - CMD_BLE_ADD_WHITE_LIST
1825// - CMD_BLE_REMOVE_WHITE_LIST
1826//
1827// Bluetooth classic events:
1828// - EVT_CONNECTION_COMP
1829// - EVT_CONNECTION_REQUEST
1830// - EVT_DISCONNECTION_COMP
1831// - EVT_ESCO_CONNECTION_COMP
1832// - EVT_ESCO_CONNECTION_CHANGED
1833//
1834// Bluetooth low energy meta events:
1835// - BLE_EVT_CONN_COMPLETE_EVT
1836// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1837//
1838// Next tag: 10
1839message BluetoothLinkLayerConnectionEvent {
1840 // An identifier that can be used to match events for this device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if the device identifier is not known
1846 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1847 // Connection handle of this connection if available
1848 // Range: 0x0000 - 0x0EFF (12 bits)
1849 // Default: 0xFFFF if the handle is unknown
1850 optional int32 connection_handle = 2;
1851 // Direction of the link
1852 // Default: DIRECTION_UNKNOWN
1853 optional android.bluetooth.DirectionEnum direction = 3;
1854 // Type of this link
1855 // Default: LINK_TYPE_UNKNOWN
1856 optional android.bluetooth.LinkTypeEnum type = 4;
1857
1858 // Reason metadata for this link layer connection event, rules for interpretation:
1859 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1860 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1861 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1862 // set and valid, ignore hci_ble_event
1863
1864 // HCI command associated with this event
1865 // Default: CMD_UNKNOWN
1866 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1867 // HCI event associated with this event
1868 // Default: EVT_UNKNOWN
1869 optional android.bluetooth.hci.EventEnum hci_event = 6;
1870 // HCI BLE meta event associated with this event
1871 // Default: BLE_EVT_UNKNOWN
1872 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1873 // HCI command status code if this is triggerred by hci_cmd
1874 // Default: STATUS_UNKNOWN
1875 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1876 // HCI reason code associated with this event
1877 // Default: STATUS_UNKNOWN
1878 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1879}
1880
Howard Roe103fe22019-01-17 16:52:16 -08001881/**
1882 * Logs when a module is rolled back by Watchdog.
1883 *
1884 * Logged from: Rollback Manager
1885 */
1886message WatchdogRollbackOccurred {
1887 enum RollbackType {
1888 UNKNOWN = 0;
1889 ROLLBACK_INITIATE = 1;
1890 ROLLBACK_SUCCESS = 2;
1891 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001892 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001893 }
1894 optional RollbackType rollback_type = 1;
1895
1896 optional string package_name = 2;
1897
1898 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001899
1900 enum RollbackReasonType {
1901 REASON_UNKNOWN = 0;
1902 REASON_NATIVE_CRASH = 1;
1903 REASON_EXPLICIT_HEALTH_CHECK = 2;
1904 REASON_APP_CRASH = 3;
1905 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001906 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001907 }
1908 optional RollbackReasonType rollback_reason = 4;
1909
1910 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1911 // is initiated. Empty if the package is unknown.
1912 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001913
1914 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001915}
1916
Jack Hec27040a2019-01-09 20:54:41 -08001917/**
1918 * Logs when there is a change in Bluetooth A2DP playback state
1919 *
1920 * Logged from:
1921 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1922 */
1923message BluetoothA2dpPlaybackStateChanged {
1924 // An identifier that can be used to match events for this device.
1925 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1926 // Salt: Randomly generated 256 bit value
1927 // Hash algorithm: HMAC-SHA256
1928 // Size: 32 byte
1929 // Default: null or empty if the device identifier is not known
1930 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1931 // Current playback state
1932 // Default: PLAYBACK_STATE_UNKNOWN
1933 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1934 // Current audio coding mode
1935 // Default: AUDIO_CODING_MODE_UNKNOWN
1936 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1937}
1938
1939/**
1940 * Logs when there is a change in A2DP codec config for a particular remote device
1941 *
1942 * Logged from:
1943 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1944 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1945 */
1946message BluetoothA2dpCodecConfigChanged {
1947 // An identifier that can be used to match events for this device.
1948 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1949 // Salt: Randomly generated 256 bit value
1950 // Hash algorithm: HMAC-SHA256
1951 // Size: 32 byte
1952 // Default: null or empty if the device identifier is not known
1953 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1954 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1955 // Default SOURCE_CODEC_TYPE_INVALID
1956 optional int32 codec_type = 2;
1957 // Codec priroity, the higher the more preferred, -1 for disabled
1958 // Default: CODEC_PRIORITY_DEFAULT
1959 optional int32 codec_priority = 3;
1960 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1961 // Default: SAMPLE_RATE_NONE
1962 optional int32 sample_rate = 4;
1963 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1964 // Default: BITS_PER_SAMPLE_NONE
1965 optional int32 bits_per_sample = 5;
1966 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1967 // Default: CHANNEL_MODE_NONE
1968 optional int32 channel_mode = 6;
1969 // Codec specific values
1970 // Default 0
1971 optional int64 codec_specific_1 = 7;
1972 optional int64 codec_specific_2 = 8;
1973 optional int64 codec_specific_3 = 9;
1974 optional int64 codec_specific_4 = 10;
1975}
1976
1977/**
1978 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1979 * Each codec's capability is logged separately due to statsd restriction
1980 *
1981 * Logged from:
1982 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1983 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1984 */
1985message BluetoothA2dpCodecCapabilityChanged {
1986 // An identifier that can be used to match events for this device.
1987 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1988 // Salt: Randomly generated 256 bit value
1989 // Hash algorithm: HMAC-SHA256
1990 // Size: 32 byte
1991 // Default: null or empty if the device identifier is not known
1992 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1993 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1994 // Default SOURCE_CODEC_TYPE_INVALID
1995 optional int32 codec_type = 2;
1996 // Codec priroity, the higher the more preferred, -1 for disabled
1997 // Default: CODEC_PRIORITY_DEFAULT
1998 optional int32 codec_priority = 3;
1999 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2000 // in BluetoothCodecConfig
2001 // Default: empty and SAMPLE_RATE_NONE for individual item
2002 optional int32 sample_rate = 4;
2003 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2004 // in BluetoothCodecConfig
2005 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2006 optional int32 bits_per_sample = 5;
2007 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2008 // BluetoothCodecConfig
2009 // Default: empty and CHANNEL_MODE_NONE for individual item
2010 optional int32 channel_mode = 6;
2011 // Codec specific values
2012 // Default 0
2013 optional int64 codec_specific_1 = 7;
2014 optional int64 codec_specific_2 = 8;
2015 optional int64 codec_specific_3 = 9;
2016 optional int64 codec_specific_4 = 10;
2017}
2018
2019/**
2020 * Logs when A2DP failed to read from PCM source.
2021 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2022 *
2023 * Logged from:
2024 * system/bt
2025 */
2026message BluetoothA2dpAudioUnderrunReported {
2027 // An identifier that can be used to match events for this device.
2028 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2029 // Salt: Randomly generated 256 bit value
2030 // Hash algorithm: HMAC-SHA256
2031 // Size: 32 byte
2032 // Default: null or empty if the device identifier is not known
2033 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2034 // Encoding interval in nanoseconds
2035 // Default: 0
2036 optional int64 encoding_interval_nanos = 2;
2037 // Number of bytes of PCM data that could not be read from the source
2038 // Default: 0
2039 optional int32 num_missing_pcm_bytes = 3;
2040}
2041
2042/**
2043 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2044 * buffer queue is full and we have to drop data
2045 *
2046 * Logged from:
2047 * system/bt
2048 */
2049message BluetoothA2dpAudioOverrunReported {
2050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // Encoding interval in nanoseconds
2058 // Default: 0
2059 optional int64 encoding_interval_nanos = 2;
2060 // Number of buffers dropped in this event
2061 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2062 // Default: 0
2063 optional int32 num_dropped_buffers = 3;
2064 // Number of encoded buffers dropped in this event
2065 // Default 0
2066 optional int32 num_dropped_encoded_frames = 4;
2067 // Number of encoded bytes dropped in this event
2068 // Default: 0
2069 optional int32 num_dropped_encoded_bytes = 5;
2070}
2071
2072/**
2073 * Logs when we receive reports regarding a device's RSSI value
2074 *
2075 * Logged from:
2076 * system/bt
2077 */
2078message BluetoothDeviceRssiReported {
2079 // An identifier that can be used to match events for this device.
2080 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2081 // Salt: Randomly generated 256 bit value
2082 // Hash algorithm: HMAC-SHA256
2083 // Size: 32 byte
2084 // Default: null or empty if the device identifier is not known
2085 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2086 // Connection handle of this connection if available
2087 // Range: 0x0000 - 0x0EFF (12 bits)
2088 // Default: 0xFFFF if the handle is unknown
2089 optional int32 connection_handle = 2;
2090 // HCI command status code if this is triggerred by hci_cmd
2091 // Default: STATUS_UNKNOWN
2092 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2093 // BR/EDR
2094 // Range: -128 ≤ N ≤ 127 (signed integer)
2095 // Units: dB
2096 // LE:
2097 // Range: -127 to 20, 127 (signed integer)
2098 // Units: dBm
2099 // Invalid when an out of range value is reported
2100 optional int32 rssi = 4;
2101}
2102
2103/**
2104 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2105 *
2106 * Logged from:
2107 * system/bt
2108 */
2109message BluetoothDeviceFailedContactCounterReported {
2110 // An identifier that can be used to match events for this device.
2111 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2112 // Salt: Randomly generated 256 bit value
2113 // Hash algorithm: HMAC-SHA256
2114 // Size: 32 byte
2115 // Default: null or empty if the device identifier is not known
2116 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2117 // Connection handle of this connection if available
2118 // Range: 0x0000 - 0x0EFF (12 bits)
2119 // Default: 0xFFFF if the handle is unknown
2120 optional int32 connection_handle = 2;
2121 // HCI command status code if this is triggerred by hci_cmd
2122 // Default: STATUS_UNKNOWN
2123 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2124 // Number of consecutive failed contacts for a connection corresponding to the Handle
2125 // Range: uint16_t, 0-0xFFFF
2126 // Default: 0xFFFFF
2127 optional int32 failed_contact_counter = 4;
2128}
2129
2130/**
2131 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2132 *
2133 * Logged from:
2134 * system/bt
2135 */
2136message BluetoothDeviceTxPowerLevelReported {
2137 // An identifier that can be used to match events for this device.
2138 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2139 // Salt: Randomly generated 256 bit value
2140 // Hash algorithm: HMAC-SHA256
2141 // Size: 32 byte
2142 // Default: null or empty if the device identifier is not known
2143 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2144 // Connection handle of this connection if available
2145 // Range: 0x0000 - 0x0EFF (12 bits)
2146 // Default: 0xFFFF if the handle is unknown
2147 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002148 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002149 // Default: STATUS_UNKNOWN
2150 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2151 // Range: -30 ≤ N ≤ 20
2152 // Units: dBm
2153 // Invalid when an out of range value is reported
2154 optional int32 transmit_power_level = 4;
2155}
Jack Heab86dbd22018-12-18 15:43:27 -08002156
Tej Singh5d991e12018-03-09 19:48:11 -08002157/**
Jack He1021a612019-01-20 21:22:46 -08002158 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2159 * receiving an HCI command from the host
2160 *
2161 * Logged from: system/bt
2162 */
2163message BluetoothHciTimeoutReported {
2164 // HCI command associated with this event
2165 // Default: CMD_UNKNOWN
2166 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2167}
2168
2169/**
2170 * Logs when we receive Bluetooth Link Quality Report event from the controller
2171 * See Android Bluetooth HCI specification for more details
2172 *
2173 * Note: all count and bytes field are counted since last event
2174 *
2175 * Logged from: system/bt
2176 */
2177message BluetoothQualityReportReported {
2178 // Quality report ID
2179 // Original type: uint8_t
2180 // Default: BQR_ID_UNKNOWN
2181 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2182 // Packet type of the connection
2183 // Original type: uint8_t
2184 // Default: BQR_PACKET_TYPE_UNKNOWN
2185 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2186 // Connection handle of the connection
2187 // Original type: uint16_t
2188 optional int32 connection_handle = 3;
2189 // Performing Role for the connection
2190 // Original type: uint8_t
2191 optional int32 connection_role = 4;
2192 // Current Transmit Power Level for the connection. This value is the same as the controller's
2193 // response to the HCI_Read_Transmit_Power_Level HCI command
2194 // Original type: uint8_t
2195 optional int32 tx_power_level = 5;
2196 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2197 // absolute receiver signal strength value
2198 // Original type: int8_t
2199 optional int32 rssi = 6;
2200 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2201 // channels used by the link currently
2202 // Original type: uint8_t
2203 optional int32 snr = 7;
2204 // Indicates the number of unused channels in AFH_channel_map
2205 // Original type: uint8_t
2206 optional int32 unused_afh_channel_count = 8;
2207 // Indicates the number of the channels which are interfered and quality is bad but are still
2208 // selected for AFH
2209 // Original type: uint8_t
2210 optional int32 afh_select_unideal_channel_count = 9;
2211 // Current Link Supervision Timeout Setting
2212 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2213 // Original type: uint16_t
2214 optional int32 lsto = 10;
2215 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2216 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2217 // 0x01 (Piconet Clock)
2218 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2219 // Original type: uint32_t
2220 optional int64 connection_piconet_clock = 11;
2221 // The count of retransmission
2222 // Original type: uint32_t
2223 optional int64 retransmission_count = 12;
2224 // The count of no RX
2225 // Original type: uint32_t
2226 optional int64 no_rx_count = 13;
2227 // The count of NAK (Negative Acknowledge)
2228 // Original type: uint32_t
2229 optional int64 nak_count = 14;
2230 // Controller timestamp of last TX ACK
2231 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2232 // Original type: uint32_t
2233 optional int64 last_tx_ack_timestamp = 15;
2234 // The count of Flow-off (STOP)
2235 // Original type: uint32_t
2236 optional int64 flow_off_count = 16;
2237 // Controller timestamp of last Flow-on (GO)
2238 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2239 // Original type: uint32_t
2240 optional int64 last_flow_on_timestamp = 17;
2241 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2242 // Original type: uint32_t
2243 optional int64 buffer_overflow_bytes = 18;
2244 // Buffer underflow count (in byte) since last event
2245 // Original type: uint32_t
2246 optional int64 buffer_underflow_bytes = 19;
2247}
2248
2249/**
2250 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2251 *
2252 * Notes:
2253 * - Each event can be partially filled as we might learn different pieces of device
2254 * information at different time
2255 * - Multiple device info events can be combined to give more complete picture
2256 * - When multiple device info events tries to describe the same information, the
2257 * later one wins
2258 *
2259 * Logged from:
2260 * packages/apps/Bluetooth
2261 */
Jack Heaea26982019-04-04 11:19:48 -07002262message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002263 // An identifier that can be used to match events for this device.
2264 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2265 // Salt: Randomly generated 256 bit value
2266 // Hash algorithm: HMAC-SHA256
2267 // Size: 32 byte
2268 // Default: null or empty if the device identifier is not known
2269 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2270 // Where is this device info obtained from
2271 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2272 // Name of the data source
2273 // For EXTERNAL: package name of the data source
2274 // For INTERNAL: null for general case, component name otherwise
2275 optional string source_name = 3;
2276 // Name of the manufacturer of this device
2277 optional string manufacturer = 4;
2278 // Model of this device
2279 optional string model = 5;
2280 // Hardware version of this device
2281 optional string hardware_version = 6;
2282 // Software version of this device
2283 optional string software_version = 7;
2284}
2285
2286/**
2287 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2288 * device, as documented by the Bluetooth Core HCI specification
2289 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2290 * Vol 2, Part E, Page 1118
2291 *
2292 * Logged from:
2293 * system/bt
2294 */
2295message BluetoothRemoteVersionInfoReported {
2296 // Connection handle of the connection
2297 // Original type: uint16_t
2298 optional int32 connection_handle = 1;
2299 // HCI command status code
2300 // Default: STATUS_UNKNOWN
2301 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2302 // 1 byte Version of current LMP in the remote controller
2303 optional int32 lmp_version = 3;
2304 // 2 bytes LMP manufacturer code of the remote controller
2305 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2306 optional int32 lmp_manufacturer_code = 4;
2307 // 4 bytes subversion of the LMP in the remote controller
2308 optional int32 lmp_subversion = 5;
2309}
2310
2311/**
2312 * Logs when certain Bluetooth SDP attributes are discovered
2313 * Constant definitions are from:
2314 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2315 *
2316 * Current logged attributes:
2317 * - BluetoothProfileDescriptorList
2318 * - Supported Features Bitmask
2319 *
2320 * Logged from:
2321 * system/bt
2322 */
2323message BluetoothSdpAttributeReported {
2324 // An identifier that can be used to match events for this device.
2325 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2326 // Salt: Randomly generated 256 bit value
2327 // Hash algorithm: HMAC-SHA256
2328 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2329 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2330 // Original type: uint16_t
2331 optional int32 protocol_uuid = 2;
2332 // Short form UUIDs used to identify Bluetooth SDP attribute types
2333 // Original type: uint16_t
2334 optional int32 attribute_id = 3;
2335 // Attribute value for the particular attribute
2336 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2337}
2338
2339/**
2340 * Logs when bond state of a Bluetooth device changes
2341 *
2342 * Logged from:
2343 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2344 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2345 */
2346message BluetoothBondStateChanged {
2347 // An identifier that can be used to match events for this device.
2348 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2349 // Salt: Randomly generated 256 bit value
2350 // Hash algorithm: HMAC-SHA256
2351 // Size: 32 byte
2352 // Default: null or empty if the device identifier is not known
2353 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2354 // Preferred transport type to remote dual mode device
2355 // Default: TRANSPORT_AUTO means no preference
2356 optional android.bluetooth.TransportTypeEnum transport = 2;
2357 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2358 // Default: UNKNOWN
2359 optional android.bluetooth.DeviceTypeEnum type = 3;
2360 // Current bond state (NONE, BONDING, BONDED)
2361 // Default: BOND_STATE_UNKNOWN
2362 optional android.bluetooth.BondStateEnum bond_state = 4;
2363 // Bonding sub state
2364 // Default: BOND_SUB_STATE_UNKNOWN
2365 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2366 // Unbond Reason
2367 // Default: UNBOND_REASON_UNKNOWN
2368 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2369}
2370
2371/**
2372 * Logs there is an event related Bluetooth classic pairing
2373 *
2374 * Logged from:
2375 * system/bt
2376 */
2377message BluetoothClassicPairingEventReported {
2378 // An identifier that can be used to match events for this device.
2379 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2380 // Salt: Randomly generated 256 bit value
2381 // Hash algorithm: HMAC-SHA256
2382 // Size: 32 byte
2383 // Default: null or empty if the device identifier is not known
2384 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2385 // Connection handle of this connection if available
2386 // Range: 0x0000 - 0x0EFF (12 bits)
2387 // Default: 0xFFFF if the handle is unknown
2388 optional int32 connection_handle = 2;
2389 // HCI command associated with this event
2390 // Default: CMD_UNKNOWN
2391 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2392 // HCI event associated with this event
2393 // Default: EVT_UNKNOWN
2394 optional android.bluetooth.hci.EventEnum hci_event = 4;
2395 // HCI command status code if this is triggerred by hci_cmd
2396 // Default: STATUS_UNKNOWN
2397 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2398 // HCI reason code associated with this event
2399 // Default: STATUS_UNKNOWN
2400 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002401 // A status value related to this specific event
2402 // Default: 0
2403 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002404}
2405
2406/**
2407 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2408 *
2409 * Logged from:
2410 * system/bt
2411 */
2412message BluetoothSmpPairingEventReported {
2413 // An identifier that can be used to match events for this device.
2414 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2415 // Salt: Randomly generated 256 bit value
2416 // Hash algorithm: HMAC-SHA256
2417 // Size: 32 byte
2418 // Default: null or empty if the device identifier is not known
2419 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2420 // SMP command sent or received over L2CAP
2421 // Default: CMD_UNKNOWN
2422 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2423 // Whether this command is sent or received
2424 // Default: DIRECTION_UNKNOWN
2425 optional android.bluetooth.DirectionEnum direction = 3;
2426 // SMP failure reason code
2427 // Default: PAIRING_FAIL_REASON_DEFAULT
2428 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2429}
2430
2431/**
Jack He815cdba2019-01-30 17:24:55 -08002432 * Logs when a Bluetooth socket’s connection state changed
2433 *
2434 * Logged from:
2435 * system/bt
2436 */
2437message BluetoothSocketConnectionStateChanged {
2438 // An identifier that can be used to match events for this device.
2439 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2440 // Salt: Randomly generated 256 bit value
2441 // Hash algorithm: HMAC-SHA256
2442 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002443 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002444 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002445 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002446 // Default 0 when unknown or don't care
2447 optional int32 port = 2;
2448 // Socket type as mentioned in
2449 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2450 // Default: SOCKET_TYPE_UNKNOWN
2451 optional android.bluetooth.SocketTypeEnum type = 3;
2452 // Socket connection state
2453 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2454 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2455 // Number of bytes sent to remote device during this connection
2456 optional int64 tx_bytes = 5;
2457 // Number of bytes received from remote device during this connection
2458 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002459 // Socket owner's UID
2460 optional int32 uid = 7 [(is_uid) = true];
2461 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2462 // |port| must be spawned by |server_port|
2463 // Default 0 when unknown or don't care
2464 optional int32 server_port = 8;
2465 // Whether this is a server listener socket
2466 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002467}
2468
2469/**
Jack He71426802019-04-02 13:32:52 -07002470 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2471 *
2472 * Logged from:
2473 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2474 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2475 *
2476 */
2477message BluetoothClassOfDeviceReported {
2478 // An identifier that can be used to match events for this device.
2479 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2480 // Salt: Randomly generated 256 bit value
2481 // Hash algorithm: HMAC-SHA256
2482 // Size: 32 byte
2483 // Default: null or empty if this is a server listener socket
2484 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2485 // Class of Device (CoD) value including both Major, Minor device class and service class
2486 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2487 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2488 // Default: 0
2489 optional int32 class_of_device = 2;
2490}
2491
2492/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002493 * Logs when something is plugged into or removed from the USB-C connector.
2494 *
2495 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002496 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002497 */
2498message UsbConnectorStateChanged {
2499 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002500 STATE_DISCONNECTED = 0;
2501 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002502 }
2503 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002504 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002505 // Last active session in ms.
2506 // 0 when the port is in connected state.
2507 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002508}
2509
2510/**
2511 * Logs the reported speaker impedance.
2512 *
2513 * Logged from:
2514 * Vendor audio implementation.
2515 */
2516message SpeakerImpedanceReported {
2517 optional int32 speaker_location = 1;
2518 optional int32 impedance = 2;
2519}
2520
2521/**
2522 * Logs the report of a failed hardware.
2523 *
2524 * Logged from:
2525 * Vendor HALs.
2526 *
2527 */
2528message HardwareFailed {
2529 enum HardwareType {
2530 HARDWARE_FAILED_UNKNOWN = 0;
2531 HARDWARE_FAILED_MICROPHONE = 1;
2532 HARDWARE_FAILED_CODEC = 2;
2533 HARDWARE_FAILED_SPEAKER = 3;
2534 HARDWARE_FAILED_FINGERPRINT = 4;
2535 }
2536 optional HardwareType hardware_type = 1;
2537
Maggie White6dcd8572019-01-31 14:11:50 -08002538 /**
2539 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002540 * the same hardware_type. The specific locations are vendor defined integers,
2541 * referring to board-specific numbering schemes.
2542 */
2543 optional int32 hardware_location = 2;
2544
Maggie White6dcd8572019-01-31 14:11:50 -08002545 /**
2546 * failure_code is specific to the HardwareType of the failed hardware.
2547 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002548 */
Maggie White6dcd8572019-01-31 14:11:50 -08002549 enum HardwareErrorCode {
2550 UNKNOWN = 0;
2551 COMPLETE = 1;
2552 SPEAKER_HIGH_Z = 2;
2553 SPEAKER_SHORT = 3;
2554 FINGERPRINT_SENSOR_BROKEN = 4;
2555 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002556 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002557 }
2558 optional int32 failure_code = 3;
2559}
2560
2561/**
2562 * Log an event when the device has been physically dropped.
2563 * Reported from the /vendor partition.
2564 */
2565message PhysicalDropDetected {
2566 // Confidence that the event was actually a drop, 0 -> 100
2567 optional int32 confidence_pctg = 1;
2568 // Peak acceleration of the drop, in 1/1000s of a g.
2569 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002570 // Duration of freefall in ms
2571 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002572}
2573
2574/**
2575 * Log bucketed battery charge cycles.
2576 *
2577 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002578 * a given charge point. For example, if 10 cycle buckets are
2579 * initialized, bucket 1 is the lowest 1/10th of the battery,
2580 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002581 *
2582 * Logged from:
2583 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2584 */
2585message ChargeCyclesReported {
2586 optional int32 cycle_bucket_1 = 1;
2587 optional int32 cycle_bucket_2 = 2;
2588 optional int32 cycle_bucket_3 = 3;
2589 optional int32 cycle_bucket_4 = 4;
2590 optional int32 cycle_bucket_5 = 5;
2591 optional int32 cycle_bucket_6 = 6;
2592 optional int32 cycle_bucket_7 = 7;
2593 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002594 optional int32 cycle_bucket_9 = 9;
2595 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002596}
2597
2598/**
Howard Roa46b6582018-09-18 16:45:02 -07002599 * Log battery health snapshot.
2600 *
2601 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2602 * are snapshotted periodically over 24hrs.
2603 */
2604message BatteryHealthSnapshot {
2605 enum BatterySnapshotType {
2606 UNKNOWN = 0;
2607 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2608 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2609 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2610 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2611 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2612 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2613 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2614 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2615 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2616 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2617 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2618 }
2619 optional BatterySnapshotType type = 1;
2620 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002621 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002622 // Voltage Battery Voltage, in microVolts.
2623 optional int32 voltage_micro_volt = 3;
2624 // Current Battery current, in microAmps.
2625 optional int32 current_micro_amps = 4;
2626 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2627 optional int32 open_circuit_micro_volt = 5;
2628 // Resistance Battery Resistance, in microOhms.
2629 optional int32 resistance_micro_ohm = 6;
2630 // Level Battery Level, as % of full.
2631 optional int32 level_percent = 7;
2632}
2633
2634/**
2635 * Log slow I/O operations on the primary storage.
2636 */
2637message SlowIo {
2638 // Classifications of IO Operations.
2639 enum IoOperation {
2640 UNKNOWN = 0;
2641 READ = 1;
2642 WRITE = 2;
2643 UNMAP = 3;
2644 SYNC = 4;
2645 }
2646 optional IoOperation operation = 1;
2647
2648 // The number of slow IO operations of this type over 24 hours.
2649 optional int32 count = 2;
2650}
2651
2652/**
2653 * Log battery caused shutdown with the last recorded voltage.
2654 */
2655message BatteryCausedShutdown {
2656 // The last recorded battery voltage prior to shutdown.
2657 optional int32 last_recorded_micro_volt = 1;
2658}
2659
2660/**
Tej Singha72344992019-04-17 18:55:08 -07002661 * Logs when ThermalService receives throttling events.
2662 *
2663 * Logged from:
2664 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2665 */
2666message ThermalThrottlingSeverityStateChanged {
2667 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2668 optional android.os.TemperatureTypeEnum sensor_type = 1;
2669
2670 // The name of the temperature source. Eg. CPU0
2671 optional string sensor_name = 2;
2672
2673 // Temperature in tenths of a degree C.
2674 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2675 optional int32 temperature_deci_celsius = 3;
2676
2677 // Relative severity of the throttling, see enum definition.
2678 optional android.os.ThrottlingSeverityEnum severity = 4;
2679}
2680
2681/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002682 * Logs the duration of a davey (jank of >=700ms) when it occurs
2683 *
2684 * Logged from:
2685 * frameworks/base/libs/hwui/JankTracker.cpp
2686 */
2687message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002688 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002689 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002690
Tej Singhbb8554a2018-01-26 11:59:14 -08002691 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002692 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002693}
2694
2695/**
Bookatze5885242017-10-24 20:10:31 -07002696 * Logs phone signal strength changes.
2697 *
2698 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002699 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002700 */
2701message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002702 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2703 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002704}
2705
Yangster4ccebea2018-10-09 17:09:02 -07002706
2707/**
2708 * Logs when the phone state, sim state or signal strength changes
2709 *
2710 * Logged from:
2711 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2712 */
2713message PhoneServiceStateChanged {
2714 optional android.telephony.ServiceStateEnum state = 1;
2715 optional android.telephony.SimStateEnum sim_state = 2;
2716 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2717}
2718
2719/**
2720 * Logs when the phone becomes on or off.
2721 *
2722 * Logged from:
2723 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2724 */
2725message PhoneStateChanged {
2726 enum State {
2727 OFF = 0;
2728 ON = 1;
2729 }
2730 optional State state = 1;
2731}
2732
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002733message BackGesture {
2734 enum BackType {
2735 DEFAULT_BACK_TYPE = 0;
2736 COMPLETED = 1;
2737 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2738 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2739 INCOMPLETE = 4;
2740 }
2741 optional BackType type = 1;
2742
2743 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2744 enum WindowHorizontalLocation {
2745 DEFAULT_LOCATION = 0;
2746 LEFT = 1;
2747 RIGHT = 2;
2748 }
2749 optional WindowHorizontalLocation x_location = 3;
2750}
2751
2752message ExclusionRectStateChanged {
2753 optional string component_name = 1; // if not available, simply packageName
2754 optional int32 requested_height = 2; // px
2755 optional int32 rejected_height = 3; // px
2756
2757 enum WindowHorizontalLocation {
2758 DEFAULT_LOCATION = 0;
2759 LEFT = 1;
2760 RIGHT = 2;
2761 }
2762 optional WindowHorizontalLocation x_location = 4;
2763 optional bool landscape = 5;
2764 optional bool splitscreen = 6;
2765 optional int32 duration_millis = 7;
2766}
2767
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002768message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002769 optional android.stats.launcher.LauncherAction action = 1;
2770 optional android.stats.launcher.LauncherState src_state = 2;
2771 optional android.stats.launcher.LauncherState dst_state = 3;
2772 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002773 optional bool is_swipe_up_enabled = 5;
2774}
2775
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002776message StyleUIChanged {
2777 optional android.stats.style.Action action = 1;
2778 optional int32 color_package_hash = 2;
2779 optional int32 font_package_hash = 3;
2780 optional int32 shape_package_hash = 4;
2781 optional int32 clock_package_hash = 5;
2782 optional int32 launcher_grid = 6;
2783 optional int32 wallpaper_category_hash = 7;
2784 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002785 optional int32 color_preference = 9;
2786 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002787}
2788
David Chenc28b2bb2017-10-24 12:52:52 -07002789/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002790 * Logs when Settings UI has changed.
2791 *
2792 * Logged from:
2793 * packages/apps/Settings
2794 */
2795message SettingsUIChanged {
2796 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002797 * Where this SettingsUIChange event comes from. For example, if
2798 * it's a PAGE_VISIBLE event, where the page is opened from.
2799 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002800 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002801
2802 /**
2803 * What the UI action is.
2804 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002805 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002806
2807 /**
2808 * Where the action is happening
2809 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002810 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002811
2812 /**
2813 * What preference changed in this event.
2814 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002815 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002816
2817 /**
2818 * The new value of the changed preference.
2819 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002820 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002821}
2822
2823/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002824 * Logs basic timing information about touch events.
2825 * Reported at most every 5 minutes while device is being interacted with.
2826 *
2827 * Logged from:
2828 * frameworks/native/services/inputflinger
2829 */
2830message TouchEventReported {
2831 /**
2832 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002833 * and the standard deviation of the time spent processing touchscreen events
2834 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002835 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002836 * On supported devices, the starting point is taken during the hard interrupt inside the
2837 * kernel touch driver. On all other devices, the starting point is taken inside
2838 * the kernel's input event subsystem upon receipt of the input event.
2839 * The ending point is taken inside InputDispatcher, just after the input event
2840 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002841 */
2842 // Minimum value
2843 optional float latency_min_micros = 1;
2844 // Maximum value
2845 optional float latency_max_micros = 2;
2846 // Average value
2847 optional float latency_mean_micros = 3;
2848 // Standard deviation
2849 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002850 // Number of touch events (input_event) in this report
2851 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002852}
2853
2854/**
Philip Quinn0eded622019-01-29 12:46:28 -08002855 * Logs gesture classification and timing information for touch events.
2856 *
2857 * Logged from:
2858 * frameworks/base/core/java/android/view/GestureDetector.java
2859 * frameworks/base/core/java/android/view/View.java
2860 */
2861message TouchGestureClassified {
2862 // The source of the classification (e.g. Java class name).
2863 optional string source = 1;
2864
2865 enum Classification {
2866 UNKNOWN_CLASSIFICATION = 0;
2867 SINGLE_TAP = 1;
2868 DOUBLE_TAP = 2;
2869 LONG_PRESS = 3;
2870 DEEP_PRESS = 4;
2871 SCROLL = 5;
2872 }
2873 // The classification of the gesture.
2874 optional Classification classification = 2;
2875
2876 // The interval from the start of a touch event stream until the
2877 // classification was made.
2878 optional int32 latency_millis = 3;
2879
2880 // The distance from the location of the first touch event to the
2881 // location of the touch event when the classification was made.
2882 optional float displacement_px = 4;
2883}
2884
2885/**
David Chenc28b2bb2017-10-24 12:52:52 -07002886 * Logs that a setting was updated.
2887 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002888 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002889 * The tag and is_default allow resetting of settings to default values based on the specified
2890 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2891 */
2892message SettingChanged {
2893 // The name of the setting.
2894 optional string setting = 1;
2895
2896 // The change being imposed on this setting. May represent a number, eg "3".
2897 optional string value = 2;
2898
2899 // The new value of this setting. For most settings, this is same as value. For some settings,
2900 // value is +X or -X where X represents an element in a set. For example, if the previous value
2901 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2902 // The +/- feature is currently only used for location_providers_allowed.
2903 optional string new_value = 3;
2904
2905 // The previous value of this setting.
2906 optional string prev_value = 4;
2907
2908 // The tag used with the is_default for resetting sets of settings. This is generally null.
2909 optional string tag = 5;
2910
Bookatz90867622018-01-31 15:05:57 -08002911 // True if this setting with tag should be resettable.
2912 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002913
David Chenbd789912018-03-16 17:19:55 -07002914 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002915 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002916
2917 enum ChangeReason {
2918 UPDATED = 1; // Updated can be an insertion or an update.
2919 DELETED = 2;
2920 }
2921 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002922}
Chenjie Yub3dda412017-10-24 13:41:59 -07002923
Chenjie Yu05013b32017-11-21 10:21:41 -08002924/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002925 * Logs activity going to foreground or background
2926 *
2927 * Logged from:
2928 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2929 */
2930message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002931 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002932 optional string pkg_name = 2;
2933 optional string class_name = 3;
2934
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002935 enum State {
2936 BACKGROUND = 0;
2937 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002938 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002939 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002940}
David Chenc8a43242017-10-17 16:23:28 -07002941
2942/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002943 * Logs when a volume entered low Storage state.
2944 * Logged from:
2945 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2946 */
2947message LowStorageStateChanged {
2948 // Volume that ran out of storage.
2949 optional string volume_description = 1;
2950
2951 enum State {
2952 UNKNOWN = 0;
2953 OFF = 1;
2954 ON = 2;
2955 }
2956 optional State state = 2;
2957}
2958
2959/**
2960 * Logs when an app is downgraded.
2961 * Logged from:
2962 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2963 */
2964message AppDowngraded {
2965 optional string package_name = 1;
2966 // Size of the package (all data) before being downgraded.
2967 optional int64 size_in_bytes_before = 2;
2968 // Size of the package (all data) after being downgraded.
2969 optional int64 size_in_bytes_after = 3;
2970
2971 optional bool aggressive = 4;
2972}
2973
2974/**
2975 * Logs when an app is optimized after being downgraded.
2976 * Logged from:
2977 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2978 */
2979message AppOptimizedAfterDowngraded {
2980 optional string package_name = 1;
2981}
2982
2983/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002984 * Logs whenever an app is installed on external storage.
2985 * Logged from:
2986 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2987 */
2988message AppInstallOnExternalStorageReported {
2989 // The type of external storage.
2990 optional android.stats.storage.ExternalStorageType storage_type = 1;
2991 // The name of the package that is installed on the sd card.
2992 optional string package_name = 2;
2993}
2994
2995/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002997 * Logged from:
2998 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2999 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003000message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003001 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003002
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003003 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003004
3005 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003006 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003007 optional string process_name = 3;
3008
3009 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003010 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003011
3012 optional string package_name = 5;
3013
3014 enum InstantApp {
3015 UNAVAILABLE = 0;
3016 FALSE = 1;
3017 TRUE = 2;
3018 }
3019 optional InstantApp is_instant_app = 6;
3020
3021 enum ForegroundState {
3022 UNKNOWN = 0;
3023 BACKGROUND = 1;
3024 FOREGROUND = 2;
3025 }
3026 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003027
3028 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003029}
David Chen9e3808c2017-11-20 17:25:34 -08003030
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031/**
3032 * Logs when a WTF (What a Terrible Failure) happened.
3033 * Logged from:
3034 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3035 */
3036message WTFOccurred {
3037 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003038
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003039 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003040
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003041 // The name of the process.
3042 // system_server if it is not by an app
3043 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003044
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045 // The pid if available. -1 means not available.
3046 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003047
3048 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003049}
3050
3051/**
3052 * Logs when system server reports low memory.
3053 * Logged from:
3054 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3055 */
3056message LowMemReported {
3057}
3058
3059/**
3060 * Logs when an app ANR (App Not Responding) occurs.
3061 * Logged from:
3062 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3063 */
3064message ANROccurred {
3065 optional int32 uid = 1 [(is_uid) = true];
3066
3067 optional string process_name = 2;
3068
3069 optional string short_component_name = 3;
3070
3071 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003072
3073 enum InstantApp {
3074 UNAVAILABLE = 0;
3075 FALSE = 1;
3076 TRUE = 2;
3077 }
3078 optional InstantApp is_instant_app = 5;
3079
3080 enum ForegroundState {
3081 UNKNOWN = 0;
3082 BACKGROUND = 1;
3083 FOREGROUND = 2;
3084 }
3085 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003086
3087 optional android.server.ErrorSource error_source = 7;
3088
3089 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003090}
3091
Bookatza7020bd2018-08-28 16:29:35 -07003092/**
3093 * Logs when the vibrator state changes.
3094 * Logged from:
3095 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3096 */
3097message VibratorStateChanged {
3098 repeated AttributionNode attribution_node = 1;
3099
3100 enum State {
3101 OFF = 0;
3102 ON = 1;
3103 }
3104 optional State state = 2;
3105
3106 // Duration (in milliseconds) requested to keep the vibrator on.
3107 // Only applicable for State == ON.
3108 optional int64 duration_millis = 3;
3109}
3110
David Chen0a368b22017-12-06 16:28:16 -08003111/*
3112 * Allows other apps to push events into statsd.
3113 * Logged from:
3114 * frameworks/base/core/java/android/util/StatsLog.java
3115 */
David Chen0b5c90c2018-01-25 16:51:49 -08003116message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003117 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003118 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003119
3120 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3121 optional int32 label = 2;
3122
3123 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3124 // predicates for the metrics).
3125 enum State {
3126 UNKNOWN = 0;
3127 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3128 STOP = 2;
3129 START = 3;
3130 }
3131 optional State state = 3;
3132}
3133
David Chen9e3808c2017-11-20 17:25:34 -08003134/**
Bookatz7948c872018-09-04 12:58:33 -07003135 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3136 * For example, this could be due to the user manually changing the time.
3137 *
3138 * Logged from:
3139 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3140 */
3141message WallClockTimeShifted {
3142 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3143 optional int64 wall_clock_timestamp_millis = 1;
3144}
3145
3146/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003147 * Logs when statsd detects an anomaly.
3148 *
3149 * Logged from:
3150 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3151 */
3152message AnomalyDetected {
3153 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003154 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003155
Yangster-mac94e197c2018-01-02 16:03:03 -08003156 // Id of the config whose anomaly detection alert fired.
3157 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003158
Yangster-mac94e197c2018-01-02 16:03:03 -08003159 // Id of the alert (i.e. name of the anomaly that was detected).
3160 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003161}
3162
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003163message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003164 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003165 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003166
3167 // The app package name.
3168 optional string pkg_name = 2;
3169
3170 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003171 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003172 WARM = 1;
3173 HOT = 2;
3174 COLD = 3;
3175 }
3176 // The transition type.
3177 optional TransitionType type = 3;
3178
3179 // The activity name.
3180 optional string activity_name = 4;
3181
3182 // The name of the calling app. Empty if not set.
3183 optional string calling_pkg_name = 5;
3184
3185 // Whether the app is an instant app.
3186 optional bool is_instant_app = 6;
3187
3188 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003189 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003190
Bookatz80d11a02018-01-16 10:46:35 -08003191 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003192
David Chen0b5c90c2018-01-25 16:51:49 -08003193 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003194 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003195 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003196 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003197 optional int32 bind_application_delay_millis = 11;
3198 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003199
3200 // Empty if not set.
3201 optional string launch_token = 13;
3202
Calin Juravle759fbda2018-02-20 19:52:30 +00003203 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003204 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003205
3206 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003207 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003208}
3209
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003210message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003211 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003212 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213
3214 // The app package name.
3215 optional string pkg_name = 2;
3216
3217 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003218 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003219 WARM = 1;
3220 HOT = 2;
3221 COLD = 3;
3222 }
3223 // The transition type.
3224 optional TransitionType type = 3;
3225
3226 // The activity name.
3227 optional string activity_name = 4;
3228}
3229
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003230message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003231 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003232 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003233
3234 // The app package name.
3235 optional string pkg_name = 2;
3236
3237 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003238 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003239 WITH_BUNDLE = 1;
3240 WITHOUT_BUNDLE = 2;
3241 }
3242 // The transition type.
3243 optional TransitionType type = 3;
3244
3245 // The activity name.
3246 optional string activity_name = 4;
3247
3248 optional bool transition_process_running = 5;
3249
3250 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003251 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003252}
3253
Bookatz8fcd09a2017-12-18 13:01:10 -08003254/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003255 * Logs a picture-in-picture action
3256 * Logged from:
3257 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3258 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3259 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3260 */
3261message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003262 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003263 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003264
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003265 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003266
Chenjie Yu52cacc62017-12-08 18:11:45 -08003267 enum State {
3268 ENTERED = 1;
3269 EXPANDED_TO_FULL_SCREEN = 2;
3270 MINIMIZED = 3;
3271 DISMISSED = 4;
3272 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003273 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003274}
3275
3276/**
Chenjie Yue8904192017-12-08 19:12:57 -08003277 * Logs overlay action
3278 * Logged from:
3279 * services/core/java/com/android/server/wm/Session.java
3280 */
3281message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003282 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003283
tsaichristine5adc7e02020-01-14 17:07:39 -08003284 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003285
3286 optional bool using_alert_window = 3;
3287
3288 enum State {
3289 ENTERED = 1;
3290 EXITED = 2;
3291 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003292 optional State state = 4 [
3293 (state_field_option).option = EXCLUSIVE_STATE,
3294 (state_field_option).nested = false,
3295 (state_field_option).default_state_value = 2
3296 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003297}
3298
Adam Bookatz38767932020-02-05 12:13:40 -08003299/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003300 * Logs foreground service starts and stops.
3301 * Note that this is not when a service starts or stops, but when it is
3302 * considered foreground.
3303 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003304 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003305 */
3306message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003307 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003308 // package_name + "/" + class_name
3309 optional string short_name = 2;
3310
3311 enum State {
3312 ENTER = 1;
3313 EXIT = 2;
3314 }
3315 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003316
3317 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3318 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3319 optional bool allow_while_in_use_permission = 4;
3320}
3321
3322/**
3323 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3324 * A foreground service session is any continuous period during which the uid holds at least one
3325 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3326 * Accesses initiated while the uid is in the TOP state are ignored.
3327 * Sessions with no attempted accesses are not logged.
3328 * Logged from
3329 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3330 */
3331message ForegroundServiceAppOpSessionEnded {
3332 optional int32 uid = 1 [(is_uid) = true];
3333
3334 // The operation's name.
3335 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3336 // Only these named ops are actually logged.
3337 enum AppOpName {
3338 OP_NONE = -1; // Also represents UNKNOWN.
3339 OP_COARSE_LOCATION = 0;
3340 OP_FINE_LOCATION = 1;
3341 OP_CAMERA = 26;
3342 OP_RECORD_AUDIO = 27;
3343 }
3344 optional AppOpName app_op_name = 2 [default = OP_NONE];
3345
3346 // The uid's permission mode for accessing the AppOp during this fgs session.
3347 enum Mode {
3348 MODE_UNKNOWN = 0;
3349 MODE_ALLOWED = 1; // Always allowed
3350 MODE_IGNORED = 2; // Denied
3351 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3352 }
3353 optional Mode app_op_mode = 3;
3354
3355 // Number of times this AppOp was requested and allowed.
3356 optional int32 count_ops_accepted = 4;
3357 // Number of times this AppOp was requested but denied.
3358 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003359}
3360
Chenjie Yue8904192017-12-08 19:12:57 -08003361/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003362 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3363 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3364 * attributed back to the parent (host) uid. One example is Chrome.
3365 *
3366 * Logged from:
3367 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3368 */
3369message IsolatedUidChanged {
3370 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003371 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003372 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003373 optional int32 parent_uid = 1;
3374
3375 optional int32 isolated_uid = 2;
3376
3377 // We expect an isolated uid to be removed before if it's used for another parent uid.
3378 enum Event {
3379 REMOVED = 0;
3380 CREATED = 1;
3381 }
3382 optional Event event = 3;
3383}
3384
3385/*
3386 * Logs the reception of an incoming network packet causing the main system to wake up for
3387 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3388 * and processed by WakeupController.cpp.
3389 */
3390message PacketWakeupOccurred {
3391 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3392 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003393 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003394 // The interface name on which the packet was received.
3395 optional string iface = 2;
3396 // The ethertype value of the packet.
3397 optional int32 ethertype = 3;
3398 // String representation of the destination MAC address of the packet.
3399 optional string destination_hardware_address = 4;
3400 // String representation of the source address of the packet if this was an IP packet.
3401 optional string source_ip = 5;
3402 // String representation of the destination address of the packet if this was an IP packet.
3403 optional string destination_ip = 6;
3404 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3405 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3406 // families.
3407 optional int32 ip_next_header = 7;
3408 // The source port if this was a TCP or UDP packet.
3409 optional int32 source_port = 8;
3410 // The destination port if this was a TCP or UDP packet.
3411 optional int32 destination_port = 9;
3412}
3413
3414/*
3415 * Logs the memory stats for an app on startup.
3416 * Logged from:
3417 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3418 */
3419message AppStartMemoryStateCaptured {
3420 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003421 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003422
3423 // The process name.
3424 optional string process_name = 2;
3425
3426 // The activity name.
3427 optional string activity_name = 3;
3428
3429 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003430 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003431
3432 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003433 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003434
3435 // RSS
3436 optional int64 rss_in_bytes = 6;
3437
3438 // CACHE
3439 optional int64 cache_in_bytes = 7;
3440
3441 // SWAP
3442 optional int64 swap_in_bytes = 8;
3443}
3444
3445/*
3446 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3447 * for LMK event.
3448 * Logged from:
3449 * system/core/lmkd/lmkd.c
3450 */
3451message LmkStateChanged {
3452 enum State {
3453 UNKNOWN = 0;
3454 START = 1;
3455 STOP = 2;
3456 }
3457 optional State state = 1;
3458}
3459
3460/*
3461 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3462 * Logged from:
3463 * system/core/lmkd/lmkd.c
3464 */
3465message LmkKillOccurred {
3466 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003467 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003468
3469 // The process name.
3470 optional string process_name = 2;
3471
3472 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003473 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003474
3475 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003476 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003477
3478 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003479 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003480
3481 // RSS
3482 optional int64 rss_in_bytes = 6;
3483
3484 // CACHE
3485 optional int64 cache_in_bytes = 7;
3486
3487 // SWAP
3488 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003489
3490 // The elapsed real time of start of the process.
3491 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003492
3493 // Min oom adj score considered by lmkd.
3494 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003495}
3496
Rajeev Kumar51b54602018-03-01 12:18:26 -08003497/*
3498 * Logs when the ActivityManagerService detects that an app died.
3499 *
3500 * Logged from:
3501 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3502 */
3503message AppDied {
3504 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003505 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003506}
3507
Howard Ro21a039c2018-08-06 14:55:47 -07003508/**
3509 * An atom for generic metrics logging. Available from Android Q.
3510 */
3511message GenericAtom {
3512 // The uid of the application that sent this custom atom.
3513 optional int32 uid = 1 [(is_uid) = true];
3514
3515 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003516 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003517}
3518
Tej Singhd6d6d772018-09-05 17:41:25 -07003519/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003520 * Atom for simple logging of user interaction and impression events, such as "the user touched
3521 * this button" or "this dialog was displayed".
3522 * Keep the UI event stream clean: don't use for system or background events.
3523 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003524 *
3525 * Logged from:
3526 * frameworks/base/services/core/java/com/android/server/
3527 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003528 */
3529message UiEventReported {
3530 // The event_id.
3531 optional int32 event_id = 1;
3532 // The event's source or target uid and package, if applicable.
3533 // For example, the package posting a notification, or the destination package of a share.
3534 optional int32 uid = 2 [(is_uid) = true];
3535 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003536 // An identifier used to disambiguate which logs refer to a particular instance of some
3537 // UI element. Useful when there might be multiple instances simultaneously active.
3538 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003539}
3540
3541/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003542 * Reports a notification was created or updated.
3543 *
3544 * Logged from:
3545 * frameworks/base/services/core/java/com/android/server/notification/
3546 */
3547message NotificationReported {
3548 // The event_id (as for UiEventReported).
3549 optional int32 event_id = 1;
3550 // The notifying app's uid and package.
3551 optional int32 uid = 2 [(is_uid) = true];
3552 optional string package_name = 3;
3553 // A small system-assigned identifier for the notification.
3554 // Locally probably-unique, but expect collisions across users and/or days.
3555 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003556 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3557 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003558
3559 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003560 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3561 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3562 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003563
3564 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003565 optional string category = 10; // App-assigned notification category (API-defined strings)
3566 optional int32 style = 11; // App-assigned notification style
3567 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003568
3569 // Ordering, importance and interruptiveness
3570
Will Brockman7614f6962020-02-10 19:43:03 -05003571 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003572
Will Brockman7614f6962020-02-10 19:43:03 -05003573 optional android.stats.sysui.NotificationImportance importance = 14;
3574 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003575
3576 enum NotificationImportanceExplanation {
3577 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3578 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3579 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3580 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3581 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3582 // Like _APP, but based on pre-channels priority signal.
3583 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3584 }
3585
Will Brockman7614f6962020-02-10 19:43:03 -05003586 optional NotificationImportanceExplanation importance_source = 16;
3587 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3588 optional NotificationImportanceExplanation importance_initial_source = 18;
3589 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3590 optional int32 assistant_hash = 20;
3591 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003592}
3593
3594message Notification {
3595 // The notifying app's uid and package.
3596 optional int32 uid = 1 [(is_uid) = true];
3597 optional string package_name = 2;
3598 // A small system-assigned identifier for the notification.
3599 optional int32 instance_id = 3;
3600
3601 // Grouping information.
3602 optional int32 group_instance_id = 4;
3603 optional bool is_group_summary = 5;
3604
3605 // The section of the shade that the notification is in.
3606 // See NotificationSectionsManager.PriorityBucket.
3607 enum NotificationSection {
3608 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003609 SECTION_HEADS_UP = 1;
3610 SECTION_PEOPLE = 2;
3611 SECTION_ALERTING = 3;
3612 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003613 }
3614 optional NotificationSection section = 6;
3615}
3616
3617message NotificationList {
3618 repeated Notification notifications = 1; // An ordered sequence of notifications.
3619}
3620
3621/**
3622 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3623 *
3624 * Logged from:
3625 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3626 */
3627message NotificationPanelReported {
3628 // The event_id (as for UiEventReported).
3629 optional int32 event_id = 1;
3630 optional int32 num_notifications = 2;
3631 // The notifications in the panel, in the order that they appear there.
3632 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3633}
3634
3635/**
3636 * Reports a notification channel, or channel group, was created, updated, or deleted.
3637 *
3638 * Logged from:
3639 * frameworks/base/services/core/java/com/android/server/notification/
3640 */
3641message NotificationChannelModified {
3642 // The event_id (as for UiEventReported).
3643 optional int32 event_id = 1;
3644 // The notifying app's uid and package.
3645 optional int32 uid = 2 [(is_uid) = true];
3646 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003647 // Hash of app-assigned notification channel ID or channel-group ID
3648 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003649 // Previous importance setting, if applicable
3650 optional android.stats.sysui.NotificationImportance old_importance = 5;
3651 // New importance setting
3652 optional android.stats.sysui.NotificationImportance importance = 6;
3653}
3654
3655
3656/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003657 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003658 *
3659 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003660 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003661 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003662message BiometricAcquired {
3663 // Biometric modality that was acquired.
3664 optional android.hardware.biometrics.ModalityEnum modality = 1;
3665 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3666 optional int32 user = 2;
3667 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3668 optional bool is_crypto = 3;
3669 // Action that the device is performing. Acquired messages are only expected for enroll and
3670 // authenticate. Other actions may indicate an error.
3671 optional android.hardware.biometrics.ActionEnum action = 4;
3672 // The client that this acquisition was received for.
3673 optional android.hardware.biometrics.ClientEnum client = 5;
3674 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3675 optional int32 acquire_info = 6;
3676 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3677 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003678 // Dictates if this message should trigger additional debugging.
3679 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003680}
3681
3682/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003683 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003684 *
3685 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003686 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003687 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003688message BiometricAuthenticated {
3689 // Biometric modality that was used.
3690 optional android.hardware.biometrics.ModalityEnum modality = 1;
3691 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3692 optional int32 user = 2;
3693 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3694 // storage.
3695 optional bool is_crypto = 3;
3696 // The client that this acquisition was received for.
3697 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003698 // If authentication requires user confirmation. See BiometricPrompt's
3699 // setRequireConfirmation(bool) method.
3700 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003701
Kevin Chyn1741a072019-01-17 11:54:40 -08003702 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003703 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003704 REJECTED = 1;
3705 PENDING_CONFIRMATION = 2;
3706 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003707 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003708
3709 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003710 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003711 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3712 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3713 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3714 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003715 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003716 // Dictates if this message should trigger additional debugging.
3717 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003718}
3719
3720/**
3721 * Logs when a biometric error occurs.
3722 *
3723 * Logged from:
3724 * frameworks/base/services/core/java/com/android/server/biometrics
3725 */
3726message BiometricErrorOccurred {
3727 // Biometric modality that was used.
3728 optional android.hardware.biometrics.ModalityEnum modality = 1;
3729 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3730 optional int32 user = 2;
3731 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3732 optional bool is_crypto = 3;
3733 // Action that the device is performing.
3734 optional android.hardware.biometrics.ActionEnum action = 4;
3735 // The client that this acquisition was received for.
3736 optional android.hardware.biometrics.ClientEnum client = 5;
3737 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3738 // are unique to modality.
3739 optional int32 error_info = 6;
3740 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3741 // by the vendor and not specified by the HIDL interface.
3742 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003743 // Dictates if this message should trigger additional debugging.
3744 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003745 // Time spent during the authentication attempt.
3746 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003747}
3748
3749/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003750 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003751 * Logged from:
3752 * frameworks/base/services/core/java/com/android/server/biometrics
3753 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003754message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003755 // Biometric modality.
3756 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003757 // Type of issue detected.
3758 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003759 // Dictates if this message should trigger additional debugging.
3760 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003761}
Howard Ro688ae182018-09-25 00:09:36 -07003762
joshmccloskey6f952b22019-03-25 20:59:35 -07003763/**
3764 * Logs when a biometric enrollment occurs.
3765 *
3766 * Logged from:
3767 * frameworks/base/services/core/java/com/android/server/biometrics
3768 */
3769message BiometricEnrolled {
3770 // Biometric modality that was used.
3771 optional android.hardware.biometrics.ModalityEnum modality = 1;
3772 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3773 optional int32 user = 2;
3774 // The amount of time the enrollment took in milliseconds.
3775 optional int64 latency_millis = 3;
3776 // Whether or not the enrollment was successful.
3777 optional bool success = 4;
3778}
3779
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003780/*
Tej Singh0d176952019-01-16 19:10:54 -08003781 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003782 */
Tej Singh0d176952019-01-16 19:10:54 -08003783message FlagFlipUpdateOccurred {
3784 // If the event is from a flag config package, specify the package name.
3785 optional string flag_flip_package_name = 1;
3786
3787 // The order id of the package
3788 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003789}
3790
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003791/**
3792 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003793 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003794 */
3795message TrainExperimentIds {
3796 repeated int64 experiment_id = 1;
3797}
3798
Yangster-macb89807e2018-11-15 21:10:57 -08003799/*
3800 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003801 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003802 */
3803message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003804 // Name of the train.
3805 optional string train_name = 1;
3806 // Version code for a "train" of packages that need to be installed atomically
3807 optional int64 train_version_code = 2;
3808 // After installation of this package, device requires a restart.
3809 optional bool requires_staging = 3;
3810 // Rollback should be enabled for this install.
3811 optional bool rollback_enabled = 4;
3812 // Requires low latency monitoring if possible.
3813 optional bool requires_low_latency_monitor = 5;
3814
Yangster-macb89807e2018-11-15 21:10:57 -08003815 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003816 UNKNOWN = 0;
3817 INSTALL_REQUESTED = 1;
3818 INSTALL_STARTED = 2;
3819 INSTALL_STAGED_NOT_READY = 3;
3820 INSTALL_STAGED_READY = 4;
3821 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003822 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3823 // and INSTALL_FAILURE_COMMIT.
3824 INSTALL_FAILURE = 6 [deprecated = true];
3825 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003826 INSTALL_CANCELLED = 7;
3827 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003828 INSTALLER_ROLLBACK_INITIATED = 9;
3829 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3830 INSTALLER_ROLLBACK_STAGED = 11;
3831 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3832 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3833 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3834 INSTALLER_ROLLBACK_SUCCESS = 15;
3835 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003836 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3837 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3838 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3839 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3840 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3841 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003842 INSTALL_FAILURE_DOWNLOAD = 23;
3843 INSTALL_FAILURE_STATE_MISMATCH = 24;
3844 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003845 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003846 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003847 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003848 // Possible experiment ids for monitoring this push.
3849 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3850 // user id
3851 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003852 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003853 // Whether or not this is a rollback event
3854 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003855}
3856
Tej Singhc9203082019-05-03 13:42:23 -07003857/* Test atom, is not logged anywhere */
3858message TestAtomReported {
3859 repeated AttributionNode attribution_node = 1;
3860 optional int32 int_field = 2;
3861 optional int64 long_field = 3;
3862 optional float float_field = 4;
3863 optional string string_field = 5;
3864 optional bool boolean_field = 6;
3865 enum State {
3866 UNKNOWN = 0;
3867 OFF = 1;
3868 ON = 2;
3869 }
3870 optional State state = 7;
3871 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3872}
3873
Maggie Whitefc1aa592018-11-28 21:55:23 -08003874/** Represents USB port overheat event. */
3875message UsbPortOverheatEvent {
3876 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3877 optional int32 plug_temperature_deci_c = 1;
3878
3879 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3880 optional int32 max_temperature_deci_c = 2;
3881
3882 /* Time between USB plug event and overheat threshold trip, in seconds. */
3883 optional int32 time_to_overheat_secs = 3;
3884
3885 /* Time between overheat threshold trip and hysteresis, in seconds. */
3886 optional int32 time_to_hysteresis_secs = 4;
3887
3888 /* Time between hysteresis and active mitigation ending, in seconds. */
3889 optional int32 time_to_inactive_secs = 5;
3890};
3891
Maggie White8735b852019-01-18 11:40:49 -08003892/**
3893 * Logs total effective full charge and discharge cycles on a battery.
3894 * Here are some examples of one effective cycle:
3895 * 1) the battery charges from 0% to 100% and drains back to 0%,
3896 * 2) charging from 50% to 100% and draining back to 50% twice.
3897 * Pulled from:
3898 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3899 */
3900message BatteryCycleCount {
3901 /* Number of total charge and discharge cycles on the system battery. */
3902 optional int32 cycle_count = 1;
3903}
3904
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003905/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003906 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3907 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003908 * Pulled from:
3909 * StatsCompanionService
3910 */
3911
Carmen Agimof12dec122019-03-06 16:14:38 +00003912message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003913
Carmen Agimof12dec122019-03-06 16:14:38 +00003914 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003915 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003916 PUBLIC = 1;
3917 PRIVATE = 2;
3918 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003919 }
3920
Carmen Agimof12dec122019-03-06 16:14:38 +00003921 // The type of external storage.
3922 optional android.stats.storage.ExternalStorageType storage_type = 1;
3923 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3924 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003925 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003926 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003927}
3928
Yangster-macb89807e2018-11-15 21:10:57 -08003929/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003930 * Logs when a connection becomes available and lost.
3931 * Logged in StatsCompanionService.java
3932 */
3933message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003934 // Id of the network.
3935 optional int32 net_id = 1;
3936
3937 enum State {
3938 UNKNOWN = 0;
3939 CONNECTED = 1;
3940 DISCONNECTED = 2;
3941 }
3942 // Connected state of a network.
3943 optional State state = 2;
3944}
3945
3946/**
3947 * Logs when a service starts and stops.
3948 * Logged from:
3949 * services/core/java/com/android/server/am/ActiveServices.java
3950 */
3951message ServiceStateChanged {
3952
3953 optional int32 uid = 1 [(is_uid) = true];
3954
3955 optional string package_name = 2;
3956
3957 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003958
3959 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003960 START = 1;
3961 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003962 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003963
3964 optional State state = 4;
3965}
3966
3967/**
3968 * Logs when a service is launched.
3969 * Logged from:
3970 * services/core/java/com/android/server/am/ActiveServices.java
3971 */
3972message ServiceLaunchReported {
3973
3974 optional int32 uid = 1 [(is_uid) = true];
3975
3976 optional string package_name = 2;
3977
3978 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003979}
Howard Ro688ae182018-09-25 00:09:36 -07003980
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003981/**
3982 * Logs when a hidden API is used.
3983 *
3984 * Logged from:
3985 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3986 */
3987message HiddenApiUsed {
3988 // The uid of the app making the hidden access.
3989 optional int32 uid = 1 [(is_uid) = true];
3990
3991 // Signature of the method or field accessed.
3992 optional string signature = 2;
3993
3994 enum AccessMethod {
3995 NONE = 0;
3996 REFLECTION = 1;
3997 JNI = 2;
3998 LINKING = 3;
3999 }
4000
4001 // Type of access.
4002 optional AccessMethod access_method = 3;
4003
4004 // Whether the access was prevented or not.
4005 optional bool access_denied = 4;
4006}
4007
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004008/**
4009 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4010 * - When user sees privacy chip
4011 * - When user clicks privacy chip
4012 * - How does the user exit the Privacy Dialog
4013 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004014 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4015 */
4016message PrivacyIndicatorsInteracted {
4017
4018 enum Type {
4019 UNKNOWN = 0;
4020 CHIP_VIEWED = 1;
4021 CHIP_CLICKED = 2;
4022 DIALOG_PRIVACY_SETTINGS = 3;
4023 DIALOG_DISMISS = 4;
4024 DIALOG_LINE_ITEM = 5;
4025 }
4026
tsaichristine5adc7e02020-01-14 17:07:39 -08004027 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004028
4029 // Used if the type is LINE_ITEM
4030 optional string package_name = 2;
4031}
4032
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004033/**
4034 * Logs information about a package that is moved from the internal to external storage and vice
4035 * versa.
4036 * It logs the package name, the type of the external storage where the package is installed
4037 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4038 * and the move type: if it's from internal to external or the other way around.
4039 *
4040 * Logged from:
4041 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4042 */
4043message AppMovedStorageReported {
4044 enum MoveType {
4045 UNKNOWN = 0;
4046 TO_EXTERNAL = 1;
4047 TO_INTERNAL = 2;
4048 }
4049 // The type of the external storage.
4050 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4051 // The type of move.
4052 optional MoveType move_type = 2;
4053 // The name of the package that was moved.
4054 optional string package_name = 3;
4055}
4056
jianjin8f2dee02019-03-29 14:03:08 -07004057/**
4058 * Logs when system server watchdog occurs.
4059 * Logged from:
4060 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4061 */
4062message SystemServerWatchdogOccurred {
4063 optional string subject = 1;
4064}
4065
4066/**
4067 * Logs when new file added to tombstones.
4068 * Logged from:
4069 * frameworks/base/core/java/com/android/server/BootReceiver.java
4070 */
4071message TombStoneOccurred {
4072}
4073
Hai Zhang5d3328d2019-04-13 21:25:06 +08004074/*
4075 * Information about a role request
4076 *
4077 * Logged from:
4078 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4079 */
4080message RoleRequestResultReported {
4081 // UID of application requesting the role
4082 optional int32 requesting_uid = 1;
4083
4084 // Package name of application requesting the role
4085 optional string requesting_package_name = 2;
4086
4087 // The role to be granted
4088 optional string role_name = 3;
4089
4090 // The count of applications qualifying for the role
4091 optional int32 qualifying_count = 4;
4092
4093 // UID of application current granted the role
4094 optional int32 current_uid = 5;
4095
4096 // Package name of application current granted the role
4097 optional string current_package_name = 6;
4098
4099 // UID of another application that user chose to grant the role to, instead of the requesting
4100 // application
4101 optional int32 granted_another_uid = 7;
4102
4103 // Package name of another application that user chose to grant the role to, instead of the
4104 // requesting application
4105 optional string granted_another_package_name = 8;
4106
4107 enum Result {
4108 UNDEFINED = 0;
4109 // role request was ignored
4110 IGNORED = 1;
4111 // role request was ignored because it's already granted
4112 IGNORED_ALREADY_GRANTED = 2;
4113 // role request was ignored because the application isn't qualified
4114 IGNORED_NOT_QUALIFIED = 3;
4115 // role request was ignored because user said it should be always denied
4116 IGNORED_USER_ALWAYS_DENIED = 4;
4117 // role was granted by user action
4118 USER_GRANTED = 5;
4119 // role was denied by user action
4120 USER_DENIED = 6;
4121 // role was denied by user granting another application the role
4122 USER_DENIED_GRANTED_ANOTHER = 7;
4123 // role was denied and set to be always denied by the user
4124 USER_DENIED_WITH_ALWAYS = 8;
4125 }
4126 // The result of the role request
4127 optional Result result = 9;
4128}
4129
Mark Tabrya824a642019-11-05 12:26:12 -08004130/**
4131 * Logs when a Vehicle Maps Service client's connection state has changed
4132 *
4133 * Logged from:
4134 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4135 */
4136message VmsClientConnectionStateChanged {
4137 // The UID of the VMS client app
4138 optional int32 uid = 1 [(is_uid) = true];
4139
4140 enum State {
4141 UNKNOWN = 0;
4142 // Attempting to connect to the client
4143 CONNECTING = 1;
4144 // Client connection established
4145 CONNECTED = 2;
4146 // Client connection closed unexpectedly
4147 DISCONNECTED = 3;
4148 // Client connection closed by VMS
4149 TERMINATED = 4;
4150 // Error establishing the client connection
4151 CONNECTION_ERROR = 5;
4152 }
4153
4154 optional State state = 2;
4155}
4156
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004157/**
4158 * Logs when MediaProvider has successfully finished scanning a storage volume.
4159 *
4160 * Logged from:
4161 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4162 */
4163message MediaProviderScanEvent {
4164 enum Reason {
4165 // Scan triggered due to unknown reason
4166 UNKNOWN = 0;
4167 // Scan triggered due to storage volume being mounted
4168 MOUNTED = 1;
4169 // Scan triggered due to explicit user action or app request
4170 DEMAND = 2;
4171 // Scan triggered due to idle maintenance
4172 IDLE = 3;
4173 }
4174
4175 // Volume type that this event pertains to
4176 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4177 // Reason why this scan was triggered
4178 optional Reason reason = 2;
4179 // Total number of files scanned
4180 optional int64 item_count = 3;
4181 // Duration of scan, normalized per file
4182 optional float normalized_duration_millis = 4;
4183 // Number of database inserts, normalized per file
4184 optional float normalized_insert_count = 5;
4185 // Number of database updates, normalized per file
4186 optional float normalized_update_count = 6;
4187 // Number of database deletes, normalized per file
4188 optional float normalized_delete_count = 7;
4189}
4190
4191/**
4192 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4193 *
4194 * Logged from:
4195 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4196 */
4197message MediaProviderDeletionEvent {
4198 // Volume type that this event pertains to
4199 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4200 // Device timestamp when this deletion event occurred
4201 optional int64 timestamp_millis = 2;
4202 // App that requested deletion
4203 optional string package_name = 3;
4204 // Number of items that were deleted
4205 optional int32 item_count = 4;
4206}
4207
4208/**
4209 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4210 *
4211 * Logged from:
4212 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4213 */
4214message MediaProviderPermissionEvent {
4215 enum Result {
4216 UNKNOWN = 0;
4217 USER_GRANTED = 1;
4218 AUTO_GRANTED = 2;
4219 USER_DENIED = 3;
4220 USER_DENIED_WITH_PREJUDICE = 4;
4221 AUTO_DENIED = 5;
4222 }
4223
4224 // Volume type that this event pertains to
4225 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4226 // Device timestamp when this permission event occurred
4227 optional int64 timestamp_millis = 2;
4228 // App that requested permission
4229 optional string package_name = 3;
4230 // Number of items that were requested
4231 optional int32 item_count = 4;
4232 // Result of this request
4233 optional Result result = 5;
4234}
4235
4236/**
4237 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4238 *
4239 * Logged from:
4240 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4241 */
4242message MediaProviderSchemaChange {
4243 // Volume type that this event pertains to
4244 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4245 // Old database version code
4246 optional int32 version_from = 2;
4247 // New database version code
4248 optional int32 version_to = 3;
4249 // Total number of files in database
4250 optional int64 item_count = 4;
4251 // Duration of schema change, normalized per file
4252 optional float normalized_duration_millis = 5;
4253}
4254
4255/**
4256 * Logs when MediaProvider has finished an idle maintenance job.
4257 *
4258 * Logged from:
4259 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4260 */
4261message MediaProviderIdleMaintenance {
4262 // Volume type that this event pertains to
4263 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4264
4265 // Total number of files in database
4266 optional int64 item_count = 2;
4267 // Duration of idle maintenance, normalized per file
4268 optional float normalized_duration_millis = 3;
4269 // Number of thumbnails found to be stale, normalized per file
4270 optional float normalized_stale_thumbnails = 4;
4271 // Number of items found to be expired, normalized per file
4272 optional float normalized_expired_media = 5;
4273}
4274
Keun young Park3e033cb2019-12-18 11:27:35 -08004275/**
4276 * Represents boot time event with duration in ms.
4277 *
4278 * Logged from: bootstat and various system server components. Check each enums for details.
4279 */
4280message BootTimeEventDuration {
4281 enum DurationEvent {
4282 UNKNOWN = 0;
4283 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4284 ABSOLUTE_BOOT_TIME = 1;
4285 // Bootloader's 1st stage execution time.
4286 // Logged from bootstat.
4287 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4288 // Bootloader's 1st stage loading time.
4289 // Logged from bootstat.
4290 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4291 // Bootloader's kernel loading time.
4292 // Logged from bootstat.
4293 BOOTLOADER_KERNEL_LOAD = 4;
4294 // Bootloader's 2nd stage execution time.
4295 // Logged from bootstat.
4296 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4297 // Bootloader's 2nd stage loading time.
4298 // Logged from bootstat.
4299 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4300 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4301 // for locked device.
4302 // Logged from bootstat.
4303 BOOTLOADER_UI_WAIT = 7;
4304 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4305 // Logged from bootstat.
4306 BOOTLOADER_TOTAL = 8;
4307 // Shutdown duration inside init for the reboot before the current boot up.
4308 // Logged from f/b/services/.../BootReceiver.java.
4309 SHUTDOWN_DURATION = 9;
4310 // Total time for mounting of disk devices during bootup.
4311 // Logged from f/b/services/.../BootReceiver.java.
4312 MOUNT_DEFAULT_DURATION = 10;
4313 // Total time for early stage mounting of disk devices during bootup.
4314 // Logged from f/b/services/.../BootReceiver.java.
4315 MOUNT_EARLY_DURATION = 11;
4316 // Total time for late stage mounting of disk devices during bootup.
4317 // Logged from f/b/services/.../BootReceiver.java.
4318 MOUNT_LATE_DURATION = 12;
4319 // Average time to scan non-system app after OTA
4320 // Logged from f/b/services/.../PackageManagerService.java
4321 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4322 // Time to initialize Package manager after OTA
4323 // Logged from f/b/services/.../PackageManagerService.java
4324 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4325 // Time to scan all system app from Package manager after OTA
4326 // Logged from f/b/services/.../PackageManagerService.java
4327 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4328 // Init's total time for cold boot stage.
4329 // Logged from bootstat.
4330 COLDBOOT_WAIT = 16;
4331 // Init's total time for initializing selinux.
4332 // Logged from bootstat.
4333 SELINUX_INIT = 17;
4334 // Time since last factory reset.
4335 // Logged from bootstat.
4336 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004337 // Init's total time spent for completing the 1st stage.
4338 // Logged from bootstat.
4339 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004340 }
4341
4342 // Type of the event.
4343 optional DurationEvent event = 1;
4344 // Duration of the event in ms.
4345 optional int64 duration_millis = 2;
4346}
4347
4348/**
4349 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4350 * since boot-up.
4351 *
4352 * Logged from: bootstat and various system server components. Check each enums for details.
4353 */
4354message BootTimeEventElapsedTime {
4355 enum ElapsedTimeEvent {
4356 UNKNOWN = 0;
4357 // Time when init starts 1st stage. Logged from bootstat.
4358 ANDROID_INIT_STAGE_1 = 1;
4359 // Time when sys.boot_completed prop is set.
4360 // Logged from bootstat.
4361 BOOT_COMPLETE = 2;
4362 // BOOT_COMPLETE for encrypted device.
4363 BOOT_COMPLETE_ENCRYPTION = 3;
4364 // BOOT_COMPLETE for device with no encryption.
4365 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4366 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004367 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004368 // BOOT_COMPLETE after factory reset.
4369 FACTORY_RESET_BOOT_COMPLETE = 6;
4370 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4371 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004372 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4373 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004374 // BOOT_COMPLETE after OTA.
4375 OTA_BOOT_COMPLETE = 9;
4376 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4377 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004378 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4379 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004380 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4381 // Logged from f/b/services/.../UserController.java
4382 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4383 // Time when the system starts sending BOOT_COMPLETED broadcast.
4384 // Logged from f/b/services/.../UserController.java
4385 FRAMEWORK_BOOT_COMPLETED = 13;
4386 // Time when the package manager starts init.
4387 // Logged from f/b/services/.../SystemServer.java
4388 PACKAGE_MANAGER_INIT_START = 14;
4389 // Time when package manager is ready
4390 // Logged from f/b/services/.../SystemServer.java
4391 PACKAGE_MANAGER_INIT_READY = 15;
4392 // Represents the time when user has entered unlock credential for system with user pin.
4393 // Logged from bootstat.
4394 POST_DECRYPT = 16;
4395 // Represents the start of zygote's init.
4396 // Logged from zygote itself.
4397 ZYGOTE_INIT_START = 17;
4398 // Represents the start of secondary zygote's init.
4399 // TODO: add logging to zygote
4400 SECONDARY_ZYGOTE_INIT_START = 18;
4401 // Represents the start of system server's init.
4402 // Logged from f/b/services/.../SystemServer.java
4403 SYSTEM_SERVER_INIT_START = 19;
4404 // Represents the completion of system server's init.
4405 // Logged from f/b/services/.../SystemServer.java
4406 SYSTEM_SERVER_READY = 20;
4407 // Represents the start of launcher during boot-up.
4408 // TODO: add logging
4409 LAUNCHER_START = 21;
4410 // Represents the completion of launcher's initial rendering. User can use other apps from
4411 // launcher from this point.
4412 // TODO: add logging
4413 LAUNCHER_SHOWN = 22;
4414 }
4415
4416 // Type of the event.
4417 optional ElapsedTimeEvent event = 1;
4418 // Time since bootup for the event.
4419 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4420 optional int64 time_millis = 2;
4421}
4422
4423/**
4424 * Boot time events with UTC time.
4425 *
4426 * Logged from: bootstat and various system server components. Check each enums for details.
4427 */
4428message BootTimeEventUtcTime {
4429 enum UtcTimeEvent {
4430 UNKNOWN = 0;
4431 // Time of the bootstat's marking of 1st boot after the last factory reset.
4432 // Logged from bootstat.
4433 FACTORY_RESET_RESET_TIME = 1;
4434 // The time when bootstat records FACTORY_RESET_* events. This is close to
4435 // BOOT_COMPLETE time for the current bootup.
4436 // Logged from bootstat.
4437 FACTORY_RESET_CURRENT_TIME = 2;
4438 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4439 // Logged from bootstat.
4440 FACTORY_RESET_RECORD_VALUE = 3;
4441 }
4442
4443 // Type of the event.
4444 optional UtcTimeEvent event = 1;
4445 // UTC time for the event.
4446 optional int64 utc_time_secs = 2;
4447}
4448
4449/**
4450 * Boot time events representing specific error code during bootup.
4451 * Meaning of error code can be different per each event type.
4452 *
4453 * Logged from: bootstat and various system server components. Check each enums for details.
4454 */
4455message BootTimeEventErrorCode {
4456 enum ErrorCodeEvent {
4457 UNKNOWN = 0;
4458 // Linux error code for time() call to get the current UTC time.
4459 // Logged from bootstat.
4460 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4461 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4462 // as UMOUNT_STAT_* from init/reboot.cpp.
4463 // Logged from f/b/services/.../BootReceiver.java.
4464 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004465 // Reprepsents fie system mounting error code of /data partition for the current boot.
4466 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004467 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004468 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004469 }
4470
4471 // Type of the event.
4472 optional ErrorCodeEvent event = 1;
4473 // error code defined per each event type.
4474 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4475 // FS_MGR_FS_STAT.
4476 optional int32 error_code = 2;
4477}
4478
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004479/**
4480 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4481 * after an OTA.
4482 *
4483 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004484 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004485 */
4486message SnapshotMergeReported {
4487 // Keep in sync with
4488 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4489 enum UpdateState {
4490 // No update or merge is in progress.
4491 NONE = 0;
4492 // An update is applying; snapshots may already exist.
4493 INITIATED = 1;
4494 // An update is pending, but has not been successfully booted yet.
4495 UNVERIFIED = 2;
4496 // The kernel is merging in the background.
4497 MERGING = 3;
4498 // Post-merge cleanup steps could not be completed due to a transient
4499 // error, but the next reboot will finish any pending operations.
4500 MERGE_NEEDS_REBOOT = 4;
4501 // Merging is complete, and needs to be acknowledged.
4502 MERGE_COMPLETED = 5;
4503 // Merging failed due to an unrecoverable error.
4504 MERGE_FAILED = 6;
4505 // The update was implicitly cancelled, either by a rollback or a flash
4506 // operation via fastboot. This state can only be returned by WaitForMerge.
4507 CANCELLED = 7;
4508 };
4509
4510 // Status of the update after the merge attempts.
4511 optional UpdateState final_state = 1;
4512
4513 // Time to complete a merge operation in milliseconds.
4514 // A negative value corresponds to the case in which the merge operation
4515 // was interrupted and resumed (e.g. in case of a system reboot during the
4516 // merge).
4517 optional int64 duration_millis = 2;
4518
4519 // Number of reboots that occurred after issuing and before completing the
4520 // merge of all the snapshot devices.
4521 optional int32 intermediate_reboots = 3;
4522}
4523
Chenjie Yubbcbc602018-02-05 16:51:52 -08004524//////////////////////////////////////////////////////////////////////
4525// Pulled atoms below this line //
4526//////////////////////////////////////////////////////////////////////
4527
4528/**
David Chenc8a43242017-10-17 16:23:28 -07004529 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4530 *
4531 * Pulled from:
4532 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4533 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004534message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004535 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004536
4537 optional int64 rx_bytes = 2;
4538
4539 optional int64 rx_packets = 3;
4540
4541 optional int64 tx_bytes = 4;
4542
4543 optional int64 tx_packets = 5;
4544}
4545
4546/**
4547 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4548 *
4549 * Pulled from:
4550 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4551 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004552message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004553 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004554
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004555 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4556 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004557
4558 optional int64 rx_bytes = 3;
4559
4560 optional int64 rx_packets = 4;
4561
4562 optional int64 tx_bytes = 5;
4563
4564 optional int64 tx_packets = 6;
4565}
4566
4567/**
4568 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4569 *
4570 * Pulled from:
4571 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4572 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004573message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004574 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004575
4576 optional int64 rx_bytes = 2;
4577
4578 optional int64 rx_packets = 3;
4579
4580 optional int64 tx_bytes = 4;
4581
4582 optional int64 tx_packets = 5;
4583}
4584
4585/**
4586 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4587 *
4588 * Pulled from:
4589 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4590 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004591message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004592 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004593
Yao Chenc40a19d2018-03-15 16:48:25 -07004594 // 1 denotes foreground and 0 denotes background. This is called Set in
4595 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004596 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004597
4598 optional int64 rx_bytes = 3;
4599
4600 optional int64 rx_packets = 4;
4601
4602 optional int64 tx_bytes = 5;
4603
4604 optional int64 tx_packets = 6;
4605}
4606
4607/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004608 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4609 *
4610 * Pulled from:
4611 * StatsCompanionService
4612 */
4613message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004614 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004615
4616 optional int64 rx_bytes = 2;
4617
4618 optional int64 tx_bytes = 3;
4619}
4620
4621/**
David Chenc8a43242017-10-17 16:23:28 -07004622 * Pulls the kernel wakelock durations. This atom is adapted from
4623 * android/internal/os/KernelWakelockStats.java
4624 *
4625 * Pulled from:
4626 * StatsCompanionService using KernelWakelockReader.
4627 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004628message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004629 optional string name = 1;
4630
4631 optional int32 count = 2;
4632
4633 optional int32 version = 3;
4634
Yangster-maca8a30442018-10-13 23:46:34 -07004635 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004636}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004637
Chenjie Yu05013b32017-11-21 10:21:41 -08004638/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004639 * Pulls low power state information. If power.stats HAL is not available, this
4640 * includes platform and subsystem sleep state information,
4641 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4642 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004643 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004644 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004645 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4646 * as defined in:
4647 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004648 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004649message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004650 // Subsystem name
4651 optional string subsystem_name = 1;
4652 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4653 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004654 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4655 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004656 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004657 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004658 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004659 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004660 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004661}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004662
Chenjie Yu05013b32017-11-21 10:21:41 -08004663/**
Bookatz92da2832018-11-01 18:10:03 -07004664 * Pulls on-device power measurement information.
4665 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4666 * Pulled from:
4667 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4668 */
4669message OnDevicePowerMeasurement {
4670 // Name of the subsystem (to which the rail belongs).
4671 optional string subsystem_name = 1;
4672
4673 // Rail name. The rail lies within the subsystem.
4674 optional string rail_name = 2;
4675
4676 // Time (in ms since boot) at which the rail energy value was measured.
4677 // This may differ slightly from the time that statsd logs this information.
4678 optional uint64 measurement_timestamp_millis = 3;
4679
4680 // Accumulated energy used via the rail since device boot in uWs.
4681 optional uint64 energy_microwatt_secs = 4;
4682}
4683
4684/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004685 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004686 * Pulls the time the cpu spend on the frequency index. Frequency index
4687 * starts from highest to lowest. The value should be monotonically
4688 * increasing since boot. However, if there is a cpu
4689 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004690 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004691message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004692 optional uint32 cluster = 1;
4693 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004694 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004695}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004696
Chenjie Yu05013b32017-11-21 10:21:41 -08004697/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004698 * Pulls Cpu Time Per Uid.
4699 * Note that isolated process uid time should be attributed to host uids.
4700 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004701message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004702 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004703 optional uint64 user_time_micros = 2;
4704 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004705}
4706
4707/**
4708 * Pulls Cpu Time Per Uid per frequency.
4709 * Note that isolated process uid time should be attributed to host uids.
4710 * For each uid, we order the time by descending frequencies.
4711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004712message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004713 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004714 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004715 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004716}
Hugo Benichi884970e2017-11-14 22:42:46 +09004717
Chenjie Yu05013b32017-11-21 10:21:41 -08004718/**
4719 * Pulls Wifi Controller Activity Energy Info
4720 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004721message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004722 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004723 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004724 // stack reported state
4725 // TODO: replace this with proto enum
4726 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004727 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004728 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004729 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004730 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004731 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004732 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004733 // product of current(mA), voltage(V) and time(ms)
4734 optional uint64 controller_energy_used = 6;
4735}
4736
4737/**
4738 * Pulls Modem Activity Energy Info
4739 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004740message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004741 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004742 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004743 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004744 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004745 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004746 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004747 /**
4748 * Tx power index
4749 * index 0 = tx_power < 0dBm
4750 * index 1 = 0dBm < tx_power < 5dBm
4751 * index 2 = 5dBm < tx_power < 15dBm
4752 * index 3 = 15dBm < tx_power < 20dBm
4753 * index 4 = tx_power > 20dBm
4754 */
4755 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004758 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004759 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004760 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004761 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004762 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004763 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004764 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004765 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004766 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004767 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004768 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004769}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004770
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004771/**
4772 * Pulls Bluetooth Activity Energy Info
4773 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4774 */
4775message BluetoothActivityInfo {
4776 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004777 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004778 // bluetooth stack state
4779 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004780 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004781 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004782 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004783 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004784 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004785 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004786 // product of current(mA), voltage(V) and time(ms)
4787 optional uint64 energy_used = 6;
4788}
4789
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004790/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004791 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004792 *
4793 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004794 */
4795message ProcessMemoryState {
4796 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004797 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004798
4799 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004800 // Usually package name, "system" for system server.
4801 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004802 optional string process_name = 2;
4803
Rafal Slawikda51b932018-12-13 16:31:33 +00004804 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004805 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004806
4807 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004808 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004809
4810 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004811 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004812
Rajeev Kumar90235992018-01-29 11:06:48 -08004813 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004814 // Value is read from memory.stat, field total_rss if per-app memory
4815 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004816 optional int64 rss_in_bytes = 6;
4817
4818 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004819 // Value is read from memory.stat, field total_cache if per-app memory
4820 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004821 optional int64 cache_in_bytes = 7;
4822
4823 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004824 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004825 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004826 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004827
Rafal Slawik203c3db2019-09-25 19:53:01 +01004828 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004829 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004830
Rafal Slawik203c3db2019-09-25 19:53:01 +01004831 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4832 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004833
Rafal Slawik203c3db2019-09-25 19:53:01 +01004834 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4835 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004836}
4837
4838/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004839 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004840 *
4841 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4842 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004843 *
4844 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004845 */
4846message ProcessMemoryHighWaterMark {
4847 // The uid if available. -1 means not available.
4848 optional int32 uid = 1 [(is_uid) = true];
4849
Rafal Slawikda51b932018-12-13 16:31:33 +00004850 // The process name.
4851 // Usually package name or process cmdline.
4852 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004853 optional string process_name = 2;
4854
Rafal Slawik239b6802019-09-09 18:46:01 +01004855 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4856 // computed by converting kilobytes to bytes.
4857 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4858
Rafal Slawik3bea8952018-11-15 12:39:33 +00004859 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4860 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004861 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004862}
4863
4864/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004865 * Logs the memory stats for a process.
4866 *
4867 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4868 * and for selected native processes.
4869 */
4870message ProcessMemorySnapshot {
4871 // The uid if available. -1 means not available.
4872 optional int32 uid = 1 [(is_uid) = true];
4873
4874 // The process name.
4875 // Usually package name or process cmdline.
4876 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4877 optional string process_name = 2;
4878
4879 // The pid of the process.
4880 // Allows to disambiguate instances of the process.
4881 optional int32 pid = 3;
4882
4883 // The current OOM score adjustment value.
4884 // Read from ProcessRecord for managed processes.
4885 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4886 optional int32 oom_score_adj = 4;
4887
4888 // The current RSS of the process.
4889 // VmRSS from /proc/pid/status.
4890 optional int32 rss_in_kilobytes = 5;
4891
4892 // The current anon RSS of the process.
4893 // RssAnon from /proc/pid/status.
4894 optional int32 anon_rss_in_kilobytes = 6;
4895
4896 // The current swap size of the process.
4897 // VmSwap from /proc/pid/status.
4898 optional int32 swap_in_kilobytes = 7;
4899
4900 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4901 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4902}
4903
4904/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004905 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004906 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004907message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004908 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004909}
4910
4911/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004912 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004913 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004914message SystemUptime {
4915 // Milliseconds since the system was booted.
4916 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4917 // for external input).
4918 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004919 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004920}
4921
4922/*
4923 * Reads from /proc/uid_concurrent_active_time which has the format:
4924 * active: X (X is # cores)
4925 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4926 * [uid1]: [time-0] [time-1] [time-2] ... ...
4927 * ...
4928 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4929 * The file contains a monotonically increasing count of time for a single boot.
4930 */
4931message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004932 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004933 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004934}
4935
4936/**
4937 * Reads from /proc/uid_concurrent_policy_time which has the format:
4938 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4939 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4940 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4941 * ...
4942 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4943 * The file contains a monotonically increasing count of time for a single boot.
4944 */
4945message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004946 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004947 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004948 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004949}
4950
4951/*
4952 * Pulls free disk space, for data, system partition and temporary directory.
4953 */
4954message DiskSpace {
4955 // available bytes in data partition
4956 optional uint64 data_available_bytes = 1;
4957 // available bytes in system partition
4958 optional uint64 system_available_bytes = 2;
4959 // available bytes in download cache or temp directories
4960 optional uint64 temp_available_bytes = 3;
4961}
Tej Singhbf972d92018-01-10 20:51:13 -08004962
4963/**
4964 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004965 *
4966 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004967 */
4968message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004969 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004970}
4971
4972/**
4973 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004974 * Pulled from:
4975 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004976 */
4977message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004978 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004979}
4980
4981/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004982 * Pulls battery voltage.
4983 * Pulled from:
4984 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4985 */
4986message BatteryVoltage {
4987 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004988 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004989}
4990
4991/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004992 * Pulls battery level (percent full, from 0 to 100).
4993 *
4994 * Pulled from:
4995 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4996 */
4997message BatteryLevel {
4998 // Battery level. Should be in [0, 100].
4999 optional int32 battery_level = 1;
5000}
5001
5002/**
Tej Singhd89137e2018-03-26 14:51:40 -07005003 * Pulls the temperature of various parts of the device.
5004 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005005 *
Maggie White442b6312019-04-05 16:26:44 -07005006 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005007 */
5008message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005009 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005010 optional android.os.TemperatureTypeEnum sensor_location = 1;
5011
5012 // The name of the temperature source. Eg. CPU0
5013 optional string sensor_name = 2;
5014
Tej Singhd89137e2018-03-26 14:51:40 -07005015 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005016 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005017 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005018
5019 // Relative severity of the throttling, see enum definition.
5020 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005021}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005022
5023/**
5024 * Pulls the statistics of calls to Binder.
5025 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005026 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5027 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005028 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005029 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005030 */
5031message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005032 // UID of the process responsible for the binder transaction. It will be set if the process
5033 // executing the binder transaction attribute the transaction to another uid using
5034 // Binder.setThreadWorkSource().
5035 //
5036 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005037 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005038 // UID of the process executing the binder transaction.
5039 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005040 // Fully qualified class name of the API call.
5041 //
5042 // This is a system server class name.
5043 //
5044 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5045 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5046 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5047 // commonly used APIs.
5048 optional string service_class_name = 2;
5049 // Method name of the API call. It can also be a transaction code if we cannot
5050 // resolve it to a name. See Binder#getTransactionName.
5051 //
5052 // This is a system server method name.
5053 optional string service_method_name = 3;
5054 // Total number of API calls.
5055 optional int64 call_count = 4;
5056 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5057 optional bool screen_interactive = 13;
5058 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5059 // call_count will be equal to recorded_call_count.
5060 //
5061 // If recorded_call_count is different than call_count, it means data collection has been
5062 // sampled. All the fields below will be sampled in this case.
5063 optional int64 recorded_call_count = 12;
5064 // Number of exceptions thrown by the API.
5065 optional int64 recorded_exception_count = 5;
5066 // Total latency of all API calls.
5067 // Average can be computed using total_latency_micros / recorded_call_count.
5068 optional int64 recorded_total_latency_micros = 6;
5069 // Maximum latency of one API call.
5070 optional int64 recorded_max_latency_micros = 7;
5071 // Total CPU usage of all API calls.
5072 // Average can be computed using total_cpu_micros / recorded_call_count.
5073 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5074 optional int64 recorded_total_cpu_micros = 8;
5075 // Maximum CPU usage of one API call.
5076 optional int64 recorded_max_cpu_micros = 9;
5077 // Maximum parcel reply size of one API call.
5078 optional int64 recorded_max_reply_size_bytes = 10;
5079 // Maximum parcel request size of one API call.
5080 optional int64 recorded_max_request_size_bytes = 11;
5081}
5082
5083/**
5084 * Pulls the statistics of exceptions during calls to Binder.
5085 *
5086 * Binder stats are cumulative from boot unless somebody reset the data using
5087 * > adb shell dumpsys binder_calls_stats --reset
5088 */
5089message BinderCallsExceptions {
5090 // Exception class name, e.g. java.lang.IllegalArgumentException.
5091 //
5092 // This is an exception class name thrown by the system server.
5093 optional string exception_class_name = 1;
5094 // Total number of exceptions.
5095 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005096}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005097
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005098/**
5099 * Pulls the statistics of message dispatching on HandlerThreads.
5100 *
5101 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5102 * config on the device.
5103 *
5104 * Next tag: 11
5105 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005106message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005107 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005108 optional int32 uid = 1 [(is_uid) = true];
5109
5110 // Fully qualified class name of the handler target class.
5111 //
5112 // This field does not contain PII. This is a system server class name.
5113 optional string handler_class_name = 2;
5114
5115 // The name of the thread that runs the Looper.
5116 //
5117 // This field does not contain PII. This is a system server thread name.
5118 optional string looper_thread_name = 3;
5119
5120 // The name of the dispatched message.
5121 //
5122 // This field does not contain PII. This is a system server constant or class
5123 // name.
5124 optional string message_name = 4;
5125
5126 // Total number of successfully dispatched messages.
5127 optional int64 message_count = 5;
5128
5129 // Total number of messages that failed dispatching.
5130 optional int64 exception_count = 6;
5131
5132 // Total number of processed messages we have data recorded for. If we
5133 // collected data for all the messages, message_count will be equal to
5134 // recorded_message_count.
5135 //
5136 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005137 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005138 optional int64 recorded_message_count = 7;
5139
5140 // Total latency of all processed messages.
5141 // Average can be computed using recorded_total_latency_micros /
5142 // recorded_message_count.
5143 optional int64 recorded_total_latency_micros = 8;
5144
5145 // Total CPU usage of all processed message.
5146 // Average can be computed using recorded_total_cpu_micros /
5147 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005148 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005149 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005150
5151 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5152 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005153
5154 // Max recorded CPU usage of all processed messages.
5155 optional int64 recorded_max_cpu_micros = 11;
5156
5157 // Max recorded latency of all processed messages.
5158 optional int64 recorded_max_latency_micros = 12;
5159
5160 // Total number of messages we tracked the dispatching delay for. If we
5161 // collected data for all the messages, message_count will be equal to
5162 // recorded_delay_message_count.
5163 //
5164 // If recorded_delay_message_count is different than message_count, it means data
5165 // collection has been sampled or/and not all messages specified the target dispatch time.
5166 // The fields below will be sampled in this case.
5167 optional int64 recorded_delay_message_count = 13;
5168
5169 // Total dispatching delay of all processed messages.
5170 // Calculated as a difference between the target dispatching time (Message.when)
5171 // and the actual dispatching time.
5172 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5173 optional int64 recorded_total_delay_millis = 14;
5174
5175 // Max dispatching delay of all processed messages.
5176 // Calculated as a difference between the target dispatching time (Message.when)
5177 // and the actual dispatching time.
5178 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005179}
Tej Singh86dc9db2018-09-06 00:39:57 +00005180
5181/**
5182 * Pulls disk information, such as write speed and latency.
5183 */
5184message DiskStats {
5185 // Time taken to open, write 512B to, and close a file.
5186 // -1 if error performing the check.
5187 optional int64 data_write_latency_millis = 1;
5188
5189 optional bool file_based_encryption = 2;
5190
5191 // Recent disk write speed in kB/s.
5192 // -1 if error querying storageed.
5193 // 0 if data is unavailable.
5194 optional int32 recent_disk_write_speed = 3;
5195}
5196
5197
5198/**
5199 * Free and total bytes of the Data, Cache, and System partition.
5200 */
5201message DirectoryUsage {
5202 enum Directory {
5203 UNKNOWN = 0;
5204 DATA = 1;
5205 CACHE = 2;
5206 SYSTEM = 3;
5207 }
5208 optional Directory directory = 1;
5209 optional int64 free_bytes = 2;
5210 optional int64 total_bytes = 3;
5211}
5212
5213
5214/**
5215 * Size of an application: apk size, data size, and cache size.
5216 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5217 * Information is only reported for apps with the primary user (user 0).
5218 * Sizes are aggregated by package name.
5219 */
5220message AppSize {
5221 // Including uids will involve modifying diskstats logic.
5222 optional string package_name = 1;
5223 // App size in bytes. -1 if unavailable.
5224 optional int64 app_size_bytes = 2;
5225 // App data size in bytes. -1 if unavailable.
5226 optional int64 app_data_size_bytes = 3;
5227 // App cache size in bytes. -1 if unavailable.
5228 optional int64 app_cache_size_bytes = 4;
5229 // Time that the cache file was produced.
5230 // Uses System.currentTimeMillis(), which is wall clock time.
5231 optional int64 cache_time_millis = 5;
5232}
5233
5234
5235/**
5236 * Size of a particular category. Eg: photos, videos.
5237 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5238 */
5239message CategorySize {
5240 enum Category {
5241 UNKNOWN = 0;
5242 APP_SIZE = 1;
5243 APP_DATA_SIZE = 2;
5244 APP_CACHE_SIZE = 3;
5245 PHOTOS = 4;
5246 VIDEOS = 5;
5247 AUDIO = 6;
5248 DOWNLOADS = 7;
5249 SYSTEM = 8;
5250 OTHER = 9;
5251 }
5252 optional Category category = 1;
5253 // Category size in bytes.
5254 optional int64 size_bytes = 2;
5255 // Time that the cache file was produced.
5256 // Uses System.currentTimeMillis(), which is wall clock time.
5257 optional int64 cache_time_millis = 3;
5258}
Tej Singhd6d6d772018-09-05 17:41:25 -07005259
5260/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005261 * Pulls per uid I/O stats. The stats are cumulative since boot.
5262 *
5263 * Read/write bytes are I/O events from a storage device
5264 * Read/write chars are data requested by read/write syscalls, and can be
5265 * satisfied by caching.
5266 *
5267 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5268 */
5269message DiskIo {
5270 optional int32 uid = 1 [(is_uid) = true];
5271 optional int64 fg_chars_read = 2;
5272 optional int64 fg_chars_write = 3;
5273 optional int64 fg_bytes_read = 4;
5274 optional int64 fg_bytes_write = 5;
5275 optional int64 bg_chars_read = 6;
5276 optional int64 bg_chars_write = 7;
5277 optional int64 bg_bytes_read = 8;
5278 optional int64 bg_bytes_write = 9;
5279 optional int64 fg_fsync = 10;
5280 optional int64 bg_fsync= 11;
5281}
5282
5283
5284/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005285 * Pulls the number of fingerprints for each user.
5286 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005287 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005288 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005289message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005290 // The associated user. Eg: 0 for owners, 10+ for others.
5291 // Defined in android/os/UserHandle.java
5292 optional int32 user = 1;
5293 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005294 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005295}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005296
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005297/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005298 * Pulls the number of faces for each user.
5299 *
5300 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5301 */
5302message NumFacesEnrolled {
5303 // The associated user. Eg: 0 for owners, 10+ for others.
5304 // Defined in android/os/UserHandle.java
5305 optional int32 user = 1;
5306 // Number of faces registered to that user.
5307 optional int32 num_faces_enrolled = 2;
5308}
5309/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005310 * A mapping of role holder -> role
5311 */
5312message RoleHolder {
5313 // uid of the role holder
5314 optional int32 uid = 1 [(is_uid) = true];
5315
5316 // package name of the role holder
5317 optional string package_name = 2;
5318
5319 // the role held
5320 optional string role = 3;
5321}
5322
Yangsteraf9aee72018-10-12 09:26:16 -07005323message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005324 // These are all in byte resolution.
5325 optional int64 min = 1 [deprecated = true];
5326 optional int64 average = 2 [deprecated = true];
5327 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005328
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005329 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5330 // int64 fields.
5331 optional int32 mean_kb = 4;
5332 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005333}
5334
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005335// A reduced subset of process states; reducing the number of possible states allows more
5336// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5337enum ProcessStateAggregated {
5338 PROCESS_STATE_UNKNOWN = 0;
5339 // Persistent system process.
5340 PROCESS_STATE_PERSISTENT = 1;
5341 // Top activity; actually any visible activity.
5342 PROCESS_STATE_TOP = 2;
5343 // Process binding to top or a foreground service.
5344 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5345 // Processing running a foreground service.
5346 PROCESS_STATE_FGS = 4;
5347 // Important foreground process (ime, wallpaper, etc).
5348 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5349 // Important background process.
5350 PROCESS_STATE_BACKGROUND = 6;
5351 // Process running a receiver.
5352 PROCESS_STATE_RECEIVER = 7;
5353 // All kinds of cached processes.
5354 PROCESS_STATE_CACHED = 8;
5355}
5356
5357// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005358message ProcessStatsStateProto {
5359 optional android.service.procstats.ScreenState screen_state = 1;
5360
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005361 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005362
5363 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5364 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005365 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5366
5367 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005368
5369 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005370 optional int64 duration_millis = 4 [deprecated = true];
5371 // Same as above, but with minute resolution so it fits into an int32.
5372 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005373
5374 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005375 optional int64 realtime_duration_millis = 9 [deprecated = true];
5376 // Same as above, but with minute resolution so it fits into an int32.
5377 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005378
5379 // # of samples taken
5380 optional int32 sample_size = 5;
5381
5382 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005383 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005384
5385 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005386 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005387
5388 // RSS is memory resident for this process
5389 optional AggStats rss = 8;
5390}
5391
5392// Next Tag: 7
5393message ProcessStatsProto {
5394 // Name of process.
5395 optional string process = 1;
5396
5397 // Uid of the process.
5398 optional int32 uid = 2;
5399
5400 // Information about how often kills occurred
5401 message Kill {
5402 // Count of excessive CPU kills
5403 optional int32 cpu = 1;
5404
5405 // Count of kills when cached
5406 optional int32 cached = 2;
5407
5408 // PSS stats during cached kill
5409 optional AggStats cached_pss = 3;
5410 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005411 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005412
5413 // Time and memory spent in various states.
5414 repeated ProcessStatsStateProto states = 5;
5415
5416 // Total time process has been running... screen_state, memory_state, and process_state
5417 // will not be set.
5418 optional ProcessStatsStateProto total_running_state = 6;
5419}
5420
5421message PackageServiceOperationStatsProto {
5422 // Operate enum: Started, Foreground, Bound, Executing
5423 optional android.service.procstats.ServiceOperationState operation = 1;
5424
5425 // Number of times the service was in this operation.
5426 optional int32 count = 2;
5427
5428 // Information about a state the service can be in.
5429 message StateStats {
5430 // Screen state enum.
5431 optional android.service.procstats.ScreenState screen_state = 1;
5432 // Memory state enum.
5433 optional android.service.procstats.MemoryState memory_state = 2;
5434
5435 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005436 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005437 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005438 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005439 }
5440 repeated StateStats state_stats = 3;
5441}
5442
5443message PackageServiceStatsProto {
5444 // Name of service component.
5445 optional string service_name = 1;
5446
5447 // The operation stats.
5448 // The package_name, package_uid, package_version, service_name will not be set to save space.
5449 repeated PackageServiceOperationStatsProto operation_stats = 2;
5450}
5451
5452message PackageAssociationSourceProcessStatsProto {
5453 // Uid of the process.
5454 optional int32 process_uid = 1;
5455 // Process name.
5456 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005457 // Package name.
5458 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005459 // Total count of the times this association appeared.
5460 optional int32 total_count = 3;
5461
5462 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005463 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005464
5465 // Total count of the times this association became actively impacting its target process.
5466 optional int32 active_count = 5;
5467
5468 // Information on one source in this association.
5469 message StateStats {
5470 // Process state enum.
5471 optional android.service.procstats.ProcessState process_state = 1;
5472 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005473 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005474 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005475 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005476 }
5477 repeated StateStats active_state_stats = 6;
5478}
5479
5480message PackageAssociationProcessStatsProto {
5481 // Name of the target component.
5482 optional string component_name = 1;
5483 // Information on one source in this association.
5484 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5485}
5486
5487
5488message ProcessStatsPackageProto {
5489 // Name of package.
5490 optional string package = 1;
5491
5492 // Uid of the package.
5493 optional int32 uid = 2;
5494
5495 // Version of the package.
5496 optional int64 version = 3;
5497
5498 // Stats for each process running with the package loaded in to it.
5499 repeated ProcessStatsProto process_stats = 4;
5500
5501 // Stats for each of the package's services.
5502 repeated PackageServiceStatsProto service_stats = 5;
5503
5504 // Stats for each association with the package.
5505 repeated PackageAssociationProcessStatsProto association_stats = 6;
5506}
5507
5508message ProcessStatsSectionProto {
5509 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005510 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005511
5512 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005513 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005514
5515 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005516 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005517
5518 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005519 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005520
5521 // System runtime library. e.g. "libdvm.so", "libart.so".
5522 optional string runtime = 5;
5523
5524 // whether kernel reports swapped pss.
5525 optional bool has_swapped_pss = 6;
5526
5527 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5528 enum Status {
5529 STATUS_UNKNOWN = 0;
5530 STATUS_COMPLETE = 1;
5531 STATUS_PARTIAL = 2;
5532 STATUS_SHUTDOWN = 3;
5533 STATUS_SYSPROPS = 4;
5534 }
5535 repeated Status status = 7;
5536
Chenjie Yub2ecc792019-01-17 10:27:26 -08005537 // Number of pages available of various types and sizes, representation fragmentation.
5538 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5539
Yangsteraf9aee72018-10-12 09:26:16 -07005540 // Stats for each process.
5541 repeated ProcessStatsProto process_stats = 8;
5542
5543 // Stats for each package.
5544 repeated ProcessStatsPackageProto package_stats = 9;
5545}
5546
Chenjie Yub2ecc792019-01-17 10:27:26 -08005547message ProcessStatsAvailablePagesProto {
5548 // Node these pages are in (as per /proc/pagetypeinfo)
5549 optional int32 node = 1;
5550
5551 // Zone these pages are in (as per /proc/pagetypeinfo)
5552 optional string zone = 2;
5553
5554 // Label for the type of these pages (as per /proc/pagetypeinfo)
5555 optional string label = 3;
5556
5557 // Distribution of number of pages available by order size. First entry in array is
5558 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5559 repeated int32 pages_per_order = 4;
5560}
5561
Chenjie Yu12e5e672018-09-14 15:54:59 -07005562/**
5563 * Pulled from ProcessStatsService.java
5564 */
5565message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005566 optional ProcessStatsSectionProto proc_stats_section = 1;
5567}
5568
Chenjie Yuf910b7802019-01-11 16:08:20 -08005569/**
5570 * Pulled from ProcessStatsService.java
5571 */
5572message ProcStatsPkgProc {
5573 optional ProcessStatsSectionProto proc_stats_section = 1;
5574}
5575
Chris Wrencdea3b72019-11-22 16:58:17 -05005576// Next Tag: 2
5577message PackageRemoteViewInfoProto {
5578 optional string package_name = 1;
5579 // add per-package additional info here (like channels)
5580}
5581
5582// Next Tag: 2
5583message NotificationRemoteViewsProto {
5584 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5585}
5586
5587/**
5588 * Pulled from NotificationManagerService.java
5589 */
5590message NotificationRemoteViews {
5591 optional NotificationRemoteViewsProto notification_remote_views = 1;
5592}
5593
Yotam Aron74299972020-01-16 16:20:58 +02005594/**
5595 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5596 */
5597message PackageNotificationPreferences {
5598 // Uid under which the package is installed.
5599 optional int32 uid = 1;
5600 // Notification importance, which specifies when and how a notification is displayed.
5601 // Specified under core/java/android/app/NotificationManager.java.
5602 optional int32 importance = 2;
5603 // Lockscreen visibility as set by the user.
5604 optional int32 visibility = 3;
5605 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5606 // PreferencesHelper.java)
5607 optional int32 user_locked_fields = 4;
5608}
5609
5610/**
5611 * Atom that contains a list of a package's channel preferences, pulled from
5612 * NotificationManagerService.java.
5613 */
5614message PackageNotificationChannelPreferences {
5615 // Uid under which the package is installed.
5616 optional int32 uid = 1;
5617 // Channel's ID. Should always be available.
5618 optional string channel_id = 2;
5619 // Channel's name. Should always be available.
5620 optional string channel_name = 3;
5621 // Channel's description. Optionally set by the channel creator.
5622 optional string description = 4;
5623 // Notification importance, which specifies when and how a notification is displayed. Specified
5624 // under core/java/android/app/NotificationManager.java.
5625 optional int32 importance = 5;
5626 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5627 // at core/java/android/app/NotificationChannel.java
5628 optional int32 user_locked_fields = 6;
5629 // Indicates if the channel was deleted by the app.
5630 optional bool is_deleted = 7;
5631}
5632
5633/**
5634 * Atom that contains a list of a package's channel group preferences, pulled from
5635 * NotificationManagerService.java.
5636 */
5637message PackageNotificationChannelGroupPreferences {
5638 // Uid under which the package is installed.
5639 optional int32 uid = 1;
5640 // Channel Group's ID. Should always be available.
5641 optional string group_id = 2;
5642 // Channel Group's name. Should always be available.
5643 optional string group_name = 3;
5644 // Channel Group's description. Optionally set by group creator.
5645 optional string description = 4;
5646 // Indicates if notifications from this channel group are blocked.
5647 optional bool is_blocked = 5;
5648 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5649 // at core/java/android/app/NotificationChannelGroup.java
5650 optional int32 user_locked_fields = 6;
5651}
5652
Yangsteraf9aee72018-10-12 09:26:16 -07005653message PowerProfileProto {
5654 optional double cpu_suspend = 1;
5655
5656 optional double cpu_idle = 2;
5657
5658 optional double cpu_active = 3;
5659
5660 message CpuCluster {
5661 optional int32 id = 1;
5662 optional double cluster_power = 2;
5663 optional int32 cores = 3;
5664 repeated int64 speed = 4;
5665 repeated double core_power = 5;
5666 }
5667
5668 repeated CpuCluster cpu_cluster = 40;
5669
5670 optional double wifi_scan = 4;
5671
5672 optional double wifi_on = 5;
5673
5674 optional double wifi_active = 6;
5675
5676 optional double wifi_controller_idle = 7;
5677
5678 optional double wifi_controller_rx = 8;
5679
5680 optional double wifi_controller_tx = 9;
5681
5682 repeated double wifi_controller_tx_levels = 10;
5683
5684 optional double wifi_controller_operating_voltage = 11;
5685
5686 optional double bluetooth_controller_idle = 12;
5687
5688 optional double bluetooth_controller_rx = 13;
5689
5690 optional double bluetooth_controller_tx = 14;
5691
5692 optional double bluetooth_controller_operating_voltage = 15;
5693
5694 optional double modem_controller_sleep = 16;
5695
5696 optional double modem_controller_idle = 17;
5697
5698 optional double modem_controller_rx = 18;
5699
5700 repeated double modem_controller_tx = 19;
5701
5702 optional double modem_controller_operating_voltage = 20;
5703
5704 optional double gps_on = 21;
5705
5706 repeated double gps_signal_quality_based = 22;
5707
5708 optional double gps_operating_voltage = 23;
5709
5710 optional double bluetooth_on = 24;
5711
5712 optional double bluetooth_active = 25;
5713
5714 optional double bluetooth_at_cmd = 26;
5715
5716 optional double ambient_display = 27;
5717
5718 optional double screen_on = 28;
5719
5720 optional double radio_on = 29;
5721
5722 optional double radio_scanning = 30;
5723
5724 optional double radio_active = 31;
5725
5726 optional double screen_full = 32;
5727
5728 optional double audio = 33;
5729
5730 optional double video = 34;
5731
5732 optional double flashlight = 35;
5733
5734 optional double memory = 36;
5735
5736 optional double camera = 37;
5737
5738 optional double wifi_batched_scan = 38;
5739
5740 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005741}
Chenjie Yuab530202018-09-26 12:39:20 -07005742
5743/**
5744 * power_profile.xml and other constants for power model calculations.
5745 * Pulled from PowerProfile.java
5746 */
5747message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005748 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005749}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005750
5751/**
arangelovd5db50e2018-10-12 20:24:39 +01005752 * Logs when a user restriction was added or removed.
5753 *
5754 * Logged from:
5755 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5756 */
5757message UserRestrictionChanged {
5758 // The raw string of the user restriction as defined in UserManager.
5759 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5760 optional string restriction = 1;
5761 // Whether the restriction is enabled or disabled.
5762 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005763}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005764
5765/**
5766 * Pulls process user time and system time. Puller takes a snapshot of all pids
5767 * in the system and returns cpu stats for those that are working at the time.
5768 * Dead pids will be dropped. Kernel processes are excluded.
5769 * Min cool-down is 5 sec.
5770 */
5771message ProcessCpuTime {
5772 optional int32 uid = 1 [(is_uid) = true];
5773
5774 optional string process_name = 2;
5775 // Process cpu time in user space, cumulative from boot/process start
5776 optional int64 user_time_millis = 3;
5777 // Process cpu time in system space, cumulative from boot/process start
5778 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005779}
Misha Wagner5a51e002018-10-03 15:04:09 +01005780
5781/**
5782 * Pulls the CPU usage for each thread.
5783 *
5784 * Read from /proc/$PID/task/$TID/time_in_state files.
5785 *
5786 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5787 * time_in_state files not being present on some phones, have not been addressed. These should be
5788 * considered before a public release.
5789 */
5790message CpuTimePerThreadFreq {
5791 // UID that owns the process.
5792 optional int32 uid = 1 [(is_uid) = true];
5793 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005794 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005795 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005796 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005797 // Name of the process taken from `/proc/$PID/cmdline`.
5798 optional string process_name = 4;
5799 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5800 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005801
5802 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5803 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5804 // frequencies are given here as the alternative is sending eight separate atoms. This method
5805 // significantly reduces the amount of data created
5806 optional int32 frequency1_khz = 6;
5807 optional int32 time1_millis = 7;
5808 optional int32 frequency2_khz = 8;
5809 optional int32 time2_millis = 9;
5810 optional int32 frequency3_khz = 10;
5811 optional int32 time3_millis = 11;
5812 optional int32 frequency4_khz = 12;
5813 optional int32 time4_millis = 13;
5814 optional int32 frequency5_khz = 14;
5815 optional int32 time5_millis = 15;
5816 optional int32 frequency6_khz = 16;
5817 optional int32 time6_millis = 17;
5818 optional int32 frequency7_khz = 18;
5819 optional int32 time7_millis = 19;
5820 optional int32 frequency8_khz = 20;
5821 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005822}
Bookatz75ee6042018-11-09 12:27:37 -08005823
5824/**
Bookatz366a4432018-11-20 09:42:33 -08005825 * Pulls information about the device's build.
5826 */
5827message BuildInformation {
5828 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5829 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5830 optional string fingerprint = 1;
5831
5832 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5833 optional string brand = 2;
5834
5835 // Build.PRODUCT. The name of the overall product.
5836 optional string product = 3;
5837
5838 // Build.DEVICE. The name of the industrial design.
5839 optional string device = 4;
5840
5841 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5842 optional string version_release = 5;
5843
5844 // Build.ID. E.g. a label like "M4-rc20".
5845 optional string id = 6;
5846
5847 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5848 // represent this build.
5849 optional string version_incremental = 7;
5850
5851 // Build.TYPE. The type of build, like "user" or "eng".
5852 optional string type = 8;
5853
5854 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5855 optional string tags = 9;
5856}
5857
5858/**
Adam He420947c2019-01-23 15:59:09 -08005859 * Logs information about mismatched caller for content capture.
5860 *
5861 * Logged from:
5862 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5863 */
5864message ContentCaptureCallerMismatchReported {
5865 optional string intended_package = 1;
5866 optional string calling_package = 2;
5867}
5868
5869/**
5870 * Logs information about content capture service events.
5871 *
5872 * Logged from:
5873 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5874 */
5875message ContentCaptureServiceEvents {
5876 // The type of event.
5877 enum Event {
5878 UNKNOWN = 0;
5879 ON_CONNECTED = 1;
5880 ON_DISCONNECTED = 2;
5881 SET_WHITELIST = 3;
5882 SET_DISABLED = 4;
5883 ON_USER_DATA_REMOVED = 5;
5884 }
5885 optional Event event = 1;
5886 // component/package of content capture service.
5887 optional string service_info = 2;
5888 // component/package of target.
5889 // it's a concatenated list of component/package for SET_WHITELIST event
5890 // separated by " ".
5891 optional string target_info = 3;
5892}
5893
5894/**
5895 * Logs information about content capture session events.
5896 *
5897 * Logged from:
5898 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5899 */
5900message ContentCaptureSessionEvents {
5901 // The type of event.
5902 enum Event {
5903 UNKNOWN = 0;
5904 ON_SESSION_STARTED = 1;
5905 ON_SESSION_FINISHED = 2;
5906 SESSION_NOT_CREATED = 3;
5907 }
5908 optional int32 session_id = 1;
5909 optional Event event = 2;
5910 // (n/a on session finished)
5911 optional int32 state_flags = 3;
5912 // component/package of content capture service.
5913 optional string service_info = 4;
5914 // component/package of app.
5915 // (n/a on session finished)
5916 optional string app_info = 5;
5917 optional bool is_child_session = 6;
5918}
5919
5920/**
5921 * Logs information about session being flushed.
5922 *
5923 * Logged from:
5924 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5925 */
5926message ContentCaptureFlushed {
5927 optional int32 session_id = 1;
5928 // component/package of content capture service.
5929 optional string service_info = 2;
5930 // component/package of app.
5931 optional string app_info = 3;
5932 // session start/finish events
5933 optional int32 child_session_started = 4;
5934 optional int32 child_session_finished = 5;
5935 // count of view events.
5936 optional int32 view_appeared_count = 6;
5937 optional int32 view_disappeared_count = 7;
5938 optional int32 view_text_changed_count = 8;
5939
5940 // Flush stats.
5941 optional int32 max_events = 9;
5942 optional int32 idle_flush_freq = 10;
5943 optional int32 text_flush_freq = 11;
5944 optional int32 flush_reason = 12;
5945}
5946
5947/**
Bookatz75ee6042018-11-09 12:27:37 -08005948 * Pulls on-device BatteryStats power use calculations for the overall device.
5949 */
5950message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005951 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5952 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5953 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5954 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005955}
5956
5957/**
5958 * Pulls on-device BatteryStats power use calculations broken down by uid.
5959 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5960 * that is attributed to non-uid items. They must all be included to get the total power use.
5961 */
5962message DeviceCalculatedPowerBlameUid {
5963 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5964 optional int32 uid = 1 [(is_uid) = true];
5965
Bookatz3dbc13a2018-12-21 12:16:51 -08005966 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5967 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5968 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005969}
5970
5971/**
5972 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5973 * drain type.
5974 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5975 * is attributed uids. They must all be included to get the total power use.
5976 */
5977message DeviceCalculatedPowerBlameOther {
5978 // The type of item whose power use is being reported.
5979 enum DrainType {
5980 AMBIENT_DISPLAY = 0;
5981 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5982 BLUETOOTH = 2;
5983 CAMERA = 3;
5984 // Cell-standby
5985 CELL = 4;
5986 FLASHLIGHT = 5;
5987 IDLE = 6;
5988 MEMORY = 7;
5989 // Amount that total computed drain exceeded the drain estimated using the
5990 // battery level changes and capacity.
5991 OVERCOUNTED = 8;
5992 PHONE = 9;
5993 SCREEN = 10;
5994 // Amount that total computed drain was below the drain estimated using the
5995 // battery level changes and capacity.
5996 UNACCOUNTED = 11;
5997 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5998 WIFI = 13;
5999 }
6000 optional DrainType drain_type = 1;
6001
Bookatz3dbc13a2018-12-21 12:16:51 -08006002 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6003 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6004 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006005}
arangelov4e994062018-11-13 16:12:38 +00006006
6007/**
6008 * Logs device policy features.
6009 *
6010 * Logged from:
6011 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6012 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6013 */
6014message DevicePolicyEvent {
6015 // The event id - unique for each event.
6016 optional android.stats.devicepolicy.EventId event_id = 1;
6017 // The admin package name.
6018 optional string admin_package_name = 2;
6019 // A generic integer parameter.
6020 optional int32 integer_value = 3;
6021 // A generic boolean parameter.
6022 optional bool boolean_value = 4;
6023 // A parameter specifying a time period in milliseconds.
6024 optional uint64 time_period_millis = 5;
6025 // A parameter specifying a list of package names, bundle extras or string parameters.
6026 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6027}
shawnlinea5b66b2018-11-13 15:05:29 +08006028
6029/**
6030 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6031 *
6032 * Logged from:
6033 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6034 */
6035message DocsUILaunchReported {
6036 optional android.stats.docsui.LaunchAction launch_action = 1;
6037 optional bool has_initial_uri = 2;
6038 optional android.stats.docsui.MimeType mime_type = 3;
6039 optional android.stats.docsui.Root initial_root = 4;
6040}
6041
6042/**
6043 * Logs root/app visited event in file managers/picker. Call this when the user
6044 * taps on root/app in hamburger menu.
6045 *
6046 * Logged from:
6047 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6048 */
6049message DocsUIRootVisitedReported {
6050 optional android.stats.docsui.ContextScope scope = 1;
6051 optional android.stats.docsui.Root root = 2;
6052}
6053
6054/**
6055 * Logs file operation stats. Call this when a file operation has completed.
6056 *
6057 * Logged from:
6058 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6059 */
6060message DocsUIFileOperationReported {
6061 optional android.stats.docsui.Provider provider = 1;
6062 optional android.stats.docsui.FileOperation file_op = 2;
6063}
6064
6065/**
6066 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6067 * mode.
6068 *
6069 * Logged from:
6070 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6071 */
6072message DocsUIFileOperationCopyMoveModeReported {
6073 optional android.stats.docsui.FileOperation file_op = 1;
6074 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6075}
6076
6077
6078/**
6079 * Logs file sub operation stats. Call this when a file operation has failed.
6080 *
6081 * Logged from:
6082 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6083 */
6084message DocsUIFileOperationFailureReported {
6085 optional android.stats.docsui.Authority authority = 1;
6086 optional android.stats.docsui.SubFileOperation sub_op = 2;
6087}
6088
6089/**
6090* Logs the cancellation of a file operation. Call this when a job is canceled
6091*
6092* Logged from:
6093* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6094*/
6095message DocsUIFileOperationCanceledReported {
6096 optional android.stats.docsui.FileOperation file_op = 1;
6097}
6098
6099/**
6100 * Logs startup time in milliseconds.
6101 *
6102 * Logged from:
6103 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6104 */
6105message DocsUIStartupMsReported {
6106 optional int32 startup_millis = 1;
6107}
6108
6109/**
6110 * Logs the action that was started by user.
6111 *
6112 * Logged from:
6113 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6114 */
6115message DocsUIUserActionReported {
6116 optional android.stats.docsui.UserAction action = 1;
6117}
6118
6119/**
6120 * Logs the invalid type when invalid scoped access is requested.
6121 *
6122 * Logged from:
6123 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6124 */
6125message DocsUIInvalidScopedAccessRequestReported {
6126 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006127}
Ben Murdochbab399f2018-12-06 11:01:38 +00006128
6129/**
shawnlina75e82d2019-01-07 10:31:12 +08006130 * Logs the package name that launches docsui picker mode.
6131 *
6132 * Logged from:
6133 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6134 */
6135message DocsUIPickerLaunchedFromReported {
6136 optional string package_name = 1;
6137}
6138
6139/**
6140 * Logs the search type.
6141 *
6142 * Logged from:
6143 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6144 */
6145message DocsUISearchTypeReported {
6146 optional android.stats.docsui.SearchType search_type = 1;
6147}
6148
6149/**
6150 * Logs the search mode.
6151 *
6152 * Logged from:
6153 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6154 */
6155message DocsUISearchModeReported {
6156 optional android.stats.docsui.SearchMode search_mode = 1;
6157}
6158
6159/**
6160 * Logs the pick result information.
6161 *
6162 * Logged from:
6163 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6164 */
6165message DocsUIPickResultReported {
6166 optional int32 total_action_count = 1;
6167 optional int64 duration_millis = 2;
6168 optional int32 file_count= 3;
6169 optional bool is_searching = 4;
6170 optional android.stats.docsui.Root picked_from = 5;
6171 optional android.stats.docsui.MimeType mime_type = 6;
6172 optional int32 repeatedly_pick_times = 7;
6173}
6174
6175/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006176 * Logs when an app's memory is compacted.
6177 *
6178 * Logged from:
6179 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6180 */
6181message AppCompacted {
6182 // The pid of the process being compacted.
6183 optional int32 pid = 1;
6184
6185 // The name of the process being compacted.
6186 optional string process_name = 2;
6187
6188 // The type of compaction.
6189 enum Action {
6190 UNKNOWN = 0;
6191 SOME = 1;
6192 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006193 PERSISTENT = 3;
6194 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006195 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006196 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006197
6198 // Total RSS in kilobytes consumed by the process prior to compaction.
6199 optional int64 before_rss_total_kilobytes = 4;
6200
6201 // File RSS in kilobytes consumed by the process prior to compaction.
6202 optional int64 before_rss_file_kilobytes = 5;
6203
6204 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6205 optional int64 before_rss_anon_kilobytes = 6;
6206
6207 // Swap in kilobytes consumed by the process prior to compaction.
6208 optional int64 before_swap_kilobytes = 7;
6209
6210 // Total RSS in kilobytes consumed by the process after compaction.
6211 optional int64 after_rss_total_kilobytes = 8;
6212
6213 // File RSS in kilobytes consumed by the process after compaction.
6214 optional int64 after_rss_file_kilobytes = 9;
6215
6216 // Anonymous RSS in kilobytes consumed by the process after compaction.
6217 optional int64 after_rss_anon_kilobytes = 10;
6218
6219 // Swap in kilobytes consumed by the process after compaction.
6220 optional int64 after_swap_kilobytes = 11;
6221
6222 // The time taken to perform compaction in milliseconds.
6223 optional int64 time_to_compact_millis = 12;
6224
6225 // The last compaction action performed for this app.
6226 optional Action last_action = 13;
6227
Ben Murdoch01720b82018-12-19 18:03:44 +00006228 // The last time that compaction was attempted on this process in milliseconds
6229 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6230 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006231
Ben Murdoch885c21b2019-03-15 18:02:04 +00006232 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006233 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006234
6235 // The process state at the time of compaction.
6236 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006237
6238 // Free ZRAM in kilobytes before compaction.
6239 optional int64 before_zram_free_kilobytes = 17;
6240
6241 // Free ZRAM in kilobytes after compaction.
6242 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006243}
lifr157fc552018-12-12 16:38:04 +08006244
6245/**
lifrb6b90b62019-03-29 00:40:17 +08006246 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6247 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6248 *
lifr1f74b052019-04-16 22:16:30 +08006249 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6250 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6251 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6252 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006253 */
6254message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006255 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006256
lifr1f74b052019-04-16 22:16:30 +08006257 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006258
6259 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006260 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006261
lifr1f74b052019-04-16 22:16:30 +08006262 // Only valid for event_type = EVENT_GETADDRINFO.
6263 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006264
lifr1f74b052019-04-16 22:16:30 +08006265 // Flags passed to android_res_nsend() defined in multinetwork.h
6266 // Only valid for event_type = EVENT_RESNSEND.
6267 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006268
lifrad9becc2019-05-20 11:04:41 +08006269 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006270
6271 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006272 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006273
6274 // Additional pass-through fields opaque to statsd.
6275 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006276 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006277
6278 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6279 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006280}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006281
6282/**
6283 * Logs when a data stall event occurs.
6284 *
6285 * Log from:
6286 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6287 */
6288message DataStallEvent {
6289 // Data stall evaluation type.
6290 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6291 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6292 optional int32 evaluation_type = 1;
6293 // See definition in data_stall_event.proto.
6294 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6295 // See definition in data_stall_event.proto.
6296 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6297 // See definition in data_stall_event.proto.
6298 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6299 // See definition in data_stall_event.proto.
6300 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6301 // See definition in data_stall_event.proto.
6302 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6303}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006304
6305/*
6306 * Logs when RescueParty resets some set of experiment flags.
6307 *
6308 * Logged from:
6309 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6310 */
6311message RescuePartyResetReported {
6312 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6313 optional int32 rescue_level = 1;
6314}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006315
6316/**
6317 * Logs when signed config is received from an APK, and if that config was applied successfully.
6318 * Logged from:
6319 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6320 */
6321message SignedConfigReported {
6322 enum Type {
6323 UNKNOWN_TYPE = 0;
6324 GLOBAL_SETTINGS = 1;
6325 }
6326 optional Type type = 1;
6327
6328 // The final status of the signed config received.
6329 enum Status {
6330 UNKNOWN_STATUS = 0;
6331 APPLIED = 1;
6332 BASE64_FAILURE_CONFIG = 2;
6333 BASE64_FAILURE_SIGNATURE = 3;
6334 SECURITY_EXCEPTION = 4;
6335 INVALID_CONFIG = 5;
6336 OLD_CONFIG = 6;
6337 SIGNATURE_CHECK_FAILED = 7;
6338 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006339 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006340 }
6341 optional Status status = 2;
6342
6343 // The version of the signed config processed.
6344 optional int32 version = 3;
6345
6346 // The package name that the config was extracted from.
6347 optional string from_package = 4;
6348
6349 enum Key {
6350 NO_KEY = 0;
6351 DEBUG = 1;
6352 PRODUCTION = 2;
6353 }
6354 // Which key was used to verify the config.
6355 optional Key verified_with = 5;
6356}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006357
6358/*
6359 * Logs GNSS Network-Initiated (NI) location events.
6360 *
6361 * Logged from:
6362 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6363 */
6364message GnssNiEventReported {
6365 // The type of GnssNiEvent.
6366 enum EventType {
6367 UNKNOWN = 0;
6368 NI_REQUEST = 1;
6369 NI_RESPONSE = 2;
6370 }
6371 optional EventType event_type = 1;
6372
6373 // An ID generated by HAL to associate NI notifications and UI responses.
6374 optional int32 notification_id = 2;
6375
6376 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006377 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006378
6379 // NI requires notification.
6380 optional bool need_notify = 4;
6381
6382 // NI requires verification.
6383 optional bool need_verify = 5;
6384
6385 // NI requires privacy override, no notification/minimal trace.
6386 optional bool privacy_override = 6;
6387
6388 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6389 // seconds.
6390 optional int32 timeout = 7;
6391
6392 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006393 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006394
6395 // String representing the requester of the network inititated location request.
6396 optional string requestor_id = 9;
6397
6398 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6399 // network initiated location request.
6400 optional string text = 10;
6401
6402 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006403 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006404
6405 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006406 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006407
6408 // True if SUPL ES is enabled.
6409 optional bool is_supl_es_enabled = 13;
6410
6411 // True if GNSS location is enabled.
6412 optional bool is_location_enabled = 14;
6413
6414 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006415 optional android.server.location.GnssUserResponseType user_response = 15;
6416}
6417
6418/**
6419 * Logs GNSS non-framework (NFW) location notification.
6420 *
6421 * Logged from:
6422 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6423 */
6424message GnssNfwNotificationReported {
6425 // Package name of the Android proxy application representing the non-framework entity that
6426 // requested location. Set to empty string if unknown.
6427 optional string proxy_app_package_name = 1;
6428
6429 // Protocol stack that initiated the non-framework location request.
6430 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6431
6432 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6433 // set to empty string. This field is opaque to the framework and used for logging purposes.
6434 optional string other_protocol_stack_name = 3;
6435
6436 // Source initiating/receiving the location information.
6437 optional android.server.location.NfwRequestor requestor = 4;
6438
6439 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6440 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6441 // and used for logging purposes.
6442 optional string requestor_id = 5;
6443
6444 // Indicates whether location information was provided for this request.
6445 optional android.server.location.NfwResponseType response_type = 6;
6446
6447 // True if the device is in user initiated emergency session.
6448 optional bool in_emergency_mode = 7;
6449
6450 // True if cached location is provided.
6451 optional bool is_cached_location = 8;
6452
6453 // True if proxy app permission mismatch between framework and GNSS HAL.
6454 optional bool is_permission_mismatched = 9;
6455}
6456
6457/**
6458 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6459 *
6460 * Logged from:
6461 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6462 */
6463message GnssConfigurationReported {
6464 // SUPL host name.
6465 optional string supl_host = 1;
6466
6467 // SUPL port number.
6468 optional int32 supl_port = 2;
6469
6470 // C2K host name.
6471 optional string c2k_host = 3;
6472
6473 // C2K port number.
6474 optional int32 c2k_port = 4;
6475
6476 // The SUPL version requested by Carrier.
6477 optional int32 supl_ver = 5;
6478
6479 // The SUPL mode.
6480 optional android.server.location.SuplMode supl_mode = 6;
6481
6482 // True if NI emergency SUPL restrictions is enabled.
6483 optional bool supl_es = 7;
6484
6485 // LTE Positioning Profile settings
6486 optional android.server.location.LppProfile lpp_profile = 8;
6487
6488 // Positioning protocol on A-Glonass system.
6489 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6490
6491 // True if emergency PDN is used. Otherwise, regular PDN is used.
6492 optional bool use_emergency_pdn_for_emergency_supl= 10;
6493
6494 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6495 optional android.server.location.GpsLock gps_lock = 11;
6496
6497 // Number of seconds to extend the emergency session duration post emergency call.
6498 optional int32 es_extension_sec = 12;
6499
6500 // The full list of package names of proxy Android applications representing the non-framework
6501 // location access entities (on/off the device) for which the framework user has granted
6502 // non-framework location access permission. The package names are concatenated in one string
6503 // with spaces as separators.
6504 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006505}
Jack Yu95b64f32018-12-13 18:26:11 +08006506
6507/**
6508 * Logs when a NFC device's error occurred.
6509 * Logged from:
6510 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6511 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6512 */
6513message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006514 enum Type {
6515 UNKNOWN = 0;
6516 CMD_TIMEOUT = 1;
6517 ERROR_NOTIFICATION = 2;
6518 AID_OVERFLOW = 3;
6519 }
6520 optional Type type = 1;
6521 // If it's nci cmd timeout, log the timeout command.
6522 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006523
Alex Salod7c3eef2019-01-25 14:43:27 -08006524 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006525}
6526
6527/**
6528 * Logs when a NFC device's state changed event
6529 * Logged from:
6530 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6531 */
6532message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006533 enum State {
6534 UNKNOWN = 0;
6535 OFF = 1;
6536 ON = 2;
6537 ON_LOCKED = 3; // Secure Nfc enabled.
6538 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6539 }
6540 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006541}
6542
6543/**
6544 * Logs when a NFC Beam Transaction occurred.
6545 * Logged from:
6546 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6547 */
6548message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006549 enum Operation {
6550 UNKNOWN = 0;
6551 SEND = 1;
6552 RECEIVE = 2;
6553 }
6554 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006555}
6556
6557/**
6558 * Logs when a NFC Card Emulation Transaction occurred.
6559 * Logged from:
6560 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6561 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6562 */
6563message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006564 enum Category {
6565 UNKNOWN = 0;
6566 HCE_PAYMENT = 1;
6567 HCE_OTHER = 2;
6568 OFFHOST = 3;
6569 }
6570 // Transaction belongs to HCE payment or HCE other category, or offhost.
6571 optional Category category = 1;
6572 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6573 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006574}
6575
6576/**
6577 * Logs when a NFC Tag event occurred.
6578 * Logged from:
6579 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6580 */
6581message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006582 enum Type {
6583 UNKNOWN = 0;
6584 URL = 1;
6585 BT_PAIRING = 2;
6586 PROVISION = 3;
6587 WIFI_CONNECT = 4;
6588 APP_LAUNCH = 5;
6589 OTHERS = 6;
6590 }
6591 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006592}
6593
6594/**
6595 * Logs when Hce transaction triggered
6596 * Logged from:
6597 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6598 */
6599message NfcHceTransactionOccurred {
6600 // The latency period(in microseconds) it took for the first HCE data
6601 // exchange.
6602 optional uint32 latency_micros = 1;
6603}
6604
6605/**
6606 * Logs when SecureElement state event changed
6607 * Logged from:
6608 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6609 */
6610message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006611 enum State {
6612 UNKNOWN = 0;
6613 INITIALIZED = 1;
6614 DISCONNECTED = 2;
6615 CONNECTED = 3;
6616 HALCRASH = 4;
6617 }
6618 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006619
Alex Salod7c3eef2019-01-25 14:43:27 -08006620 optional string state_change_reason = 2;
6621 // SIMx or eSEx.
6622 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006623}
6624
6625/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006626 * Information about a permission grant request
6627 */
6628message PermissionGrantRequestResultReported {
6629 // unique value identifying an API call. A API call might result in multiple of these atoms
6630 optional int64 request_id = 1;
6631
6632 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006633 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006634
6635 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006636 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006637
6638 // The permission to be granted
6639 optional string permission_name = 4;
6640
6641 // If the permission was explicitly requested via the API or added by the system
6642 optional bool is_implicit = 5;
6643
6644 enum Result {
6645 UNDEFINED = 0;
6646 // permission request was ignored
6647 IGNORED = 1;
6648 // permission request was ignored because it was user fixed
6649 IGNORED_USER_FIXED = 2;
6650 // permission request was ignored because it was policy fixed
6651 IGNORED_POLICY_FIXED = 3;
6652 // permission was granted by user action
6653 USER_GRANTED = 4;
6654 // permission was automatically granted
6655 AUTO_GRANTED = 5;
6656 // permission was denied by user action
6657 USER_DENIED = 6;
6658 // permission was denied with prejudice by the user
6659 USER_DENIED_WITH_PREJUDICE = 7;
6660 // permission was automatically denied
6661 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006662 // permission request was ignored because permission is restricted
6663 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006664 // one time permission was granted by user action
6665 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006666 // user ignored request by leaving the request screen without choosing any option
6667 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006668 // user granted the permission after being linked to settings
6669 USER_GRANTED_IN_SETTINGS = 12;
6670 // user denied the permission after being linked to settings
6671 USER_DENIED_IN_SETTINGS = 13;
6672 // user denied the permission with prejudice after being linked to settings
6673 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6674 // permission was automatically revoked after one-time permission expired
6675 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006676 // permission was automatically revoked for unused app
6677 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006678 }
6679 // The result of the permission grant
6680 optional Result result = 6;
6681}
6682
6683/**
Jack Yu95b64f32018-12-13 18:26:11 +08006684 * Logs when Omapi API used
6685 * Logged from:
6686 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6687 */
6688message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006689 enum Operation {
6690 UNKNOWN = 0;
6691 OPEN_CHANNEL = 1;
6692 }
6693 optional Operation operation = 1;
6694 // SIMx or eSEx.
6695 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006696
Alex Salod7c3eef2019-01-25 14:43:27 -08006697 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006698}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006699
6700/**
Alex Saloa060aee2019-01-21 14:36:41 -08006701 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6702 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006703 * Logged from:
6704 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6705 */
6706message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006707 optional int64 dispatch_latency_millis = 1;
6708}
6709
6710/**
6711 * Logs AttentionManagerService attention check result.
6712 *
6713 * Logged from:
6714 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6715 */
6716message AttentionManagerServiceResultReported {
6717 // See core/java/android/service/attention/AttentionService.java
6718 enum AttentionCheckResult {
6719 UNKNOWN = 20;
6720 ATTENTION_SUCCESS_ABSENT = 0;
6721 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006722 ATTENTION_FAILURE_UNKNOWN = 2;
6723 ATTENTION_FAILURE_CANCELLED = 3;
6724 ATTENTION_FAILURE_PREEMPTED = 4;
6725 ATTENTION_FAILURE_TIMED_OUT = 5;
6726 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006727 }
6728 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006729}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006730
6731/**
6732 * Logs when an adb connection changes state.
6733 *
6734 * Logged from:
6735 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6736 */
6737message AdbConnectionChanged {
6738 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6739 // previously selected for this system.
6740 optional int64 last_connection_time_millis = 1;
6741
6742 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6743 // to reconnect via adb without user interaction.
6744 optional int64 auth_window_millis = 2;
6745
6746 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6747 optional android.debug.AdbConnectionStateEnum state = 3;
6748
6749 // True if the 'always allow' option was selected for this system.
6750 optional bool always_allow = 4;
6751}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006752
6753/*
6754 * Logs the reported speech DSP status.
6755 *
6756 * Logged from:
6757 * Vendor audio implementation.
6758 */
6759message SpeechDspStatReported {
6760 // The total Speech DSP uptime in milliseconds.
6761 optional int32 total_uptime_millis = 1;
6762 // The total Speech DSP downtime in milliseconds.
6763 optional int32 total_downtime_millis = 2;
6764 optional int32 total_crash_count = 3;
6765 optional int32 total_recover_count = 4;
6766}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006767
6768/**
6769 * Logs USB connector contaminant status.
6770 *
6771 * Logged from: USB Service.
6772 */
6773message UsbContaminantReported {
6774 optional string id = 1;
6775 optional android.service.usb.ContaminantPresenceStatus status = 2;
6776}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006777
6778/**
6779 * This atom is for debugging purpose.
6780 */
6781message DebugElapsedClock {
6782 // Monotically increasing value for each pull.
6783 optional int64 pull_count = 1;
6784 // Time from System.elapsedRealtime.
6785 optional int64 elapsed_clock_millis = 2;
6786 // Time from System.elapsedRealtime.
6787 optional int64 same_elapsed_clock_millis = 3;
6788 // Diff between current elapsed time and elapsed time from previous pull.
6789 optional int64 elapsed_clock_diff_millis = 4;
6790
6791 enum Type {
6792 TYPE_UNKNOWN = 0;
6793 ALWAYS_PRESENT = 1;
6794 PRESENT_ON_ODD_PULLS = 2;
6795 }
6796 // Type of behavior for the pulled data.
6797 optional Type type = 5;
6798}
6799
6800/**
6801 * This atom is for debugging purpose.
6802 */
6803message DebugFailingElapsedClock {
6804 // Monotically increasing value for each pull.
6805 optional int64 pull_count = 1;
6806 // Time from System.elapsedRealtime.
6807 optional int64 elapsed_clock_millis = 2;
6808 // Time from System.elapsedRealtime.
6809 optional int64 same_elapsed_clock_millis = 3;
6810 // Diff between current elapsed time and elapsed time from previous pull.
6811 optional int64 elapsed_clock_diff_millis = 4;
6812}
Steven Wuacef6bb2019-01-23 14:21:17 -05006813
6814/** Logs System UI bubbles event changed.
6815 *
6816 * Logged from:
6817 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6818 */
6819message BubbleUIChanged {
6820
6821 // The app package that is posting the bubble.
6822 optional string package_name = 1;
6823
6824 // The notification channel that is posting the bubble.
6825 optional string notification_channel = 2;
6826
6827 // The notification id associated with the posted bubble.
6828 optional int32 notification_id = 3;
6829
6830 // The position of the bubble within the bubble stack.
6831 optional int32 position = 4;
6832
6833 // The total number of bubbles within the bubble stack.
6834 optional int32 total_number = 5;
6835
6836 // User interactions with the bubble.
6837 enum Action {
6838 UNKNOWN = 0;
6839 POSTED = 1;
6840 UPDATED = 2;
6841 EXPANDED = 3;
6842 COLLAPSED = 4;
6843 DISMISSED = 5;
6844 STACK_DISMISSED = 6;
6845 STACK_MOVED = 7;
6846 HEADER_GO_TO_APP = 8;
6847 HEADER_GO_TO_SETTINGS = 9;
6848 PERMISSION_OPT_IN = 10;
6849 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006850 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006851 SWIPE_LEFT = 13;
6852 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006853 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006854 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006855 }
6856 optional Action action = 6;
6857
6858 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6859 optional float normalized_x_position = 7;
6860 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006861
6862 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6863 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006864
6865 // Whether the bubble is an on-going one.
6866 optional bool is_ongoing = 10;
6867
6868 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006869 // This is deprecated and the value should be ignored.
6870 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006871}
Kweku Adams8845d012018-12-11 20:06:45 -08006872
6873/**
Steven Wu552f63f2019-02-05 13:41:36 -05006874 * Logs System UI bubbles developer errors.
6875 *
6876 * Logged from:
6877 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6878 */
6879message BubbleDeveloperErrorReported {
6880
6881 // The app package that is posting the bubble.
6882 optional string package_name = 1;
6883
6884 // Bubble developer error type enums.
6885 enum Error {
6886 UNKNOWN = 0;
6887 ACTIVITY_INFO_MISSING = 1;
6888 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6889 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6890 }
6891 optional Error error = 2 [default = UNKNOWN];
6892}
6893
6894/**
Kweku Adams8845d012018-12-11 20:06:45 -08006895 * Logs that a constraint for a scheduled job has changed.
6896 *
6897 * Logged from:
6898 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6899 */
6900message ScheduledJobConstraintChanged {
6901 repeated AttributionNode attribution_node = 1;
6902
6903 // Name of the job.
6904 optional string job_name = 2;
6905
6906 optional com.android.server.job.ConstraintEnum constraint = 3;
6907
6908 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006909 UNKNOWN = 0;
6910 UNSATISFIED = 1;
6911 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006912 }
6913 optional State state = 4;
6914}
Alex Salod7c3eef2019-01-25 14:43:27 -08006915
6916/**
6917 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6918 * returns true.
6919 *
6920 * Logged from:
6921 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6922 */
6923message ScreenTimeoutExtensionReported {
6924 // Describes how many times in a row did the power manager reset the screen off timeout.
6925 optional uint32 consecutive_timeout_extended_count = 1;
6926}
Hui Yu885aca12019-01-10 17:11:34 -08006927
6928/*
6929* Logs number of milliseconds it takes to start a process.
6930* The definition of app process start time is from the app launch time to
6931* the time that Zygote finished forking the app process and loaded the
6932* application package's java classes.
6933
6934* This metric is different from AppStartOccurred which is for foreground
6935* activity only.
6936
6937* ProcessStartTime can report all processes (both foreground and background)
6938* start time.
6939*
6940* Logged from:
6941* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6942*/
6943message ProcessStartTime {
6944 // The uid of the ProcessRecord.
6945 optional int32 uid = 1 [(is_uid) = true];
6946
6947 // The process pid.
6948 optional int32 pid = 2;
6949
6950 // The process name.
6951 // Usually package name, "system" for system server.
6952 // Provided by ActivityManagerService.
6953 optional string process_name = 3;
6954
6955 enum StartType {
6956 UNKNOWN = 0;
6957 WARM = 1;
6958 HOT = 2;
6959 COLD = 3;
6960 }
6961
6962 // The start type.
6963 optional StartType type = 4;
6964
6965 // The elapsed realtime at the start of the process.
6966 optional int64 process_start_time_millis = 5;
6967
6968 // Number of milliseconds it takes to reach bind application.
6969 optional int32 bind_application_delay_millis = 6;
6970
6971 // Number of milliseconds it takes to finish start of the process.
6972 optional int32 process_start_delay_millis = 7;
6973
6974 // hostingType field in ProcessRecord, the component type such as "activity",
6975 // "service", "content provider", "broadcast" or other strings.
6976 optional string hosting_type = 8;
6977
6978 // hostingNameStr field in ProcessRecord. The component class name that runs
6979 // in this process.
6980 optional string hosting_name = 9;
6981}
6982
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006983/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006984 * Track Media Codec usage
6985 * Logged from:
6986 * frameworks/av/media/libstagefright/MediaCodec.cpp
6987 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6988 */
6989message MediametricsCodecReported {
6990 optional int64 timestamp_nanos = 1;
6991 optional string package_name = 2;
6992 optional int64 package_version_code = 3;
6993 optional int64 media_apex_version = 4;
6994
6995 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6996}
6997
6998/**
6999 * Track Media Extractor (pulling video/audio streams out of containers) usage
7000 * Logged from:
7001 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7002 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7003 */
7004message MediametricsExtractorReported {
7005 optional int64 timestamp_nanos = 1;
7006 optional string package_name = 2;
7007 optional int64 package_version_code = 3;
7008 optional int64 media_apex_version = 4;
7009
7010 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7011}
7012
7013/**
7014 * Track how we arbitrate between microphone/input requests.
7015 * Logged from
7016 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7017 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7018 */
7019message MediametricsAudiopolicyReported {
7020 optional int64 timestamp_nanos = 1;
7021 optional string package_name = 2;
7022 optional int64 package_version_code = 3;
7023 optional int64 media_apex_version = 4;
7024
7025 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7026}
7027
7028/**
7029 * Track how we arbitrate between microphone requests.
7030 * Logged from
7031 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7032 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7033 */
7034message MediametricsAudiorecordReported {
7035 optional int64 timestamp_nanos = 1;
7036 optional string package_name = 2;
7037 optional int64 package_version_code = 3;
7038 optional int64 media_apex_version = 4;
7039
7040 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7041}
7042
7043/**
7044 * Track how we arbitrate between microphone/input requests.
7045 * Logged from
7046 * frameworks/av/media/libnblog/ReportPerformance.cpp
7047 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7048 */
7049message MediametricsAudiothreadReported {
7050 optional int64 timestamp_nanos = 1;
7051 optional string package_name = 2;
7052 optional int64 package_version_code = 3;
7053 optional int64 media_apex_version = 4;
7054
7055 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7056}
7057
7058/**
7059 * Track how we arbitrate between microphone/input requests.
7060 * Logged from
7061 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7062 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7063 */
7064message MediametricsAudiotrackReported {
7065 optional int64 timestamp_nanos = 1;
7066 optional string package_name = 2;
7067 optional int64 package_version_code = 3;
7068 optional int64 media_apex_version = 4;
7069
7070 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7071}
7072
7073/**
7074 * Track information about DRM framework performance
7075 * Logged from
7076 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7077 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7078 */
7079message MediametricsMediadrmReported {
7080 optional int64 timestamp_nanos = 1;
7081 optional string package_name = 2;
7082 optional int64 package_version_code = 3;
7083 optional int64 media_apex_version = 4;
7084
7085 // vendor+description tell about which DRM plugin is in use on this device
7086 optional string vendor = 5;
7087 optional string description = 6;
7088 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7089 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7090}
7091
7092/**
7093 * Track information about the widevine DRM plugin performance
7094 * Logged from
7095 * vendor/widevine/libwvdrmengine/cdm/metrics
7096 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7097 */
7098message MediametricsDrmWidevineReported {
7099 optional int64 timestamp_nanos = 1;
7100 optional string package_name = 2;
7101 optional int64 package_version_code = 3;
7102 optional int64 media_apex_version = 4;
7103
7104 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7105}
7106
7107/**
7108 * Track information about recordings (e.g. camcorder)
7109 * Logged from
7110 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7111 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7112 */
7113message MediametricsRecorderReported {
7114 optional int64 timestamp_nanos = 1;
7115 optional string package_name = 2;
7116 optional int64 package_version_code = 3;
7117 optional int64 media_apex_version = 4;
7118
7119 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7120}
7121
7122/**
7123 * Track Media Player usage
7124 * Logged from:
7125 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7126 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7127 */
7128message MediametricsNuPlayerReported {
7129 optional int64 timestamp_nanos = 1;
7130 optional string package_name = 2;
7131 optional int64 package_version_code = 3;
7132 optional int64 media_apex_version = 4;
7133
7134 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7135}
7136
7137/**
Robert Shiha4beed32019-08-19 14:15:23 -07007138 * Track Legacy DRM usage
7139 * Logged from
7140 * frameworks/av/drm/drmserver/DrmManager.cpp
7141 */
7142message MediametricsDrmManagerReported {
7143 optional int64 timestamp_nanos = 1;
7144 optional string package_name = 2;
7145 optional int64 package_version_code = 3;
7146 optional int64 media_apex_version = 4;
7147
7148 enum Method {
7149 METHOD_NOT_FOUND = -1;
7150 GET_CONSTRAINTS = 0;
7151 GET_METADATA = 1;
7152 CAN_HANDLE = 2;
7153 PROCESS_DRM_INFO = 3;
7154 ACQUIRE_DRM_INFO = 4;
7155 SAVE_RIGHTS = 5;
7156 GET_ORIGINAL_MIME_TYPE = 6;
7157 GET_DRM_OBJECT_TYPE = 7;
7158 CHECK_RIGHTS_STATUS = 8;
7159 REMOVE_RIGHTS = 9;
7160 REMOVE_ALL_RIGHTS = 10;
7161 OPEN_CONVERT_SESSION = 11;
7162 OPEN_DECRYPT_SESSION = 12;
7163 }
7164
7165 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7166 optional string plugin_id = 5;
7167 optional string description = 6;
7168 optional Method method = 7;
7169 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007170
7171 optional int64 get_constraints_count = 9;
7172 optional int64 get_metadata_count = 10;
7173 optional int64 can_handle_count = 11;
7174 optional int64 process_drm_info_count = 12;
7175 optional int64 acquire_drm_info_count = 13;
7176 optional int64 save_rights_count = 14;
7177 optional int64 get_original_mime_type_count = 15;
7178 optional int64 get_drm_object_type_count = 16;
7179 optional int64 check_rights_status_count = 17;
7180 optional int64 remove_rights_count = 18;
7181 optional int64 remove_all_rights_count = 19;
7182 optional int64 open_convert_session_count = 20;
7183 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007184}
7185
7186/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007187 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007188 * Pulled from: StatsCompanionService
7189*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007190message DangerousPermissionState {
7191 // Name of the permission
7192 optional string permission_name = 1;
7193
7194 // Uid of the package
7195 optional int32 uid = 2 [(is_uid) = true];
7196
7197 // Package requesting the permission
7198 optional string package_name = 3;
7199
7200 // If the permission is granted to the uid
7201 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007202
7203 // Permission flags as per android.content.pm.PermissionFlags
7204 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007205}
7206
Michael Groover4a0ca942019-01-24 17:41:25 -08007207/**
7208 * Logs when a package is denied access to a device identifier based on the new access requirements.
7209 *
7210 * Logged from:
7211 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7212 */
7213message DeviceIdentifierAccessDenied {
7214 // The name of the package denied access to the requested device identifier.
7215 optional string package_name = 1;
7216
7217 // The name of the device identifier method the package attempted to invoke.
7218 optional string method_name = 2;
7219
7220 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007221 // Starting from Android 11, this boolean is not set and will always be false.
7222 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007223
7224 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007225 // Starting from Android 11, this boolean is not set and will always be false.
7226 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007227}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007228
7229/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007230 * Pulls the ongoing mainline install train version code.
7231 * Pulled from StatsCompanionService
7232 */
7233message TrainInfo {
7234 optional int64 train_version_code = 1;
7235
7236 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007237
7238 optional string train_name = 3;
7239
7240 enum Status {
7241 UNKNOWN = 0;
7242 INSTALL_REQUESTED = 1;
7243 INSTALL_STARTED = 2;
7244 INSTALL_STAGED_NOT_READY = 3;
7245 INSTALL_STAGED_READY = 4;
7246 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007247 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7248 // and INSTALL_FAILURE_COMMIT.
7249 INSTALL_FAILURE = 6 [deprecated = true];
7250 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007251 INSTALL_CANCELLED = 7;
7252 INSTALLER_ROLLBACK_REQUESTED = 8;
7253 INSTALLER_ROLLBACK_INITIATED = 9;
7254 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7255 INSTALLER_ROLLBACK_STAGED = 11;
7256 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7257 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7258 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7259 INSTALLER_ROLLBACK_SUCCESS = 15;
7260 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007261 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7262 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7263 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7264 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7265 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7266 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007267 INSTALL_FAILURE_DOWNLOAD = 23;
7268 INSTALL_FAILURE_STATE_MISMATCH = 24;
7269 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007270 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007271 }
7272 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007273}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007274
7275/**
7276 * Logs the gesture stage changed event.
7277 *
7278 * Logged from:
7279 * frameworks/base/packages/SystemUI/
7280 */
7281message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007282 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007283}
7284
7285/**
7286 * Logs the feedback type.
7287 *
7288 * Logged from:
7289 * frameworks/base/packages/SystemUI/
7290 */
7291message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007292 // Whether or not the gesture was used.
7293 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007294}
7295
7296/**
7297 * Logs the progress.
7298 *
7299 * Logged from:
7300 * frameworks/base/packages/SystemUI/
7301 */
7302message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007303 // [0,100] progress for the assist gesture.
7304 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007305}
Neil Fullerdb14b482019-02-05 19:44:44 +00007306
7307/*
7308 * Information about the time zone data on a device.
7309 */
7310message TimeZoneDataInfo {
7311 // A version identifier for the data set on device. e.g. "2018i"
7312 optional string tzdb_version = 1;
7313}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007314
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007315/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007316 * Logs the GPU stats global health information.
7317 *
7318 * Logged from:
7319 * frameworks/native/services/gpuservice/gpustats/
7320 */
7321message GpuStatsGlobalInfo {
7322 // Package name of the gpu driver.
7323 optional string driver_package_name = 1;
7324
7325 // Version name of the gpu driver.
7326 optional string driver_version_name = 2;
7327
7328 // Version code of the gpu driver.
7329 optional int64 driver_version_code = 3;
7330
7331 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7332 optional int64 driver_build_time = 4;
7333
7334 // Total count of the gl driver gets loaded.
7335 optional int64 gl_loading_count = 5;
7336
7337 // Total count of the gl driver fails to be loaded.
7338 optional int64 gl_loading_failure_count = 6;
7339
7340 // Total count of the Vulkan driver gets loaded.
7341 optional int64 vk_loading_count = 7;
7342
7343 // Total count of the Vulkan driver fails to be loaded.
7344 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007345
7346 // Api version of the system Vulkan driver.
7347 optional int32 vulkan_version = 9;
7348
7349 // Api version of the system CPU Vulkan driver.
7350 optional int32 cpu_vulkan_version = 10;
7351
7352 // Api version of the system GLES driver.
7353 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007354
7355 // Total count of the angle driver gets loaded.
7356 optional int64 angle_loading_count = 12;
7357
7358 // Total count of the angle driver fails to be loaded.
7359 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007360}
7361
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007362/**
7363 * GPU driver loading time info.
7364 */
7365message GpuDriverLoadingTime {
7366 // List of all the driver loading times for this app. The list size is
7367 // capped at 50.
7368 repeated int64 driver_loading_time = 1;
7369}
7370
7371/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007372 * Logs the GPU stats per app health information.
7373 *
7374 * Logged from:
7375 * frameworks/native/services/gpuservice/gpustats/
7376 */
7377message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007378 // Package name of the application that loads the gpu driver. Total number
7379 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007380 optional string app_package_name = 1;
7381
7382 // Version code of the gpu driver this app loads.
7383 optional int64 driver_version_code = 2;
7384
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007385 // gl driver loading time info.
7386 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7387 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007388
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007389 // Vulkan driver loading time info.
7390 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7391 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007392
7393 // Angle driver loading time info.
7394 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7395 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007396
7397 // CPU Vulkan implementation is in use.
7398 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007399
7400 // App is not doing pre-rotation correctly.
7401 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007402
7403 // App creates GLESv1 context.
7404 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007405}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007406
7407/*
7408 * Logs the size of the system ion heap.
7409 *
7410 * Pulled from StatsCompanionService.
7411 */
7412message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007413 // Deprecated due to limited support of ion stats in debugfs.
7414 // Use `IonHeapSize` instead.
7415 option deprecated = true;
7416
Rafal Slawikd4e87572019-03-12 13:08:38 +00007417 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007418 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007419 optional int64 size_in_bytes = 1;
7420}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007421
Rafal Slawik77987ed2019-06-17 12:28:23 +01007422/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007423 * Logs the total size of the ion heap.
7424 *
7425 * Pulled from StatsCompanionService.
7426 */
7427message IonHeapSize {
7428 // Total size of all ion heaps in kilobytes.
7429 // Read from: /sys/kernel/ion/total_heaps_kb.
7430 optional int32 total_size_kb = 1;
7431}
7432
7433/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007434 * Logs the per-process size of the system ion heap.
7435 *
7436 * Pulled from StatsCompanionService.
7437 */
7438message ProcessSystemIonHeapSize {
7439 // The uid if available. -1 means not available.
7440 optional int32 uid = 1 [(is_uid) = true];
7441
7442 // The process name (from /proc/PID/cmdline).
7443 optional string process_name = 2;
7444
7445 // Sum of sizes of all allocations.
7446 optional int32 total_size_in_kilobytes = 3;
7447
7448 // Number of allocations.
7449 optional int32 allocation_count = 4;
7450
7451 // Size of the largest allocation.
7452 optional int32 max_size_in_kilobytes = 5;
7453}
7454
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007455/**
7456 * Push network stack events.
7457 *
7458 * Log from:
7459 * frameworks/base/packages/NetworkStack/
7460 */
7461message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007462 // The id that indicates the event reported from NetworkStack.
7463 optional int32 event_id = 1;
7464 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007465 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7466}
Carmen Agimofa769c152019-03-04 14:39:14 +00007467
7468/**
7469 * Logs the apps that are installed on the external storage.
7470 * Pulled from:
7471 * StatsCompanionService
7472 */
7473message AppsOnExternalStorageInfo {
7474 // The type of the external storage.
7475 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7476 // The name of the package that is installed on the external storage.
7477 optional string package_name = 2;
7478}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007479
7480/**
7481 * Logs the settings related to Face.
7482 * Logged from:
7483 * frameworks/base/services/core/java/com/android/server/stats
7484 */
7485message FaceSettings {
7486 // Whether or not face unlock is allowed on Keyguard.
7487 optional bool unlock_keyguard_enabled = 1;
7488 // Whether or not face unlock dismisses the Keyguard.
7489 optional bool unlock_dismisses_keyguard = 2;
7490 // Whether or not face unlock requires attention.
7491 optional bool unlock_attention_required = 3;
7492 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7493 optional bool unlock_app_enabled = 4;
7494 // Whether or not face unlock always requires user confirmation.
7495 optional bool unlock_always_require_confirmation = 5;
7496 // Whether or not a diverse set of poses are required during enrollment.
7497 optional bool unlock_diversity_required = 6;
7498}
Maggie White442b6312019-04-05 16:26:44 -07007499
7500/**
7501 * Logs cooling devices maintained by the kernel.
7502 *
7503 * Pulled from StatsCompanionService.java
7504 */
7505message CoolingDevice {
7506 // The type of cooling device being reported. Eg. CPU, GPU...
7507 optional android.os.CoolingTypeEnum device_location = 1;
7508 // The name of the cooling device source. Eg. CPU0
7509 optional string device_name = 2;
7510 // Current throttle state of the cooling device. The value can any unsigned
7511 // integer between 0 and max_state defined in its driver. 0 means device is
7512 // not in throttling, higher value means deeper throttling.
7513 optional int32 state = 3;
7514}
Ben Blount763a5d52019-04-10 11:48:58 -07007515
7516/**
7517 * Intelligence has several counter-type events that don't warrant a
7518 * full separate atom. These are primarily API call counters but also include
7519 * counters for feature usage and specific failure modes.
7520 *
7521 * Logged from the Intelligence mainline module.
7522 */
7523message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007524 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007525 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007526 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007527 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007528 // How many times the event occured (to report a batch of high frequency events).
7529 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007530 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007531 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007532}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007533
7534/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007535 * Logs when Car Power state changed.
7536 *
7537 * Logged from:
7538 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7539 */
7540message CarPowerStateChanged {
7541 // States come from CpmsState in CarPowerManagementService.java.
7542 enum State {
7543 WAIT_FOR_VHAL = 0;
7544 ON = 1;
7545 SHUTDOWN_PREPARE = 2;
7546 WAIT_FOR_FINISH = 3;
7547 SUSPEND = 4;
7548 SIMULATE_SLEEP = 5;
7549 }
7550 optional State state = 1;
7551}
7552
7553/**
7554 * Logs whether GarageMode is entered.
7555 *
7556 * Logged from:
7557 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7558 */
7559message GarageModeInfo {
7560 // Whether GarageMode is entered.
7561 optional bool is_garage_mode = 1;
7562}
Martijn Coenencd95d462019-04-25 17:09:45 +02007563
7564/**
7565 * Historical app ops data per package.
7566 */
7567message AppOps {
7568 // Uid of the package requesting the op
7569 optional int32 uid = 1 [(is_uid) = true];
7570
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007571 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007572 optional string package_name = 2;
7573
7574 // operation id; maps to the OP_* constants in AppOpsManager.java
7575 optional int32 op_id = 3;
7576
7577 // The number of times the op was granted while the app was in the
7578 // foreground (only for trusted requests)
7579 optional int64 trusted_foreground_granted_count = 4;
7580
7581 // The number of times the op was granted while the app was in the
7582 // background (only for trusted requests)
7583 optional int64 trusted_background_granted_count = 5;
7584
7585 // The number of times the op was rejected while the app was in the
7586 // foreground (only for trusted requests)
7587 optional int64 trusted_foreground_rejected_count = 6;
7588
7589 // The number of times the op was rejected while the app was in the
7590 // background (only for trusted requests)
7591 optional int64 trusted_background_rejected_count = 7;
7592
7593 // For long-running operations, total duration of the operation
7594 // while the app was in the foreground (only for trusted requests)
7595 optional int64 trusted_foreground_duration_millis = 8;
7596
7597 // For long-running operations, total duration of the operation
7598 // while the app was in the background (only for trusted requests)
7599 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007600
7601 // Whether AppOps is guarded by Runtime permission
7602 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007603}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007604
7605/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007606 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007607 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007608message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007609 // Uid of the package requesting the op
7610 optional int32 uid = 1 [(is_uid) = true];
7611
7612 // Name of the package performing the op
7613 optional string package_name = 2;
7614
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007615 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7616 // Attributions must be provided through manifest using <attribution> tag available in R and
7617 // above.
7618 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007619
7620 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7621 optional string op = 4;
7622
7623 // The number of times the op was granted while the app was in the
7624 // foreground (only for trusted requests)
7625 optional int64 trusted_foreground_granted_count = 5;
7626
7627 // The number of times the op was granted while the app was in the
7628 // background (only for trusted requests)
7629 optional int64 trusted_background_granted_count = 6;
7630
7631 // The number of times the op was rejected while the app was in the
7632 // foreground (only for trusted requests)
7633 optional int64 trusted_foreground_rejected_count = 7;
7634
7635 // The number of times the op was rejected while the app was in the
7636 // background (only for trusted requests)
7637 optional int64 trusted_background_rejected_count = 8;
7638
7639 // For long-running operations, total duration of the operation
7640 // while the app was in the foreground (only for trusted requests)
7641 optional int64 trusted_foreground_duration_millis = 9;
7642
7643 // For long-running operations, total duration of the operation
7644 // while the app was in the background (only for trusted requests)
7645 optional int64 trusted_background_duration_millis = 10;
7646
7647 // Whether AppOps is guarded by Runtime permission
7648 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007649
7650 // Sampling rate used on device, from 0 to 100
7651 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007652}
7653
7654/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007655 * Location Manager API Usage information(e.g. API under usage,
7656 * API call's parameters).
7657 * Logged from:
7658 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7659 */
7660message LocationManagerApiUsageReported {
7661
7662 // Indicating if usage starts or usage ends.
7663 optional android.stats.location.UsageState state = 1;
7664
7665 // LocationManagerService's API in use.
7666 // We can identify which API from LocationManager is
7667 // invoking current LMS API by the combination of
7668 // API parameter(e.g. is_listener_null, is_intent_null,
7669 // is_location_request_null)
7670 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7671
7672 // Name of the package calling the API.
7673 optional string calling_package_name = 3;
7674
7675 // Type of the location provider.
7676 optional android.stats.location.ProviderType provider = 4;
7677
7678 // Quality of the location request
7679 optional android.stats.location.LocationRequestQuality quality = 5;
7680
7681 // The desired interval for active location updates, in milliseconds.
7682 // Bucketized to reduce cardinality.
7683 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7684
7685 // Minimum distance between location updates, in meters.
7686 // Bucketized to reduce cardinality.
7687 optional android.stats.location.SmallestDisplacementBucket
7688 bucketized_smallest_displacement = 7;
7689
7690 // The number of location updates.
7691 optional int64 num_updates = 8;
7692
7693 // The request expiration time, in millisecond since boot.
7694 // Bucketized to reduce cardinality.
7695 optional android.stats.location.ExpirationBucket
7696 bucketized_expire_in = 9;
7697
7698 // Type of Callback passed in for this API.
7699 optional android.stats.location.CallbackType callback_type = 10;
7700
7701 // The radius of the central point of the alert
7702 // region, in meters. Only for API REQUEST_GEOFENCE.
7703 // Bucketized to reduce cardinality.
7704 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7705
7706 // Activity Importance of API caller.
7707 // Categorized to 3 types that are interesting from location's perspective.
7708 optional android.stats.location.ActivityImportance activiy_importance = 12;
7709}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007710
7711/**
7712 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7713 */
7714message ReviewPermissionsFragmentResultReported {
7715 // unique value identifying a permission group change. A permission group change might result
7716 // in multiple of these atoms
7717 optional int64 change_id = 1;
7718
7719 // UID of package the permission belongs to
7720 optional int32 uid = 2 [(is_uid) = true];
7721
7722 // Name of package the permission belongs to
7723 optional string package_name = 3;
7724
7725 // The permission to be granted
7726 optional string permission_name = 4;
7727
7728 // The result of the permission grant
7729 optional bool permission_granted = 5;
7730}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007731
7732/**
7733* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7734* Logged from: RuntimePermissionUpdgradeController
7735*/
7736message RuntimePermissionsUpgradeResult {
7737 // Permission granted as result of upgrade
7738 optional string permission_name = 1;
7739
7740 // UID of package granted permission
7741 optional int32 uid = 2 [(is_uid) = true];
7742
7743 // Name of package granted permission
7744 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007745}
7746
7747/**
7748* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7749*/
7750message GrantPermissionsActivityButtonActions {
7751 // Permission granted as result of upgrade
7752 optional string permission_group_name = 1;
7753
7754 // UID of package granted permission
7755 optional int32 uid = 2 [(is_uid) = true];
7756
7757 // Name of package requesting permission
7758 optional string package_name = 3;
7759
7760 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7761 // LABEL_ constants in GrantPermissionActivity.java
7762 optional int32 buttons_presented = 4;
7763
7764 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7765 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007766
7767 // id which identifies single session of user interacting with permission controller
7768 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007769}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007770
7771/**
7772 * Information about LocationAccessCheck notification presented to user
7773 */
7774message LocationAccessCheckNotificationAction {
7775
7776 // id which identifies single session of user interacting with permission controller
7777 optional int64 session_id = 1;
7778
7779 // Uid of package for which location access check is presented
7780 optional int32 package_uid = 2;
7781
7782 // Name of package for which location access check is presented
7783 optional string package_name = 3;
7784
7785 enum Result {
7786 UNDEFINED = 0;
7787 // notification was presented to the user
7788 NOTIFICATION_PRESENTED = 1;
7789 // notification was declined by the user
7790 NOTIFICATION_DECLINED = 2;
7791 // notification was clicked by the user
7792 NOTIFICATION_CLICKED = 3;
7793 }
7794
7795 // View / interaction recorded
7796 optional Result result = 4;
7797}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007798
7799/**
7800 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7801 */
7802message AppPermissionFragmentActionReported {
7803 // id which identifies single session of user interacting with permission controller
7804 optional int64 session_id = 1;
7805
7806 // unique value identifying a permission group change. A permission group change might result
7807 // in multiple of these atoms
7808 optional int64 change_id = 2;
7809
7810 // UID of package the permission belongs to
7811 optional int32 uid = 3 [(is_uid) = true];
7812
7813 // Name of package the permission belongs to
7814 optional string package_name = 4;
7815
7816 // The permission to be granted
7817 optional string permission_name = 5;
7818
7819 // The result of the permission grant
7820 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007821
7822 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7823 optional int32 permission_flags = 7;
7824
7825 enum Button {
7826 UNDEFINED = 0;
7827 // Allow button
7828 ALLOW = 1;
7829 // Deny button
7830 DENY = 2;
7831 // Ask every time button
7832 ASK_EVERY_TIME = 3;
7833 // Allow all the time button
7834 ALLOW_ALWAYS = 4;
7835 // Allow only while using the app button
7836 ALLOW_FOREGROUND = 5;
7837 // Same is Deny button but shown in while in use dialog
7838 DENY_FOREGROUND = 6;
7839 }
7840
7841 // Button pressed in the dialog
7842 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007843}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007844
7845/**
7846* Information about a AppPermissionFragment viewed by user
7847*/
7848message AppPermissionFragmentViewed {
7849 // id which identifies single session of user interacting with permission controller
7850 optional int64 session_id = 1;
7851
7852 // UID of package for which permissions are viewed
7853 optional int32 uid = 2 [(is_uid) = true];
7854
7855 // Name of package for which permissions are viewed
7856 optional string package_name = 3;
7857
7858 // Permission group viewed
7859 optional string permission_group_name = 4;
7860}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007861
7862/**
7863* Information about a AppPermissionsFragment viewed by user
7864*/
7865message AppPermissionsFragmentViewed {
7866 // id which identifies single session of user interacting with permission controller
7867 optional int64 session_id = 1;
7868
7869 // id which identifies single view as every view might have several logging records
7870 // with different package information attached
7871 optional int64 view_id = 2;
7872
7873 // Permission group viewed
7874 optional string permission_group_name = 3;
7875
7876 // UID of package for which permissions are viewed
7877 optional int32 uid = 4 [(is_uid) = true];
7878
7879 // Name of package for which permissions are viewed
7880 optional string package_name = 5;
7881
7882 // Category in which permission is included
7883 enum Category {
7884 UNDEFINED = 0;
7885 ALLOWED = 1;
7886 ALLOWED_FOREGROUND = 2;
7887 DENIED = 3;
7888 }
7889 optional Category category = 6;
7890}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007891
7892/**
7893* Information about a PermissionAppsFragment viewed by user.
7894* Logged from ui/handheld/PermissionAppsFragment.java
7895*/
7896message PermissionAppsFragmentViewed {
7897 // id which identifies single session of user interacting with permission controller
7898 optional int64 session_id = 1;
7899
7900 // id which identifies single view as every view might have several logging records
7901 // with different package information attached
7902 optional int64 view_id = 2;
7903
7904 // Permission group viewed
7905 optional string permission_group_name = 3;
7906
7907 // UID of package for which permissions are viewed
7908 optional int32 uid = 4 [(is_uid) = true];
7909
7910 // Name of package for which permissions are viewed
7911 optional string package_name = 5;
7912
7913 // Category in which app is included
7914 enum Category {
7915 UNDEFINED = 0;
7916 ALLOWED = 1;
7917 ALLOWED_FOREGROUND = 2;
7918 DENIED = 3;
7919 }
7920 optional Category category = 6;
7921}
Tony Make2b1b672019-07-29 16:59:47 +01007922
7923/**
7924 * Logs when there is a smart selection related event.
7925 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7926 * Logged from: TextClassifierEventLogger.java
7927 */
7928message TextSelectionEvent {
7929 // A session ID.
7930 optional string session_id = 1;
7931
7932 // Event type of this event.
7933 optional android.stats.textclassifier.EventType event_type = 2;
7934
Tony Mak9c84bd22019-12-09 07:27:25 +00007935 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007936 optional string model_name = 3;
7937
7938 // Type of widget that was involved in triggering this event.
7939 optional android.stats.textclassifier.WidgetType widget_type = 4;
7940
7941 // Index of this event in a session.
7942 optional int32 event_index = 5;
7943
7944 // Entity type that is involved.
7945 optional string entity_type = 6;
7946
7947 // Relative word index of the start of the selection.
7948 optional int32 relative_word_start_index = 7;
7949
7950 // Relative word (exclusive) index of the end of the selection.
7951 optional int32 relative_word_end_index = 8;
7952
7953 // Relative word index of the start of the smart selection.
7954 optional int32 relative_suggested_word_start_index = 9;
7955
7956 // Relative word (exclusive) index of the end of the smart selection.
7957 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007958
7959 // Name of source package.
7960 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007961}
7962
7963/**
7964 * Logs when there is a smart linkify related event.
7965 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7966 * Logged from: TextClassifierEventLogger.java
7967 */
7968message TextLinkifyEvent {
7969 // A session ID.
7970 optional string session_id = 1;
7971
7972 // Event type of this event.
7973 optional android.stats.textclassifier.EventType event_type = 2;
7974
Tony Mak9c84bd22019-12-09 07:27:25 +00007975 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007976 optional string model_name = 3;
7977
7978 // Type of widget that was involved in triggering this event.
7979 optional android.stats.textclassifier.WidgetType widget_type = 4;
7980
7981 // Index of this event in a session.
7982 optional int32 event_index = 5;
7983
7984 // Entity type that is involved.
7985 optional string entity_type = 6;
7986
7987 // Number of links detected.
7988 optional int32 num_links = 7;
7989
7990 // The total length of all links.
7991 optional int32 linked_text_length = 8;
7992
7993 // Length of input text.
7994 optional int32 text_length = 9;
7995
7996 // Time spent on generating links in ms.
7997 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007998
7999 // Name of source package.
8000 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008001}
8002
8003/**
8004 * Logs when there is a conversation actions related event.
8005 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8006 * Logged from: TextClassifierEventLogger.java
8007 */
8008message ConversationActionsEvent {
8009 // A session ID.
8010 optional string session_id = 1;
8011
8012 // Event type of this event.
8013 optional android.stats.textclassifier.EventType event_type = 2;
8014
Tony Mak9c84bd22019-12-09 07:27:25 +00008015 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008016 optional string model_name = 3;
8017
8018 // Type of widget that was involved in triggering this event.
8019 optional android.stats.textclassifier.WidgetType widget_type = 4;
8020
8021 // The first entity type that is involved.
8022 optional string first_entity_type = 5;
8023
8024 // The second entity type that is involved.
8025 optional string second_entity_type = 6;
8026
8027 // The third entity type that is involved.
8028 optional string third_entity_type = 7;
8029
8030 // The score of the first entity type.
8031 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008032
8033 // Name of source package.
8034 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008035
8036 // Name of the annotator model that is involved in this event.
8037 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008038}
8039
8040/**
8041 * Logs when there is a language detection related event.
8042 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8043 * Logged from: TextClassifierEventLogger.java
8044 */
8045message LanguageDetectionEvent {
8046 // A session ID.
8047 optional string session_id = 1;
8048
8049 // Event type of this event.
8050 optional android.stats.textclassifier.EventType event_type = 2;
8051
Tony Mak9c84bd22019-12-09 07:27:25 +00008052 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008053 optional string model_name = 3;
8054
8055 // Type of widget that was involved in triggering this event.
8056 optional android.stats.textclassifier.WidgetType widget_type = 4;
8057
8058 // Detected language.
8059 optional string language_tag = 5;
8060
8061 // Score of the detected language.
8062 optional float score = 6;
8063
8064 // Position of this action.
8065 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008066
8067 // Name of source package.
8068 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008069}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008070
8071/**
8072 * Information about an OTA update attempt by update_engine.
8073 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8074 */
8075message UpdateEngineUpdateAttemptReported {
8076 // The number of attempts for the update engine to apply a given payload.
8077 optional int32 attempt_number = 1;
8078
8079 optional android.stats.otaupdate.PayloadType payload_type = 2;
8080
8081 // The total time in minutes for the update engine to apply a given payload.
8082 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8083 // it's increased when the system is sleeping.
8084 optional int32 duration_boottime_in_minutes = 3;
8085
8086 // The total time in minutes for the update engine to apply a given payload.
8087 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8088 // and it's not increased when the system is sleeping.
8089 optional int32 duration_monotonic_in_minutes = 4;
8090
8091 // The size of the payload in MiBs.
8092 optional int32 payload_size_mib = 5;
8093
8094 // The attempt result reported by the update engine for an OTA update.
8095 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8096
8097 // The error code reported by the update engine after an OTA update attempt
8098 // on A/B devices.
8099 optional android.stats.otaupdate.ErrorCode error_code = 7;
8100
8101 // The build fingerprint of the source system. The value is read from a
8102 // system property when the device takes the update. e.g.
8103 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8104 optional string source_fingerprint = 8;
8105}
8106
8107/**
8108 * Information about all the attempts the device make before finishing the
8109 * successful update.
8110 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8111 */
8112message UpdateEngineSuccessfulUpdateReported {
8113 // The number of attempts for the update engine to apply the payload for a
8114 // successful update.
8115 optional int32 attempt_count = 1;
8116
8117 optional android.stats.otaupdate.PayloadType payload_type = 2;
8118
8119 optional int32 payload_size_mib = 3;
8120
8121 // The total number of bytes downloaded by update_engine since the last
8122 // successful update.
8123 optional int32 total_bytes_downloaded_mib = 4;
8124
8125 // The ratio in percentage of the over-downloaded bytes compared to the
8126 // total bytes needed to successfully install the update. e.g. 200 if we
8127 // download 200MiB in total for a 100MiB package.
8128 optional int32 download_overhead_percentage = 5;
8129
8130 // The total time in minutes for the update engine to apply the payload for a
8131 // successful update.
8132 optional int32 total_duration_minutes = 6;
8133
8134 // The number of reboot of the device during a successful update.
8135 optional int32 reboot_count = 7;
8136}
Alec Mourie088e762019-07-02 13:10:55 -07008137
8138/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008139 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8140 * key to indicate whether it was successful or not.
8141 *
8142 * Logged from:
8143 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8144 */
8145message RebootEscrowRecoveryReported {
8146 optional bool successful = 1;
8147}
8148
8149/**
Alec Mourie088e762019-07-02 13:10:55 -07008150 * Global display pipeline metrics reported by SurfaceFlinger.
8151 * Pulled from:
8152 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8153 */
8154message SurfaceflingerStatsGlobalInfo {
8155 // Total number of frames presented during the tracing period
8156 optional int64 total_frames = 1;
8157 // Total number of frames missed
8158 optional int64 missed_frames = 2;
8159 // Total number of frames that fell back to client composition
8160 optional int64 client_composition_frames = 3;
8161 // Total time the display was turned on
8162 optional int64 display_on_millis = 4;
8163 // Total time that was spent performing animations.
8164 // This is derived from the present-to-present layer histogram
8165 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008166 // Total number of event connections tracked by SurfaceFlinger at the time
8167 // of this pull. If this number grows prohibitively large, then this can
8168 // cause jank due to resource contention.
8169 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008170 // Set of timings measured from when SurfaceFlinger began compositing a
8171 // frame, until the frame was requested to be presented to the display. This
8172 // measures SurfaceFlinger's total CPU walltime on the critical path per
8173 // frame.
8174 optional FrameTimingHistogram frame_duration = 7
8175 [(android.os.statsd.log_mode) = MODE_BYTES];
8176 // Set of timings measured from when SurfaceFlinger first began using the
8177 // GPU to composite a frame, until the GPU has finished compositing that
8178 // frame. This measures the total additional time SurfaceFlinger needed to
8179 // perform due to falling back into GPU composition.
8180 optional FrameTimingHistogram render_engine_timing = 8
8181 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008182}
8183
8184/**
8185 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8186 * The number of layers uploaded will be restricted due to size limitations.
8187 * Pulled from:
8188 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8189 */
8190message SurfaceflingerStatsLayerInfo {
8191 // The layer for this set of metrics
8192 // For now we can infer that the package name is included in the layer
8193 // name.
8194 optional string layer_name = 1;
8195 // Total number of frames presented
8196 optional int64 total_frames = 2;
8197 // Total number of dropped frames while latching a buffer for this layer.
8198 optional int64 dropped_frames = 3;
8199 // Set of timings measured between successive presentation timestamps.
8200 optional FrameTimingHistogram present_to_present = 4
8201 [(android.os.statsd.log_mode) = MODE_BYTES];
8202 // Set of timings measured from when an app queued a buffer for
8203 // presentation, until the buffer was actually presented to the
8204 // display.
8205 optional FrameTimingHistogram post_to_present = 5
8206 [(android.os.statsd.log_mode) = MODE_BYTES];
8207 // Set of timings measured from when a buffer is ready to be presented,
8208 // until the buffer was actually presented to the display.
8209 optional FrameTimingHistogram acquire_to_present = 6
8210 [(android.os.statsd.log_mode) = MODE_BYTES];
8211 // Set of timings measured from when a buffer was latched by
8212 // SurfaceFlinger, until the buffer was presented to the display
8213 optional FrameTimingHistogram latch_to_present = 7
8214 [(android.os.statsd.log_mode) = MODE_BYTES];
8215 // Set of timings measured from the desired presentation to the actual
8216 // presentation time
8217 optional FrameTimingHistogram desired_to_present = 8
8218 [(android.os.statsd.log_mode) = MODE_BYTES];
8219 // Set of timings measured from when an app queued a buffer for
8220 // presentation, until the buffer was ready to be presented.
8221 optional FrameTimingHistogram post_to_acquire = 9
8222 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008223 // Frames missed latch because the acquire fence didn't fire
8224 optional int64 late_acquire_frames = 10;
8225 // Frames latched early because the desired present time was bad
8226 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008227}
8228
8229/**
8230 * Histogram of frame counts bucketed by time in milliseconds.
8231 * Because of size limitations, we hard-cap the number of buckets, with
8232 * buckets for corresponding to larger milliseconds being less precise.
8233 */
8234message FrameTimingHistogram {
8235 // Timings in milliseconds that describes a set of histogram buckets
8236 repeated int32 time_millis_buckets = 1;
8237 // Number of frames that match to each time_millis, i.e. the bucket
8238 // contents
8239 // It's required that len(time_millis) == len(frame_count)
8240 repeated int64 frame_counts = 2;
8241}
Emilian Peev6729f372019-08-29 09:14:09 -07008242
Emilian Peev6729f372019-08-29 09:14:09 -07008243/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008244 * Janky event as reported by SurfaceFlinger.
8245 * This event is intended to be consumed by a Perfetto subscriber for
8246 * automated trace collection.
8247 *
8248 * Logged from:
8249 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8250 */
8251message DisplayJankReported {
8252 // Informational field for how long the janky event lasted in milliseconds
8253 optional int64 event_duration_millis = 1;
8254 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8255 // the display on time.
8256 optional int32 present_deadlines_missed = 2;
8257}
8258
8259/**
Emilian Peev6729f372019-08-29 09:14:09 -07008260 * Information about camera facing and API level usage.
8261 * Logged from:
8262 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8263 */
8264message CameraActionEvent {
8265 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008266 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008267
8268 // Camera API level used
8269 optional int32 api_level = 2;
8270
8271 // Name of client package
8272 optional string package_name = 3;
8273
8274 // Camera facing
8275 enum Facing {
8276 UNKNOWN = 0;
8277 BACK = 1;
8278 FRONT = 2;
8279 EXTERNAL = 3;
8280 }
8281 optional Facing facing = 4;
8282}
atrost01a20932019-08-28 15:40:37 +01008283
8284/**
8285 * Logs when a compatibility change is affecting an app.
8286 *
8287 * Logged from:
8288 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8289 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8290 */
8291message AppCompatibilityChangeReported {
8292 // The UID of the app being affected by the compatibilty change.
8293 optional int32 uid = 1 [(is_uid) = true];
8294
8295 // The ID of the change affecting the app.
8296 optional int64 change_id = 2;
8297
8298 enum State {
8299 UNKNOWN_STATE = 0;
8300 ENABLED = 1;
8301 DISABLED = 2;
8302 LOGGED = 3;
8303 }
8304
8305 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8306 // logged otherwise.
8307 optional State state = 3;
8308
8309 enum Source {
8310 UNKNOWN_SOURCE = 0;
8311 APP_PROCESS = 1;
8312 SYSTEM_SERVER = 2;
8313 }
8314
8315 // Where it was logged from.
8316 optional Source source = 4;
8317
8318}
Hector Dearman40579f62019-11-01 13:19:30 +00008319
8320/**
8321 * Logged from
8322 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8323 */
8324message PerfettoUploaded {
8325 enum Event {
8326 PERFETTO_UNDEFINED = 0;
8327 PERFETTO_TRACE_BEGIN = 1;
8328 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8329 PERFETTO_ON_CONNECT = 3;
8330 PERFETTO_ON_TRACING_DISABLED = 4;
8331 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8332 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8333 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8334 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8335 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8336 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8337 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8338 PERFETTO_TRIGGER_BEGIN = 12;
8339 PERFETTO_TRIGGER_SUCCESS = 13;
8340 PERFETTO_TRIGGER_FAILURE = 14;
8341 PERFETTO_HIT_GUARDRAILS = 15;
8342 PERFETTO_ON_TIMEOUT = 16;
8343 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8344 }
8345
8346 // Which stage of the pipeline we are reporting from.
8347 optional Event event = 1;
8348
8349 // UUID matching the one set inside the SystemInfo trace packet.
8350 optional int64 trace_uuid_lsb = 2;
8351 optional int64 trace_uuid_msb = 3;
8352}
Mark Tabrya824a642019-11-05 12:26:12 -08008353
8354/**
8355 * Pulls client metrics on data transferred via Vehicle Maps Service.
8356 * Metrics are keyed by uid + layer.
8357 *
8358 * Pulled from:
8359 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8360 */
8361message VmsClientStats {
8362 // UID of the VMS client app
8363 optional int32 uid = 1 [(is_uid) = true];
8364
8365 // VMS layer definition
8366 optional int32 layer_type = 2;
8367 optional int32 layer_channel = 3;
8368 optional int32 layer_version = 4;
8369
8370 // Bytes and packets sent by the client for the layer
8371 optional int64 tx_bytes = 5;
8372 optional int64 tx_packets = 6;
8373
8374 // Bytes and packets received by the client for the layer
8375 optional int64 rx_bytes = 7;
8376 optional int64 rx_packets = 8;
8377
8378 // Bytes and packets dropped due to client error
8379 optional int64 dropped_bytes = 9;
8380 optional int64 dropped_packets = 10;
8381}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008382
8383/**
8384 * State of a dangerous permission requested by a package - sampled
8385 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8386*/
8387message DangerousPermissionStateSampled {
8388 // Name of the permission
8389 optional string permission_name = 1;
8390
8391 // Uid of the package
8392 optional int32 uid = 2 [(is_uid) = true];
8393
8394 // If the permission is granted to the uid
8395 optional bool is_granted = 3;
8396
8397 // Permission flags as per android.content.pm.PermissionFlags
8398 optional int32 permission_flags = 4;
8399}
8400
Stan Iliev637ba5e2019-08-16 13:43:08 -04008401/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008402 * HWUI stats for a given app.
8403 */
8404message GraphicsStats {
8405 // The package name of the app
8406 optional string package_name = 1;
8407
8408 // The version code of the app
8409 optional int64 version_code = 2;
8410
8411 // The start & end timestamps in UTC as
8412 // milliseconds since January 1, 1970
8413 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008414 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008415
Stan Ilievb6517192020-02-18 10:12:42 -05008416 optional int64 end_millis = 4;
8417
8418 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8419 enum PipelineType {
8420 UNKNOWN = 0;
8421 GL = 1;
8422 VULKAN = 2;
8423 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008424
8425 // HWUI renders pipeline type: GL or Vulkan.
8426 optional PipelineType pipeline = 5;
8427
8428 // Distinct frame count.
8429 optional int32 total_frames = 6;
8430
8431 // Number of "missed vsync" events.
8432 optional int32 missed_vsync_count = 7;
8433
8434 // Number of frames in triple-buffering scenario (high input latency)
8435 optional int32 high_input_latency_count = 8;
8436
8437 // Number of "slow UI thread" events.
8438 optional int32 slow_ui_thread_count = 9;
8439
8440 // Number of "slow bitmap upload" events.
8441 optional int32 slow_bitmap_upload_count = 10;
8442
8443 // Number of "slow draw" events.
8444 optional int32 slow_draw_count = 11;
8445
8446 // Number of frames that missed their deadline (aka, visibly janked)
8447 optional int32 missed_deadline_count = 12;
8448
8449 // The frame time histogram for the package
8450 optional FrameTimingHistogram cpu_histogram = 13
8451 [(android.os.statsd.log_mode) = MODE_BYTES];
8452
8453 // The gpu frame time histogram for the package
8454 optional FrameTimingHistogram gpu_histogram = 14
8455 [(android.os.statsd.log_mode) = MODE_BYTES];
8456
8457 // UI mainline module version.
8458 optional int64 version_ui_module = 15;
8459
8460 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8461 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8462 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8463 // more apps are running / rendering.
8464 optional bool is_today = 16;
8465}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008466
8467/**
8468 * Message related to dangerous (runtime) app ops access
8469 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008470message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008471 // Uid of the package accessing app op
8472 optional int32 uid = 1 [(is_uid) = true];
8473
8474 // Name of the package accessing app op
8475 optional string package_name = 2;
8476
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008477 // operation string id per OPSTR_ constants in AppOpsManager.java
8478 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008479
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008480 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8481 // API.
8482 // Attributions must be provided through manifest using <attribution> tag available in R and
8483 // above.
8484 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008485
8486 // message related to app op access, limited to 600 chars by API
8487 optional string message = 5;
8488
8489 enum SamplingStrategy {
8490 DEFAULT = 0;
8491 UNIFORM = 1;
8492 RARELY_USED = 2;
8493 }
8494
8495 // sampling strategy used to collect this message
8496 optional SamplingStrategy sampling_strategy = 6;
8497}
8498
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008499/*
8500 * Logs userspace reboot outcome and duration.
8501 *
8502 * Logged from:
8503 * frameworks/base/core/java/com/android/server/BootReceiver.java
8504 */
8505message UserspaceRebootReported {
8506 // Possible outcomes of userspace reboot.
8507 enum Outcome {
8508 // Default value in case platform failed to determine the outcome.
8509 OUTCOME_UNKNOWN = 0;
8510 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8511 SUCCESS = 1;
8512 // Userspace reboot shutdown sequence was aborted.
8513 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8514 // Remounting userdata into checkpointing mode failed.
8515 FAILED_USERDATA_REMOUNT = 3;
8516 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8517 // reboot.
8518 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8519 }
8520 // Outcome of userspace reboot. Always set.
8521 optional Outcome outcome = 1;
8522 // Duration of userspace reboot in case it has a successful outcome.
8523 // Duration is measured as time between userspace reboot was initiated and until boot completed
8524 // (e.g. sys.boot_completed=1).
8525 optional int64 duration_millis = 2;
8526 // State of primary user's (user0) credential encryption storage.
8527 enum UserEncryptionState {
8528 // Default value.
8529 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8530 // Credential encrypted storage is unlocked.
8531 UNLOCKED = 1;
8532 // Credential encrypted storage is locked.
8533 LOCKED = 2;
8534 }
8535 // State of primary user's encryption storage at the moment boot completed. Always set.
8536 optional UserEncryptionState user_encryption_state = 3;
8537}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008538
8539/*
8540 * Logs integrity check information during each install.
8541 *
8542 * Logged from:
8543 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8544 */
8545message IntegrityCheckResultReported {
8546 optional string package_name = 1;
8547 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008548 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008549 optional string installer_package_name = 4;
8550 enum Response {
8551 UNKNOWN = 0;
8552 ALLOWED = 1;
8553 REJECTED = 2;
8554 FORCE_ALLOWED = 3;
8555 }
8556 optional Response response = 5;
8557 // An estimate on the cause of the response. This will only be populated for
8558 // REJECTED and FORCE_ALLOWED
8559 optional bool caused_by_app_cert_rule = 6;
8560 optional bool caused_by_installer_rule = 7;
8561}
8562
8563/**
8564 * Logs the information about the rules and the provider whenever rules are
8565 * pushed into AppIntegrityManager.
8566 *
8567 * Logged from:
8568 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8569 */
8570message IntegrityRulesPushed {
8571 optional bool success = 1;
8572 // Package name of the app that pushed the rules.
8573 optional string rule_provider = 2;
8574 // Version string of arbitrary format provided by the rule provider to
8575 // identify the rules.
8576 optional string rule_version = 3;
8577}
Jordan Liubedfa702019-12-20 15:08:45 -08008578
8579/**
8580 * Logs when a cell broadcast message is received on the device.
8581 *
8582 * Logged from CellBroadcastService module:
8583 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8584 */
8585message CellBroadcastMessageReported {
8586 // The type of Cell Broadcast message
8587 enum CbType {
8588 UNKNOWN_TYPE = 0;
8589 GSM = 1;
8590 CDMA = 2;
8591 CDMA_SPC = 3;
8592 }
8593
8594 // GSM, CDMA, CDMA-SCP
8595 optional CbType type = 1;
8596}
8597
8598/**
8599 * Logs when an error occurs while handling a cell broadcast message;
8600 *
8601 * Logged from CellBroadcastService module:
8602 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8603 */
8604message CellBroadcastMessageError {
8605 // The type of error raised when trying to handle a cell broadcast message
8606 enum ErrorType {
8607 UNKNOWN_TYPE = 0;
8608 CDMA_DECODING_ERROR = 1;
8609 CDMA_SCP_EMPTY = 2;
8610 CDMA_SCP_HANDLING_ERROR = 3;
8611 GSM_INVALID_HEADER_LENGTH = 4;
8612 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8613 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8614 GSM_INVALID_PDU = 7;
8615 GSM_INVALID_GEO_FENCING_DATA = 8;
8616 GSM_UMTS_INVALID_WAC = 9;
8617 FAILED_TO_INSERT_TO_DB = 10;
8618 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8619 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8620 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8621 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8622 }
8623
8624 // What kind of error occurred
8625 optional ErrorType type = 1;
8626
8627 // Exception message (or log message) associated with the error (max 1000 chars)
8628 optional string exception_message = 2;
8629}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008630
8631/**
8632 * Logs when the SDK Extensions test app has polled the current version.
8633 * This is atom ID 354.
8634 *
8635 * Logged from:
8636 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8637 */
8638message SdkExtensionStatus {
8639 enum ApiCallStatus {
8640 CALL_NOT_ATTEMPTED = 0;
8641 CALL_SUCCESSFUL = 1;
8642 CALL_FAILED = 2;
8643 }
8644
8645 optional ApiCallStatus result = 1;
8646
8647 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8648 optional int32 r_extension_version = 2;
8649
8650 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8651 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8652 optional int32 failed_call_symbol = 3;
8653}
Marco Ballesio497aff42020-01-24 08:39:42 -08008654
8655/**
8656 * Logs when an app is frozen or unfrozen.
8657 *
8658 * Logged from:
8659 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8660 */
8661message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008662 // The type of event.
8663 enum Action {
8664 UNKNOWN = 0;
8665 FREEZE_APP = 1;
8666 UNFREEZE_APP = 2;
8667 }
8668 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008669
Blake Kragten6ce382a2020-01-16 20:20:46 -08008670 // Pid of the process being frozen.
8671 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008672
Blake Kragten6ce382a2020-01-16 20:20:46 -08008673 // Name of the process being frozen.
8674 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008675
Blake Kragten6ce382a2020-01-16 20:20:46 -08008676 // Time since last unfrozen.
8677 optional int64 time_unfrozen_millis = 4;
8678}
8679
8680/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008681 * Pulls information for a single voice call.
8682 *
8683 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8684 *
8685 * Pulled from:
8686 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8687 */
8688message VoiceCallSession {
8689 // Bearer (IMS or CS) when the call started.
8690 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8691
8692 // Bearer (IMS or CS) when the call ended.
8693 // The bearer may change during the call, e.g. due to SRVCC.
8694 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8695
8696 // Direction of the call (incoming or outgoing).
8697 optional android.telephony.CallDirectionEnum direction = 3;
8698
8699 // Time spent setting up the call.
8700 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8701
8702 // Whether the call ended before the setup was completed.
8703 optional bool setup_failed = 5;
8704
8705 // IMS reason code or CS disconnect cause.
8706 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8707 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8708 optional int32 disconnect_reason_code = 6;
8709
8710 // IMS extra code or CS precise disconnect cause.
8711 // For IMS, this code is vendor-specific
8712 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8713 optional int32 disconnect_extra_code = 7;
8714
8715 // IMS extra message or CS vendor cause.
8716 optional string disconnect_extra_message = 8;
8717
8718 // Radio access technology (RAT) used when call started.
8719 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8720
8721 // Radio access technology (RAT) used when call terminated.
8722 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8723
8724 // Number of times RAT changed during the call.
8725 optional int64 rat_switch_count = 11;
8726
8727 // A bitmask of all codecs used during the call.
8728 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8729 optional int64 codec_bitmask = 12;
8730
8731 // Number of other calls going on during call setup, for the same SIM slot.
8732 optional int32 concurrent_call_count_at_start = 13;
8733
8734 // Number of other calls going on during call termination, for the same SIM slot.
8735 optional int32 concurrent_call_count_at_end = 14;
8736
8737 // Index of the SIM is used, 0 for single-SIM devices.
8738 optional int32 sim_slot_index = 15;
8739
8740 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8741 optional bool is_multi_sim = 16;
8742
8743 // Whether the call was made with an eSIM profile.
8744 optional bool is_esim = 17;
8745
8746 // Carrier ID of the SIM card.
8747 // See https://source.android.com/devices/tech/config/carrierid.
8748 optional int32 carrier_id = 18;
8749
8750 // Whether an SRVCC has been completed successfully.
8751 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8752 // events once the call is switched to CS.
8753 optional bool srvcc_completed = 19;
8754
8755 // Number of SRVCC failures.
8756 optional int64 srvcc_failure_count = 20;
8757
8758 // Number of SRVCC cancellations.
8759 optional int64 srvcc_cancellation_count = 21;
8760
8761 // Whether the Real-Time Text (RTT) was ever used in the call.
8762 optional bool rtt_enabled = 22;
8763
8764 // Whether this was an emergency call.
8765 optional bool is_emergency = 23;
8766
8767 // Whether the call was performed while roaming.
8768 optional bool is_roaming = 24;
8769}
8770
8771/**
8772 * Pulls voice call radio access technology (RAT) usage.
8773 *
8774 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8775 * time. The atom will be skipped if not enough data is available.
8776 *
8777 * Pulled from:
8778 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8779 */
8780message VoiceCallRatUsage {
8781 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8782 optional int32 carrier_id = 1;
8783
8784 // Radio access technology.
8785 optional android.telephony.NetworkTypeEnum rat = 2;
8786
8787 // Total duration that voice calls spent on this carrier and RAT.
8788 optional int64 total_duration_seconds = 3;
8789
8790 // Total number of calls using this carrier and RAT.
8791 // A call is counted once even if it used the RAT multiple times.
8792 optional int64 call_count = 4;
8793}
8794
8795/**
8796 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8797 *
8798 * Pulled from:
8799 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8800 */
8801message SimSlotState {
8802 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8803 optional int32 active_slot_count = 1;
8804
8805 // Number of SIM cards (both physical and active eSIM profiles).
8806 // This number is always equal to or less than the number of active SIM slots.
8807 optional int32 sim_count = 2;
8808
8809 // Number of active eSIM profiles.
8810 // This number is always equal to or less than the number of SIMs.
8811 optional int32 esim_count = 3;
8812}
8813
8814/**
8815 * Pulls supported cellular radio access technologies.
8816 *
8817 * This atom reports the capabilities of the device, rather than the network it has access to.
8818 *
8819 * Pulled from:
8820 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8821 */
8822message SupportedRadioAccessFamily {
8823 // A bitmask of supported radio technologies.
8824 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8825 optional int64 network_type_bitmask = 1;
8826}
8827
8828/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008829 * Logs gnss stats from location service provider
8830 *
8831 * Pulled from:
8832 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8833 */
8834
8835message GnssStats {
8836 // Number of location reports since boot
8837 optional int64 location_reports = 1;
8838
8839 // Total pulled reports of Location failures since boot
8840 optional int64 location_failure_reports = 2;
8841
8842 // Number of time to first fix reports since boot
8843 optional int64 time_to_first_fix_reports = 3;
8844
8845 // Total pulled reported time to first fix (in milli-seconds) since boot
8846 optional int64 time_to_first_fix_milli_s = 4;
8847
8848 // Number of position accuracy reports since boot
8849 optional int64 position_accuracy_reports = 5;
8850
8851 // Total pulled reported position accuracy (in meters) since boot
8852 optional int64 position_accuracy_meters = 6;
8853
8854 // Number of top 4 average CN0 reports since boot
8855 optional int64 top_four_average_cn0_reports = 7;
8856
8857 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8858 optional int64 top_four_average_cn0_db_mhz = 8;
8859
8860 // Number of l5 top 4 average CN0 reports since boot
8861 optional int64 l5_top_four_average_cn0_reports = 9;
8862
8863 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8864 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8865
8866 // Total number of sv status messages reports since boot
8867 optional int64 sv_status_reports = 11;
8868
8869 // Total number of sv status messages reports, where sv is used in fix since boot
8870 optional int64 sv_status_reports_used_in_fix = 12;
8871
8872 // Total number of L5 sv status messages reports since boot
8873 optional int64 l5_sv_status_reports = 13;
8874
8875 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8876 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008877}
Kweku Adams12752132020-02-18 15:36:48 -08008878
8879/**
8880 * Logs when an app is moved to a different standby bucket.
8881 *
8882 * Logged from:
8883 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8884 */
8885message AppStandbyBucketChanged {
8886 optional string package_name = 1;
8887
8888 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8889 optional int32 user_id = 2;
8890
8891 // These enum values match the constants defined in UsageStatsManager.java.
8892 enum Bucket {
8893 BUCKET_UNKNOWN = 0;
8894 BUCKET_EXEMPTED = 5;
8895 BUCKET_ACTIVE = 10;
8896 BUCKET_WORKING_SET = 20;
8897 BUCKET_FREQUENT = 30;
8898 BUCKET_RARE = 40;
8899 BUCKET_RESTRICTED = 45;
8900 BUCKET_NEVER = 50;
8901 }
8902 optional Bucket bucket = 3;
8903
8904 enum MainReason {
8905 MAIN_UNKNOWN = 0;
8906 MAIN_DEFAULT = 0x0100;
8907 MAIN_TIMEOUT = 0x0200;
8908 MAIN_USAGE = 0x0300;
8909 MAIN_FORCED_BY_USER = 0x0400;
8910 MAIN_PREDICTED = 0x0500;
8911 MAIN_FORCED_BY_SYSTEM = 0x0600;
8912 }
8913 optional MainReason main_reason = 4;
8914
8915 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8916 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8917 // UsageStatsManager.java.
8918 optional int32 sub_reason = 5;
8919}