blob: 1cbe1508e6bb859c0494e7ab970c2c8248e700c4 [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"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500401 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
402 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000403 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000404 }
David Chenc8a43242017-10-17 16:23:28 -0700405
David Chen6e3e6cb2018-01-03 16:14:06 -0800406 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700407 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700408 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800409 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
410 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
411 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
412 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
413 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
414 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800415 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800416 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
417 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800418 CpuTimePerUidFreq cpu_time_per_uid_freq =
419 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800420 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
421 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
422 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
423 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
424 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
425 SystemUptime system_uptime = 10015 [(module) = "framework"];
426 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
427 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000428 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800429 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
430 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 Temperature temperature = 10021 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800432 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800434 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800435 DiskStats disk_stats = 10025 [(module) = "framework"];
436 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
437 AppSize app_size = 10027 [(module) = "framework"];
438 CategorySize category_size = 10028 [(module) = "framework"];
439 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800440 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800441 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
442 DiskIo disk_io = 10032 [(module) = "framework"];
443 PowerProfile power_profile = 10033 [(module) = "framework"];
444 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
445 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
446 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700447 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
449 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
450 10040 [(module) = "framework"];
451 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
452 10041 [(module) = "framework"];
453 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800454 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800456 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
458 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
459 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
460 RoleHolder role_holder = 10049 [(module) = "framework"];
461 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800462 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800463 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
464 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800465 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
466 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
468 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
469 FaceSettings face_settings = 10058 [(module) = "framework"];
470 CoolingDevice cooling_device = 10059 [(module) = "framework"];
471 AppOps app_ops = 10060 [(module) = "framework"];
472 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700473 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
474 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800476 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800477 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
478 DangerousPermissionStateSampled dangerous_permission_state_sampled =
479 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400480 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000481 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000482 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200483 PackageNotificationPreferences package_notification_preferences =
484 10071 [(module) = "framework"];
485 PackageNotificationChannelPreferences package_notification_channel_preferences =
486 10072 [(module) = "framework"];
487 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
488 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800489 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800490 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700491 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
492 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
493 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
494 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700495 }
yroa1fe77c2018-02-26 14:22:54 -0800496
Bookatz76aafcf2018-09-17 16:17:10 -0700497 // DO NOT USE field numbers above 100,000 in AOSP.
498 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
499 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100500
501 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700502}
503
Yao Chend54f9dd2017-10-17 17:37:48 +0000504/**
Yangster-mac20877162017-12-22 17:19:39 -0800505 * This proto represents a node of an attribution chain.
506 * Note: All attribution chains are represented as a repeated field of type
507 * AttributionNode. It is understood that in such arrays, the order is that
508 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000509 */
Yangster-mac20877162017-12-22 17:19:39 -0800510message AttributionNode {
511 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800512 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800513
Yangster-mac20877162017-12-22 17:19:39 -0800514 // The (optional) string tag for an element in the attribution chain. If the
515 // element has no tag, it is encoded as an empty string.
516 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700517}
518
Yangster-mac48b3d622018-08-18 12:38:11 -0700519message KeyValuePair {
520 optional int32 key = 1;
521 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700522 int32 value_int = 2;
523 int64 value_long = 3;
524 string value_str = 4;
525 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700526 }
527}
528
529message KeyValuePairsAtom {
530 optional int32 uid = 1;
531 repeated KeyValuePair pairs = 2;
532}
533
Yao Chend54f9dd2017-10-17 17:37:48 +0000534/*
535 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800536 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000537 *
538 * RULES:
539 * - The field ids for each atom must start at 1, and count upwards by 1.
540 * Skipping field ids is not allowed.
541 * - These form an API, so renaming, renumbering or removing fields is
542 * not allowed between android releases. (This is not currently enforced,
543 * but there will be a tool to enforce this restriction).
544 * - The types must be built-in protocol buffer types, namely, no sub-messages
545 * are allowed (yet). The bytes type is also not allowed.
546 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800547 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000548 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800549 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000550 * - A field that is a uid should be a string field, tagged with the [xxx]
551 * annotation. The generated code on android will be represented by UIDs,
552 * and those UIDs will be translated in xxx to those strings.
553 *
554 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700555 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 * - If there is a UID, it goes first. Think in an object-oriented fashion.
557 * *****************************************************************************
558 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700559
Yao Chend54f9dd2017-10-17 17:37:48 +0000560/**
Tej Singha72344992019-04-17 18:55:08 -0700561 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700562 * Logs when the Thermal service HAL notifies the throttling start/stop events.
563 *
564 * Logged from:
565 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
566 */
567message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700568 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700569 optional android.os.TemperatureTypeEnum sensor_type = 1;
570
Maggie White442b6312019-04-05 16:26:44 -0700571 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700572 enum State {
573 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700574 START = 1; // START indicated that throttling was triggered.
575 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700576 }
Yangster-mace16189a2018-08-26 12:20:16 -0700577 optional State state = 2;
578
579 optional float temperature = 3;
580}
581
582/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 * Logs when the screen state changes.
584 *
585 * Logged from:
586 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
587 */
588message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800589 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800590 optional android.view.DisplayStateEnum state = 1
591 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700592}
Yao Chend54f9dd2017-10-17 17:37:48 +0000593
594/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700595 * Logs that the process state of the uid, as determined by ActivityManager
596 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000597 *
598 * Logged from:
599 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
600 */
Bookatzc1a050a2017-10-10 15:49:28 -0700601message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800602 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000603
Bookatzdb026a22018-01-10 19:01:56 -0800604 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800605 optional android.app.ProcessStateEnum state = 2
606 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000607}
608
609/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700610 * Logs process state change of a process, as per the activity manager.
611 *
612 * Logged from:
613 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
614 */
615message ProcessStateChanged {
616 optional int32 uid = 1;
617 optional string process_name = 2;
618 optional string package_name = 3;
619 // TODO: remove this when validation is done
620 optional int64 version = 5;
621 // The state, from frameworks/base/core/proto/android/app/enums.proto.
622 optional android.app.ProcessStateEnum state = 4;
623}
624
625/**
626 * Logs when ActivityManagerService sleep state is changed.
627 *
628 * Logged from:
629 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
630 */
631message ActivityManagerSleepStateChanged {
632 // TODO: import frameworks proto
633 enum State {
634 UNKNOWN = 0;
635 ASLEEP = 1;
636 AWAKE = 2;
637 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800638 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700639}
640
641/**
642 * Logs when system memory state changes.
643 *
644 * Logged from:
645 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
646 */
647message MemoryFactorStateChanged {
648 // TODO: import frameworks proto
649 enum State {
650 MEMORY_UNKNOWN = 0;
651 NORMAL = 1; // normal.
652 MODERATE = 2; // moderate memory pressure.
653 LOW = 3; // low memory.
654 CRITICAL = 4; // critical memory.
655
656 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800657 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700658}
659
660/**
661 * Logs when app is using too much cpu, according to ActivityManagerService.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message ExcessiveCpuUsageReported {
667 optional int32 uid = 1;
668 optional string process_name = 2;
669 optional string package_name = 3;
670 // package version. TODO: remove this when validation is done
671 optional int64 version = 4;
672}
673
674/**
675 * Logs when a cached process is killed, along with its pss.
676 *
677 * Logged from:
678 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
679 */
680message CachedKillReported {
681 optional int32 uid = 1;
682 optional string process_name = 2;
683 optional string package_name = 3;
684 // TODO: remove this when validation is done
685 optional int64 version = 5;
686 optional int64 pss = 4;
687}
688
689/**
xshu2c3d9e42019-09-26 17:54:02 -0700690 * Logs the change in wifi health.
691 *
692 * Logged from:
693 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
694 */
695message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800696 enum Band {
697 UNKNOWN = 0;
698 // All of 2.4GHz band
699 BAND_2G = 1;
700 // Frequencies in the range of [5150, 5250) GHz
701 BAND_5G_LOW = 2;
702 // Frequencies in the range of [5250, 5725) GHz
703 BAND_5G_MIDDLE = 3;
704 // Frequencies in the range of [5725, 5850) GHz
705 BAND_5G_HIGH = 4;
706 // Frequencies in the range of [5925, 6425) GHz
707 BAND_6G_LOW = 5;
708 // Frequencies in the range of [6425, 6875) GHz
709 BAND_6G_MIDDLE = 6;
710 // Frequencies in the range of [6875, 7125) GHz
711 BAND_6G_HIGH = 7;
712 }
xshu2c3d9e42019-09-26 17:54:02 -0700713 // duration this stat is obtained over in milliseconds
714 optional int32 duration_millis = 1;
715 // whether wifi is classified as sufficient for the user's data traffic, determined
716 // by whether the calculated throughput exceeds the average demand within |duration_millis|
717 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700718 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800719 optional bool is_cell_data_available = 3;
720 // the Band bucket the connected network is on
721 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700722}
723
724/**
725 * Logged when wifi detects a significant change in connection failure rate.
726 *
727 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
728 *
729 */
730message WifiFailureStatReported {
731 enum AbnormalityType {
732 UNKNOWN = 0;
733 SIGNIFICANT_INCREASE = 1;
734 SIGNIFICANT_DECREASE = 2;
735 SIMPLY_HIGH = 3;
736 }
737 enum FailureType {
738 FAILURE_UNKNOWN = 0;
739 FAILURE_CONNECTION = 1;
740 FAILURE_ASSOCIATION_REJECTION = 2;
741 FAILURE_ASSOCIATION_TIMEOUT = 3;
742 FAILURE_AUTHENTICATION = 4;
743 FAILURE_NON_LOCAL_DISCONNECTION = 5;
744 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
745 }
746 // Reason for uploading this stat
747 optional AbnormalityType abnormality_type = 1;
748 // The particular type of failure
749 optional FailureType failure_type = 2;
750 // How many times we have encountered this combination of AbnormalityType and FailureType
751 optional int32 failure_count = 3;
752}
753
754/**
755 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
756 *
757 * Logged from:
758 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
759 */
760message WifiConnectionResultReported {
761 enum FailureCode {
762 FAILURE_UNKNOWN = 0;
763 FAILURE_ASSOCIATION_TIMEOUT = 1;
764 FAILURE_ASSOCIATION_REJECTION = 2;
765 FAILURE_AUTHENTICATION_GENERAL = 3;
766 FAILURE_AUTHENTICATION_EAP = 4;
767 FAILURE_DHCP = 5;
768 FAILURE_NETWORK_DISCONNECTION = 6;
769 FAILURE_ROAM_TIMEOUT = 7;
770 }
771 // true represents a successful connection
772 optional bool connection_result = 1;
773 // reason for the connection failure
774 optional FailureCode failure_code = 2;
775 // scan rssi before the connection attempt
776 optional int32 rssi = 3;
777}
778
779/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700780 * Logs when memory stats of a process is reported.
781 *
782 * Logged from:
783 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
784 */
785message ProcessMemoryStatReported {
786 optional int32 uid = 1;
787 optional string process_name = 2;
788 optional string package_name = 3;
789 //TODO: remove this when validation is done
790 optional int64 version = 9;
791 optional int64 pss = 4;
792 optional int64 uss = 5;
793 optional int64 rss = 6;
794 enum Type {
795 ADD_PSS_INTERNAL_SINGLE = 0;
796 ADD_PSS_INTERNAL_ALL_MEM = 1;
797 ADD_PSS_INTERNAL_ALL_POLL = 2;
798 ADD_PSS_EXTERNAL = 3;
799 ADD_PSS_EXTERNAL_SLOW = 4;
800 }
801 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800802 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700803}
804
805/**
Bookatzc1a050a2017-10-10 15:49:28 -0700806 * Logs that a process started, finished, crashed, or ANRed.
807 *
808 * Logged from:
809 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
810 */
811message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700812 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700813
David Chen0b5c90c2018-01-25 16:51:49 -0800814 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800815 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700816
Bookatzddccf0a2017-11-28 16:48:14 -0800817 // What lifecycle state the process changed to.
818 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800819 enum State {
820 FINISHED = 0;
821 STARTED = 1;
822 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800823 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800824 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700825}
826
Bookatzc1a050a2017-10-10 15:49:28 -0700827/**
828 * Logs when the ble scan state changes.
829 *
830 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700831 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700832 */
833message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800834 repeated AttributionNode attribution_node = 1
835 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700836
837 enum State {
838 OFF = 0;
839 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700840 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
841 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700842 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800843 optional State state = 2 [
844 (state_field_option).option = EXCLUSIVE_STATE,
845 (state_field_option).default_state_value = 0 /* State.OFF */,
846 (state_field_option).reset_state_value = 2 /* State.RESET */,
847 (state_field_option).nested = true
848 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700849
Bookatze5ec0b42018-03-26 13:34:56 -0700850 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800851 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700852 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700854 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800855 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700856}
857
858/**
859 * Logs reporting of a ble scan finding results.
860 *
861 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700862 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700863 */
Bookatzae6738e2018-09-13 11:38:56 -0700864// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700865message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800866 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700867
868 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800869 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700870}
871
872/**
873 * Logs when a sensor state changes.
874 *
875 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700876 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700877 */
878message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800879 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700880
Bookatzc1a050a2017-10-10 15:49:28 -0700881 // The id (int) of the sensor.
882 optional int32 sensor_id = 2;
883
884 enum State {
885 OFF = 0;
886 ON = 1;
887 }
888 optional State state = 3;
889}
890
Bookatzc1a050a2017-10-10 15:49:28 -0700891/**
892 * Logs when GPS state changes.
893 *
894 * Logged from:
895 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
896 */
897message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
900 enum State {
901 OFF = 0;
902 ON = 1;
903 }
904 optional State state = 2;
905}
906
Bookatz48d362e2018-11-06 15:49:08 -0800907/**
908 * Logs when GPS signal quality.
909 *
910 * Logged from:
911 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
912 */
913message GpsSignalQualityChanged {
914 optional android.server.location.GpsSignalQualityEnum level = 1;
915}
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917
918/**
919 * Logs when a sync manager sync state changes.
920 *
921 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700922 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700923 */
924message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800925 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700926
David Chen0b5c90c2018-01-25 16:51:49 -0800927 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800928 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700929
930 enum State {
931 OFF = 0;
932 ON = 1;
933 }
934 optional State state = 3;
935}
936
Yangster-mac96353002018-09-05 11:18:55 -0700937/*
938 * Deferred job stats.
939 *
940 * Logged from:
941 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
942*/
943message DeferredJobStatsReported {
944 repeated AttributionNode attribution_node = 1;
945
946 // Number of jobs deferred.
947 optional int32 num_jobs_deferred = 2;
948
949 // Time since the last job runs.
950 optional int64 time_since_last_job_millis = 3;
951}
952
Bookatzc1a050a2017-10-10 15:49:28 -0700953/**
954 * Logs when a job scheduler job state changes.
955 *
956 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700957 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700958 */
959message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800960 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700961
962 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800963 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700964
965 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800966 FINISHED = 0;
967 STARTED = 1;
968 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700969 }
970 optional State state = 3;
971
Tej Singh33a412b2018-03-16 18:43:59 -0700972 // The reason a job has stopped.
973 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700974 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700975 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100976
977 // The standby bucket of the app that scheduled the job. These match the framework constants
978 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
979 // already assigned 0.
980 enum Bucket {
981 UNKNOWN = -1;
982 ACTIVE = 0;
983 WORKING_SET = 1;
984 FREQUENT = 2;
985 RARE = 3;
986 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800987 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100988 }
989 optional Bucket standby_bucket = 5 [default = UNKNOWN];
990
991 // The job id (as assigned by the app).
992 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -0800993
994 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
995 // constraints as they are always assumed to be set.
996 optional bool has_charging_constraint = 7;
997 optional bool has_battery_not_low_constraint = 8;
998 optional bool has_storage_not_low_constraint = 9;
999 optional bool has_timing_delay_constraint = 10;
1000 optional bool has_deadline_constraint = 11;
1001 optional bool has_idle_constraint = 12;
1002 optional bool has_connectivity_constraint = 13;
1003 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001004}
1005
1006/**
1007 * Logs when the audio state changes.
1008 *
1009 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001010 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001011 */
1012message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001013 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001014
1015 enum State {
1016 OFF = 0;
1017 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001018 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1019 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001020 }
1021 optional State state = 2;
1022}
1023
1024/**
1025 * Logs when the video codec state changes.
1026 *
1027 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001028 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001029 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001030message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001031 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001032
1033 enum State {
1034 OFF = 0;
1035 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001036 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1037 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001038 }
1039 optional State state = 2;
1040}
1041
1042/**
1043 * Logs when the flashlight state changes.
1044 *
1045 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001046 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001047 */
1048message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001049 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001050
1051 enum State {
1052 OFF = 0;
1053 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001054 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1055 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001056 }
1057 optional State state = 2;
1058}
1059
1060/**
1061 * Logs when the camera state changes.
1062 *
1063 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001064 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001065 */
1066message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001067 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001068
1069 enum State {
1070 OFF = 0;
1071 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001072 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1073 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001074 }
1075 optional State state = 2;
1076}
1077
1078/**
1079 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001080 *
1081 * Logged from:
1082 * TODO
1083 */
Bookatzd6746242017-10-24 18:39:35 -07001084message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001085 repeated AttributionNode attribution_node = 1
1086 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001087
Bookatz1a1b0462018-01-12 11:47:03 -08001088 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1089 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001090 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001091 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001092
1093 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001094 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001095
1096 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001097 RELEASE = 0;
1098 ACQUIRE = 1;
1099 CHANGE_RELEASE = 2;
1100 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001101 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001102 optional State state = 4 [
1103 (state_field_option).option = EXCLUSIVE_STATE,
1104 (state_field_option).default_state_value = 0,
1105 (state_field_option).nested = true
1106 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001107}
1108
1109/**
Bookatzc1a050a2017-10-10 15:49:28 -07001110 * Logs when a partial wakelock is considered 'long' (over 1 min).
1111 *
1112 * Logged from:
1113 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1114 */
1115message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001116 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001117
Yao Chend54f9dd2017-10-17 17:37:48 +00001118 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1119 optional string tag = 2;
1120
Bookatzc1a050a2017-10-10 15:49:28 -07001121 // TODO: I have no idea what this is.
1122 optional string history_tag = 3;
1123
1124 enum State {
1125 OFF = 0;
1126 ON = 1;
1127 }
1128 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001129}
1130
Bookatzc1a050a2017-10-10 15:49:28 -07001131/**
Bookatza66083f2018-09-20 17:24:00 -07001132 * Logs when the device is interactive, according to the PowerManager Notifier.
1133 *
1134 * Logged from:
1135 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1136 */
1137message InteractiveStateChanged {
1138 enum State {
1139 OFF = 0;
1140 ON = 1;
1141 }
1142 optional State state = 1;
1143}
1144
1145/**
Bookatzc1a050a2017-10-10 15:49:28 -07001146 * Logs Battery Saver state change.
1147 *
1148 * Logged from:
1149 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1150 */
1151message BatterySaverModeStateChanged {
1152 enum State {
1153 OFF = 0;
1154 ON = 1;
1155 }
1156 optional State state = 1;
1157}
1158
1159/**
1160 * Logs Doze mode state change.
1161 *
1162 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001163 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001164 */
1165message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001166 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001167}
1168
1169
1170/**
1171 * Logs state change of Doze mode including maintenance windows.
1172 *
1173 * Logged from:
1174 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1175 */
1176message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001177 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001178}
1179
1180/**
1181 * Logs screen brightness level.
1182 *
1183 * Logged from:
1184 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1185 */
1186message ScreenBrightnessChanged {
1187 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1188 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001189}
1190
1191/**
1192 * Logs battery level (percent full, from 0 to 100).
1193 *
1194 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001195 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001196 */
1197message BatteryLevelChanged {
1198 // Battery level. Should be in [0, 100].
1199 optional int32 battery_level = 1;
1200}
1201
1202/**
1203 * Logs change in charging status of the device.
1204 *
1205 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001206 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001207 */
1208message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001209 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1210 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001211}
1212
1213/**
1214 * Logs whether the device is plugged in, and what power source it is using.
1215 *
1216 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001217 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001218 */
1219message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001220 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1221 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001222}
1223
Bookatz8c6571b2017-10-24 15:04:41 -07001224/**
1225 * Logs when an app's wakeup alarm fires.
1226 *
1227 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001228 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001229 */
1230message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001231 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001232
1233 // Name of the wakeup alarm.
1234 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001235
1236 // Name of source package (for historical reasons, since BatteryStats tracked it).
1237 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001238
Ben Murdoch3389f1522019-05-21 15:05:34 +01001239 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001240 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001241}
1242
1243/**
1244 * Logs when an an app causes the mobile radio to change state.
1245 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1246 *
1247 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001248 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001249 */
1250message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001251 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001252
Bookatz1a1b0462018-01-12 11:47:03 -08001253 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1254 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001255}
1256
1257/**
1258 * Logs when an an app causes the wifi radio to change state.
1259 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1260 *
1261 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001262 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001263 */
1264message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001265 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001266
Bookatz1a1b0462018-01-12 11:47:03 -08001267 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1268 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001269}
1270
1271/**
1272 * Logs kernel wakeup reasons and aborts.
1273 *
1274 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001275 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001276 */
1277message KernelWakeupReported {
1278 // Name of the kernel wakeup reason (or abort).
1279 optional string wakeup_reason_name = 1;
1280
1281 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001282 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001283}
1284
1285/**
Bookatzda1798c2018-12-13 14:16:00 -08001286 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001287 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001288 *
1289 * Logged from:
1290 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1291 */
1292message WifiEnabledStateChanged {
1293 enum State {
1294 OFF = 0;
1295 ON = 1;
1296 }
1297 optional State state = 1;
1298}
1299
1300/**
tsaichristinececebdc2020-02-04 14:05:56 -08001301 * This atom is deprecated starting in R.
1302 *
Bookatzda1798c2018-12-13 14:16:00 -08001303 * 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 -08001304 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1305 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001306 *
1307 * Logged from:
1308 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1309 */
1310message WifiRunningStateChanged {
1311 repeated AttributionNode attribution_node = 1;
1312
1313 enum State {
1314 OFF = 0;
1315 ON = 1;
1316 }
1317 optional State state = 2;
1318}
1319
1320/**
Bookatze5885242017-10-24 20:10:31 -07001321 * Logs wifi locks held by an app.
1322 *
1323 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001324 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001325 */
1326message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001327 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001328
1329 enum State {
1330 OFF = 0;
1331 ON = 1;
1332 }
1333 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001334
1335 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1336 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001337}
1338
1339/**
1340 * Logs wifi signal strength changes.
1341 *
1342 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001343 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001344 */
1345message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001346 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1347 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001348}
1349
1350/**
1351 * Logs wifi scans performed by an app.
1352 *
1353 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001354 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001355 */
1356message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001357 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001358
1359 enum State {
1360 OFF = 0;
1361 ON = 1;
1362 }
1363 optional State state = 2;
1364}
1365
1366/**
Tej Singh4503e102018-01-04 14:35:01 -08001367 * Logs wifi multicast locks held by an app
1368 *
1369 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001370 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001371 */
1372message WifiMulticastLockStateChanged {
1373 repeated AttributionNode attribution_node = 1;
1374
1375 enum State {
1376 OFF = 0;
1377 ON = 1;
1378 }
1379 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001380
1381 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001382}
1383
1384/**
Tej Singh1ea42892018-01-19 09:27:00 -08001385 * Logs shutdown reason and duration on next boot.
1386 *
1387 * Logged from:
1388 * frameworks/base/core/java/com/android/server/BootReceiver.java
1389 */
1390message ShutdownSequenceReported {
1391 // True if shutdown is for a reboot. Default: false if we do not know.
1392 optional bool reboot = 1;
1393
1394 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1395 optional string reason = 2;
1396
1397 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1398 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001399 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001400
1401 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001402 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001403}
1404
Tej Singh6483ea42018-01-25 17:45:49 -08001405
1406/**
1407 * Logs boot reason and duration.
1408 *
1409 * Logged from:
1410 * system/core/bootstat/bootstat.cpp
1411 */
1412message BootSequenceReported {
1413 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1414 // Default: "<EMPTY>" if not available.
1415 optional string bootloader_reason = 1;
1416
1417 // Reason for system boot. Eg. bootloader, reboot,userrequested
1418 // Default: "<EMPTY>" if not available.
1419 optional string system_reason = 2;
1420
1421 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001422 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001423
1424 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001425 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001426
1427 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001428 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001429
1430 // Time since last boot in ms. Default: 0 if not available.
1431 optional int64 time_since_last_boot = 6;
1432}
1433
Tej Singhc477d9c2018-02-05 18:31:39 -08001434
1435/**
1436 * Logs call state and disconnect cause (if applicable).
1437 *
1438 * Logged from:
1439 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1440 */
1441message CallStateChanged {
1442 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1443 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1444 optional android.telecom.CallStateEnum call_state = 1;
1445
1446 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1447 // This value is only applicable when the call_state is DISCONNECTED, and
1448 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1449 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1450 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1451
1452 // True if the call is self-managed, which are apps that use the
1453 // telecom infrastructure to make their own calls.
1454 optional bool self_managed = 3;
1455
1456 // True if call is external. External calls are calls on connected Wear
1457 // devices but show up in Telecom so the user can pull them onto the device.
1458 optional bool external_call = 4;
1459}
1460
Tej Singh1ea42892018-01-19 09:27:00 -08001461/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001462 * Logs keyguard state. The keyguard is the lock screen.
1463 *
1464 * Logged from:
1465 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1466 */
1467message KeyguardStateChanged {
1468 enum State {
1469 UNKNOWN = 0;
1470 // The keyguard is hidden when the phone is unlocked.
1471 HIDDEN = 1;
1472 // The keyguard is shown when the phone is locked (screen turns off).
1473 SHOWN= 2;
1474 // The keyguard is occluded when something is overlaying the keyguard.
1475 // Eg. Opening the camera while on the lock screen.
1476 OCCLUDED = 3;
1477 }
1478 optional State state = 1;
1479}
1480
1481/**
1482 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1483 * prompts the user to enter a password (pattern, pin, etc).
1484 *
1485 * Logged from:
1486 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1487 */
1488
1489message KeyguardBouncerStateChanged {
1490 enum State {
1491 UNKNOWN = 0;
1492 // Bouncer is hidden, either as a result of successfully entering the
1493 // password, screen timing out, or user going back to lock screen.
1494 HIDDEN = 1;
1495 // This is when the user is being prompted to enter the password.
1496 SHOWN = 2;
1497 }
1498 optional State state = 1;
1499}
1500
1501/**
1502 * Logs the result of entering a password into the keyguard bouncer.
1503 *
1504 * Logged from:
1505 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1506 */
1507message KeyguardBouncerPasswordEntered {
1508 enum BouncerResult {
1509 UNKNOWN = 0;
1510 // The password entered was incorrect.
1511 FAILURE = 1;
1512 // The password entered was correct.
1513 SUCCESS = 2;
1514 }
1515 optional BouncerResult result = 1;
1516}
1517
Tej Singha883b372018-02-15 11:30:01 -08001518/*
1519 * Logs changes to the configuration of the device. The configuration is defined
1520 * in frameworks/base/core/java/android/content/res/Configuration.java
1521 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1522 * Please go there to interpret the possible values each field can be.
1523 *
1524 * Logged from:
1525 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1526 */
1527message ResourceConfigurationChanged {
1528 // Bit mask of color capabilities of the screen.
1529 // Contains information about the color gamut and hdr mode of the screen.
1530 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001531 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001532
1533 // The target screen density being rendered to.
1534 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001535 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001536
1537 // Current user preference for the scaling factor for fonts,
1538 // relative to the base density scaling.
1539 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001540 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001541
1542 // Flag indicating whether the hard keyboard is hidden.
1543 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001544 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001545
1546 // The type of keyboard attached to the device.
1547 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1548 optional int32 keyboard = 5;
1549
1550 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1551 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001552 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001553
1554 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1555 // 0 if undefined.
1556 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1557 optional int32 mcc = 7;
1558
1559 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1560 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1561 // MNC_ZERO symbol defined in Configuration.java.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1563 optional int32 mnc = 8;
1564
1565 // The kind of navigation available on the device.
1566 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1567 optional int32 navigation = 9;
1568
1569 // Flag indicating whether the navigation is available.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // Overall orientation of the screen.
1574 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1575 optional int32 orientation = 11;
1576
1577 // The current height of the available screen space, in dp units.
1578 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001579 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001580
1581 // Bit mask of overall layout of the screen.
1582 // Contains information about screen size, whether the screen is wider/taller
1583 // than normal, whether the screen layout is right-tl-left or left-to-right,
1584 // and whether the screen has a rounded shape.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001586 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001587
1588 // Current width of the available screen space, in dp units.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // The smallest screen size an application will see in normal operation.
1593 // This is the smallest value of both screenWidthDp and screenHeightDp
1594 // in portrait and landscape.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001596 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001597
1598 // The type of touch screen attached to the device.
1599 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1600 optional int32 touchscreen = 16;
1601
1602 // Bit mask of the ui mode.
1603 // Contains information about the overall ui mode of the device.
1604 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1605 // Also contains information about whether the device is in night mode.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001608}
1609
Tej Singheee317b2018-03-07 19:28:05 -08001610
1611/**
1612 * Logs changes in the connection state of the mobile radio.
1613 *
1614 * Logged from:
1615 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1616 */
1617message MobileConnectionStateChanged {
1618 // States are from the state machine DataConnection.java.
1619 enum State {
1620 UNKNOWN = 0;
1621 // The connection is inactive, or disconnected.
1622 INACTIVE = 1;
1623 // The connection is being activated, or connecting.
1624 ACTIVATING = 2;
1625 // The connection is active, or connected.
1626 ACTIVE = 3;
1627 // The connection is disconnecting.
1628 DISCONNECTING = 4;
1629 // The connection is disconnecting after creating a connection.
1630 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1631 }
1632 optional State state = 1;
1633 // For multi-sim phones, this distinguishes between the sim cards.
1634 optional int32 sim_slot_index = 2;
1635 // Used to identify the connection. Starts at 0 and increments by 1 for
1636 // every new network created. Resets whenever the device reboots.
1637 optional int32 data_connection_id = 3;
1638 // A bitmask for the capabilities of this connection.
1639 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1640 // Default value (if we have no information): 0
1641 optional int64 capabilities = 4;
1642 // If this connection has internet.
1643 // This just checks if the DEFAULT bit of capabilities is set.
1644 optional bool has_internet = 5;
1645}
1646
1647/**
1648 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1649 *
1650 * Logged from:
1651 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1652 */
1653message MobileRadioTechnologyChanged {
1654 optional android.telephony.NetworkTypeEnum state = 1;
1655 // For multi-sim phones, this distinguishes between the sim cards.
1656 optional int32 sim_slot_index = 2;
1657}
1658
Andrew Chantb56388b2018-03-22 21:07:33 -07001659/**
1660 * Logs the VID and PID of any connected USB devices.
1661 *
1662 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1663 *
1664 * Logged by Vendor.
1665 */
1666message UsbDeviceAttached {
1667 optional int32 vid = 1;
1668 optional int32 pid = 2;
1669 optional bool has_audio = 3;
1670 optional bool has_hid = 4;
1671 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001672 enum State {
1673 STATE_DISCONNECTED = 0;
1674 STATE_CONNECTED = 1;
1675 }
1676 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001677 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001678}
1679
Tej Singheee317b2018-03-07 19:28:05 -08001680
Tej Singhdd7bd352018-02-09 19:33:15 -08001681/**
Tej Singh5d991e12018-03-09 19:48:11 -08001682 * Logs when Bluetooth is enabled and disabled.
1683 *
1684 * Logged from:
1685 * services/core/java/com/android/server/BluetoothManagerService.java
1686 */
1687message BluetoothEnabledStateChanged {
1688 repeated AttributionNode attribution_node = 1;
1689 // Whether or not bluetooth is enabled on the device.
1690 enum State {
1691 UNKNOWN = 0;
1692 ENABLED = 1;
1693 DISABLED = 2;
1694 }
1695 optional State state = 2;
1696 // The reason for being enabled/disabled.
1697 // Eg. Airplane mode, crash, application request.
1698 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1699 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001700 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001701}
1702
1703/**
Jack Hed9837c82019-01-09 01:19:13 -08001704 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001705 *
1706 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001707 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1708 *
1709 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001710 */
1711message BluetoothConnectionStateChanged {
1712 // The state of the connection.
1713 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1714 optional android.bluetooth.ConnectionStateEnum state = 1;
1715 // An identifier that can be used to match connect and disconnect events.
1716 // Currently is last two bytes of a hash of a device level ID and
1717 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001718 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001719 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001720 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1721 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001722 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001723 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001724 // An identifier that can be used to match events for this device.
1725 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1726 // Salt: Randomly generated 256 bit value
1727 // Hash algorithm: HMAC-SHA256
1728 // Size: 32 byte
1729 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001730 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001731}
1732
1733/**
1734 * Logs when a Bluetooth device connects and disconnects over ACL
1735 *
1736 * Logged from:
1737 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1738 *
1739 * Next Tag: 3
1740 */
1741message BluetoothAclConnectionStateChanged {
1742 // An identifier that can be used to match events for this device.
1743 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1744 // Salt: Randomly generated 256 bit value
1745 // Hash algorithm: HMAC-SHA256
1746 // Size: 32 byte
1747 // Default: null or empty if the device identifier is not known
1748 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1749 // The state of the connection.
1750 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1751 optional android.bluetooth.ConnectionStateEnum state = 2;
1752}
1753
1754/**
1755 * Logs when a Bluetooth device connects and disconnects over SCO
1756 *
1757 * Logged from:
1758 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1759 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1760 *
1761 * Next Tag: 4
1762 */
1763message BluetoothScoConnectionStateChanged {
1764 // An identifier that can be used to match events for this device.
1765 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1766 // Salt: Randomly generated 256 bit value
1767 // Hash algorithm: HMAC-SHA256
1768 // Size: 32 byte
1769 // Default: null or empty if the device identifier is not known
1770 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1771 // The state of the connection.
1772 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1773 optional android.bluetooth.ConnectionStateEnum state = 2;
1774 // Codec used for this SCO connection
1775 // Default: UNKNOWN
1776 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001777}
1778
Jack Hec27040a2019-01-09 20:54:41 -08001779/**
1780 * Logged when active device of a profile changes
1781 *
1782 * Logged from:
1783 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1784 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1785 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1786 */
1787message BluetoothActiveDeviceChanged {
1788 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1789 // From android.bluetooth.BluetoothProfile
1790 optional int32 bt_profile = 1;
1791 // An identifier that can be used to match events for this new active device.
1792 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1793 // Salt: Randomly generated 256 bit value
1794 // Hash algorithm: HMAC-SHA256
1795 // Size: 32 byte
1796 // Default: null or empty if there is no active device for this profile
1797 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1798}
1799
Jack Heab86dbd22018-12-18 15:43:27 -08001800// Logs when there is an event affecting Bluetooth device's link layer connection.
1801// - This event is triggered when there is a related HCI command or event
1802// - Users of this metrics can deduce Bluetooth device's connection state from these events
1803// - HCI commands are logged before the command is sent, after receiving command status, and after
1804// receiving command complete
1805// - HCI events are logged when they arrive
1806//
1807// Low level log from system/bt
1808//
1809// Bluetooth classic commands:
1810// - CMD_CREATE_CONNECTION
1811// - CMD_DISCONNECT
1812// - CMD_CREATE_CONNECTION_CANCEL
1813// - CMD_ACCEPT_CONNECTION_REQUEST
1814// - CMD_REJECT_CONNECTION_REQUEST
1815// - CMD_SETUP_ESCO_CONNECTION
1816// - CMD_ACCEPT_ESCO_CONNECTION
1817// - CMD_REJECT_ESCO_CONNECTION
1818// - CMD_ENH_SETUP_ESCO_CONNECTION
1819// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1820//
1821// Bluetooth low energy commands:
1822// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1823// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1824// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1825// - CMD_BLE_CLEAR_WHITE_LIST
1826// - CMD_BLE_ADD_WHITE_LIST
1827// - CMD_BLE_REMOVE_WHITE_LIST
1828//
1829// Bluetooth classic events:
1830// - EVT_CONNECTION_COMP
1831// - EVT_CONNECTION_REQUEST
1832// - EVT_DISCONNECTION_COMP
1833// - EVT_ESCO_CONNECTION_COMP
1834// - EVT_ESCO_CONNECTION_CHANGED
1835//
1836// Bluetooth low energy meta events:
1837// - BLE_EVT_CONN_COMPLETE_EVT
1838// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1839//
1840// Next tag: 10
1841message BluetoothLinkLayerConnectionEvent {
1842 // An identifier that can be used to match events for this device.
1843 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1844 // Salt: Randomly generated 256 bit value
1845 // Hash algorithm: HMAC-SHA256
1846 // Size: 32 byte
1847 // Default: null or empty if the device identifier is not known
1848 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1849 // Connection handle of this connection if available
1850 // Range: 0x0000 - 0x0EFF (12 bits)
1851 // Default: 0xFFFF if the handle is unknown
1852 optional int32 connection_handle = 2;
1853 // Direction of the link
1854 // Default: DIRECTION_UNKNOWN
1855 optional android.bluetooth.DirectionEnum direction = 3;
1856 // Type of this link
1857 // Default: LINK_TYPE_UNKNOWN
1858 optional android.bluetooth.LinkTypeEnum type = 4;
1859
1860 // Reason metadata for this link layer connection event, rules for interpretation:
1861 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1862 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1863 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1864 // set and valid, ignore hci_ble_event
1865
1866 // HCI command associated with this event
1867 // Default: CMD_UNKNOWN
1868 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1869 // HCI event associated with this event
1870 // Default: EVT_UNKNOWN
1871 optional android.bluetooth.hci.EventEnum hci_event = 6;
1872 // HCI BLE meta event associated with this event
1873 // Default: BLE_EVT_UNKNOWN
1874 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1875 // HCI command status code if this is triggerred by hci_cmd
1876 // Default: STATUS_UNKNOWN
1877 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1878 // HCI reason code associated with this event
1879 // Default: STATUS_UNKNOWN
1880 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1881}
1882
Howard Roe103fe22019-01-17 16:52:16 -08001883/**
1884 * Logs when a module is rolled back by Watchdog.
1885 *
1886 * Logged from: Rollback Manager
1887 */
1888message WatchdogRollbackOccurred {
1889 enum RollbackType {
1890 UNKNOWN = 0;
1891 ROLLBACK_INITIATE = 1;
1892 ROLLBACK_SUCCESS = 2;
1893 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001894 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001895 }
1896 optional RollbackType rollback_type = 1;
1897
1898 optional string package_name = 2;
1899
1900 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001901
1902 enum RollbackReasonType {
1903 REASON_UNKNOWN = 0;
1904 REASON_NATIVE_CRASH = 1;
1905 REASON_EXPLICIT_HEALTH_CHECK = 2;
1906 REASON_APP_CRASH = 3;
1907 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001908 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001909 }
1910 optional RollbackReasonType rollback_reason = 4;
1911
1912 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1913 // is initiated. Empty if the package is unknown.
1914 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001915
1916 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001917}
1918
Jack Hec27040a2019-01-09 20:54:41 -08001919/**
1920 * Logs when there is a change in Bluetooth A2DP playback state
1921 *
1922 * Logged from:
1923 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1924 */
1925message BluetoothA2dpPlaybackStateChanged {
1926 // An identifier that can be used to match events for this device.
1927 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1928 // Salt: Randomly generated 256 bit value
1929 // Hash algorithm: HMAC-SHA256
1930 // Size: 32 byte
1931 // Default: null or empty if the device identifier is not known
1932 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1933 // Current playback state
1934 // Default: PLAYBACK_STATE_UNKNOWN
1935 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1936 // Current audio coding mode
1937 // Default: AUDIO_CODING_MODE_UNKNOWN
1938 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1939}
1940
1941/**
1942 * Logs when there is a change in A2DP codec config for a particular remote device
1943 *
1944 * Logged from:
1945 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1946 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1947 */
1948message BluetoothA2dpCodecConfigChanged {
1949 // An identifier that can be used to match events for this device.
1950 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1951 // Salt: Randomly generated 256 bit value
1952 // Hash algorithm: HMAC-SHA256
1953 // Size: 32 byte
1954 // Default: null or empty if the device identifier is not known
1955 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1956 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1957 // Default SOURCE_CODEC_TYPE_INVALID
1958 optional int32 codec_type = 2;
1959 // Codec priroity, the higher the more preferred, -1 for disabled
1960 // Default: CODEC_PRIORITY_DEFAULT
1961 optional int32 codec_priority = 3;
1962 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1963 // Default: SAMPLE_RATE_NONE
1964 optional int32 sample_rate = 4;
1965 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1966 // Default: BITS_PER_SAMPLE_NONE
1967 optional int32 bits_per_sample = 5;
1968 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1969 // Default: CHANNEL_MODE_NONE
1970 optional int32 channel_mode = 6;
1971 // Codec specific values
1972 // Default 0
1973 optional int64 codec_specific_1 = 7;
1974 optional int64 codec_specific_2 = 8;
1975 optional int64 codec_specific_3 = 9;
1976 optional int64 codec_specific_4 = 10;
1977}
1978
1979/**
1980 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1981 * Each codec's capability is logged separately due to statsd restriction
1982 *
1983 * Logged from:
1984 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1985 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1986 */
1987message BluetoothA2dpCodecCapabilityChanged {
1988 // An identifier that can be used to match events for this device.
1989 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1990 // Salt: Randomly generated 256 bit value
1991 // Hash algorithm: HMAC-SHA256
1992 // Size: 32 byte
1993 // Default: null or empty if the device identifier is not known
1994 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1995 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1996 // Default SOURCE_CODEC_TYPE_INVALID
1997 optional int32 codec_type = 2;
1998 // Codec priroity, the higher the more preferred, -1 for disabled
1999 // Default: CODEC_PRIORITY_DEFAULT
2000 optional int32 codec_priority = 3;
2001 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2002 // in BluetoothCodecConfig
2003 // Default: empty and SAMPLE_RATE_NONE for individual item
2004 optional int32 sample_rate = 4;
2005 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2006 // in BluetoothCodecConfig
2007 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2008 optional int32 bits_per_sample = 5;
2009 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2010 // BluetoothCodecConfig
2011 // Default: empty and CHANNEL_MODE_NONE for individual item
2012 optional int32 channel_mode = 6;
2013 // Codec specific values
2014 // Default 0
2015 optional int64 codec_specific_1 = 7;
2016 optional int64 codec_specific_2 = 8;
2017 optional int64 codec_specific_3 = 9;
2018 optional int64 codec_specific_4 = 10;
2019}
2020
2021/**
2022 * Logs when A2DP failed to read from PCM source.
2023 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2024 *
2025 * Logged from:
2026 * system/bt
2027 */
2028message BluetoothA2dpAudioUnderrunReported {
2029 // An identifier that can be used to match events for this device.
2030 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2031 // Salt: Randomly generated 256 bit value
2032 // Hash algorithm: HMAC-SHA256
2033 // Size: 32 byte
2034 // Default: null or empty if the device identifier is not known
2035 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2036 // Encoding interval in nanoseconds
2037 // Default: 0
2038 optional int64 encoding_interval_nanos = 2;
2039 // Number of bytes of PCM data that could not be read from the source
2040 // Default: 0
2041 optional int32 num_missing_pcm_bytes = 3;
2042}
2043
2044/**
2045 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2046 * buffer queue is full and we have to drop data
2047 *
2048 * Logged from:
2049 * system/bt
2050 */
2051message BluetoothA2dpAudioOverrunReported {
2052 // An identifier that can be used to match events for this device.
2053 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2054 // Salt: Randomly generated 256 bit value
2055 // Hash algorithm: HMAC-SHA256
2056 // Size: 32 byte
2057 // Default: null or empty if the device identifier is not known
2058 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2059 // Encoding interval in nanoseconds
2060 // Default: 0
2061 optional int64 encoding_interval_nanos = 2;
2062 // Number of buffers dropped in this event
2063 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2064 // Default: 0
2065 optional int32 num_dropped_buffers = 3;
2066 // Number of encoded buffers dropped in this event
2067 // Default 0
2068 optional int32 num_dropped_encoded_frames = 4;
2069 // Number of encoded bytes dropped in this event
2070 // Default: 0
2071 optional int32 num_dropped_encoded_bytes = 5;
2072}
2073
2074/**
2075 * Logs when we receive reports regarding a device's RSSI value
2076 *
2077 * Logged from:
2078 * system/bt
2079 */
2080message BluetoothDeviceRssiReported {
2081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 // Size: 32 byte
2086 // Default: null or empty if the device identifier is not known
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Connection handle of this connection if available
2089 // Range: 0x0000 - 0x0EFF (12 bits)
2090 // Default: 0xFFFF if the handle is unknown
2091 optional int32 connection_handle = 2;
2092 // HCI command status code if this is triggerred by hci_cmd
2093 // Default: STATUS_UNKNOWN
2094 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2095 // BR/EDR
2096 // Range: -128 ≤ N ≤ 127 (signed integer)
2097 // Units: dB
2098 // LE:
2099 // Range: -127 to 20, 127 (signed integer)
2100 // Units: dBm
2101 // Invalid when an out of range value is reported
2102 optional int32 rssi = 4;
2103}
2104
2105/**
2106 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2107 *
2108 * Logged from:
2109 * system/bt
2110 */
2111message BluetoothDeviceFailedContactCounterReported {
2112 // An identifier that can be used to match events for this device.
2113 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2114 // Salt: Randomly generated 256 bit value
2115 // Hash algorithm: HMAC-SHA256
2116 // Size: 32 byte
2117 // Default: null or empty if the device identifier is not known
2118 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2119 // Connection handle of this connection if available
2120 // Range: 0x0000 - 0x0EFF (12 bits)
2121 // Default: 0xFFFF if the handle is unknown
2122 optional int32 connection_handle = 2;
2123 // HCI command status code if this is triggerred by hci_cmd
2124 // Default: STATUS_UNKNOWN
2125 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2126 // Number of consecutive failed contacts for a connection corresponding to the Handle
2127 // Range: uint16_t, 0-0xFFFF
2128 // Default: 0xFFFFF
2129 optional int32 failed_contact_counter = 4;
2130}
2131
2132/**
2133 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2134 *
2135 * Logged from:
2136 * system/bt
2137 */
2138message BluetoothDeviceTxPowerLevelReported {
2139 // An identifier that can be used to match events for this device.
2140 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2141 // Salt: Randomly generated 256 bit value
2142 // Hash algorithm: HMAC-SHA256
2143 // Size: 32 byte
2144 // Default: null or empty if the device identifier is not known
2145 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2146 // Connection handle of this connection if available
2147 // Range: 0x0000 - 0x0EFF (12 bits)
2148 // Default: 0xFFFF if the handle is unknown
2149 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002150 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002151 // Default: STATUS_UNKNOWN
2152 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2153 // Range: -30 ≤ N ≤ 20
2154 // Units: dBm
2155 // Invalid when an out of range value is reported
2156 optional int32 transmit_power_level = 4;
2157}
Jack Heab86dbd22018-12-18 15:43:27 -08002158
Tej Singh5d991e12018-03-09 19:48:11 -08002159/**
Jack He1021a612019-01-20 21:22:46 -08002160 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2161 * receiving an HCI command from the host
2162 *
2163 * Logged from: system/bt
2164 */
2165message BluetoothHciTimeoutReported {
2166 // HCI command associated with this event
2167 // Default: CMD_UNKNOWN
2168 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2169}
2170
2171/**
2172 * Logs when we receive Bluetooth Link Quality Report event from the controller
2173 * See Android Bluetooth HCI specification for more details
2174 *
2175 * Note: all count and bytes field are counted since last event
2176 *
2177 * Logged from: system/bt
2178 */
2179message BluetoothQualityReportReported {
2180 // Quality report ID
2181 // Original type: uint8_t
2182 // Default: BQR_ID_UNKNOWN
2183 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2184 // Packet type of the connection
2185 // Original type: uint8_t
2186 // Default: BQR_PACKET_TYPE_UNKNOWN
2187 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2188 // Connection handle of the connection
2189 // Original type: uint16_t
2190 optional int32 connection_handle = 3;
2191 // Performing Role for the connection
2192 // Original type: uint8_t
2193 optional int32 connection_role = 4;
2194 // Current Transmit Power Level for the connection. This value is the same as the controller's
2195 // response to the HCI_Read_Transmit_Power_Level HCI command
2196 // Original type: uint8_t
2197 optional int32 tx_power_level = 5;
2198 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2199 // absolute receiver signal strength value
2200 // Original type: int8_t
2201 optional int32 rssi = 6;
2202 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2203 // channels used by the link currently
2204 // Original type: uint8_t
2205 optional int32 snr = 7;
2206 // Indicates the number of unused channels in AFH_channel_map
2207 // Original type: uint8_t
2208 optional int32 unused_afh_channel_count = 8;
2209 // Indicates the number of the channels which are interfered and quality is bad but are still
2210 // selected for AFH
2211 // Original type: uint8_t
2212 optional int32 afh_select_unideal_channel_count = 9;
2213 // Current Link Supervision Timeout Setting
2214 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2215 // Original type: uint16_t
2216 optional int32 lsto = 10;
2217 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2218 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2219 // 0x01 (Piconet Clock)
2220 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2221 // Original type: uint32_t
2222 optional int64 connection_piconet_clock = 11;
2223 // The count of retransmission
2224 // Original type: uint32_t
2225 optional int64 retransmission_count = 12;
2226 // The count of no RX
2227 // Original type: uint32_t
2228 optional int64 no_rx_count = 13;
2229 // The count of NAK (Negative Acknowledge)
2230 // Original type: uint32_t
2231 optional int64 nak_count = 14;
2232 // Controller timestamp of last TX ACK
2233 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2234 // Original type: uint32_t
2235 optional int64 last_tx_ack_timestamp = 15;
2236 // The count of Flow-off (STOP)
2237 // Original type: uint32_t
2238 optional int64 flow_off_count = 16;
2239 // Controller timestamp of last Flow-on (GO)
2240 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2241 // Original type: uint32_t
2242 optional int64 last_flow_on_timestamp = 17;
2243 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2244 // Original type: uint32_t
2245 optional int64 buffer_overflow_bytes = 18;
2246 // Buffer underflow count (in byte) since last event
2247 // Original type: uint32_t
2248 optional int64 buffer_underflow_bytes = 19;
2249}
2250
2251/**
2252 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2253 *
2254 * Notes:
2255 * - Each event can be partially filled as we might learn different pieces of device
2256 * information at different time
2257 * - Multiple device info events can be combined to give more complete picture
2258 * - When multiple device info events tries to describe the same information, the
2259 * later one wins
2260 *
2261 * Logged from:
2262 * packages/apps/Bluetooth
2263 */
Jack Heaea26982019-04-04 11:19:48 -07002264message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002265 // An identifier that can be used to match events for this device.
2266 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2267 // Salt: Randomly generated 256 bit value
2268 // Hash algorithm: HMAC-SHA256
2269 // Size: 32 byte
2270 // Default: null or empty if the device identifier is not known
2271 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2272 // Where is this device info obtained from
2273 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2274 // Name of the data source
2275 // For EXTERNAL: package name of the data source
2276 // For INTERNAL: null for general case, component name otherwise
2277 optional string source_name = 3;
2278 // Name of the manufacturer of this device
2279 optional string manufacturer = 4;
2280 // Model of this device
2281 optional string model = 5;
2282 // Hardware version of this device
2283 optional string hardware_version = 6;
2284 // Software version of this device
2285 optional string software_version = 7;
2286}
2287
2288/**
2289 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2290 * device, as documented by the Bluetooth Core HCI specification
2291 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2292 * Vol 2, Part E, Page 1118
2293 *
2294 * Logged from:
2295 * system/bt
2296 */
2297message BluetoothRemoteVersionInfoReported {
2298 // Connection handle of the connection
2299 // Original type: uint16_t
2300 optional int32 connection_handle = 1;
2301 // HCI command status code
2302 // Default: STATUS_UNKNOWN
2303 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2304 // 1 byte Version of current LMP in the remote controller
2305 optional int32 lmp_version = 3;
2306 // 2 bytes LMP manufacturer code of the remote controller
2307 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2308 optional int32 lmp_manufacturer_code = 4;
2309 // 4 bytes subversion of the LMP in the remote controller
2310 optional int32 lmp_subversion = 5;
2311}
2312
2313/**
2314 * Logs when certain Bluetooth SDP attributes are discovered
2315 * Constant definitions are from:
2316 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2317 *
2318 * Current logged attributes:
2319 * - BluetoothProfileDescriptorList
2320 * - Supported Features Bitmask
2321 *
2322 * Logged from:
2323 * system/bt
2324 */
2325message BluetoothSdpAttributeReported {
2326 // An identifier that can be used to match events for this device.
2327 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2328 // Salt: Randomly generated 256 bit value
2329 // Hash algorithm: HMAC-SHA256
2330 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2331 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2332 // Original type: uint16_t
2333 optional int32 protocol_uuid = 2;
2334 // Short form UUIDs used to identify Bluetooth SDP attribute types
2335 // Original type: uint16_t
2336 optional int32 attribute_id = 3;
2337 // Attribute value for the particular attribute
2338 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2339}
2340
2341/**
2342 * Logs when bond state of a Bluetooth device changes
2343 *
2344 * Logged from:
2345 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2346 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2347 */
2348message BluetoothBondStateChanged {
2349 // An identifier that can be used to match events for this device.
2350 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2351 // Salt: Randomly generated 256 bit value
2352 // Hash algorithm: HMAC-SHA256
2353 // Size: 32 byte
2354 // Default: null or empty if the device identifier is not known
2355 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2356 // Preferred transport type to remote dual mode device
2357 // Default: TRANSPORT_AUTO means no preference
2358 optional android.bluetooth.TransportTypeEnum transport = 2;
2359 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2360 // Default: UNKNOWN
2361 optional android.bluetooth.DeviceTypeEnum type = 3;
2362 // Current bond state (NONE, BONDING, BONDED)
2363 // Default: BOND_STATE_UNKNOWN
2364 optional android.bluetooth.BondStateEnum bond_state = 4;
2365 // Bonding sub state
2366 // Default: BOND_SUB_STATE_UNKNOWN
2367 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2368 // Unbond Reason
2369 // Default: UNBOND_REASON_UNKNOWN
2370 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2371}
2372
2373/**
2374 * Logs there is an event related Bluetooth classic pairing
2375 *
2376 * Logged from:
2377 * system/bt
2378 */
2379message BluetoothClassicPairingEventReported {
2380 // An identifier that can be used to match events for this device.
2381 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2382 // Salt: Randomly generated 256 bit value
2383 // Hash algorithm: HMAC-SHA256
2384 // Size: 32 byte
2385 // Default: null or empty if the device identifier is not known
2386 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2387 // Connection handle of this connection if available
2388 // Range: 0x0000 - 0x0EFF (12 bits)
2389 // Default: 0xFFFF if the handle is unknown
2390 optional int32 connection_handle = 2;
2391 // HCI command associated with this event
2392 // Default: CMD_UNKNOWN
2393 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2394 // HCI event associated with this event
2395 // Default: EVT_UNKNOWN
2396 optional android.bluetooth.hci.EventEnum hci_event = 4;
2397 // HCI command status code if this is triggerred by hci_cmd
2398 // Default: STATUS_UNKNOWN
2399 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2400 // HCI reason code associated with this event
2401 // Default: STATUS_UNKNOWN
2402 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002403 // A status value related to this specific event
2404 // Default: 0
2405 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002406}
2407
2408/**
2409 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2410 *
2411 * Logged from:
2412 * system/bt
2413 */
2414message BluetoothSmpPairingEventReported {
2415 // An identifier that can be used to match events for this device.
2416 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2417 // Salt: Randomly generated 256 bit value
2418 // Hash algorithm: HMAC-SHA256
2419 // Size: 32 byte
2420 // Default: null or empty if the device identifier is not known
2421 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2422 // SMP command sent or received over L2CAP
2423 // Default: CMD_UNKNOWN
2424 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2425 // Whether this command is sent or received
2426 // Default: DIRECTION_UNKNOWN
2427 optional android.bluetooth.DirectionEnum direction = 3;
2428 // SMP failure reason code
2429 // Default: PAIRING_FAIL_REASON_DEFAULT
2430 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2431}
2432
2433/**
Jack He815cdba2019-01-30 17:24:55 -08002434 * Logs when a Bluetooth socket’s connection state changed
2435 *
2436 * Logged from:
2437 * system/bt
2438 */
2439message BluetoothSocketConnectionStateChanged {
2440 // An identifier that can be used to match events for this device.
2441 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2442 // Salt: Randomly generated 256 bit value
2443 // Hash algorithm: HMAC-SHA256
2444 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002445 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002446 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002447 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002448 // Default 0 when unknown or don't care
2449 optional int32 port = 2;
2450 // Socket type as mentioned in
2451 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2452 // Default: SOCKET_TYPE_UNKNOWN
2453 optional android.bluetooth.SocketTypeEnum type = 3;
2454 // Socket connection state
2455 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2456 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2457 // Number of bytes sent to remote device during this connection
2458 optional int64 tx_bytes = 5;
2459 // Number of bytes received from remote device during this connection
2460 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002461 // Socket owner's UID
2462 optional int32 uid = 7 [(is_uid) = true];
2463 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2464 // |port| must be spawned by |server_port|
2465 // Default 0 when unknown or don't care
2466 optional int32 server_port = 8;
2467 // Whether this is a server listener socket
2468 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002469}
2470
2471/**
Jack He71426802019-04-02 13:32:52 -07002472 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2473 *
2474 * Logged from:
2475 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2476 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2477 *
2478 */
2479message BluetoothClassOfDeviceReported {
2480 // An identifier that can be used to match events for this device.
2481 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2482 // Salt: Randomly generated 256 bit value
2483 // Hash algorithm: HMAC-SHA256
2484 // Size: 32 byte
2485 // Default: null or empty if this is a server listener socket
2486 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2487 // Class of Device (CoD) value including both Major, Minor device class and service class
2488 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2489 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2490 // Default: 0
2491 optional int32 class_of_device = 2;
2492}
2493
2494/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002495 * Logs when something is plugged into or removed from the USB-C connector.
2496 *
2497 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002498 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002499 */
2500message UsbConnectorStateChanged {
2501 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002502 STATE_DISCONNECTED = 0;
2503 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002504 }
2505 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002506 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002507 // Last active session in ms.
2508 // 0 when the port is in connected state.
2509 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002510}
2511
2512/**
2513 * Logs the reported speaker impedance.
2514 *
2515 * Logged from:
2516 * Vendor audio implementation.
2517 */
2518message SpeakerImpedanceReported {
2519 optional int32 speaker_location = 1;
2520 optional int32 impedance = 2;
2521}
2522
2523/**
2524 * Logs the report of a failed hardware.
2525 *
2526 * Logged from:
2527 * Vendor HALs.
2528 *
2529 */
2530message HardwareFailed {
2531 enum HardwareType {
2532 HARDWARE_FAILED_UNKNOWN = 0;
2533 HARDWARE_FAILED_MICROPHONE = 1;
2534 HARDWARE_FAILED_CODEC = 2;
2535 HARDWARE_FAILED_SPEAKER = 3;
2536 HARDWARE_FAILED_FINGERPRINT = 4;
2537 }
2538 optional HardwareType hardware_type = 1;
2539
Maggie White6dcd8572019-01-31 14:11:50 -08002540 /**
2541 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002542 * the same hardware_type. The specific locations are vendor defined integers,
2543 * referring to board-specific numbering schemes.
2544 */
2545 optional int32 hardware_location = 2;
2546
Maggie White6dcd8572019-01-31 14:11:50 -08002547 /**
2548 * failure_code is specific to the HardwareType of the failed hardware.
2549 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002550 */
Maggie White6dcd8572019-01-31 14:11:50 -08002551 enum HardwareErrorCode {
2552 UNKNOWN = 0;
2553 COMPLETE = 1;
2554 SPEAKER_HIGH_Z = 2;
2555 SPEAKER_SHORT = 3;
2556 FINGERPRINT_SENSOR_BROKEN = 4;
2557 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002558 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002559 }
2560 optional int32 failure_code = 3;
2561}
2562
2563/**
2564 * Log an event when the device has been physically dropped.
2565 * Reported from the /vendor partition.
2566 */
2567message PhysicalDropDetected {
2568 // Confidence that the event was actually a drop, 0 -> 100
2569 optional int32 confidence_pctg = 1;
2570 // Peak acceleration of the drop, in 1/1000s of a g.
2571 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002572 // Duration of freefall in ms
2573 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002574}
2575
2576/**
2577 * Log bucketed battery charge cycles.
2578 *
2579 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002580 * a given charge point. For example, if 10 cycle buckets are
2581 * initialized, bucket 1 is the lowest 1/10th of the battery,
2582 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002583 *
2584 * Logged from:
2585 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2586 */
2587message ChargeCyclesReported {
2588 optional int32 cycle_bucket_1 = 1;
2589 optional int32 cycle_bucket_2 = 2;
2590 optional int32 cycle_bucket_3 = 3;
2591 optional int32 cycle_bucket_4 = 4;
2592 optional int32 cycle_bucket_5 = 5;
2593 optional int32 cycle_bucket_6 = 6;
2594 optional int32 cycle_bucket_7 = 7;
2595 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002596 optional int32 cycle_bucket_9 = 9;
2597 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002598}
2599
2600/**
Howard Roa46b6582018-09-18 16:45:02 -07002601 * Log battery health snapshot.
2602 *
2603 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2604 * are snapshotted periodically over 24hrs.
2605 */
2606message BatteryHealthSnapshot {
2607 enum BatterySnapshotType {
2608 UNKNOWN = 0;
2609 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2610 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2611 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2612 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2613 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2614 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2615 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2616 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2617 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2618 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2619 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2620 }
2621 optional BatterySnapshotType type = 1;
2622 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002623 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002624 // Voltage Battery Voltage, in microVolts.
2625 optional int32 voltage_micro_volt = 3;
2626 // Current Battery current, in microAmps.
2627 optional int32 current_micro_amps = 4;
2628 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2629 optional int32 open_circuit_micro_volt = 5;
2630 // Resistance Battery Resistance, in microOhms.
2631 optional int32 resistance_micro_ohm = 6;
2632 // Level Battery Level, as % of full.
2633 optional int32 level_percent = 7;
2634}
2635
2636/**
2637 * Log slow I/O operations on the primary storage.
2638 */
2639message SlowIo {
2640 // Classifications of IO Operations.
2641 enum IoOperation {
2642 UNKNOWN = 0;
2643 READ = 1;
2644 WRITE = 2;
2645 UNMAP = 3;
2646 SYNC = 4;
2647 }
2648 optional IoOperation operation = 1;
2649
2650 // The number of slow IO operations of this type over 24 hours.
2651 optional int32 count = 2;
2652}
2653
2654/**
2655 * Log battery caused shutdown with the last recorded voltage.
2656 */
2657message BatteryCausedShutdown {
2658 // The last recorded battery voltage prior to shutdown.
2659 optional int32 last_recorded_micro_volt = 1;
2660}
2661
2662/**
Tej Singha72344992019-04-17 18:55:08 -07002663 * Logs when ThermalService receives throttling events.
2664 *
2665 * Logged from:
2666 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2667 */
2668message ThermalThrottlingSeverityStateChanged {
2669 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2670 optional android.os.TemperatureTypeEnum sensor_type = 1;
2671
2672 // The name of the temperature source. Eg. CPU0
2673 optional string sensor_name = 2;
2674
2675 // Temperature in tenths of a degree C.
2676 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2677 optional int32 temperature_deci_celsius = 3;
2678
2679 // Relative severity of the throttling, see enum definition.
2680 optional android.os.ThrottlingSeverityEnum severity = 4;
2681}
2682
2683/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002684 * Logs the duration of a davey (jank of >=700ms) when it occurs
2685 *
2686 * Logged from:
2687 * frameworks/base/libs/hwui/JankTracker.cpp
2688 */
2689message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002690 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002691 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002692
Tej Singhbb8554a2018-01-26 11:59:14 -08002693 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002694 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002695}
2696
2697/**
Bookatze5885242017-10-24 20:10:31 -07002698 * Logs phone signal strength changes.
2699 *
2700 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002701 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002702 */
2703message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002704 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2705 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002706}
2707
Yangster4ccebea2018-10-09 17:09:02 -07002708
2709/**
2710 * Logs when the phone state, sim state or signal strength changes
2711 *
2712 * Logged from:
2713 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2714 */
2715message PhoneServiceStateChanged {
2716 optional android.telephony.ServiceStateEnum state = 1;
2717 optional android.telephony.SimStateEnum sim_state = 2;
2718 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2719}
2720
2721/**
2722 * Logs when the phone becomes on or off.
2723 *
2724 * Logged from:
2725 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2726 */
2727message PhoneStateChanged {
2728 enum State {
2729 OFF = 0;
2730 ON = 1;
2731 }
2732 optional State state = 1;
2733}
2734
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002735message BackGesture {
2736 enum BackType {
2737 DEFAULT_BACK_TYPE = 0;
2738 COMPLETED = 1;
2739 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2740 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2741 INCOMPLETE = 4;
2742 }
2743 optional BackType type = 1;
2744
2745 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2746 enum WindowHorizontalLocation {
2747 DEFAULT_LOCATION = 0;
2748 LEFT = 1;
2749 RIGHT = 2;
2750 }
2751 optional WindowHorizontalLocation x_location = 3;
2752}
2753
2754message ExclusionRectStateChanged {
2755 optional string component_name = 1; // if not available, simply packageName
2756 optional int32 requested_height = 2; // px
2757 optional int32 rejected_height = 3; // px
2758
2759 enum WindowHorizontalLocation {
2760 DEFAULT_LOCATION = 0;
2761 LEFT = 1;
2762 RIGHT = 2;
2763 }
2764 optional WindowHorizontalLocation x_location = 4;
2765 optional bool landscape = 5;
2766 optional bool splitscreen = 6;
2767 optional int32 duration_millis = 7;
2768}
2769
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002770message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002771 optional android.stats.launcher.LauncherAction action = 1;
2772 optional android.stats.launcher.LauncherState src_state = 2;
2773 optional android.stats.launcher.LauncherState dst_state = 3;
2774 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002775 optional bool is_swipe_up_enabled = 5;
2776}
2777
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002778message StyleUIChanged {
2779 optional android.stats.style.Action action = 1;
2780 optional int32 color_package_hash = 2;
2781 optional int32 font_package_hash = 3;
2782 optional int32 shape_package_hash = 4;
2783 optional int32 clock_package_hash = 5;
2784 optional int32 launcher_grid = 6;
2785 optional int32 wallpaper_category_hash = 7;
2786 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002787 optional int32 color_preference = 9;
2788 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002789}
2790
David Chenc28b2bb2017-10-24 12:52:52 -07002791/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002792 * Logs when Settings UI has changed.
2793 *
2794 * Logged from:
2795 * packages/apps/Settings
2796 */
2797message SettingsUIChanged {
2798 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002799 * Where this SettingsUIChange event comes from. For example, if
2800 * it's a PAGE_VISIBLE event, where the page is opened from.
2801 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002802 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002803
2804 /**
2805 * What the UI action is.
2806 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002807 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002808
2809 /**
2810 * Where the action is happening
2811 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002812 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002813
2814 /**
2815 * What preference changed in this event.
2816 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002817 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002818
2819 /**
2820 * The new value of the changed preference.
2821 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002822 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002823}
2824
2825/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002826 * Logs basic timing information about touch events.
2827 * Reported at most every 5 minutes while device is being interacted with.
2828 *
2829 * Logged from:
2830 * frameworks/native/services/inputflinger
2831 */
2832message TouchEventReported {
2833 /**
2834 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002835 * and the standard deviation of the time spent processing touchscreen events
2836 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002837 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002838 * On supported devices, the starting point is taken during the hard interrupt inside the
2839 * kernel touch driver. On all other devices, the starting point is taken inside
2840 * the kernel's input event subsystem upon receipt of the input event.
2841 * The ending point is taken inside InputDispatcher, just after the input event
2842 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002843 */
2844 // Minimum value
2845 optional float latency_min_micros = 1;
2846 // Maximum value
2847 optional float latency_max_micros = 2;
2848 // Average value
2849 optional float latency_mean_micros = 3;
2850 // Standard deviation
2851 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002852 // Number of touch events (input_event) in this report
2853 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002854}
2855
2856/**
Philip Quinn0eded622019-01-29 12:46:28 -08002857 * Logs gesture classification and timing information for touch events.
2858 *
2859 * Logged from:
2860 * frameworks/base/core/java/android/view/GestureDetector.java
2861 * frameworks/base/core/java/android/view/View.java
2862 */
2863message TouchGestureClassified {
2864 // The source of the classification (e.g. Java class name).
2865 optional string source = 1;
2866
2867 enum Classification {
2868 UNKNOWN_CLASSIFICATION = 0;
2869 SINGLE_TAP = 1;
2870 DOUBLE_TAP = 2;
2871 LONG_PRESS = 3;
2872 DEEP_PRESS = 4;
2873 SCROLL = 5;
2874 }
2875 // The classification of the gesture.
2876 optional Classification classification = 2;
2877
2878 // The interval from the start of a touch event stream until the
2879 // classification was made.
2880 optional int32 latency_millis = 3;
2881
2882 // The distance from the location of the first touch event to the
2883 // location of the touch event when the classification was made.
2884 optional float displacement_px = 4;
2885}
2886
2887/**
David Chenc28b2bb2017-10-24 12:52:52 -07002888 * Logs that a setting was updated.
2889 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002890 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002891 * The tag and is_default allow resetting of settings to default values based on the specified
2892 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2893 */
2894message SettingChanged {
2895 // The name of the setting.
2896 optional string setting = 1;
2897
2898 // The change being imposed on this setting. May represent a number, eg "3".
2899 optional string value = 2;
2900
2901 // The new value of this setting. For most settings, this is same as value. For some settings,
2902 // value is +X or -X where X represents an element in a set. For example, if the previous value
2903 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2904 // The +/- feature is currently only used for location_providers_allowed.
2905 optional string new_value = 3;
2906
2907 // The previous value of this setting.
2908 optional string prev_value = 4;
2909
2910 // The tag used with the is_default for resetting sets of settings. This is generally null.
2911 optional string tag = 5;
2912
Bookatz90867622018-01-31 15:05:57 -08002913 // True if this setting with tag should be resettable.
2914 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002915
David Chenbd789912018-03-16 17:19:55 -07002916 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002917 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002918
2919 enum ChangeReason {
2920 UPDATED = 1; // Updated can be an insertion or an update.
2921 DELETED = 2;
2922 }
2923 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002924}
Chenjie Yub3dda412017-10-24 13:41:59 -07002925
Chenjie Yu05013b32017-11-21 10:21:41 -08002926/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002927 * Logs activity going to foreground or background
2928 *
2929 * Logged from:
2930 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2931 */
2932message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002933 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002934 optional string pkg_name = 2;
2935 optional string class_name = 3;
2936
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002937 enum State {
2938 BACKGROUND = 0;
2939 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002940 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002941 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002942}
David Chenc8a43242017-10-17 16:23:28 -07002943
2944/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002945 * Logs when a volume entered low Storage state.
2946 * Logged from:
2947 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2948 */
2949message LowStorageStateChanged {
2950 // Volume that ran out of storage.
2951 optional string volume_description = 1;
2952
2953 enum State {
2954 UNKNOWN = 0;
2955 OFF = 1;
2956 ON = 2;
2957 }
2958 optional State state = 2;
2959}
2960
2961/**
2962 * Logs when an app is downgraded.
2963 * Logged from:
2964 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2965 */
2966message AppDowngraded {
2967 optional string package_name = 1;
2968 // Size of the package (all data) before being downgraded.
2969 optional int64 size_in_bytes_before = 2;
2970 // Size of the package (all data) after being downgraded.
2971 optional int64 size_in_bytes_after = 3;
2972
2973 optional bool aggressive = 4;
2974}
2975
2976/**
2977 * Logs when an app is optimized after being downgraded.
2978 * Logged from:
2979 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2980 */
2981message AppOptimizedAfterDowngraded {
2982 optional string package_name = 1;
2983}
2984
2985/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002986 * Logs whenever an app is installed on external storage.
2987 * Logged from:
2988 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2989 */
2990message AppInstallOnExternalStorageReported {
2991 // The type of external storage.
2992 optional android.stats.storage.ExternalStorageType storage_type = 1;
2993 // The name of the package that is installed on the sd card.
2994 optional string package_name = 2;
2995}
2996
2997/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002999 * Logged from:
3000 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3001 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003002message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003003 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003004
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003005 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003006
3007 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003008 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003009 optional string process_name = 3;
3010
3011 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003012 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003013
3014 optional string package_name = 5;
3015
3016 enum InstantApp {
3017 UNAVAILABLE = 0;
3018 FALSE = 1;
3019 TRUE = 2;
3020 }
3021 optional InstantApp is_instant_app = 6;
3022
3023 enum ForegroundState {
3024 UNKNOWN = 0;
3025 BACKGROUND = 1;
3026 FOREGROUND = 2;
3027 }
3028 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003029
3030 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003031}
David Chen9e3808c2017-11-20 17:25:34 -08003032
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003033/**
3034 * Logs when a WTF (What a Terrible Failure) happened.
3035 * Logged from:
3036 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3037 */
3038message WTFOccurred {
3039 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003040
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003041 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003042
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043 // The name of the process.
3044 // system_server if it is not by an app
3045 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003046
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003047 // The pid if available. -1 means not available.
3048 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003049
3050 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003051}
3052
3053/**
3054 * Logs when system server reports low memory.
3055 * Logged from:
3056 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3057 */
3058message LowMemReported {
3059}
3060
3061/**
3062 * Logs when an app ANR (App Not Responding) occurs.
3063 * Logged from:
3064 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3065 */
3066message ANROccurred {
3067 optional int32 uid = 1 [(is_uid) = true];
3068
3069 optional string process_name = 2;
3070
3071 optional string short_component_name = 3;
3072
3073 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003074
3075 enum InstantApp {
3076 UNAVAILABLE = 0;
3077 FALSE = 1;
3078 TRUE = 2;
3079 }
3080 optional InstantApp is_instant_app = 5;
3081
3082 enum ForegroundState {
3083 UNKNOWN = 0;
3084 BACKGROUND = 1;
3085 FOREGROUND = 2;
3086 }
3087 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003088
3089 optional android.server.ErrorSource error_source = 7;
3090
3091 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003092}
3093
Bookatza7020bd2018-08-28 16:29:35 -07003094/**
3095 * Logs when the vibrator state changes.
3096 * Logged from:
3097 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3098 */
3099message VibratorStateChanged {
3100 repeated AttributionNode attribution_node = 1;
3101
3102 enum State {
3103 OFF = 0;
3104 ON = 1;
3105 }
3106 optional State state = 2;
3107
3108 // Duration (in milliseconds) requested to keep the vibrator on.
3109 // Only applicable for State == ON.
3110 optional int64 duration_millis = 3;
3111}
3112
David Chen0a368b22017-12-06 16:28:16 -08003113/*
3114 * Allows other apps to push events into statsd.
3115 * Logged from:
3116 * frameworks/base/core/java/android/util/StatsLog.java
3117 */
David Chen0b5c90c2018-01-25 16:51:49 -08003118message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003119 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003120 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003121
3122 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3123 optional int32 label = 2;
3124
3125 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3126 // predicates for the metrics).
3127 enum State {
3128 UNKNOWN = 0;
3129 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3130 STOP = 2;
3131 START = 3;
3132 }
3133 optional State state = 3;
3134}
3135
David Chen9e3808c2017-11-20 17:25:34 -08003136/**
Bookatz7948c872018-09-04 12:58:33 -07003137 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3138 * For example, this could be due to the user manually changing the time.
3139 *
3140 * Logged from:
3141 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3142 */
3143message WallClockTimeShifted {
3144 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3145 optional int64 wall_clock_timestamp_millis = 1;
3146}
3147
3148/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003149 * Logs when statsd detects an anomaly.
3150 *
3151 * Logged from:
3152 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3153 */
3154message AnomalyDetected {
3155 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003156 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003157
Yangster-mac94e197c2018-01-02 16:03:03 -08003158 // Id of the config whose anomaly detection alert fired.
3159 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003160
Yangster-mac94e197c2018-01-02 16:03:03 -08003161 // Id of the alert (i.e. name of the anomaly that was detected).
3162 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003163}
3164
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003165message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003166 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003167 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003168
3169 // The app package name.
3170 optional string pkg_name = 2;
3171
3172 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003173 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003174 WARM = 1;
3175 HOT = 2;
3176 COLD = 3;
3177 }
3178 // The transition type.
3179 optional TransitionType type = 3;
3180
3181 // The activity name.
3182 optional string activity_name = 4;
3183
3184 // The name of the calling app. Empty if not set.
3185 optional string calling_pkg_name = 5;
3186
3187 // Whether the app is an instant app.
3188 optional bool is_instant_app = 6;
3189
3190 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003191 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003192
Bookatz80d11a02018-01-16 10:46:35 -08003193 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003194
David Chen0b5c90c2018-01-25 16:51:49 -08003195 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003196 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003197 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003199 optional int32 bind_application_delay_millis = 11;
3200 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003201
3202 // Empty if not set.
3203 optional string launch_token = 13;
3204
Calin Juravle759fbda2018-02-20 19:52:30 +00003205 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003206 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003207
3208 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003209 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210}
3211
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003212message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003213 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003214 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003215
3216 // The app package name.
3217 optional string pkg_name = 2;
3218
3219 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003220 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003221 WARM = 1;
3222 HOT = 2;
3223 COLD = 3;
3224 }
3225 // The transition type.
3226 optional TransitionType type = 3;
3227
3228 // The activity name.
3229 optional string activity_name = 4;
3230}
3231
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003232message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003233 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003234 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003235
3236 // The app package name.
3237 optional string pkg_name = 2;
3238
3239 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003240 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003241 WITH_BUNDLE = 1;
3242 WITHOUT_BUNDLE = 2;
3243 }
3244 // The transition type.
3245 optional TransitionType type = 3;
3246
3247 // The activity name.
3248 optional string activity_name = 4;
3249
3250 optional bool transition_process_running = 5;
3251
3252 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003253 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003254}
3255
Bookatz8fcd09a2017-12-18 13:01:10 -08003256/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003257 * Logs a picture-in-picture action
3258 * Logged from:
3259 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3260 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3261 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3262 */
3263message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003264 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003265 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003266
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003267 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003268
Chenjie Yu52cacc62017-12-08 18:11:45 -08003269 enum State {
3270 ENTERED = 1;
3271 EXPANDED_TO_FULL_SCREEN = 2;
3272 MINIMIZED = 3;
3273 DISMISSED = 4;
3274 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003275 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003276}
3277
3278/**
Chenjie Yue8904192017-12-08 19:12:57 -08003279 * Logs overlay action
3280 * Logged from:
3281 * services/core/java/com/android/server/wm/Session.java
3282 */
3283message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003284 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003285
tsaichristine5adc7e02020-01-14 17:07:39 -08003286 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003287
3288 optional bool using_alert_window = 3;
3289
3290 enum State {
3291 ENTERED = 1;
3292 EXITED = 2;
3293 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003294 optional State state = 4 [
3295 (state_field_option).option = EXCLUSIVE_STATE,
3296 (state_field_option).nested = false,
3297 (state_field_option).default_state_value = 2
3298 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003299}
3300
Adam Bookatz38767932020-02-05 12:13:40 -08003301/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003302 * Logs foreground service starts and stops.
3303 * Note that this is not when a service starts or stops, but when it is
3304 * considered foreground.
3305 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003306 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003307 */
3308message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003309 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003310 // package_name + "/" + class_name
3311 optional string short_name = 2;
3312
3313 enum State {
3314 ENTER = 1;
3315 EXIT = 2;
3316 }
3317 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003318
3319 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3320 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3321 optional bool allow_while_in_use_permission = 4;
3322}
3323
3324/**
3325 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3326 * A foreground service session is any continuous period during which the uid holds at least one
3327 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3328 * Accesses initiated while the uid is in the TOP state are ignored.
3329 * Sessions with no attempted accesses are not logged.
3330 * Logged from
3331 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3332 */
3333message ForegroundServiceAppOpSessionEnded {
3334 optional int32 uid = 1 [(is_uid) = true];
3335
3336 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003337 // Only following four ops are logged
3338 // COARSE_LOCATION = 0
3339 // FINE_LOCATION = 1
3340 // CAMERA = 26
3341 // RECORD_AUDIO = 27
3342 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003343
3344 // The uid's permission mode for accessing the AppOp during this fgs session.
3345 enum Mode {
3346 MODE_UNKNOWN = 0;
3347 MODE_ALLOWED = 1; // Always allowed
3348 MODE_IGNORED = 2; // Denied
3349 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3350 }
3351 optional Mode app_op_mode = 3;
3352
3353 // Number of times this AppOp was requested and allowed.
3354 optional int32 count_ops_accepted = 4;
3355 // Number of times this AppOp was requested but denied.
3356 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003357}
3358
Chenjie Yue8904192017-12-08 19:12:57 -08003359/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003360 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3361 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3362 * attributed back to the parent (host) uid. One example is Chrome.
3363 *
3364 * Logged from:
3365 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3366 */
3367message IsolatedUidChanged {
3368 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003369 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003370 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003371 optional int32 parent_uid = 1;
3372
3373 optional int32 isolated_uid = 2;
3374
3375 // We expect an isolated uid to be removed before if it's used for another parent uid.
3376 enum Event {
3377 REMOVED = 0;
3378 CREATED = 1;
3379 }
3380 optional Event event = 3;
3381}
3382
3383/*
3384 * Logs the reception of an incoming network packet causing the main system to wake up for
3385 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3386 * and processed by WakeupController.cpp.
3387 */
3388message PacketWakeupOccurred {
3389 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3390 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003391 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003392 // The interface name on which the packet was received.
3393 optional string iface = 2;
3394 // The ethertype value of the packet.
3395 optional int32 ethertype = 3;
3396 // String representation of the destination MAC address of the packet.
3397 optional string destination_hardware_address = 4;
3398 // String representation of the source address of the packet if this was an IP packet.
3399 optional string source_ip = 5;
3400 // String representation of the destination address of the packet if this was an IP packet.
3401 optional string destination_ip = 6;
3402 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3403 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3404 // families.
3405 optional int32 ip_next_header = 7;
3406 // The source port if this was a TCP or UDP packet.
3407 optional int32 source_port = 8;
3408 // The destination port if this was a TCP or UDP packet.
3409 optional int32 destination_port = 9;
3410}
3411
3412/*
3413 * Logs the memory stats for an app on startup.
3414 * Logged from:
3415 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3416 */
3417message AppStartMemoryStateCaptured {
3418 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003419 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003420
3421 // The process name.
3422 optional string process_name = 2;
3423
3424 // The activity name.
3425 optional string activity_name = 3;
3426
3427 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003428 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003429
3430 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003431 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003432
3433 // RSS
3434 optional int64 rss_in_bytes = 6;
3435
3436 // CACHE
3437 optional int64 cache_in_bytes = 7;
3438
3439 // SWAP
3440 optional int64 swap_in_bytes = 8;
3441}
3442
3443/*
3444 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3445 * for LMK event.
3446 * Logged from:
3447 * system/core/lmkd/lmkd.c
3448 */
3449message LmkStateChanged {
3450 enum State {
3451 UNKNOWN = 0;
3452 START = 1;
3453 STOP = 2;
3454 }
3455 optional State state = 1;
3456}
3457
3458/*
3459 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3460 * Logged from:
3461 * system/core/lmkd/lmkd.c
3462 */
3463message LmkKillOccurred {
3464 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003465 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003466
3467 // The process name.
3468 optional string process_name = 2;
3469
3470 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003471 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003472
3473 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003474 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003475
3476 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003477 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003478
3479 // RSS
3480 optional int64 rss_in_bytes = 6;
3481
3482 // CACHE
3483 optional int64 cache_in_bytes = 7;
3484
3485 // SWAP
3486 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003487
3488 // The elapsed real time of start of the process.
3489 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003490
3491 // Min oom adj score considered by lmkd.
3492 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003493}
3494
Rajeev Kumar51b54602018-03-01 12:18:26 -08003495/*
3496 * Logs when the ActivityManagerService detects that an app died.
3497 *
3498 * Logged from:
3499 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3500 */
3501message AppDied {
3502 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003503 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003504}
3505
Howard Ro21a039c2018-08-06 14:55:47 -07003506/**
3507 * An atom for generic metrics logging. Available from Android Q.
3508 */
3509message GenericAtom {
3510 // The uid of the application that sent this custom atom.
3511 optional int32 uid = 1 [(is_uid) = true];
3512
3513 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003514 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003515}
3516
Tej Singhd6d6d772018-09-05 17:41:25 -07003517/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003518 * Atom for simple logging of user interaction and impression events, such as "the user touched
3519 * this button" or "this dialog was displayed".
3520 * Keep the UI event stream clean: don't use for system or background events.
3521 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003522 *
3523 * Logged from:
3524 * frameworks/base/services/core/java/com/android/server/
3525 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003526 */
3527message UiEventReported {
3528 // The event_id.
3529 optional int32 event_id = 1;
3530 // The event's source or target uid and package, if applicable.
3531 // For example, the package posting a notification, or the destination package of a share.
3532 optional int32 uid = 2 [(is_uid) = true];
3533 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003534 // An identifier used to disambiguate which logs refer to a particular instance of some
3535 // UI element. Useful when there might be multiple instances simultaneously active.
3536 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003537}
3538
3539/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003540 * Reports a notification was created or updated.
3541 *
3542 * Logged from:
3543 * frameworks/base/services/core/java/com/android/server/notification/
3544 */
3545message NotificationReported {
3546 // The event_id (as for UiEventReported).
3547 optional int32 event_id = 1;
3548 // The notifying app's uid and package.
3549 optional int32 uid = 2 [(is_uid) = true];
3550 optional string package_name = 3;
3551 // A small system-assigned identifier for the notification.
3552 // Locally probably-unique, but expect collisions across users and/or days.
3553 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003554 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3555 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003556
3557 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003558 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3559 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3560 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003561
3562 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003563 optional string category = 10; // App-assigned notification category (API-defined strings)
3564 optional int32 style = 11; // App-assigned notification style
3565 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003566
3567 // Ordering, importance and interruptiveness
3568
Will Brockman7614f6962020-02-10 19:43:03 -05003569 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003570
Will Brockman7614f6962020-02-10 19:43:03 -05003571 optional android.stats.sysui.NotificationImportance importance = 14;
3572 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003573
3574 enum NotificationImportanceExplanation {
3575 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3576 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3577 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3578 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3579 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3580 // Like _APP, but based on pre-channels priority signal.
3581 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3582 }
3583
Will Brockman7614f6962020-02-10 19:43:03 -05003584 optional NotificationImportanceExplanation importance_source = 16;
3585 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3586 optional NotificationImportanceExplanation importance_initial_source = 18;
3587 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3588 optional int32 assistant_hash = 20;
3589 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003590}
3591
3592message Notification {
3593 // The notifying app's uid and package.
3594 optional int32 uid = 1 [(is_uid) = true];
3595 optional string package_name = 2;
3596 // A small system-assigned identifier for the notification.
3597 optional int32 instance_id = 3;
3598
3599 // Grouping information.
3600 optional int32 group_instance_id = 4;
3601 optional bool is_group_summary = 5;
3602
3603 // The section of the shade that the notification is in.
3604 // See NotificationSectionsManager.PriorityBucket.
3605 enum NotificationSection {
3606 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003607 SECTION_HEADS_UP = 1;
3608 SECTION_PEOPLE = 2;
3609 SECTION_ALERTING = 3;
3610 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003611 }
3612 optional NotificationSection section = 6;
3613}
3614
3615message NotificationList {
3616 repeated Notification notifications = 1; // An ordered sequence of notifications.
3617}
3618
3619/**
3620 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3621 *
3622 * Logged from:
3623 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3624 */
3625message NotificationPanelReported {
3626 // The event_id (as for UiEventReported).
3627 optional int32 event_id = 1;
3628 optional int32 num_notifications = 2;
3629 // The notifications in the panel, in the order that they appear there.
3630 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3631}
3632
3633/**
3634 * Reports a notification channel, or channel group, was created, updated, or deleted.
3635 *
3636 * Logged from:
3637 * frameworks/base/services/core/java/com/android/server/notification/
3638 */
3639message NotificationChannelModified {
3640 // The event_id (as for UiEventReported).
3641 optional int32 event_id = 1;
3642 // The notifying app's uid and package.
3643 optional int32 uid = 2 [(is_uid) = true];
3644 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003645 // Hash of app-assigned notification channel ID or channel-group ID
3646 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003647 // Previous importance setting, if applicable
3648 optional android.stats.sysui.NotificationImportance old_importance = 5;
3649 // New importance setting
3650 optional android.stats.sysui.NotificationImportance importance = 6;
3651}
3652
3653
3654/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003655 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003656 *
3657 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003658 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003659 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003660message BiometricAcquired {
3661 // Biometric modality that was acquired.
3662 optional android.hardware.biometrics.ModalityEnum modality = 1;
3663 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3664 optional int32 user = 2;
3665 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3666 optional bool is_crypto = 3;
3667 // Action that the device is performing. Acquired messages are only expected for enroll and
3668 // authenticate. Other actions may indicate an error.
3669 optional android.hardware.biometrics.ActionEnum action = 4;
3670 // The client that this acquisition was received for.
3671 optional android.hardware.biometrics.ClientEnum client = 5;
3672 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3673 optional int32 acquire_info = 6;
3674 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3675 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003676 // Dictates if this message should trigger additional debugging.
3677 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003678}
3679
3680/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003681 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003682 *
3683 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003684 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003685 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003686message BiometricAuthenticated {
3687 // Biometric modality that was used.
3688 optional android.hardware.biometrics.ModalityEnum modality = 1;
3689 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3690 optional int32 user = 2;
3691 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3692 // storage.
3693 optional bool is_crypto = 3;
3694 // The client that this acquisition was received for.
3695 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003696 // If authentication requires user confirmation. See BiometricPrompt's
3697 // setRequireConfirmation(bool) method.
3698 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003699
Kevin Chyn1741a072019-01-17 11:54:40 -08003700 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003701 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003702 REJECTED = 1;
3703 PENDING_CONFIRMATION = 2;
3704 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003705 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003706
3707 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003708 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003709 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3710 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3711 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3712 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003713 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003714 // Dictates if this message should trigger additional debugging.
3715 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003716}
3717
3718/**
3719 * Logs when a biometric error occurs.
3720 *
3721 * Logged from:
3722 * frameworks/base/services/core/java/com/android/server/biometrics
3723 */
3724message BiometricErrorOccurred {
3725 // Biometric modality that was used.
3726 optional android.hardware.biometrics.ModalityEnum modality = 1;
3727 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3728 optional int32 user = 2;
3729 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3730 optional bool is_crypto = 3;
3731 // Action that the device is performing.
3732 optional android.hardware.biometrics.ActionEnum action = 4;
3733 // The client that this acquisition was received for.
3734 optional android.hardware.biometrics.ClientEnum client = 5;
3735 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3736 // are unique to modality.
3737 optional int32 error_info = 6;
3738 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3739 // by the vendor and not specified by the HIDL interface.
3740 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003741 // Dictates if this message should trigger additional debugging.
3742 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003743 // Time spent during the authentication attempt.
3744 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003745}
3746
3747/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003748 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003749 * Logged from:
3750 * frameworks/base/services/core/java/com/android/server/biometrics
3751 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003752message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003753 // Biometric modality.
3754 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003755 // Type of issue detected.
3756 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003757 // Dictates if this message should trigger additional debugging.
3758 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003759}
Howard Ro688ae182018-09-25 00:09:36 -07003760
joshmccloskey6f952b22019-03-25 20:59:35 -07003761/**
3762 * Logs when a biometric enrollment occurs.
3763 *
3764 * Logged from:
3765 * frameworks/base/services/core/java/com/android/server/biometrics
3766 */
3767message BiometricEnrolled {
3768 // Biometric modality that was used.
3769 optional android.hardware.biometrics.ModalityEnum modality = 1;
3770 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3771 optional int32 user = 2;
3772 // The amount of time the enrollment took in milliseconds.
3773 optional int64 latency_millis = 3;
3774 // Whether or not the enrollment was successful.
3775 optional bool success = 4;
3776}
3777
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003778/*
Tej Singh0d176952019-01-16 19:10:54 -08003779 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003780 */
Tej Singh0d176952019-01-16 19:10:54 -08003781message FlagFlipUpdateOccurred {
3782 // If the event is from a flag config package, specify the package name.
3783 optional string flag_flip_package_name = 1;
3784
3785 // The order id of the package
3786 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003787}
3788
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003789/**
3790 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003791 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003792 */
3793message TrainExperimentIds {
3794 repeated int64 experiment_id = 1;
3795}
3796
Yangster-macb89807e2018-11-15 21:10:57 -08003797/*
3798 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003799 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003800 */
3801message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003802 // Name of the train.
3803 optional string train_name = 1;
3804 // Version code for a "train" of packages that need to be installed atomically
3805 optional int64 train_version_code = 2;
3806 // After installation of this package, device requires a restart.
3807 optional bool requires_staging = 3;
3808 // Rollback should be enabled for this install.
3809 optional bool rollback_enabled = 4;
3810 // Requires low latency monitoring if possible.
3811 optional bool requires_low_latency_monitor = 5;
3812
Yangster-macb89807e2018-11-15 21:10:57 -08003813 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003814 UNKNOWN = 0;
3815 INSTALL_REQUESTED = 1;
3816 INSTALL_STARTED = 2;
3817 INSTALL_STAGED_NOT_READY = 3;
3818 INSTALL_STAGED_READY = 4;
3819 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003820 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3821 // and INSTALL_FAILURE_COMMIT.
3822 INSTALL_FAILURE = 6 [deprecated = true];
3823 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003824 INSTALL_CANCELLED = 7;
3825 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003826 INSTALLER_ROLLBACK_INITIATED = 9;
3827 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3828 INSTALLER_ROLLBACK_STAGED = 11;
3829 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3830 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3831 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3832 INSTALLER_ROLLBACK_SUCCESS = 15;
3833 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003834 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3835 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3836 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3837 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3838 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3839 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003840 INSTALL_FAILURE_DOWNLOAD = 23;
3841 INSTALL_FAILURE_STATE_MISMATCH = 24;
3842 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003843 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003844 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003845 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003846 // Possible experiment ids for monitoring this push.
3847 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3848 // user id
3849 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003850 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003851 // Whether or not this is a rollback event
3852 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003853}
3854
Tej Singhc9203082019-05-03 13:42:23 -07003855/* Test atom, is not logged anywhere */
3856message TestAtomReported {
3857 repeated AttributionNode attribution_node = 1;
3858 optional int32 int_field = 2;
3859 optional int64 long_field = 3;
3860 optional float float_field = 4;
3861 optional string string_field = 5;
3862 optional bool boolean_field = 6;
3863 enum State {
3864 UNKNOWN = 0;
3865 OFF = 1;
3866 ON = 2;
3867 }
3868 optional State state = 7;
3869 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3870}
3871
Maggie Whitefc1aa592018-11-28 21:55:23 -08003872/** Represents USB port overheat event. */
3873message UsbPortOverheatEvent {
3874 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3875 optional int32 plug_temperature_deci_c = 1;
3876
3877 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3878 optional int32 max_temperature_deci_c = 2;
3879
3880 /* Time between USB plug event and overheat threshold trip, in seconds. */
3881 optional int32 time_to_overheat_secs = 3;
3882
3883 /* Time between overheat threshold trip and hysteresis, in seconds. */
3884 optional int32 time_to_hysteresis_secs = 4;
3885
3886 /* Time between hysteresis and active mitigation ending, in seconds. */
3887 optional int32 time_to_inactive_secs = 5;
3888};
3889
Maggie White8735b852019-01-18 11:40:49 -08003890/**
3891 * Logs total effective full charge and discharge cycles on a battery.
3892 * Here are some examples of one effective cycle:
3893 * 1) the battery charges from 0% to 100% and drains back to 0%,
3894 * 2) charging from 50% to 100% and draining back to 50% twice.
3895 * Pulled from:
3896 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3897 */
3898message BatteryCycleCount {
3899 /* Number of total charge and discharge cycles on the system battery. */
3900 optional int32 cycle_count = 1;
3901}
3902
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003903/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003904 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3905 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003906 * Pulled from:
3907 * StatsCompanionService
3908 */
3909
Carmen Agimof12dec122019-03-06 16:14:38 +00003910message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003911
Carmen Agimof12dec122019-03-06 16:14:38 +00003912 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003913 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003914 PUBLIC = 1;
3915 PRIVATE = 2;
3916 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003917 }
3918
Carmen Agimof12dec122019-03-06 16:14:38 +00003919 // The type of external storage.
3920 optional android.stats.storage.ExternalStorageType storage_type = 1;
3921 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3922 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003923 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003924 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003925}
3926
Yangster-macb89807e2018-11-15 21:10:57 -08003927/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003928 * Logs when a connection becomes available and lost.
3929 * Logged in StatsCompanionService.java
3930 */
3931message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003932 // Id of the network.
3933 optional int32 net_id = 1;
3934
3935 enum State {
3936 UNKNOWN = 0;
3937 CONNECTED = 1;
3938 DISCONNECTED = 2;
3939 }
3940 // Connected state of a network.
3941 optional State state = 2;
3942}
3943
3944/**
3945 * Logs when a service starts and stops.
3946 * Logged from:
3947 * services/core/java/com/android/server/am/ActiveServices.java
3948 */
3949message ServiceStateChanged {
3950
3951 optional int32 uid = 1 [(is_uid) = true];
3952
3953 optional string package_name = 2;
3954
3955 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003956
3957 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003958 START = 1;
3959 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003960 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003961
3962 optional State state = 4;
3963}
3964
3965/**
3966 * Logs when a service is launched.
3967 * Logged from:
3968 * services/core/java/com/android/server/am/ActiveServices.java
3969 */
3970message ServiceLaunchReported {
3971
3972 optional int32 uid = 1 [(is_uid) = true];
3973
3974 optional string package_name = 2;
3975
3976 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003977}
Howard Ro688ae182018-09-25 00:09:36 -07003978
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003979/**
3980 * Logs when a hidden API is used.
3981 *
3982 * Logged from:
3983 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3984 */
3985message HiddenApiUsed {
3986 // The uid of the app making the hidden access.
3987 optional int32 uid = 1 [(is_uid) = true];
3988
3989 // Signature of the method or field accessed.
3990 optional string signature = 2;
3991
3992 enum AccessMethod {
3993 NONE = 0;
3994 REFLECTION = 1;
3995 JNI = 2;
3996 LINKING = 3;
3997 }
3998
3999 // Type of access.
4000 optional AccessMethod access_method = 3;
4001
4002 // Whether the access was prevented or not.
4003 optional bool access_denied = 4;
4004}
4005
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004006/**
4007 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4008 * - When user sees privacy chip
4009 * - When user clicks privacy chip
4010 * - How does the user exit the Privacy Dialog
4011 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004012 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4013 */
4014message PrivacyIndicatorsInteracted {
4015
4016 enum Type {
4017 UNKNOWN = 0;
4018 CHIP_VIEWED = 1;
4019 CHIP_CLICKED = 2;
4020 DIALOG_PRIVACY_SETTINGS = 3;
4021 DIALOG_DISMISS = 4;
4022 DIALOG_LINE_ITEM = 5;
4023 }
4024
tsaichristine5adc7e02020-01-14 17:07:39 -08004025 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004026
4027 // Used if the type is LINE_ITEM
4028 optional string package_name = 2;
4029}
4030
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004031/**
4032 * Logs information about a package that is moved from the internal to external storage and vice
4033 * versa.
4034 * It logs the package name, the type of the external storage where the package is installed
4035 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4036 * and the move type: if it's from internal to external or the other way around.
4037 *
4038 * Logged from:
4039 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4040 */
4041message AppMovedStorageReported {
4042 enum MoveType {
4043 UNKNOWN = 0;
4044 TO_EXTERNAL = 1;
4045 TO_INTERNAL = 2;
4046 }
4047 // The type of the external storage.
4048 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4049 // The type of move.
4050 optional MoveType move_type = 2;
4051 // The name of the package that was moved.
4052 optional string package_name = 3;
4053}
4054
jianjin8f2dee02019-03-29 14:03:08 -07004055/**
4056 * Logs when system server watchdog occurs.
4057 * Logged from:
4058 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4059 */
4060message SystemServerWatchdogOccurred {
4061 optional string subject = 1;
4062}
4063
4064/**
4065 * Logs when new file added to tombstones.
4066 * Logged from:
4067 * frameworks/base/core/java/com/android/server/BootReceiver.java
4068 */
4069message TombStoneOccurred {
4070}
4071
Hai Zhang5d3328d2019-04-13 21:25:06 +08004072/*
4073 * Information about a role request
4074 *
4075 * Logged from:
4076 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4077 */
4078message RoleRequestResultReported {
4079 // UID of application requesting the role
4080 optional int32 requesting_uid = 1;
4081
4082 // Package name of application requesting the role
4083 optional string requesting_package_name = 2;
4084
4085 // The role to be granted
4086 optional string role_name = 3;
4087
4088 // The count of applications qualifying for the role
4089 optional int32 qualifying_count = 4;
4090
4091 // UID of application current granted the role
4092 optional int32 current_uid = 5;
4093
4094 // Package name of application current granted the role
4095 optional string current_package_name = 6;
4096
4097 // UID of another application that user chose to grant the role to, instead of the requesting
4098 // application
4099 optional int32 granted_another_uid = 7;
4100
4101 // Package name of another application that user chose to grant the role to, instead of the
4102 // requesting application
4103 optional string granted_another_package_name = 8;
4104
4105 enum Result {
4106 UNDEFINED = 0;
4107 // role request was ignored
4108 IGNORED = 1;
4109 // role request was ignored because it's already granted
4110 IGNORED_ALREADY_GRANTED = 2;
4111 // role request was ignored because the application isn't qualified
4112 IGNORED_NOT_QUALIFIED = 3;
4113 // role request was ignored because user said it should be always denied
4114 IGNORED_USER_ALWAYS_DENIED = 4;
4115 // role was granted by user action
4116 USER_GRANTED = 5;
4117 // role was denied by user action
4118 USER_DENIED = 6;
4119 // role was denied by user granting another application the role
4120 USER_DENIED_GRANTED_ANOTHER = 7;
4121 // role was denied and set to be always denied by the user
4122 USER_DENIED_WITH_ALWAYS = 8;
4123 }
4124 // The result of the role request
4125 optional Result result = 9;
4126}
4127
Mark Tabrya824a642019-11-05 12:26:12 -08004128/**
4129 * Logs when a Vehicle Maps Service client's connection state has changed
4130 *
4131 * Logged from:
4132 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4133 */
4134message VmsClientConnectionStateChanged {
4135 // The UID of the VMS client app
4136 optional int32 uid = 1 [(is_uid) = true];
4137
4138 enum State {
4139 UNKNOWN = 0;
4140 // Attempting to connect to the client
4141 CONNECTING = 1;
4142 // Client connection established
4143 CONNECTED = 2;
4144 // Client connection closed unexpectedly
4145 DISCONNECTED = 3;
4146 // Client connection closed by VMS
4147 TERMINATED = 4;
4148 // Error establishing the client connection
4149 CONNECTION_ERROR = 5;
4150 }
4151
4152 optional State state = 2;
4153}
4154
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004155/**
4156 * Logs when MediaProvider has successfully finished scanning a storage volume.
4157 *
4158 * Logged from:
4159 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4160 */
4161message MediaProviderScanEvent {
4162 enum Reason {
4163 // Scan triggered due to unknown reason
4164 UNKNOWN = 0;
4165 // Scan triggered due to storage volume being mounted
4166 MOUNTED = 1;
4167 // Scan triggered due to explicit user action or app request
4168 DEMAND = 2;
4169 // Scan triggered due to idle maintenance
4170 IDLE = 3;
4171 }
4172
4173 // Volume type that this event pertains to
4174 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4175 // Reason why this scan was triggered
4176 optional Reason reason = 2;
4177 // Total number of files scanned
4178 optional int64 item_count = 3;
4179 // Duration of scan, normalized per file
4180 optional float normalized_duration_millis = 4;
4181 // Number of database inserts, normalized per file
4182 optional float normalized_insert_count = 5;
4183 // Number of database updates, normalized per file
4184 optional float normalized_update_count = 6;
4185 // Number of database deletes, normalized per file
4186 optional float normalized_delete_count = 7;
4187}
4188
4189/**
4190 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4191 *
4192 * Logged from:
4193 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4194 */
4195message MediaProviderDeletionEvent {
4196 // Volume type that this event pertains to
4197 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4198 // Device timestamp when this deletion event occurred
4199 optional int64 timestamp_millis = 2;
4200 // App that requested deletion
4201 optional string package_name = 3;
4202 // Number of items that were deleted
4203 optional int32 item_count = 4;
4204}
4205
4206/**
4207 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4208 *
4209 * Logged from:
4210 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4211 */
4212message MediaProviderPermissionEvent {
4213 enum Result {
4214 UNKNOWN = 0;
4215 USER_GRANTED = 1;
4216 AUTO_GRANTED = 2;
4217 USER_DENIED = 3;
4218 USER_DENIED_WITH_PREJUDICE = 4;
4219 AUTO_DENIED = 5;
4220 }
4221
4222 // Volume type that this event pertains to
4223 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4224 // Device timestamp when this permission event occurred
4225 optional int64 timestamp_millis = 2;
4226 // App that requested permission
4227 optional string package_name = 3;
4228 // Number of items that were requested
4229 optional int32 item_count = 4;
4230 // Result of this request
4231 optional Result result = 5;
4232}
4233
4234/**
4235 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4236 *
4237 * Logged from:
4238 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4239 */
4240message MediaProviderSchemaChange {
4241 // Volume type that this event pertains to
4242 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4243 // Old database version code
4244 optional int32 version_from = 2;
4245 // New database version code
4246 optional int32 version_to = 3;
4247 // Total number of files in database
4248 optional int64 item_count = 4;
4249 // Duration of schema change, normalized per file
4250 optional float normalized_duration_millis = 5;
4251}
4252
4253/**
4254 * Logs when MediaProvider has finished an idle maintenance job.
4255 *
4256 * Logged from:
4257 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4258 */
4259message MediaProviderIdleMaintenance {
4260 // Volume type that this event pertains to
4261 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4262
4263 // Total number of files in database
4264 optional int64 item_count = 2;
4265 // Duration of idle maintenance, normalized per file
4266 optional float normalized_duration_millis = 3;
4267 // Number of thumbnails found to be stale, normalized per file
4268 optional float normalized_stale_thumbnails = 4;
4269 // Number of items found to be expired, normalized per file
4270 optional float normalized_expired_media = 5;
4271}
4272
Keun young Park3e033cb2019-12-18 11:27:35 -08004273/**
4274 * Represents boot time event with duration in ms.
4275 *
4276 * Logged from: bootstat and various system server components. Check each enums for details.
4277 */
4278message BootTimeEventDuration {
4279 enum DurationEvent {
4280 UNKNOWN = 0;
4281 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4282 ABSOLUTE_BOOT_TIME = 1;
4283 // Bootloader's 1st stage execution time.
4284 // Logged from bootstat.
4285 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4286 // Bootloader's 1st stage loading time.
4287 // Logged from bootstat.
4288 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4289 // Bootloader's kernel loading time.
4290 // Logged from bootstat.
4291 BOOTLOADER_KERNEL_LOAD = 4;
4292 // Bootloader's 2nd stage execution time.
4293 // Logged from bootstat.
4294 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4295 // Bootloader's 2nd stage loading time.
4296 // Logged from bootstat.
4297 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4298 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4299 // for locked device.
4300 // Logged from bootstat.
4301 BOOTLOADER_UI_WAIT = 7;
4302 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4303 // Logged from bootstat.
4304 BOOTLOADER_TOTAL = 8;
4305 // Shutdown duration inside init for the reboot before the current boot up.
4306 // Logged from f/b/services/.../BootReceiver.java.
4307 SHUTDOWN_DURATION = 9;
4308 // Total time for mounting of disk devices during bootup.
4309 // Logged from f/b/services/.../BootReceiver.java.
4310 MOUNT_DEFAULT_DURATION = 10;
4311 // Total time for early stage mounting of disk devices during bootup.
4312 // Logged from f/b/services/.../BootReceiver.java.
4313 MOUNT_EARLY_DURATION = 11;
4314 // Total time for late stage mounting of disk devices during bootup.
4315 // Logged from f/b/services/.../BootReceiver.java.
4316 MOUNT_LATE_DURATION = 12;
4317 // Average time to scan non-system app after OTA
4318 // Logged from f/b/services/.../PackageManagerService.java
4319 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4320 // Time to initialize Package manager after OTA
4321 // Logged from f/b/services/.../PackageManagerService.java
4322 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4323 // Time to scan all system app from Package manager after OTA
4324 // Logged from f/b/services/.../PackageManagerService.java
4325 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4326 // Init's total time for cold boot stage.
4327 // Logged from bootstat.
4328 COLDBOOT_WAIT = 16;
4329 // Init's total time for initializing selinux.
4330 // Logged from bootstat.
4331 SELINUX_INIT = 17;
4332 // Time since last factory reset.
4333 // Logged from bootstat.
4334 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004335 // Init's total time spent for completing the 1st stage.
4336 // Logged from bootstat.
4337 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004338 }
4339
4340 // Type of the event.
4341 optional DurationEvent event = 1;
4342 // Duration of the event in ms.
4343 optional int64 duration_millis = 2;
4344}
4345
4346/**
4347 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4348 * since boot-up.
4349 *
4350 * Logged from: bootstat and various system server components. Check each enums for details.
4351 */
4352message BootTimeEventElapsedTime {
4353 enum ElapsedTimeEvent {
4354 UNKNOWN = 0;
4355 // Time when init starts 1st stage. Logged from bootstat.
4356 ANDROID_INIT_STAGE_1 = 1;
4357 // Time when sys.boot_completed prop is set.
4358 // Logged from bootstat.
4359 BOOT_COMPLETE = 2;
4360 // BOOT_COMPLETE for encrypted device.
4361 BOOT_COMPLETE_ENCRYPTION = 3;
4362 // BOOT_COMPLETE for device with no encryption.
4363 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4364 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004365 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004366 // BOOT_COMPLETE after factory reset.
4367 FACTORY_RESET_BOOT_COMPLETE = 6;
4368 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4369 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004370 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4371 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004372 // BOOT_COMPLETE after OTA.
4373 OTA_BOOT_COMPLETE = 9;
4374 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4375 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004376 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4377 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004378 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4379 // Logged from f/b/services/.../UserController.java
4380 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4381 // Time when the system starts sending BOOT_COMPLETED broadcast.
4382 // Logged from f/b/services/.../UserController.java
4383 FRAMEWORK_BOOT_COMPLETED = 13;
4384 // Time when the package manager starts init.
4385 // Logged from f/b/services/.../SystemServer.java
4386 PACKAGE_MANAGER_INIT_START = 14;
4387 // Time when package manager is ready
4388 // Logged from f/b/services/.../SystemServer.java
4389 PACKAGE_MANAGER_INIT_READY = 15;
4390 // Represents the time when user has entered unlock credential for system with user pin.
4391 // Logged from bootstat.
4392 POST_DECRYPT = 16;
4393 // Represents the start of zygote's init.
4394 // Logged from zygote itself.
4395 ZYGOTE_INIT_START = 17;
4396 // Represents the start of secondary zygote's init.
4397 // TODO: add logging to zygote
4398 SECONDARY_ZYGOTE_INIT_START = 18;
4399 // Represents the start of system server's init.
4400 // Logged from f/b/services/.../SystemServer.java
4401 SYSTEM_SERVER_INIT_START = 19;
4402 // Represents the completion of system server's init.
4403 // Logged from f/b/services/.../SystemServer.java
4404 SYSTEM_SERVER_READY = 20;
4405 // Represents the start of launcher during boot-up.
4406 // TODO: add logging
4407 LAUNCHER_START = 21;
4408 // Represents the completion of launcher's initial rendering. User can use other apps from
4409 // launcher from this point.
4410 // TODO: add logging
4411 LAUNCHER_SHOWN = 22;
4412 }
4413
4414 // Type of the event.
4415 optional ElapsedTimeEvent event = 1;
4416 // Time since bootup for the event.
4417 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4418 optional int64 time_millis = 2;
4419}
4420
4421/**
4422 * Boot time events with UTC time.
4423 *
4424 * Logged from: bootstat and various system server components. Check each enums for details.
4425 */
4426message BootTimeEventUtcTime {
4427 enum UtcTimeEvent {
4428 UNKNOWN = 0;
4429 // Time of the bootstat's marking of 1st boot after the last factory reset.
4430 // Logged from bootstat.
4431 FACTORY_RESET_RESET_TIME = 1;
4432 // The time when bootstat records FACTORY_RESET_* events. This is close to
4433 // BOOT_COMPLETE time for the current bootup.
4434 // Logged from bootstat.
4435 FACTORY_RESET_CURRENT_TIME = 2;
4436 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4437 // Logged from bootstat.
4438 FACTORY_RESET_RECORD_VALUE = 3;
4439 }
4440
4441 // Type of the event.
4442 optional UtcTimeEvent event = 1;
4443 // UTC time for the event.
4444 optional int64 utc_time_secs = 2;
4445}
4446
4447/**
4448 * Boot time events representing specific error code during bootup.
4449 * Meaning of error code can be different per each event type.
4450 *
4451 * Logged from: bootstat and various system server components. Check each enums for details.
4452 */
4453message BootTimeEventErrorCode {
4454 enum ErrorCodeEvent {
4455 UNKNOWN = 0;
4456 // Linux error code for time() call to get the current UTC time.
4457 // Logged from bootstat.
4458 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4459 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4460 // as UMOUNT_STAT_* from init/reboot.cpp.
4461 // Logged from f/b/services/.../BootReceiver.java.
4462 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004463 // Reprepsents fie system mounting error code of /data partition for the current boot.
4464 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004465 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004466 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004467 }
4468
4469 // Type of the event.
4470 optional ErrorCodeEvent event = 1;
4471 // error code defined per each event type.
4472 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4473 // FS_MGR_FS_STAT.
4474 optional int32 error_code = 2;
4475}
4476
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004477/**
4478 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4479 * after an OTA.
4480 *
4481 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004482 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004483 */
4484message SnapshotMergeReported {
4485 // Keep in sync with
4486 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4487 enum UpdateState {
4488 // No update or merge is in progress.
4489 NONE = 0;
4490 // An update is applying; snapshots may already exist.
4491 INITIATED = 1;
4492 // An update is pending, but has not been successfully booted yet.
4493 UNVERIFIED = 2;
4494 // The kernel is merging in the background.
4495 MERGING = 3;
4496 // Post-merge cleanup steps could not be completed due to a transient
4497 // error, but the next reboot will finish any pending operations.
4498 MERGE_NEEDS_REBOOT = 4;
4499 // Merging is complete, and needs to be acknowledged.
4500 MERGE_COMPLETED = 5;
4501 // Merging failed due to an unrecoverable error.
4502 MERGE_FAILED = 6;
4503 // The update was implicitly cancelled, either by a rollback or a flash
4504 // operation via fastboot. This state can only be returned by WaitForMerge.
4505 CANCELLED = 7;
4506 };
4507
4508 // Status of the update after the merge attempts.
4509 optional UpdateState final_state = 1;
4510
4511 // Time to complete a merge operation in milliseconds.
4512 // A negative value corresponds to the case in which the merge operation
4513 // was interrupted and resumed (e.g. in case of a system reboot during the
4514 // merge).
4515 optional int64 duration_millis = 2;
4516
4517 // Number of reboots that occurred after issuing and before completing the
4518 // merge of all the snapshot devices.
4519 optional int32 intermediate_reboots = 3;
4520}
4521
Chenjie Yubbcbc602018-02-05 16:51:52 -08004522//////////////////////////////////////////////////////////////////////
4523// Pulled atoms below this line //
4524//////////////////////////////////////////////////////////////////////
4525
4526/**
David Chenc8a43242017-10-17 16:23:28 -07004527 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4528 *
4529 * Pulled from:
4530 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4531 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004532message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004533 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004534
4535 optional int64 rx_bytes = 2;
4536
4537 optional int64 rx_packets = 3;
4538
4539 optional int64 tx_bytes = 4;
4540
4541 optional int64 tx_packets = 5;
4542}
4543
4544/**
4545 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4546 *
4547 * Pulled from:
4548 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4549 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004550message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004551 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004552
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004553 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4554 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004555
4556 optional int64 rx_bytes = 3;
4557
4558 optional int64 rx_packets = 4;
4559
4560 optional int64 tx_bytes = 5;
4561
4562 optional int64 tx_packets = 6;
4563}
4564
4565/**
4566 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4567 *
4568 * Pulled from:
4569 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4570 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004571message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004572 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004573
4574 optional int64 rx_bytes = 2;
4575
4576 optional int64 rx_packets = 3;
4577
4578 optional int64 tx_bytes = 4;
4579
4580 optional int64 tx_packets = 5;
4581}
4582
4583/**
4584 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4585 *
4586 * Pulled from:
4587 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4588 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004589message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004590 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004591
Yao Chenc40a19d2018-03-15 16:48:25 -07004592 // 1 denotes foreground and 0 denotes background. This is called Set in
4593 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004594 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004595
4596 optional int64 rx_bytes = 3;
4597
4598 optional int64 rx_packets = 4;
4599
4600 optional int64 tx_bytes = 5;
4601
4602 optional int64 tx_packets = 6;
4603}
4604
4605/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004606 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4607 *
4608 * Pulled from:
4609 * StatsCompanionService
4610 */
4611message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004612 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004613
4614 optional int64 rx_bytes = 2;
4615
4616 optional int64 tx_bytes = 3;
4617}
4618
4619/**
David Chenc8a43242017-10-17 16:23:28 -07004620 * Pulls the kernel wakelock durations. This atom is adapted from
4621 * android/internal/os/KernelWakelockStats.java
4622 *
4623 * Pulled from:
4624 * StatsCompanionService using KernelWakelockReader.
4625 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004626message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004627 optional string name = 1;
4628
4629 optional int32 count = 2;
4630
4631 optional int32 version = 3;
4632
Yangster-maca8a30442018-10-13 23:46:34 -07004633 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004634}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004635
Chenjie Yu05013b32017-11-21 10:21:41 -08004636/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004637 * Pulls low power state information. If power.stats HAL is not available, this
4638 * includes platform and subsystem sleep state information,
4639 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4640 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004641 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004642 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004643 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4644 * as defined in:
4645 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004646 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004647message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004648 // Subsystem name
4649 optional string subsystem_name = 1;
4650 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4651 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004652 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4653 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004654 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004655 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004656 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004657 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004658 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004659}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004660
Chenjie Yu05013b32017-11-21 10:21:41 -08004661/**
Bookatz92da2832018-11-01 18:10:03 -07004662 * Pulls on-device power measurement information.
4663 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4664 * Pulled from:
4665 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4666 */
4667message OnDevicePowerMeasurement {
4668 // Name of the subsystem (to which the rail belongs).
4669 optional string subsystem_name = 1;
4670
4671 // Rail name. The rail lies within the subsystem.
4672 optional string rail_name = 2;
4673
4674 // Time (in ms since boot) at which the rail energy value was measured.
4675 // This may differ slightly from the time that statsd logs this information.
4676 optional uint64 measurement_timestamp_millis = 3;
4677
4678 // Accumulated energy used via the rail since device boot in uWs.
4679 optional uint64 energy_microwatt_secs = 4;
4680}
4681
4682/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004683 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004684 * Pulls the time the cpu spend on the frequency index. Frequency index
4685 * starts from highest to lowest. The value should be monotonically
4686 * increasing since boot. However, if there is a cpu
4687 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004689message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004690 optional uint32 cluster = 1;
4691 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004692 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004693}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004694
Chenjie Yu05013b32017-11-21 10:21:41 -08004695/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004696 * Pulls Cpu Time Per Uid.
4697 * Note that isolated process uid time should be attributed to host uids.
4698 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004699message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004700 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004701 optional uint64 user_time_micros = 2;
4702 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004703}
4704
4705/**
4706 * Pulls Cpu Time Per Uid per frequency.
4707 * Note that isolated process uid time should be attributed to host uids.
4708 * For each uid, we order the time by descending frequencies.
4709 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004710message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004711 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004712 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004713 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004714}
Hugo Benichi884970e2017-11-14 22:42:46 +09004715
Chenjie Yu05013b32017-11-21 10:21:41 -08004716/**
4717 * Pulls Wifi Controller Activity Energy Info
4718 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004719message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004720 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004721 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004722 // stack reported state
4723 // TODO: replace this with proto enum
4724 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004725 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004726 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004727 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004728 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004729 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004730 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004731 // product of current(mA), voltage(V) and time(ms)
4732 optional uint64 controller_energy_used = 6;
4733}
4734
4735/**
4736 * Pulls Modem Activity Energy Info
4737 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004738message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004739 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004740 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004741 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004742 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004743 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004744 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004745 /**
4746 * Tx power index
4747 * index 0 = tx_power < 0dBm
4748 * index 1 = 0dBm < tx_power < 5dBm
4749 * index 2 = 5dBm < tx_power < 15dBm
4750 * index 3 = 15dBm < tx_power < 20dBm
4751 * index 4 = tx_power > 20dBm
4752 */
4753 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004754 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004755 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004758 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004759 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004760 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004761 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004762 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004763 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004764 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004765 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004766 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004767}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004768
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004769/**
4770 * Pulls Bluetooth Activity Energy Info
4771 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4772 */
4773message BluetoothActivityInfo {
4774 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004776 // bluetooth stack state
4777 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004778 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004779 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004780 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004781 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004782 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004783 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004784 // product of current(mA), voltage(V) and time(ms)
4785 optional uint64 energy_used = 6;
4786}
4787
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004788/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004789 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004790 *
4791 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004792 */
4793message ProcessMemoryState {
4794 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004795 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004796
4797 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004798 // Usually package name, "system" for system server.
4799 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004800 optional string process_name = 2;
4801
Rafal Slawikda51b932018-12-13 16:31:33 +00004802 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004803 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004804
4805 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004806 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004807
4808 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004809 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004810
Rajeev Kumar90235992018-01-29 11:06:48 -08004811 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004812 // Value is read from memory.stat, field total_rss if per-app memory
4813 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004814 optional int64 rss_in_bytes = 6;
4815
4816 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004817 // Value is read from memory.stat, field total_cache if per-app memory
4818 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004819 optional int64 cache_in_bytes = 7;
4820
4821 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004822 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004823 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004824 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004825
Rafal Slawik203c3db2019-09-25 19:53:01 +01004826 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004827 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004828
Rafal Slawik203c3db2019-09-25 19:53:01 +01004829 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4830 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004831
Rafal Slawik203c3db2019-09-25 19:53:01 +01004832 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4833 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004834}
4835
4836/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004837 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004838 *
4839 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4840 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004841 *
4842 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004843 */
4844message ProcessMemoryHighWaterMark {
4845 // The uid if available. -1 means not available.
4846 optional int32 uid = 1 [(is_uid) = true];
4847
Rafal Slawikda51b932018-12-13 16:31:33 +00004848 // The process name.
4849 // Usually package name or process cmdline.
4850 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004851 optional string process_name = 2;
4852
Rafal Slawik239b6802019-09-09 18:46:01 +01004853 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4854 // computed by converting kilobytes to bytes.
4855 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4856
Rafal Slawik3bea8952018-11-15 12:39:33 +00004857 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4858 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004859 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004860}
4861
4862/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004863 * Logs the memory stats for a process.
4864 *
4865 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4866 * and for selected native processes.
4867 */
4868message ProcessMemorySnapshot {
4869 // The uid if available. -1 means not available.
4870 optional int32 uid = 1 [(is_uid) = true];
4871
4872 // The process name.
4873 // Usually package name or process cmdline.
4874 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4875 optional string process_name = 2;
4876
4877 // The pid of the process.
4878 // Allows to disambiguate instances of the process.
4879 optional int32 pid = 3;
4880
4881 // The current OOM score adjustment value.
4882 // Read from ProcessRecord for managed processes.
4883 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4884 optional int32 oom_score_adj = 4;
4885
4886 // The current RSS of the process.
4887 // VmRSS from /proc/pid/status.
4888 optional int32 rss_in_kilobytes = 5;
4889
4890 // The current anon RSS of the process.
4891 // RssAnon from /proc/pid/status.
4892 optional int32 anon_rss_in_kilobytes = 6;
4893
4894 // The current swap size of the process.
4895 // VmSwap from /proc/pid/status.
4896 optional int32 swap_in_kilobytes = 7;
4897
4898 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4899 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4900}
4901
4902/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004903 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004904 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004905message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004906 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004907}
4908
4909/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004910 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004911 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004912message SystemUptime {
4913 // Milliseconds since the system was booted.
4914 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4915 // for external input).
4916 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004917 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004918}
4919
4920/*
4921 * Reads from /proc/uid_concurrent_active_time which has the format:
4922 * active: X (X is # cores)
4923 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4924 * [uid1]: [time-0] [time-1] [time-2] ... ...
4925 * ...
4926 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4927 * The file contains a monotonically increasing count of time for a single boot.
4928 */
4929message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004930 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004931 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004932}
4933
4934/**
4935 * Reads from /proc/uid_concurrent_policy_time which has the format:
4936 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4937 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4938 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4939 * ...
4940 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4941 * The file contains a monotonically increasing count of time for a single boot.
4942 */
4943message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004944 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004945 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004946 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004947}
4948
4949/*
4950 * Pulls free disk space, for data, system partition and temporary directory.
4951 */
4952message DiskSpace {
4953 // available bytes in data partition
4954 optional uint64 data_available_bytes = 1;
4955 // available bytes in system partition
4956 optional uint64 system_available_bytes = 2;
4957 // available bytes in download cache or temp directories
4958 optional uint64 temp_available_bytes = 3;
4959}
Tej Singhbf972d92018-01-10 20:51:13 -08004960
4961/**
4962 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004963 *
4964 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004965 */
4966message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004967 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004968}
4969
4970/**
4971 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004972 * Pulled from:
4973 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004974 */
4975message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004976 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004977}
4978
4979/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004980 * Pulls battery voltage.
4981 * Pulled from:
4982 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4983 */
4984message BatteryVoltage {
4985 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004986 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004987}
4988
4989/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004990 * Pulls battery level (percent full, from 0 to 100).
4991 *
4992 * Pulled from:
4993 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4994 */
4995message BatteryLevel {
4996 // Battery level. Should be in [0, 100].
4997 optional int32 battery_level = 1;
4998}
4999
5000/**
Tej Singhd89137e2018-03-26 14:51:40 -07005001 * Pulls the temperature of various parts of the device.
5002 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005003 *
Maggie White442b6312019-04-05 16:26:44 -07005004 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005005 */
5006message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005007 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005008 optional android.os.TemperatureTypeEnum sensor_location = 1;
5009
5010 // The name of the temperature source. Eg. CPU0
5011 optional string sensor_name = 2;
5012
Tej Singhd89137e2018-03-26 14:51:40 -07005013 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005014 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005015 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005016
5017 // Relative severity of the throttling, see enum definition.
5018 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005019}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005020
5021/**
5022 * Pulls the statistics of calls to Binder.
5023 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005024 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5025 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005026 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005027 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005028 */
5029message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005030 // UID of the process responsible for the binder transaction. It will be set if the process
5031 // executing the binder transaction attribute the transaction to another uid using
5032 // Binder.setThreadWorkSource().
5033 //
5034 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005035 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005036 // UID of the process executing the binder transaction.
5037 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005038 // Fully qualified class name of the API call.
5039 //
5040 // This is a system server class name.
5041 //
5042 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5043 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5044 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5045 // commonly used APIs.
5046 optional string service_class_name = 2;
5047 // Method name of the API call. It can also be a transaction code if we cannot
5048 // resolve it to a name. See Binder#getTransactionName.
5049 //
5050 // This is a system server method name.
5051 optional string service_method_name = 3;
5052 // Total number of API calls.
5053 optional int64 call_count = 4;
5054 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5055 optional bool screen_interactive = 13;
5056 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5057 // call_count will be equal to recorded_call_count.
5058 //
5059 // If recorded_call_count is different than call_count, it means data collection has been
5060 // sampled. All the fields below will be sampled in this case.
5061 optional int64 recorded_call_count = 12;
5062 // Number of exceptions thrown by the API.
5063 optional int64 recorded_exception_count = 5;
5064 // Total latency of all API calls.
5065 // Average can be computed using total_latency_micros / recorded_call_count.
5066 optional int64 recorded_total_latency_micros = 6;
5067 // Maximum latency of one API call.
5068 optional int64 recorded_max_latency_micros = 7;
5069 // Total CPU usage of all API calls.
5070 // Average can be computed using total_cpu_micros / recorded_call_count.
5071 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5072 optional int64 recorded_total_cpu_micros = 8;
5073 // Maximum CPU usage of one API call.
5074 optional int64 recorded_max_cpu_micros = 9;
5075 // Maximum parcel reply size of one API call.
5076 optional int64 recorded_max_reply_size_bytes = 10;
5077 // Maximum parcel request size of one API call.
5078 optional int64 recorded_max_request_size_bytes = 11;
5079}
5080
5081/**
5082 * Pulls the statistics of exceptions during calls to Binder.
5083 *
5084 * Binder stats are cumulative from boot unless somebody reset the data using
5085 * > adb shell dumpsys binder_calls_stats --reset
5086 */
5087message BinderCallsExceptions {
5088 // Exception class name, e.g. java.lang.IllegalArgumentException.
5089 //
5090 // This is an exception class name thrown by the system server.
5091 optional string exception_class_name = 1;
5092 // Total number of exceptions.
5093 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005094}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005095
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005096/**
5097 * Pulls the statistics of message dispatching on HandlerThreads.
5098 *
5099 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5100 * config on the device.
5101 *
5102 * Next tag: 11
5103 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005104message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005105 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005106 optional int32 uid = 1 [(is_uid) = true];
5107
5108 // Fully qualified class name of the handler target class.
5109 //
5110 // This field does not contain PII. This is a system server class name.
5111 optional string handler_class_name = 2;
5112
5113 // The name of the thread that runs the Looper.
5114 //
5115 // This field does not contain PII. This is a system server thread name.
5116 optional string looper_thread_name = 3;
5117
5118 // The name of the dispatched message.
5119 //
5120 // This field does not contain PII. This is a system server constant or class
5121 // name.
5122 optional string message_name = 4;
5123
5124 // Total number of successfully dispatched messages.
5125 optional int64 message_count = 5;
5126
5127 // Total number of messages that failed dispatching.
5128 optional int64 exception_count = 6;
5129
5130 // Total number of processed messages we have data recorded for. If we
5131 // collected data for all the messages, message_count will be equal to
5132 // recorded_message_count.
5133 //
5134 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005135 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005136 optional int64 recorded_message_count = 7;
5137
5138 // Total latency of all processed messages.
5139 // Average can be computed using recorded_total_latency_micros /
5140 // recorded_message_count.
5141 optional int64 recorded_total_latency_micros = 8;
5142
5143 // Total CPU usage of all processed message.
5144 // Average can be computed using recorded_total_cpu_micros /
5145 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005146 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005147 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005148
5149 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5150 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005151
5152 // Max recorded CPU usage of all processed messages.
5153 optional int64 recorded_max_cpu_micros = 11;
5154
5155 // Max recorded latency of all processed messages.
5156 optional int64 recorded_max_latency_micros = 12;
5157
5158 // Total number of messages we tracked the dispatching delay for. If we
5159 // collected data for all the messages, message_count will be equal to
5160 // recorded_delay_message_count.
5161 //
5162 // If recorded_delay_message_count is different than message_count, it means data
5163 // collection has been sampled or/and not all messages specified the target dispatch time.
5164 // The fields below will be sampled in this case.
5165 optional int64 recorded_delay_message_count = 13;
5166
5167 // Total dispatching delay of all processed messages.
5168 // Calculated as a difference between the target dispatching time (Message.when)
5169 // and the actual dispatching time.
5170 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5171 optional int64 recorded_total_delay_millis = 14;
5172
5173 // Max dispatching delay of all processed messages.
5174 // Calculated as a difference between the target dispatching time (Message.when)
5175 // and the actual dispatching time.
5176 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005177}
Tej Singh86dc9db2018-09-06 00:39:57 +00005178
5179/**
5180 * Pulls disk information, such as write speed and latency.
5181 */
5182message DiskStats {
5183 // Time taken to open, write 512B to, and close a file.
5184 // -1 if error performing the check.
5185 optional int64 data_write_latency_millis = 1;
5186
5187 optional bool file_based_encryption = 2;
5188
5189 // Recent disk write speed in kB/s.
5190 // -1 if error querying storageed.
5191 // 0 if data is unavailable.
5192 optional int32 recent_disk_write_speed = 3;
5193}
5194
5195
5196/**
5197 * Free and total bytes of the Data, Cache, and System partition.
5198 */
5199message DirectoryUsage {
5200 enum Directory {
5201 UNKNOWN = 0;
5202 DATA = 1;
5203 CACHE = 2;
5204 SYSTEM = 3;
5205 }
5206 optional Directory directory = 1;
5207 optional int64 free_bytes = 2;
5208 optional int64 total_bytes = 3;
5209}
5210
5211
5212/**
5213 * Size of an application: apk size, data size, and cache size.
5214 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5215 * Information is only reported for apps with the primary user (user 0).
5216 * Sizes are aggregated by package name.
5217 */
5218message AppSize {
5219 // Including uids will involve modifying diskstats logic.
5220 optional string package_name = 1;
5221 // App size in bytes. -1 if unavailable.
5222 optional int64 app_size_bytes = 2;
5223 // App data size in bytes. -1 if unavailable.
5224 optional int64 app_data_size_bytes = 3;
5225 // App cache size in bytes. -1 if unavailable.
5226 optional int64 app_cache_size_bytes = 4;
5227 // Time that the cache file was produced.
5228 // Uses System.currentTimeMillis(), which is wall clock time.
5229 optional int64 cache_time_millis = 5;
5230}
5231
5232
5233/**
5234 * Size of a particular category. Eg: photos, videos.
5235 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5236 */
5237message CategorySize {
5238 enum Category {
5239 UNKNOWN = 0;
5240 APP_SIZE = 1;
5241 APP_DATA_SIZE = 2;
5242 APP_CACHE_SIZE = 3;
5243 PHOTOS = 4;
5244 VIDEOS = 5;
5245 AUDIO = 6;
5246 DOWNLOADS = 7;
5247 SYSTEM = 8;
5248 OTHER = 9;
5249 }
5250 optional Category category = 1;
5251 // Category size in bytes.
5252 optional int64 size_bytes = 2;
5253 // Time that the cache file was produced.
5254 // Uses System.currentTimeMillis(), which is wall clock time.
5255 optional int64 cache_time_millis = 3;
5256}
Tej Singhd6d6d772018-09-05 17:41:25 -07005257
5258/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005259 * Pulls per uid I/O stats. The stats are cumulative since boot.
5260 *
5261 * Read/write bytes are I/O events from a storage device
5262 * Read/write chars are data requested by read/write syscalls, and can be
5263 * satisfied by caching.
5264 *
5265 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5266 */
5267message DiskIo {
5268 optional int32 uid = 1 [(is_uid) = true];
5269 optional int64 fg_chars_read = 2;
5270 optional int64 fg_chars_write = 3;
5271 optional int64 fg_bytes_read = 4;
5272 optional int64 fg_bytes_write = 5;
5273 optional int64 bg_chars_read = 6;
5274 optional int64 bg_chars_write = 7;
5275 optional int64 bg_bytes_read = 8;
5276 optional int64 bg_bytes_write = 9;
5277 optional int64 fg_fsync = 10;
5278 optional int64 bg_fsync= 11;
5279}
5280
5281
5282/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005283 * Pulls the number of fingerprints for each user.
5284 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005285 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005286 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005287message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005288 // The associated user. Eg: 0 for owners, 10+ for others.
5289 // Defined in android/os/UserHandle.java
5290 optional int32 user = 1;
5291 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005292 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005293}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005294
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005295/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005296 * Pulls the number of faces for each user.
5297 *
5298 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5299 */
5300message NumFacesEnrolled {
5301 // The associated user. Eg: 0 for owners, 10+ for others.
5302 // Defined in android/os/UserHandle.java
5303 optional int32 user = 1;
5304 // Number of faces registered to that user.
5305 optional int32 num_faces_enrolled = 2;
5306}
5307/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005308 * A mapping of role holder -> role
5309 */
5310message RoleHolder {
5311 // uid of the role holder
5312 optional int32 uid = 1 [(is_uid) = true];
5313
5314 // package name of the role holder
5315 optional string package_name = 2;
5316
5317 // the role held
5318 optional string role = 3;
5319}
5320
Yangsteraf9aee72018-10-12 09:26:16 -07005321message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005322 // These are all in byte resolution.
5323 optional int64 min = 1 [deprecated = true];
5324 optional int64 average = 2 [deprecated = true];
5325 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005326
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005327 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5328 // int64 fields.
5329 optional int32 mean_kb = 4;
5330 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005331}
5332
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005333// A reduced subset of process states; reducing the number of possible states allows more
5334// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5335enum ProcessStateAggregated {
5336 PROCESS_STATE_UNKNOWN = 0;
5337 // Persistent system process.
5338 PROCESS_STATE_PERSISTENT = 1;
5339 // Top activity; actually any visible activity.
5340 PROCESS_STATE_TOP = 2;
5341 // Process binding to top or a foreground service.
5342 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5343 // Processing running a foreground service.
5344 PROCESS_STATE_FGS = 4;
5345 // Important foreground process (ime, wallpaper, etc).
5346 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5347 // Important background process.
5348 PROCESS_STATE_BACKGROUND = 6;
5349 // Process running a receiver.
5350 PROCESS_STATE_RECEIVER = 7;
5351 // All kinds of cached processes.
5352 PROCESS_STATE_CACHED = 8;
5353}
5354
5355// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005356message ProcessStatsStateProto {
5357 optional android.service.procstats.ScreenState screen_state = 1;
5358
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005359 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005360
5361 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5362 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005363 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5364
5365 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005366
5367 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005368 optional int64 duration_millis = 4 [deprecated = true];
5369 // Same as above, but with minute resolution so it fits into an int32.
5370 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005371
5372 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005373 optional int64 realtime_duration_millis = 9 [deprecated = true];
5374 // Same as above, but with minute resolution so it fits into an int32.
5375 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005376
5377 // # of samples taken
5378 optional int32 sample_size = 5;
5379
5380 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005381 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005382
5383 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005384 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005385
5386 // RSS is memory resident for this process
5387 optional AggStats rss = 8;
5388}
5389
5390// Next Tag: 7
5391message ProcessStatsProto {
5392 // Name of process.
5393 optional string process = 1;
5394
5395 // Uid of the process.
5396 optional int32 uid = 2;
5397
5398 // Information about how often kills occurred
5399 message Kill {
5400 // Count of excessive CPU kills
5401 optional int32 cpu = 1;
5402
5403 // Count of kills when cached
5404 optional int32 cached = 2;
5405
5406 // PSS stats during cached kill
5407 optional AggStats cached_pss = 3;
5408 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005409 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005410
5411 // Time and memory spent in various states.
5412 repeated ProcessStatsStateProto states = 5;
5413
5414 // Total time process has been running... screen_state, memory_state, and process_state
5415 // will not be set.
5416 optional ProcessStatsStateProto total_running_state = 6;
5417}
5418
5419message PackageServiceOperationStatsProto {
5420 // Operate enum: Started, Foreground, Bound, Executing
5421 optional android.service.procstats.ServiceOperationState operation = 1;
5422
5423 // Number of times the service was in this operation.
5424 optional int32 count = 2;
5425
5426 // Information about a state the service can be in.
5427 message StateStats {
5428 // Screen state enum.
5429 optional android.service.procstats.ScreenState screen_state = 1;
5430 // Memory state enum.
5431 optional android.service.procstats.MemoryState memory_state = 2;
5432
5433 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005434 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005435 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005436 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005437 }
5438 repeated StateStats state_stats = 3;
5439}
5440
5441message PackageServiceStatsProto {
5442 // Name of service component.
5443 optional string service_name = 1;
5444
5445 // The operation stats.
5446 // The package_name, package_uid, package_version, service_name will not be set to save space.
5447 repeated PackageServiceOperationStatsProto operation_stats = 2;
5448}
5449
5450message PackageAssociationSourceProcessStatsProto {
5451 // Uid of the process.
5452 optional int32 process_uid = 1;
5453 // Process name.
5454 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005455 // Package name.
5456 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005457 // Total count of the times this association appeared.
5458 optional int32 total_count = 3;
5459
5460 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005461 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005462
5463 // Total count of the times this association became actively impacting its target process.
5464 optional int32 active_count = 5;
5465
5466 // Information on one source in this association.
5467 message StateStats {
5468 // Process state enum.
5469 optional android.service.procstats.ProcessState process_state = 1;
5470 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005471 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005472 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005473 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005474 }
5475 repeated StateStats active_state_stats = 6;
5476}
5477
5478message PackageAssociationProcessStatsProto {
5479 // Name of the target component.
5480 optional string component_name = 1;
5481 // Information on one source in this association.
5482 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5483}
5484
5485
5486message ProcessStatsPackageProto {
5487 // Name of package.
5488 optional string package = 1;
5489
5490 // Uid of the package.
5491 optional int32 uid = 2;
5492
5493 // Version of the package.
5494 optional int64 version = 3;
5495
5496 // Stats for each process running with the package loaded in to it.
5497 repeated ProcessStatsProto process_stats = 4;
5498
5499 // Stats for each of the package's services.
5500 repeated PackageServiceStatsProto service_stats = 5;
5501
5502 // Stats for each association with the package.
5503 repeated PackageAssociationProcessStatsProto association_stats = 6;
5504}
5505
5506message ProcessStatsSectionProto {
5507 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005508 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005509
5510 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005511 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005512
5513 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005514 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005515
5516 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005517 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005518
5519 // System runtime library. e.g. "libdvm.so", "libart.so".
5520 optional string runtime = 5;
5521
5522 // whether kernel reports swapped pss.
5523 optional bool has_swapped_pss = 6;
5524
5525 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5526 enum Status {
5527 STATUS_UNKNOWN = 0;
5528 STATUS_COMPLETE = 1;
5529 STATUS_PARTIAL = 2;
5530 STATUS_SHUTDOWN = 3;
5531 STATUS_SYSPROPS = 4;
5532 }
5533 repeated Status status = 7;
5534
Chenjie Yub2ecc792019-01-17 10:27:26 -08005535 // Number of pages available of various types and sizes, representation fragmentation.
5536 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5537
Yangsteraf9aee72018-10-12 09:26:16 -07005538 // Stats for each process.
5539 repeated ProcessStatsProto process_stats = 8;
5540
5541 // Stats for each package.
5542 repeated ProcessStatsPackageProto package_stats = 9;
5543}
5544
Chenjie Yub2ecc792019-01-17 10:27:26 -08005545message ProcessStatsAvailablePagesProto {
5546 // Node these pages are in (as per /proc/pagetypeinfo)
5547 optional int32 node = 1;
5548
5549 // Zone these pages are in (as per /proc/pagetypeinfo)
5550 optional string zone = 2;
5551
5552 // Label for the type of these pages (as per /proc/pagetypeinfo)
5553 optional string label = 3;
5554
5555 // Distribution of number of pages available by order size. First entry in array is
5556 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5557 repeated int32 pages_per_order = 4;
5558}
5559
Chenjie Yu12e5e672018-09-14 15:54:59 -07005560/**
5561 * Pulled from ProcessStatsService.java
5562 */
5563message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005564 optional ProcessStatsSectionProto proc_stats_section = 1;
5565}
5566
Chenjie Yuf910b7802019-01-11 16:08:20 -08005567/**
5568 * Pulled from ProcessStatsService.java
5569 */
5570message ProcStatsPkgProc {
5571 optional ProcessStatsSectionProto proc_stats_section = 1;
5572}
5573
Chris Wrencdea3b72019-11-22 16:58:17 -05005574// Next Tag: 2
5575message PackageRemoteViewInfoProto {
5576 optional string package_name = 1;
5577 // add per-package additional info here (like channels)
5578}
5579
5580// Next Tag: 2
5581message NotificationRemoteViewsProto {
5582 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5583}
5584
5585/**
5586 * Pulled from NotificationManagerService.java
5587 */
5588message NotificationRemoteViews {
5589 optional NotificationRemoteViewsProto notification_remote_views = 1;
5590}
5591
Yotam Aron74299972020-01-16 16:20:58 +02005592/**
5593 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5594 */
5595message PackageNotificationPreferences {
5596 // Uid under which the package is installed.
5597 optional int32 uid = 1;
5598 // Notification importance, which specifies when and how a notification is displayed.
5599 // Specified under core/java/android/app/NotificationManager.java.
5600 optional int32 importance = 2;
5601 // Lockscreen visibility as set by the user.
5602 optional int32 visibility = 3;
5603 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5604 // PreferencesHelper.java)
5605 optional int32 user_locked_fields = 4;
5606}
5607
5608/**
5609 * Atom that contains a list of a package's channel preferences, pulled from
5610 * NotificationManagerService.java.
5611 */
5612message PackageNotificationChannelPreferences {
5613 // Uid under which the package is installed.
5614 optional int32 uid = 1;
5615 // Channel's ID. Should always be available.
5616 optional string channel_id = 2;
5617 // Channel's name. Should always be available.
5618 optional string channel_name = 3;
5619 // Channel's description. Optionally set by the channel creator.
5620 optional string description = 4;
5621 // Notification importance, which specifies when and how a notification is displayed. Specified
5622 // under core/java/android/app/NotificationManager.java.
5623 optional int32 importance = 5;
5624 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5625 // at core/java/android/app/NotificationChannel.java
5626 optional int32 user_locked_fields = 6;
5627 // Indicates if the channel was deleted by the app.
5628 optional bool is_deleted = 7;
5629}
5630
5631/**
5632 * Atom that contains a list of a package's channel group preferences, pulled from
5633 * NotificationManagerService.java.
5634 */
5635message PackageNotificationChannelGroupPreferences {
5636 // Uid under which the package is installed.
5637 optional int32 uid = 1;
5638 // Channel Group's ID. Should always be available.
5639 optional string group_id = 2;
5640 // Channel Group's name. Should always be available.
5641 optional string group_name = 3;
5642 // Channel Group's description. Optionally set by group creator.
5643 optional string description = 4;
5644 // Indicates if notifications from this channel group are blocked.
5645 optional bool is_blocked = 5;
5646 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5647 // at core/java/android/app/NotificationChannelGroup.java
5648 optional int32 user_locked_fields = 6;
5649}
5650
Yangsteraf9aee72018-10-12 09:26:16 -07005651message PowerProfileProto {
5652 optional double cpu_suspend = 1;
5653
5654 optional double cpu_idle = 2;
5655
5656 optional double cpu_active = 3;
5657
5658 message CpuCluster {
5659 optional int32 id = 1;
5660 optional double cluster_power = 2;
5661 optional int32 cores = 3;
5662 repeated int64 speed = 4;
5663 repeated double core_power = 5;
5664 }
5665
5666 repeated CpuCluster cpu_cluster = 40;
5667
5668 optional double wifi_scan = 4;
5669
5670 optional double wifi_on = 5;
5671
5672 optional double wifi_active = 6;
5673
5674 optional double wifi_controller_idle = 7;
5675
5676 optional double wifi_controller_rx = 8;
5677
5678 optional double wifi_controller_tx = 9;
5679
5680 repeated double wifi_controller_tx_levels = 10;
5681
5682 optional double wifi_controller_operating_voltage = 11;
5683
5684 optional double bluetooth_controller_idle = 12;
5685
5686 optional double bluetooth_controller_rx = 13;
5687
5688 optional double bluetooth_controller_tx = 14;
5689
5690 optional double bluetooth_controller_operating_voltage = 15;
5691
5692 optional double modem_controller_sleep = 16;
5693
5694 optional double modem_controller_idle = 17;
5695
5696 optional double modem_controller_rx = 18;
5697
5698 repeated double modem_controller_tx = 19;
5699
5700 optional double modem_controller_operating_voltage = 20;
5701
5702 optional double gps_on = 21;
5703
5704 repeated double gps_signal_quality_based = 22;
5705
5706 optional double gps_operating_voltage = 23;
5707
5708 optional double bluetooth_on = 24;
5709
5710 optional double bluetooth_active = 25;
5711
5712 optional double bluetooth_at_cmd = 26;
5713
5714 optional double ambient_display = 27;
5715
5716 optional double screen_on = 28;
5717
5718 optional double radio_on = 29;
5719
5720 optional double radio_scanning = 30;
5721
5722 optional double radio_active = 31;
5723
5724 optional double screen_full = 32;
5725
5726 optional double audio = 33;
5727
5728 optional double video = 34;
5729
5730 optional double flashlight = 35;
5731
5732 optional double memory = 36;
5733
5734 optional double camera = 37;
5735
5736 optional double wifi_batched_scan = 38;
5737
5738 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005739}
Chenjie Yuab530202018-09-26 12:39:20 -07005740
5741/**
5742 * power_profile.xml and other constants for power model calculations.
5743 * Pulled from PowerProfile.java
5744 */
5745message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005746 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005747}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005748
5749/**
arangelovd5db50e2018-10-12 20:24:39 +01005750 * Logs when a user restriction was added or removed.
5751 *
5752 * Logged from:
5753 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5754 */
5755message UserRestrictionChanged {
5756 // The raw string of the user restriction as defined in UserManager.
5757 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5758 optional string restriction = 1;
5759 // Whether the restriction is enabled or disabled.
5760 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005761}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005762
5763/**
5764 * Pulls process user time and system time. Puller takes a snapshot of all pids
5765 * in the system and returns cpu stats for those that are working at the time.
5766 * Dead pids will be dropped. Kernel processes are excluded.
5767 * Min cool-down is 5 sec.
5768 */
5769message ProcessCpuTime {
5770 optional int32 uid = 1 [(is_uid) = true];
5771
5772 optional string process_name = 2;
5773 // Process cpu time in user space, cumulative from boot/process start
5774 optional int64 user_time_millis = 3;
5775 // Process cpu time in system space, cumulative from boot/process start
5776 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005777}
Misha Wagner5a51e002018-10-03 15:04:09 +01005778
5779/**
5780 * Pulls the CPU usage for each thread.
5781 *
5782 * Read from /proc/$PID/task/$TID/time_in_state files.
5783 *
5784 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5785 * time_in_state files not being present on some phones, have not been addressed. These should be
5786 * considered before a public release.
5787 */
5788message CpuTimePerThreadFreq {
5789 // UID that owns the process.
5790 optional int32 uid = 1 [(is_uid) = true];
5791 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005792 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005793 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005794 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005795 // Name of the process taken from `/proc/$PID/cmdline`.
5796 optional string process_name = 4;
5797 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5798 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005799
5800 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5801 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5802 // frequencies are given here as the alternative is sending eight separate atoms. This method
5803 // significantly reduces the amount of data created
5804 optional int32 frequency1_khz = 6;
5805 optional int32 time1_millis = 7;
5806 optional int32 frequency2_khz = 8;
5807 optional int32 time2_millis = 9;
5808 optional int32 frequency3_khz = 10;
5809 optional int32 time3_millis = 11;
5810 optional int32 frequency4_khz = 12;
5811 optional int32 time4_millis = 13;
5812 optional int32 frequency5_khz = 14;
5813 optional int32 time5_millis = 15;
5814 optional int32 frequency6_khz = 16;
5815 optional int32 time6_millis = 17;
5816 optional int32 frequency7_khz = 18;
5817 optional int32 time7_millis = 19;
5818 optional int32 frequency8_khz = 20;
5819 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005820}
Bookatz75ee60422018-11-09 12:27:37 -08005821
5822/**
Bookatz366a4432018-11-20 09:42:33 -08005823 * Pulls information about the device's build.
5824 */
5825message BuildInformation {
5826 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5827 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5828 optional string fingerprint = 1;
5829
5830 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5831 optional string brand = 2;
5832
5833 // Build.PRODUCT. The name of the overall product.
5834 optional string product = 3;
5835
5836 // Build.DEVICE. The name of the industrial design.
5837 optional string device = 4;
5838
5839 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5840 optional string version_release = 5;
5841
5842 // Build.ID. E.g. a label like "M4-rc20".
5843 optional string id = 6;
5844
5845 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5846 // represent this build.
5847 optional string version_incremental = 7;
5848
5849 // Build.TYPE. The type of build, like "user" or "eng".
5850 optional string type = 8;
5851
5852 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5853 optional string tags = 9;
5854}
5855
5856/**
Adam He420947c2019-01-23 15:59:09 -08005857 * Logs information about mismatched caller for content capture.
5858 *
5859 * Logged from:
5860 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5861 */
5862message ContentCaptureCallerMismatchReported {
5863 optional string intended_package = 1;
5864 optional string calling_package = 2;
5865}
5866
5867/**
5868 * Logs information about content capture service events.
5869 *
5870 * Logged from:
5871 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5872 */
5873message ContentCaptureServiceEvents {
5874 // The type of event.
5875 enum Event {
5876 UNKNOWN = 0;
5877 ON_CONNECTED = 1;
5878 ON_DISCONNECTED = 2;
5879 SET_WHITELIST = 3;
5880 SET_DISABLED = 4;
5881 ON_USER_DATA_REMOVED = 5;
5882 }
5883 optional Event event = 1;
5884 // component/package of content capture service.
5885 optional string service_info = 2;
5886 // component/package of target.
5887 // it's a concatenated list of component/package for SET_WHITELIST event
5888 // separated by " ".
5889 optional string target_info = 3;
5890}
5891
5892/**
5893 * Logs information about content capture session events.
5894 *
5895 * Logged from:
5896 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5897 */
5898message ContentCaptureSessionEvents {
5899 // The type of event.
5900 enum Event {
5901 UNKNOWN = 0;
5902 ON_SESSION_STARTED = 1;
5903 ON_SESSION_FINISHED = 2;
5904 SESSION_NOT_CREATED = 3;
5905 }
5906 optional int32 session_id = 1;
5907 optional Event event = 2;
5908 // (n/a on session finished)
5909 optional int32 state_flags = 3;
5910 // component/package of content capture service.
5911 optional string service_info = 4;
5912 // component/package of app.
5913 // (n/a on session finished)
5914 optional string app_info = 5;
5915 optional bool is_child_session = 6;
5916}
5917
5918/**
5919 * Logs information about session being flushed.
5920 *
5921 * Logged from:
5922 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5923 */
5924message ContentCaptureFlushed {
5925 optional int32 session_id = 1;
5926 // component/package of content capture service.
5927 optional string service_info = 2;
5928 // component/package of app.
5929 optional string app_info = 3;
5930 // session start/finish events
5931 optional int32 child_session_started = 4;
5932 optional int32 child_session_finished = 5;
5933 // count of view events.
5934 optional int32 view_appeared_count = 6;
5935 optional int32 view_disappeared_count = 7;
5936 optional int32 view_text_changed_count = 8;
5937
5938 // Flush stats.
5939 optional int32 max_events = 9;
5940 optional int32 idle_flush_freq = 10;
5941 optional int32 text_flush_freq = 11;
5942 optional int32 flush_reason = 12;
5943}
5944
5945/**
Bookatz75ee60422018-11-09 12:27:37 -08005946 * Pulls on-device BatteryStats power use calculations for the overall device.
5947 */
5948message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005949 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5950 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5951 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5952 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005953}
5954
5955/**
5956 * Pulls on-device BatteryStats power use calculations broken down by uid.
5957 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5958 * that is attributed to non-uid items. They must all be included to get the total power use.
5959 */
5960message DeviceCalculatedPowerBlameUid {
5961 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5962 optional int32 uid = 1 [(is_uid) = true];
5963
Bookatz3dbc13a2018-12-21 12:16:51 -08005964 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5965 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5966 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005967}
5968
5969/**
5970 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5971 * drain type.
5972 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5973 * is attributed uids. They must all be included to get the total power use.
5974 */
5975message DeviceCalculatedPowerBlameOther {
5976 // The type of item whose power use is being reported.
5977 enum DrainType {
5978 AMBIENT_DISPLAY = 0;
5979 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5980 BLUETOOTH = 2;
5981 CAMERA = 3;
5982 // Cell-standby
5983 CELL = 4;
5984 FLASHLIGHT = 5;
5985 IDLE = 6;
5986 MEMORY = 7;
5987 // Amount that total computed drain exceeded the drain estimated using the
5988 // battery level changes and capacity.
5989 OVERCOUNTED = 8;
5990 PHONE = 9;
5991 SCREEN = 10;
5992 // Amount that total computed drain was below the drain estimated using the
5993 // battery level changes and capacity.
5994 UNACCOUNTED = 11;
5995 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5996 WIFI = 13;
5997 }
5998 optional DrainType drain_type = 1;
5999
Bookatz3dbc13a2018-12-21 12:16:51 -08006000 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6001 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6002 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006003}
arangelov4e994062018-11-13 16:12:38 +00006004
6005/**
6006 * Logs device policy features.
6007 *
6008 * Logged from:
6009 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6010 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6011 */
6012message DevicePolicyEvent {
6013 // The event id - unique for each event.
6014 optional android.stats.devicepolicy.EventId event_id = 1;
6015 // The admin package name.
6016 optional string admin_package_name = 2;
6017 // A generic integer parameter.
6018 optional int32 integer_value = 3;
6019 // A generic boolean parameter.
6020 optional bool boolean_value = 4;
6021 // A parameter specifying a time period in milliseconds.
6022 optional uint64 time_period_millis = 5;
6023 // A parameter specifying a list of package names, bundle extras or string parameters.
6024 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6025}
shawnlinea5b66b2018-11-13 15:05:29 +08006026
6027/**
6028 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6029 *
6030 * Logged from:
6031 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6032 */
6033message DocsUILaunchReported {
6034 optional android.stats.docsui.LaunchAction launch_action = 1;
6035 optional bool has_initial_uri = 2;
6036 optional android.stats.docsui.MimeType mime_type = 3;
6037 optional android.stats.docsui.Root initial_root = 4;
6038}
6039
6040/**
6041 * Logs root/app visited event in file managers/picker. Call this when the user
6042 * taps on root/app in hamburger menu.
6043 *
6044 * Logged from:
6045 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6046 */
6047message DocsUIRootVisitedReported {
6048 optional android.stats.docsui.ContextScope scope = 1;
6049 optional android.stats.docsui.Root root = 2;
6050}
6051
6052/**
6053 * Logs file operation stats. Call this when a file operation has completed.
6054 *
6055 * Logged from:
6056 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6057 */
6058message DocsUIFileOperationReported {
6059 optional android.stats.docsui.Provider provider = 1;
6060 optional android.stats.docsui.FileOperation file_op = 2;
6061}
6062
6063/**
6064 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6065 * mode.
6066 *
6067 * Logged from:
6068 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6069 */
6070message DocsUIFileOperationCopyMoveModeReported {
6071 optional android.stats.docsui.FileOperation file_op = 1;
6072 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6073}
6074
6075
6076/**
6077 * Logs file sub operation stats. Call this when a file operation has failed.
6078 *
6079 * Logged from:
6080 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6081 */
6082message DocsUIFileOperationFailureReported {
6083 optional android.stats.docsui.Authority authority = 1;
6084 optional android.stats.docsui.SubFileOperation sub_op = 2;
6085}
6086
6087/**
6088* Logs the cancellation of a file operation. Call this when a job is canceled
6089*
6090* Logged from:
6091* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6092*/
6093message DocsUIFileOperationCanceledReported {
6094 optional android.stats.docsui.FileOperation file_op = 1;
6095}
6096
6097/**
6098 * Logs startup time in milliseconds.
6099 *
6100 * Logged from:
6101 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6102 */
6103message DocsUIStartupMsReported {
6104 optional int32 startup_millis = 1;
6105}
6106
6107/**
6108 * Logs the action that was started by user.
6109 *
6110 * Logged from:
6111 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6112 */
6113message DocsUIUserActionReported {
6114 optional android.stats.docsui.UserAction action = 1;
6115}
6116
6117/**
6118 * Logs the invalid type when invalid scoped access is requested.
6119 *
6120 * Logged from:
6121 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6122 */
6123message DocsUIInvalidScopedAccessRequestReported {
6124 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006125}
Ben Murdochbab399f62018-12-06 11:01:38 +00006126
6127/**
shawnlina75e82d2019-01-07 10:31:12 +08006128 * Logs the package name that launches docsui picker mode.
6129 *
6130 * Logged from:
6131 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6132 */
6133message DocsUIPickerLaunchedFromReported {
6134 optional string package_name = 1;
6135}
6136
6137/**
6138 * Logs the search type.
6139 *
6140 * Logged from:
6141 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6142 */
6143message DocsUISearchTypeReported {
6144 optional android.stats.docsui.SearchType search_type = 1;
6145}
6146
6147/**
6148 * Logs the search mode.
6149 *
6150 * Logged from:
6151 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6152 */
6153message DocsUISearchModeReported {
6154 optional android.stats.docsui.SearchMode search_mode = 1;
6155}
6156
6157/**
6158 * Logs the pick result information.
6159 *
6160 * Logged from:
6161 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6162 */
6163message DocsUIPickResultReported {
6164 optional int32 total_action_count = 1;
6165 optional int64 duration_millis = 2;
6166 optional int32 file_count= 3;
6167 optional bool is_searching = 4;
6168 optional android.stats.docsui.Root picked_from = 5;
6169 optional android.stats.docsui.MimeType mime_type = 6;
6170 optional int32 repeatedly_pick_times = 7;
6171}
6172
6173/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006174 * Logs when an app's memory is compacted.
6175 *
6176 * Logged from:
6177 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6178 */
6179message AppCompacted {
6180 // The pid of the process being compacted.
6181 optional int32 pid = 1;
6182
6183 // The name of the process being compacted.
6184 optional string process_name = 2;
6185
6186 // The type of compaction.
6187 enum Action {
6188 UNKNOWN = 0;
6189 SOME = 1;
6190 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006191 PERSISTENT = 3;
6192 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006193 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006194 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006195
6196 // Total RSS in kilobytes consumed by the process prior to compaction.
6197 optional int64 before_rss_total_kilobytes = 4;
6198
6199 // File RSS in kilobytes consumed by the process prior to compaction.
6200 optional int64 before_rss_file_kilobytes = 5;
6201
6202 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6203 optional int64 before_rss_anon_kilobytes = 6;
6204
6205 // Swap in kilobytes consumed by the process prior to compaction.
6206 optional int64 before_swap_kilobytes = 7;
6207
6208 // Total RSS in kilobytes consumed by the process after compaction.
6209 optional int64 after_rss_total_kilobytes = 8;
6210
6211 // File RSS in kilobytes consumed by the process after compaction.
6212 optional int64 after_rss_file_kilobytes = 9;
6213
6214 // Anonymous RSS in kilobytes consumed by the process after compaction.
6215 optional int64 after_rss_anon_kilobytes = 10;
6216
6217 // Swap in kilobytes consumed by the process after compaction.
6218 optional int64 after_swap_kilobytes = 11;
6219
6220 // The time taken to perform compaction in milliseconds.
6221 optional int64 time_to_compact_millis = 12;
6222
6223 // The last compaction action performed for this app.
6224 optional Action last_action = 13;
6225
Ben Murdoch01720b82018-12-19 18:03:44 +00006226 // The last time that compaction was attempted on this process in milliseconds
6227 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6228 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006229
Ben Murdoch885c21b2019-03-15 18:02:04 +00006230 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006231 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006232
6233 // The process state at the time of compaction.
6234 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006235
6236 // Free ZRAM in kilobytes before compaction.
6237 optional int64 before_zram_free_kilobytes = 17;
6238
6239 // Free ZRAM in kilobytes after compaction.
6240 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006241}
lifr157fc552018-12-12 16:38:04 +08006242
6243/**
lifrb6b90b62019-03-29 00:40:17 +08006244 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6245 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6246 *
lifr1f74b052019-04-16 22:16:30 +08006247 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6248 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6249 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6250 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006251 */
6252message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006253 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006254
lifr1f74b052019-04-16 22:16:30 +08006255 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006256
6257 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006258 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006259
lifr1f74b052019-04-16 22:16:30 +08006260 // Only valid for event_type = EVENT_GETADDRINFO.
6261 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006262
lifr1f74b052019-04-16 22:16:30 +08006263 // Flags passed to android_res_nsend() defined in multinetwork.h
6264 // Only valid for event_type = EVENT_RESNSEND.
6265 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006266
lifrad9becc2019-05-20 11:04:41 +08006267 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006268
6269 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006270 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006271
6272 // Additional pass-through fields opaque to statsd.
6273 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006274 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006275
6276 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6277 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006278}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006279
6280/**
6281 * Logs when a data stall event occurs.
6282 *
6283 * Log from:
6284 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6285 */
6286message DataStallEvent {
6287 // Data stall evaluation type.
6288 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6289 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6290 optional int32 evaluation_type = 1;
6291 // See definition in data_stall_event.proto.
6292 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6293 // See definition in data_stall_event.proto.
6294 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6295 // See definition in data_stall_event.proto.
6296 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6297 // See definition in data_stall_event.proto.
6298 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6299 // See definition in data_stall_event.proto.
6300 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6301}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006302
6303/*
6304 * Logs when RescueParty resets some set of experiment flags.
6305 *
6306 * Logged from:
6307 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6308 */
6309message RescuePartyResetReported {
6310 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6311 optional int32 rescue_level = 1;
6312}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006313
6314/**
6315 * Logs when signed config is received from an APK, and if that config was applied successfully.
6316 * Logged from:
6317 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6318 */
6319message SignedConfigReported {
6320 enum Type {
6321 UNKNOWN_TYPE = 0;
6322 GLOBAL_SETTINGS = 1;
6323 }
6324 optional Type type = 1;
6325
6326 // The final status of the signed config received.
6327 enum Status {
6328 UNKNOWN_STATUS = 0;
6329 APPLIED = 1;
6330 BASE64_FAILURE_CONFIG = 2;
6331 BASE64_FAILURE_SIGNATURE = 3;
6332 SECURITY_EXCEPTION = 4;
6333 INVALID_CONFIG = 5;
6334 OLD_CONFIG = 6;
6335 SIGNATURE_CHECK_FAILED = 7;
6336 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006337 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006338 }
6339 optional Status status = 2;
6340
6341 // The version of the signed config processed.
6342 optional int32 version = 3;
6343
6344 // The package name that the config was extracted from.
6345 optional string from_package = 4;
6346
6347 enum Key {
6348 NO_KEY = 0;
6349 DEBUG = 1;
6350 PRODUCTION = 2;
6351 }
6352 // Which key was used to verify the config.
6353 optional Key verified_with = 5;
6354}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006355
6356/*
6357 * Logs GNSS Network-Initiated (NI) location events.
6358 *
6359 * Logged from:
6360 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6361 */
6362message GnssNiEventReported {
6363 // The type of GnssNiEvent.
6364 enum EventType {
6365 UNKNOWN = 0;
6366 NI_REQUEST = 1;
6367 NI_RESPONSE = 2;
6368 }
6369 optional EventType event_type = 1;
6370
6371 // An ID generated by HAL to associate NI notifications and UI responses.
6372 optional int32 notification_id = 2;
6373
6374 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006375 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006376
6377 // NI requires notification.
6378 optional bool need_notify = 4;
6379
6380 // NI requires verification.
6381 optional bool need_verify = 5;
6382
6383 // NI requires privacy override, no notification/minimal trace.
6384 optional bool privacy_override = 6;
6385
6386 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6387 // seconds.
6388 optional int32 timeout = 7;
6389
6390 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006391 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006392
6393 // String representing the requester of the network inititated location request.
6394 optional string requestor_id = 9;
6395
6396 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6397 // network initiated location request.
6398 optional string text = 10;
6399
6400 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006401 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006402
6403 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006404 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006405
6406 // True if SUPL ES is enabled.
6407 optional bool is_supl_es_enabled = 13;
6408
6409 // True if GNSS location is enabled.
6410 optional bool is_location_enabled = 14;
6411
6412 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006413 optional android.server.location.GnssUserResponseType user_response = 15;
6414}
6415
6416/**
6417 * Logs GNSS non-framework (NFW) location notification.
6418 *
6419 * Logged from:
6420 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6421 */
6422message GnssNfwNotificationReported {
6423 // Package name of the Android proxy application representing the non-framework entity that
6424 // requested location. Set to empty string if unknown.
6425 optional string proxy_app_package_name = 1;
6426
6427 // Protocol stack that initiated the non-framework location request.
6428 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6429
6430 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6431 // set to empty string. This field is opaque to the framework and used for logging purposes.
6432 optional string other_protocol_stack_name = 3;
6433
6434 // Source initiating/receiving the location information.
6435 optional android.server.location.NfwRequestor requestor = 4;
6436
6437 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6438 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6439 // and used for logging purposes.
6440 optional string requestor_id = 5;
6441
6442 // Indicates whether location information was provided for this request.
6443 optional android.server.location.NfwResponseType response_type = 6;
6444
6445 // True if the device is in user initiated emergency session.
6446 optional bool in_emergency_mode = 7;
6447
6448 // True if cached location is provided.
6449 optional bool is_cached_location = 8;
6450
6451 // True if proxy app permission mismatch between framework and GNSS HAL.
6452 optional bool is_permission_mismatched = 9;
6453}
6454
6455/**
6456 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6457 *
6458 * Logged from:
6459 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6460 */
6461message GnssConfigurationReported {
6462 // SUPL host name.
6463 optional string supl_host = 1;
6464
6465 // SUPL port number.
6466 optional int32 supl_port = 2;
6467
6468 // C2K host name.
6469 optional string c2k_host = 3;
6470
6471 // C2K port number.
6472 optional int32 c2k_port = 4;
6473
6474 // The SUPL version requested by Carrier.
6475 optional int32 supl_ver = 5;
6476
6477 // The SUPL mode.
6478 optional android.server.location.SuplMode supl_mode = 6;
6479
6480 // True if NI emergency SUPL restrictions is enabled.
6481 optional bool supl_es = 7;
6482
6483 // LTE Positioning Profile settings
6484 optional android.server.location.LppProfile lpp_profile = 8;
6485
6486 // Positioning protocol on A-Glonass system.
6487 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6488
6489 // True if emergency PDN is used. Otherwise, regular PDN is used.
6490 optional bool use_emergency_pdn_for_emergency_supl= 10;
6491
6492 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6493 optional android.server.location.GpsLock gps_lock = 11;
6494
6495 // Number of seconds to extend the emergency session duration post emergency call.
6496 optional int32 es_extension_sec = 12;
6497
6498 // The full list of package names of proxy Android applications representing the non-framework
6499 // location access entities (on/off the device) for which the framework user has granted
6500 // non-framework location access permission. The package names are concatenated in one string
6501 // with spaces as separators.
6502 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006503}
Jack Yu95b64f32018-12-13 18:26:11 +08006504
6505/**
6506 * Logs when a NFC device's error occurred.
6507 * Logged from:
6508 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6509 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6510 */
6511message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006512 enum Type {
6513 UNKNOWN = 0;
6514 CMD_TIMEOUT = 1;
6515 ERROR_NOTIFICATION = 2;
6516 AID_OVERFLOW = 3;
6517 }
6518 optional Type type = 1;
6519 // If it's nci cmd timeout, log the timeout command.
6520 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006521
Alex Salod7c3eef2019-01-25 14:43:27 -08006522 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006523}
6524
6525/**
6526 * Logs when a NFC device's state changed event
6527 * Logged from:
6528 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6529 */
6530message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006531 enum State {
6532 UNKNOWN = 0;
6533 OFF = 1;
6534 ON = 2;
6535 ON_LOCKED = 3; // Secure Nfc enabled.
6536 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6537 }
6538 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006539}
6540
6541/**
6542 * Logs when a NFC Beam Transaction occurred.
6543 * Logged from:
6544 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6545 */
6546message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006547 enum Operation {
6548 UNKNOWN = 0;
6549 SEND = 1;
6550 RECEIVE = 2;
6551 }
6552 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006553}
6554
6555/**
6556 * Logs when a NFC Card Emulation Transaction occurred.
6557 * Logged from:
6558 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6559 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6560 */
6561message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006562 enum Category {
6563 UNKNOWN = 0;
6564 HCE_PAYMENT = 1;
6565 HCE_OTHER = 2;
6566 OFFHOST = 3;
6567 }
6568 // Transaction belongs to HCE payment or HCE other category, or offhost.
6569 optional Category category = 1;
6570 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6571 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006572}
6573
6574/**
6575 * Logs when a NFC Tag event occurred.
6576 * Logged from:
6577 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6578 */
6579message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006580 enum Type {
6581 UNKNOWN = 0;
6582 URL = 1;
6583 BT_PAIRING = 2;
6584 PROVISION = 3;
6585 WIFI_CONNECT = 4;
6586 APP_LAUNCH = 5;
6587 OTHERS = 6;
6588 }
6589 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006590}
6591
6592/**
6593 * Logs when Hce transaction triggered
6594 * Logged from:
6595 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6596 */
6597message NfcHceTransactionOccurred {
6598 // The latency period(in microseconds) it took for the first HCE data
6599 // exchange.
6600 optional uint32 latency_micros = 1;
6601}
6602
6603/**
6604 * Logs when SecureElement state event changed
6605 * Logged from:
6606 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6607 */
6608message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006609 enum State {
6610 UNKNOWN = 0;
6611 INITIALIZED = 1;
6612 DISCONNECTED = 2;
6613 CONNECTED = 3;
6614 HALCRASH = 4;
6615 }
6616 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006617
Alex Salod7c3eef2019-01-25 14:43:27 -08006618 optional string state_change_reason = 2;
6619 // SIMx or eSEx.
6620 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006621}
6622
6623/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006624 * Information about a permission grant request
6625 */
6626message PermissionGrantRequestResultReported {
6627 // unique value identifying an API call. A API call might result in multiple of these atoms
6628 optional int64 request_id = 1;
6629
6630 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006631 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006632
6633 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006634 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006635
6636 // The permission to be granted
6637 optional string permission_name = 4;
6638
6639 // If the permission was explicitly requested via the API or added by the system
6640 optional bool is_implicit = 5;
6641
6642 enum Result {
6643 UNDEFINED = 0;
6644 // permission request was ignored
6645 IGNORED = 1;
6646 // permission request was ignored because it was user fixed
6647 IGNORED_USER_FIXED = 2;
6648 // permission request was ignored because it was policy fixed
6649 IGNORED_POLICY_FIXED = 3;
6650 // permission was granted by user action
6651 USER_GRANTED = 4;
6652 // permission was automatically granted
6653 AUTO_GRANTED = 5;
6654 // permission was denied by user action
6655 USER_DENIED = 6;
6656 // permission was denied with prejudice by the user
6657 USER_DENIED_WITH_PREJUDICE = 7;
6658 // permission was automatically denied
6659 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006660 // permission request was ignored because permission is restricted
6661 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006662 // one time permission was granted by user action
6663 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006664 // user ignored request by leaving the request screen without choosing any option
6665 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006666 // user granted the permission after being linked to settings
6667 USER_GRANTED_IN_SETTINGS = 12;
6668 // user denied the permission after being linked to settings
6669 USER_DENIED_IN_SETTINGS = 13;
6670 // user denied the permission with prejudice after being linked to settings
6671 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6672 // permission was automatically revoked after one-time permission expired
6673 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006674 // permission was automatically revoked for unused app
6675 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006676 }
6677 // The result of the permission grant
6678 optional Result result = 6;
6679}
6680
6681/**
Jack Yu95b64f32018-12-13 18:26:11 +08006682 * Logs when Omapi API used
6683 * Logged from:
6684 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6685 */
6686message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006687 enum Operation {
6688 UNKNOWN = 0;
6689 OPEN_CHANNEL = 1;
6690 }
6691 optional Operation operation = 1;
6692 // SIMx or eSEx.
6693 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006694
Alex Salod7c3eef2019-01-25 14:43:27 -08006695 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006696}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006697
6698/**
Alex Saloa060aee2019-01-21 14:36:41 -08006699 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6700 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006701 * Logged from:
6702 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6703 */
6704message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006705 optional int64 dispatch_latency_millis = 1;
6706}
6707
6708/**
6709 * Logs AttentionManagerService attention check result.
6710 *
6711 * Logged from:
6712 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6713 */
6714message AttentionManagerServiceResultReported {
6715 // See core/java/android/service/attention/AttentionService.java
6716 enum AttentionCheckResult {
6717 UNKNOWN = 20;
6718 ATTENTION_SUCCESS_ABSENT = 0;
6719 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006720 ATTENTION_FAILURE_UNKNOWN = 2;
6721 ATTENTION_FAILURE_CANCELLED = 3;
6722 ATTENTION_FAILURE_PREEMPTED = 4;
6723 ATTENTION_FAILURE_TIMED_OUT = 5;
6724 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006725 }
6726 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006727}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006728
6729/**
6730 * Logs when an adb connection changes state.
6731 *
6732 * Logged from:
6733 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6734 */
6735message AdbConnectionChanged {
6736 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6737 // previously selected for this system.
6738 optional int64 last_connection_time_millis = 1;
6739
6740 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6741 // to reconnect via adb without user interaction.
6742 optional int64 auth_window_millis = 2;
6743
6744 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6745 optional android.debug.AdbConnectionStateEnum state = 3;
6746
6747 // True if the 'always allow' option was selected for this system.
6748 optional bool always_allow = 4;
6749}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006750
6751/*
6752 * Logs the reported speech DSP status.
6753 *
6754 * Logged from:
6755 * Vendor audio implementation.
6756 */
6757message SpeechDspStatReported {
6758 // The total Speech DSP uptime in milliseconds.
6759 optional int32 total_uptime_millis = 1;
6760 // The total Speech DSP downtime in milliseconds.
6761 optional int32 total_downtime_millis = 2;
6762 optional int32 total_crash_count = 3;
6763 optional int32 total_recover_count = 4;
6764}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006765
6766/**
6767 * Logs USB connector contaminant status.
6768 *
6769 * Logged from: USB Service.
6770 */
6771message UsbContaminantReported {
6772 optional string id = 1;
6773 optional android.service.usb.ContaminantPresenceStatus status = 2;
6774}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006775
6776/**
6777 * This atom is for debugging purpose.
6778 */
6779message DebugElapsedClock {
6780 // Monotically increasing value for each pull.
6781 optional int64 pull_count = 1;
6782 // Time from System.elapsedRealtime.
6783 optional int64 elapsed_clock_millis = 2;
6784 // Time from System.elapsedRealtime.
6785 optional int64 same_elapsed_clock_millis = 3;
6786 // Diff between current elapsed time and elapsed time from previous pull.
6787 optional int64 elapsed_clock_diff_millis = 4;
6788
6789 enum Type {
6790 TYPE_UNKNOWN = 0;
6791 ALWAYS_PRESENT = 1;
6792 PRESENT_ON_ODD_PULLS = 2;
6793 }
6794 // Type of behavior for the pulled data.
6795 optional Type type = 5;
6796}
6797
6798/**
6799 * This atom is for debugging purpose.
6800 */
6801message DebugFailingElapsedClock {
6802 // Monotically increasing value for each pull.
6803 optional int64 pull_count = 1;
6804 // Time from System.elapsedRealtime.
6805 optional int64 elapsed_clock_millis = 2;
6806 // Time from System.elapsedRealtime.
6807 optional int64 same_elapsed_clock_millis = 3;
6808 // Diff between current elapsed time and elapsed time from previous pull.
6809 optional int64 elapsed_clock_diff_millis = 4;
6810}
Steven Wuacef6bb2019-01-23 14:21:17 -05006811
6812/** Logs System UI bubbles event changed.
6813 *
6814 * Logged from:
6815 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6816 */
6817message BubbleUIChanged {
6818
6819 // The app package that is posting the bubble.
6820 optional string package_name = 1;
6821
6822 // The notification channel that is posting the bubble.
6823 optional string notification_channel = 2;
6824
6825 // The notification id associated with the posted bubble.
6826 optional int32 notification_id = 3;
6827
6828 // The position of the bubble within the bubble stack.
6829 optional int32 position = 4;
6830
6831 // The total number of bubbles within the bubble stack.
6832 optional int32 total_number = 5;
6833
6834 // User interactions with the bubble.
6835 enum Action {
6836 UNKNOWN = 0;
6837 POSTED = 1;
6838 UPDATED = 2;
6839 EXPANDED = 3;
6840 COLLAPSED = 4;
6841 DISMISSED = 5;
6842 STACK_DISMISSED = 6;
6843 STACK_MOVED = 7;
6844 HEADER_GO_TO_APP = 8;
6845 HEADER_GO_TO_SETTINGS = 9;
6846 PERMISSION_OPT_IN = 10;
6847 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006848 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006849 SWIPE_LEFT = 13;
6850 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006851 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006852 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006853 }
6854 optional Action action = 6;
6855
6856 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6857 optional float normalized_x_position = 7;
6858 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006859
6860 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6861 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006862
6863 // Whether the bubble is an on-going one.
6864 optional bool is_ongoing = 10;
6865
6866 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006867 // This is deprecated and the value should be ignored.
6868 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006869}
Kweku Adams8845d012018-12-11 20:06:45 -08006870
6871/**
Steven Wu552f63f2019-02-05 13:41:36 -05006872 * Logs System UI bubbles developer errors.
6873 *
6874 * Logged from:
6875 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6876 */
6877message BubbleDeveloperErrorReported {
6878
6879 // The app package that is posting the bubble.
6880 optional string package_name = 1;
6881
6882 // Bubble developer error type enums.
6883 enum Error {
6884 UNKNOWN = 0;
6885 ACTIVITY_INFO_MISSING = 1;
6886 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6887 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6888 }
6889 optional Error error = 2 [default = UNKNOWN];
6890}
6891
6892/**
Kweku Adams8845d012018-12-11 20:06:45 -08006893 * Logs that a constraint for a scheduled job has changed.
6894 *
6895 * Logged from:
6896 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6897 */
6898message ScheduledJobConstraintChanged {
6899 repeated AttributionNode attribution_node = 1;
6900
6901 // Name of the job.
6902 optional string job_name = 2;
6903
6904 optional com.android.server.job.ConstraintEnum constraint = 3;
6905
6906 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006907 UNKNOWN = 0;
6908 UNSATISFIED = 1;
6909 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006910 }
6911 optional State state = 4;
6912}
Alex Salod7c3eef2019-01-25 14:43:27 -08006913
6914/**
6915 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6916 * returns true.
6917 *
6918 * Logged from:
6919 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6920 */
6921message ScreenTimeoutExtensionReported {
6922 // Describes how many times in a row did the power manager reset the screen off timeout.
6923 optional uint32 consecutive_timeout_extended_count = 1;
6924}
Hui Yu885aca12019-01-10 17:11:34 -08006925
6926/*
6927* Logs number of milliseconds it takes to start a process.
6928* The definition of app process start time is from the app launch time to
6929* the time that Zygote finished forking the app process and loaded the
6930* application package's java classes.
6931
6932* This metric is different from AppStartOccurred which is for foreground
6933* activity only.
6934
6935* ProcessStartTime can report all processes (both foreground and background)
6936* start time.
6937*
6938* Logged from:
6939* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6940*/
6941message ProcessStartTime {
6942 // The uid of the ProcessRecord.
6943 optional int32 uid = 1 [(is_uid) = true];
6944
6945 // The process pid.
6946 optional int32 pid = 2;
6947
6948 // The process name.
6949 // Usually package name, "system" for system server.
6950 // Provided by ActivityManagerService.
6951 optional string process_name = 3;
6952
6953 enum StartType {
6954 UNKNOWN = 0;
6955 WARM = 1;
6956 HOT = 2;
6957 COLD = 3;
6958 }
6959
6960 // The start type.
6961 optional StartType type = 4;
6962
6963 // The elapsed realtime at the start of the process.
6964 optional int64 process_start_time_millis = 5;
6965
6966 // Number of milliseconds it takes to reach bind application.
6967 optional int32 bind_application_delay_millis = 6;
6968
6969 // Number of milliseconds it takes to finish start of the process.
6970 optional int32 process_start_delay_millis = 7;
6971
6972 // hostingType field in ProcessRecord, the component type such as "activity",
6973 // "service", "content provider", "broadcast" or other strings.
6974 optional string hosting_type = 8;
6975
6976 // hostingNameStr field in ProcessRecord. The component class name that runs
6977 // in this process.
6978 optional string hosting_name = 9;
6979}
6980
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006981/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006982 * Track Media Codec usage
6983 * Logged from:
6984 * frameworks/av/media/libstagefright/MediaCodec.cpp
6985 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6986 */
6987message MediametricsCodecReported {
6988 optional int64 timestamp_nanos = 1;
6989 optional string package_name = 2;
6990 optional int64 package_version_code = 3;
6991 optional int64 media_apex_version = 4;
6992
6993 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6994}
6995
6996/**
6997 * Track Media Extractor (pulling video/audio streams out of containers) usage
6998 * Logged from:
6999 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7000 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7001 */
7002message MediametricsExtractorReported {
7003 optional int64 timestamp_nanos = 1;
7004 optional string package_name = 2;
7005 optional int64 package_version_code = 3;
7006 optional int64 media_apex_version = 4;
7007
7008 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7009}
7010
7011/**
7012 * Track how we arbitrate between microphone/input requests.
7013 * Logged from
7014 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7015 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7016 */
7017message MediametricsAudiopolicyReported {
7018 optional int64 timestamp_nanos = 1;
7019 optional string package_name = 2;
7020 optional int64 package_version_code = 3;
7021 optional int64 media_apex_version = 4;
7022
7023 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7024}
7025
7026/**
7027 * Track how we arbitrate between microphone requests.
7028 * Logged from
7029 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7030 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7031 */
7032message MediametricsAudiorecordReported {
7033 optional int64 timestamp_nanos = 1;
7034 optional string package_name = 2;
7035 optional int64 package_version_code = 3;
7036 optional int64 media_apex_version = 4;
7037
7038 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7039}
7040
7041/**
7042 * Track how we arbitrate between microphone/input requests.
7043 * Logged from
7044 * frameworks/av/media/libnblog/ReportPerformance.cpp
7045 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7046 */
7047message MediametricsAudiothreadReported {
7048 optional int64 timestamp_nanos = 1;
7049 optional string package_name = 2;
7050 optional int64 package_version_code = 3;
7051 optional int64 media_apex_version = 4;
7052
7053 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7054}
7055
7056/**
7057 * Track how we arbitrate between microphone/input requests.
7058 * Logged from
7059 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7060 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7061 */
7062message MediametricsAudiotrackReported {
7063 optional int64 timestamp_nanos = 1;
7064 optional string package_name = 2;
7065 optional int64 package_version_code = 3;
7066 optional int64 media_apex_version = 4;
7067
7068 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7069}
7070
7071/**
7072 * Track information about DRM framework performance
7073 * Logged from
7074 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7075 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7076 */
7077message MediametricsMediadrmReported {
7078 optional int64 timestamp_nanos = 1;
7079 optional string package_name = 2;
7080 optional int64 package_version_code = 3;
7081 optional int64 media_apex_version = 4;
7082
7083 // vendor+description tell about which DRM plugin is in use on this device
7084 optional string vendor = 5;
7085 optional string description = 6;
7086 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7087 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7088}
7089
7090/**
7091 * Track information about the widevine DRM plugin performance
7092 * Logged from
7093 * vendor/widevine/libwvdrmengine/cdm/metrics
7094 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7095 */
7096message MediametricsDrmWidevineReported {
7097 optional int64 timestamp_nanos = 1;
7098 optional string package_name = 2;
7099 optional int64 package_version_code = 3;
7100 optional int64 media_apex_version = 4;
7101
7102 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7103}
7104
7105/**
7106 * Track information about recordings (e.g. camcorder)
7107 * Logged from
7108 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7109 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7110 */
7111message MediametricsRecorderReported {
7112 optional int64 timestamp_nanos = 1;
7113 optional string package_name = 2;
7114 optional int64 package_version_code = 3;
7115 optional int64 media_apex_version = 4;
7116
7117 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7118}
7119
7120/**
7121 * Track Media Player usage
7122 * Logged from:
7123 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7124 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7125 */
7126message MediametricsNuPlayerReported {
7127 optional int64 timestamp_nanos = 1;
7128 optional string package_name = 2;
7129 optional int64 package_version_code = 3;
7130 optional int64 media_apex_version = 4;
7131
7132 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7133}
7134
7135/**
Robert Shiha4beed32019-08-19 14:15:23 -07007136 * Track Legacy DRM usage
7137 * Logged from
7138 * frameworks/av/drm/drmserver/DrmManager.cpp
7139 */
7140message MediametricsDrmManagerReported {
7141 optional int64 timestamp_nanos = 1;
7142 optional string package_name = 2;
7143 optional int64 package_version_code = 3;
7144 optional int64 media_apex_version = 4;
7145
7146 enum Method {
7147 METHOD_NOT_FOUND = -1;
7148 GET_CONSTRAINTS = 0;
7149 GET_METADATA = 1;
7150 CAN_HANDLE = 2;
7151 PROCESS_DRM_INFO = 3;
7152 ACQUIRE_DRM_INFO = 4;
7153 SAVE_RIGHTS = 5;
7154 GET_ORIGINAL_MIME_TYPE = 6;
7155 GET_DRM_OBJECT_TYPE = 7;
7156 CHECK_RIGHTS_STATUS = 8;
7157 REMOVE_RIGHTS = 9;
7158 REMOVE_ALL_RIGHTS = 10;
7159 OPEN_CONVERT_SESSION = 11;
7160 OPEN_DECRYPT_SESSION = 12;
7161 }
7162
7163 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7164 optional string plugin_id = 5;
7165 optional string description = 6;
7166 optional Method method = 7;
7167 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007168
7169 optional int64 get_constraints_count = 9;
7170 optional int64 get_metadata_count = 10;
7171 optional int64 can_handle_count = 11;
7172 optional int64 process_drm_info_count = 12;
7173 optional int64 acquire_drm_info_count = 13;
7174 optional int64 save_rights_count = 14;
7175 optional int64 get_original_mime_type_count = 15;
7176 optional int64 get_drm_object_type_count = 16;
7177 optional int64 check_rights_status_count = 17;
7178 optional int64 remove_rights_count = 18;
7179 optional int64 remove_all_rights_count = 19;
7180 optional int64 open_convert_session_count = 20;
7181 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007182}
7183
7184/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007185 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007186 * Pulled from: StatsCompanionService
7187*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007188message DangerousPermissionState {
7189 // Name of the permission
7190 optional string permission_name = 1;
7191
7192 // Uid of the package
7193 optional int32 uid = 2 [(is_uid) = true];
7194
7195 // Package requesting the permission
7196 optional string package_name = 3;
7197
7198 // If the permission is granted to the uid
7199 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007200
7201 // Permission flags as per android.content.pm.PermissionFlags
7202 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007203}
7204
Michael Groover4a0ca942019-01-24 17:41:25 -08007205/**
7206 * Logs when a package is denied access to a device identifier based on the new access requirements.
7207 *
7208 * Logged from:
7209 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7210 */
7211message DeviceIdentifierAccessDenied {
7212 // The name of the package denied access to the requested device identifier.
7213 optional string package_name = 1;
7214
7215 // The name of the device identifier method the package attempted to invoke.
7216 optional string method_name = 2;
7217
7218 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007219 // Starting from Android 11, this boolean is not set and will always be false.
7220 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007221
7222 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007223 // Starting from Android 11, this boolean is not set and will always be false.
7224 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007225}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007226
7227/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007228 * Pulls the ongoing mainline install train version code.
7229 * Pulled from StatsCompanionService
7230 */
7231message TrainInfo {
7232 optional int64 train_version_code = 1;
7233
7234 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007235
7236 optional string train_name = 3;
7237
7238 enum Status {
7239 UNKNOWN = 0;
7240 INSTALL_REQUESTED = 1;
7241 INSTALL_STARTED = 2;
7242 INSTALL_STAGED_NOT_READY = 3;
7243 INSTALL_STAGED_READY = 4;
7244 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007245 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7246 // and INSTALL_FAILURE_COMMIT.
7247 INSTALL_FAILURE = 6 [deprecated = true];
7248 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007249 INSTALL_CANCELLED = 7;
7250 INSTALLER_ROLLBACK_REQUESTED = 8;
7251 INSTALLER_ROLLBACK_INITIATED = 9;
7252 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7253 INSTALLER_ROLLBACK_STAGED = 11;
7254 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7255 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7256 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7257 INSTALLER_ROLLBACK_SUCCESS = 15;
7258 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007259 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7260 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7261 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7262 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7263 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7264 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007265 INSTALL_FAILURE_DOWNLOAD = 23;
7266 INSTALL_FAILURE_STATE_MISMATCH = 24;
7267 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007268 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007269 }
7270 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007271}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007272
7273/**
7274 * Logs the gesture stage changed event.
7275 *
7276 * Logged from:
7277 * frameworks/base/packages/SystemUI/
7278 */
7279message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007280 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007281}
7282
7283/**
7284 * Logs the feedback type.
7285 *
7286 * Logged from:
7287 * frameworks/base/packages/SystemUI/
7288 */
7289message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007290 // Whether or not the gesture was used.
7291 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007292}
7293
7294/**
7295 * Logs the progress.
7296 *
7297 * Logged from:
7298 * frameworks/base/packages/SystemUI/
7299 */
7300message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007301 // [0,100] progress for the assist gesture.
7302 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007303}
Neil Fullerdb14b482019-02-05 19:44:44 +00007304
7305/*
7306 * Information about the time zone data on a device.
7307 */
7308message TimeZoneDataInfo {
7309 // A version identifier for the data set on device. e.g. "2018i"
7310 optional string tzdb_version = 1;
7311}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007312
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007313/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007314 * Logs the GPU stats global health information.
7315 *
7316 * Logged from:
7317 * frameworks/native/services/gpuservice/gpustats/
7318 */
7319message GpuStatsGlobalInfo {
7320 // Package name of the gpu driver.
7321 optional string driver_package_name = 1;
7322
7323 // Version name of the gpu driver.
7324 optional string driver_version_name = 2;
7325
7326 // Version code of the gpu driver.
7327 optional int64 driver_version_code = 3;
7328
7329 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7330 optional int64 driver_build_time = 4;
7331
7332 // Total count of the gl driver gets loaded.
7333 optional int64 gl_loading_count = 5;
7334
7335 // Total count of the gl driver fails to be loaded.
7336 optional int64 gl_loading_failure_count = 6;
7337
7338 // Total count of the Vulkan driver gets loaded.
7339 optional int64 vk_loading_count = 7;
7340
7341 // Total count of the Vulkan driver fails to be loaded.
7342 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007343
7344 // Api version of the system Vulkan driver.
7345 optional int32 vulkan_version = 9;
7346
7347 // Api version of the system CPU Vulkan driver.
7348 optional int32 cpu_vulkan_version = 10;
7349
7350 // Api version of the system GLES driver.
7351 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007352
7353 // Total count of the angle driver gets loaded.
7354 optional int64 angle_loading_count = 12;
7355
7356 // Total count of the angle driver fails to be loaded.
7357 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007358}
7359
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007360/**
7361 * GPU driver loading time info.
7362 */
7363message GpuDriverLoadingTime {
7364 // List of all the driver loading times for this app. The list size is
7365 // capped at 50.
7366 repeated int64 driver_loading_time = 1;
7367}
7368
7369/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007370 * Logs the GPU stats per app health information.
7371 *
7372 * Logged from:
7373 * frameworks/native/services/gpuservice/gpustats/
7374 */
7375message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007376 // Package name of the application that loads the gpu driver. Total number
7377 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007378 optional string app_package_name = 1;
7379
7380 // Version code of the gpu driver this app loads.
7381 optional int64 driver_version_code = 2;
7382
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007383 // gl driver loading time info.
7384 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7385 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007386
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007387 // Vulkan driver loading time info.
7388 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7389 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007390
7391 // Angle driver loading time info.
7392 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7393 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007394
7395 // CPU Vulkan implementation is in use.
7396 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007397
7398 // App is not doing pre-rotation correctly.
7399 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007400
7401 // App creates GLESv1 context.
7402 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007403}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007404
7405/*
7406 * Logs the size of the system ion heap.
7407 *
7408 * Pulled from StatsCompanionService.
7409 */
7410message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007411 // Deprecated due to limited support of ion stats in debugfs.
7412 // Use `IonHeapSize` instead.
7413 option deprecated = true;
7414
Rafal Slawikd4e87572019-03-12 13:08:38 +00007415 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007416 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007417 optional int64 size_in_bytes = 1;
7418}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007419
Rafal Slawik77987ed2019-06-17 12:28:23 +01007420/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007421 * Logs the total size of the ion heap.
7422 *
7423 * Pulled from StatsCompanionService.
7424 */
7425message IonHeapSize {
7426 // Total size of all ion heaps in kilobytes.
7427 // Read from: /sys/kernel/ion/total_heaps_kb.
7428 optional int32 total_size_kb = 1;
7429}
7430
7431/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007432 * Logs the per-process size of the system ion heap.
7433 *
7434 * Pulled from StatsCompanionService.
7435 */
7436message ProcessSystemIonHeapSize {
7437 // The uid if available. -1 means not available.
7438 optional int32 uid = 1 [(is_uid) = true];
7439
7440 // The process name (from /proc/PID/cmdline).
7441 optional string process_name = 2;
7442
7443 // Sum of sizes of all allocations.
7444 optional int32 total_size_in_kilobytes = 3;
7445
7446 // Number of allocations.
7447 optional int32 allocation_count = 4;
7448
7449 // Size of the largest allocation.
7450 optional int32 max_size_in_kilobytes = 5;
7451}
7452
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007453/**
7454 * Push network stack events.
7455 *
7456 * Log from:
7457 * frameworks/base/packages/NetworkStack/
7458 */
7459message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007460 // The id that indicates the event reported from NetworkStack.
7461 optional int32 event_id = 1;
7462 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007463 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7464}
Carmen Agimofa769c152019-03-04 14:39:14 +00007465
7466/**
7467 * Logs the apps that are installed on the external storage.
7468 * Pulled from:
7469 * StatsCompanionService
7470 */
7471message AppsOnExternalStorageInfo {
7472 // The type of the external storage.
7473 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7474 // The name of the package that is installed on the external storage.
7475 optional string package_name = 2;
7476}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007477
7478/**
7479 * Logs the settings related to Face.
7480 * Logged from:
7481 * frameworks/base/services/core/java/com/android/server/stats
7482 */
7483message FaceSettings {
7484 // Whether or not face unlock is allowed on Keyguard.
7485 optional bool unlock_keyguard_enabled = 1;
7486 // Whether or not face unlock dismisses the Keyguard.
7487 optional bool unlock_dismisses_keyguard = 2;
7488 // Whether or not face unlock requires attention.
7489 optional bool unlock_attention_required = 3;
7490 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7491 optional bool unlock_app_enabled = 4;
7492 // Whether or not face unlock always requires user confirmation.
7493 optional bool unlock_always_require_confirmation = 5;
7494 // Whether or not a diverse set of poses are required during enrollment.
7495 optional bool unlock_diversity_required = 6;
7496}
Maggie White442b6312019-04-05 16:26:44 -07007497
7498/**
7499 * Logs cooling devices maintained by the kernel.
7500 *
7501 * Pulled from StatsCompanionService.java
7502 */
7503message CoolingDevice {
7504 // The type of cooling device being reported. Eg. CPU, GPU...
7505 optional android.os.CoolingTypeEnum device_location = 1;
7506 // The name of the cooling device source. Eg. CPU0
7507 optional string device_name = 2;
7508 // Current throttle state of the cooling device. The value can any unsigned
7509 // integer between 0 and max_state defined in its driver. 0 means device is
7510 // not in throttling, higher value means deeper throttling.
7511 optional int32 state = 3;
7512}
Ben Blount763a5d52019-04-10 11:48:58 -07007513
7514/**
7515 * Intelligence has several counter-type events that don't warrant a
7516 * full separate atom. These are primarily API call counters but also include
7517 * counters for feature usage and specific failure modes.
7518 *
7519 * Logged from the Intelligence mainline module.
7520 */
7521message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007522 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007523 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007524 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007525 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007526 // How many times the event occured (to report a batch of high frequency events).
7527 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007528 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007529 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007530}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007531
7532/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007533 * Logs when Car Power state changed.
7534 *
7535 * Logged from:
7536 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7537 */
7538message CarPowerStateChanged {
7539 // States come from CpmsState in CarPowerManagementService.java.
7540 enum State {
7541 WAIT_FOR_VHAL = 0;
7542 ON = 1;
7543 SHUTDOWN_PREPARE = 2;
7544 WAIT_FOR_FINISH = 3;
7545 SUSPEND = 4;
7546 SIMULATE_SLEEP = 5;
7547 }
7548 optional State state = 1;
7549}
7550
7551/**
7552 * Logs whether GarageMode is entered.
7553 *
7554 * Logged from:
7555 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7556 */
7557message GarageModeInfo {
7558 // Whether GarageMode is entered.
7559 optional bool is_garage_mode = 1;
7560}
Martijn Coenencd95d462019-04-25 17:09:45 +02007561
7562/**
7563 * Historical app ops data per package.
7564 */
7565message AppOps {
7566 // Uid of the package requesting the op
7567 optional int32 uid = 1 [(is_uid) = true];
7568
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007569 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007570 optional string package_name = 2;
7571
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007572 // operation id
7573 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007574
7575 // The number of times the op was granted while the app was in the
7576 // foreground (only for trusted requests)
7577 optional int64 trusted_foreground_granted_count = 4;
7578
7579 // The number of times the op was granted while the app was in the
7580 // background (only for trusted requests)
7581 optional int64 trusted_background_granted_count = 5;
7582
7583 // The number of times the op was rejected while the app was in the
7584 // foreground (only for trusted requests)
7585 optional int64 trusted_foreground_rejected_count = 6;
7586
7587 // The number of times the op was rejected while the app was in the
7588 // background (only for trusted requests)
7589 optional int64 trusted_background_rejected_count = 7;
7590
7591 // For long-running operations, total duration of the operation
7592 // while the app was in the foreground (only for trusted requests)
7593 optional int64 trusted_foreground_duration_millis = 8;
7594
7595 // For long-running operations, total duration of the operation
7596 // while the app was in the background (only for trusted requests)
7597 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007598
7599 // Whether AppOps is guarded by Runtime permission
7600 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007601}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007602
7603/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007604 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007605 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007606message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007607 // Uid of the package requesting the op
7608 optional int32 uid = 1 [(is_uid) = true];
7609
7610 // Name of the package performing the op
7611 optional string package_name = 2;
7612
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007613 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7614 // Attributions must be provided through manifest using <attribution> tag available in R and
7615 // above.
7616 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007617
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007618 // operation id
7619 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007620
7621 // The number of times the op was granted while the app was in the
7622 // foreground (only for trusted requests)
7623 optional int64 trusted_foreground_granted_count = 5;
7624
7625 // The number of times the op was granted while the app was in the
7626 // background (only for trusted requests)
7627 optional int64 trusted_background_granted_count = 6;
7628
7629 // The number of times the op was rejected while the app was in the
7630 // foreground (only for trusted requests)
7631 optional int64 trusted_foreground_rejected_count = 7;
7632
7633 // The number of times the op was rejected while the app was in the
7634 // background (only for trusted requests)
7635 optional int64 trusted_background_rejected_count = 8;
7636
7637 // For long-running operations, total duration of the operation
7638 // while the app was in the foreground (only for trusted requests)
7639 optional int64 trusted_foreground_duration_millis = 9;
7640
7641 // For long-running operations, total duration of the operation
7642 // while the app was in the background (only for trusted requests)
7643 optional int64 trusted_background_duration_millis = 10;
7644
7645 // Whether AppOps is guarded by Runtime permission
7646 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007647
7648 // Sampling rate used on device, from 0 to 100
7649 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007650}
7651
7652/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007653 * Location Manager API Usage information(e.g. API under usage,
7654 * API call's parameters).
7655 * Logged from:
7656 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7657 */
7658message LocationManagerApiUsageReported {
7659
7660 // Indicating if usage starts or usage ends.
7661 optional android.stats.location.UsageState state = 1;
7662
7663 // LocationManagerService's API in use.
7664 // We can identify which API from LocationManager is
7665 // invoking current LMS API by the combination of
7666 // API parameter(e.g. is_listener_null, is_intent_null,
7667 // is_location_request_null)
7668 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7669
7670 // Name of the package calling the API.
7671 optional string calling_package_name = 3;
7672
7673 // Type of the location provider.
7674 optional android.stats.location.ProviderType provider = 4;
7675
7676 // Quality of the location request
7677 optional android.stats.location.LocationRequestQuality quality = 5;
7678
7679 // The desired interval for active location updates, in milliseconds.
7680 // Bucketized to reduce cardinality.
7681 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7682
7683 // Minimum distance between location updates, in meters.
7684 // Bucketized to reduce cardinality.
7685 optional android.stats.location.SmallestDisplacementBucket
7686 bucketized_smallest_displacement = 7;
7687
7688 // The number of location updates.
7689 optional int64 num_updates = 8;
7690
7691 // The request expiration time, in millisecond since boot.
7692 // Bucketized to reduce cardinality.
7693 optional android.stats.location.ExpirationBucket
7694 bucketized_expire_in = 9;
7695
7696 // Type of Callback passed in for this API.
7697 optional android.stats.location.CallbackType callback_type = 10;
7698
7699 // The radius of the central point of the alert
7700 // region, in meters. Only for API REQUEST_GEOFENCE.
7701 // Bucketized to reduce cardinality.
7702 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7703
7704 // Activity Importance of API caller.
7705 // Categorized to 3 types that are interesting from location's perspective.
7706 optional android.stats.location.ActivityImportance activiy_importance = 12;
7707}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007708
7709/**
7710 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7711 */
7712message ReviewPermissionsFragmentResultReported {
7713 // unique value identifying a permission group change. A permission group change might result
7714 // in multiple of these atoms
7715 optional int64 change_id = 1;
7716
7717 // UID of package the permission belongs to
7718 optional int32 uid = 2 [(is_uid) = true];
7719
7720 // Name of package the permission belongs to
7721 optional string package_name = 3;
7722
7723 // The permission to be granted
7724 optional string permission_name = 4;
7725
7726 // The result of the permission grant
7727 optional bool permission_granted = 5;
7728}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007729
7730/**
7731* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7732* Logged from: RuntimePermissionUpdgradeController
7733*/
7734message RuntimePermissionsUpgradeResult {
7735 // Permission granted as result of upgrade
7736 optional string permission_name = 1;
7737
7738 // UID of package granted permission
7739 optional int32 uid = 2 [(is_uid) = true];
7740
7741 // Name of package granted permission
7742 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007743}
7744
7745/**
7746* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7747*/
7748message GrantPermissionsActivityButtonActions {
7749 // Permission granted as result of upgrade
7750 optional string permission_group_name = 1;
7751
7752 // UID of package granted permission
7753 optional int32 uid = 2 [(is_uid) = true];
7754
7755 // Name of package requesting permission
7756 optional string package_name = 3;
7757
7758 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7759 // LABEL_ constants in GrantPermissionActivity.java
7760 optional int32 buttons_presented = 4;
7761
7762 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7763 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007764
7765 // id which identifies single session of user interacting with permission controller
7766 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007767}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007768
7769/**
7770 * Information about LocationAccessCheck notification presented to user
7771 */
7772message LocationAccessCheckNotificationAction {
7773
7774 // id which identifies single session of user interacting with permission controller
7775 optional int64 session_id = 1;
7776
7777 // Uid of package for which location access check is presented
7778 optional int32 package_uid = 2;
7779
7780 // Name of package for which location access check is presented
7781 optional string package_name = 3;
7782
7783 enum Result {
7784 UNDEFINED = 0;
7785 // notification was presented to the user
7786 NOTIFICATION_PRESENTED = 1;
7787 // notification was declined by the user
7788 NOTIFICATION_DECLINED = 2;
7789 // notification was clicked by the user
7790 NOTIFICATION_CLICKED = 3;
7791 }
7792
7793 // View / interaction recorded
7794 optional Result result = 4;
7795}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007796
7797/**
7798 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7799 */
7800message AppPermissionFragmentActionReported {
7801 // id which identifies single session of user interacting with permission controller
7802 optional int64 session_id = 1;
7803
7804 // unique value identifying a permission group change. A permission group change might result
7805 // in multiple of these atoms
7806 optional int64 change_id = 2;
7807
7808 // UID of package the permission belongs to
7809 optional int32 uid = 3 [(is_uid) = true];
7810
7811 // Name of package the permission belongs to
7812 optional string package_name = 4;
7813
7814 // The permission to be granted
7815 optional string permission_name = 5;
7816
7817 // The result of the permission grant
7818 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007819
7820 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7821 optional int32 permission_flags = 7;
7822
7823 enum Button {
7824 UNDEFINED = 0;
7825 // Allow button
7826 ALLOW = 1;
7827 // Deny button
7828 DENY = 2;
7829 // Ask every time button
7830 ASK_EVERY_TIME = 3;
7831 // Allow all the time button
7832 ALLOW_ALWAYS = 4;
7833 // Allow only while using the app button
7834 ALLOW_FOREGROUND = 5;
7835 // Same is Deny button but shown in while in use dialog
7836 DENY_FOREGROUND = 6;
7837 }
7838
7839 // Button pressed in the dialog
7840 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007841}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007842
7843/**
7844* Information about a AppPermissionFragment viewed by user
7845*/
7846message AppPermissionFragmentViewed {
7847 // id which identifies single session of user interacting with permission controller
7848 optional int64 session_id = 1;
7849
7850 // UID of package for which permissions are viewed
7851 optional int32 uid = 2 [(is_uid) = true];
7852
7853 // Name of package for which permissions are viewed
7854 optional string package_name = 3;
7855
7856 // Permission group viewed
7857 optional string permission_group_name = 4;
7858}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007859
7860/**
7861* Information about a AppPermissionsFragment viewed by user
7862*/
7863message AppPermissionsFragmentViewed {
7864 // id which identifies single session of user interacting with permission controller
7865 optional int64 session_id = 1;
7866
7867 // id which identifies single view as every view might have several logging records
7868 // with different package information attached
7869 optional int64 view_id = 2;
7870
7871 // Permission group viewed
7872 optional string permission_group_name = 3;
7873
7874 // UID of package for which permissions are viewed
7875 optional int32 uid = 4 [(is_uid) = true];
7876
7877 // Name of package for which permissions are viewed
7878 optional string package_name = 5;
7879
7880 // Category in which permission is included
7881 enum Category {
7882 UNDEFINED = 0;
7883 ALLOWED = 1;
7884 ALLOWED_FOREGROUND = 2;
7885 DENIED = 3;
7886 }
7887 optional Category category = 6;
7888}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007889
7890/**
7891* Information about a PermissionAppsFragment viewed by user.
7892* Logged from ui/handheld/PermissionAppsFragment.java
7893*/
7894message PermissionAppsFragmentViewed {
7895 // id which identifies single session of user interacting with permission controller
7896 optional int64 session_id = 1;
7897
7898 // id which identifies single view as every view might have several logging records
7899 // with different package information attached
7900 optional int64 view_id = 2;
7901
7902 // Permission group viewed
7903 optional string permission_group_name = 3;
7904
7905 // UID of package for which permissions are viewed
7906 optional int32 uid = 4 [(is_uid) = true];
7907
7908 // Name of package for which permissions are viewed
7909 optional string package_name = 5;
7910
7911 // Category in which app is included
7912 enum Category {
7913 UNDEFINED = 0;
7914 ALLOWED = 1;
7915 ALLOWED_FOREGROUND = 2;
7916 DENIED = 3;
7917 }
7918 optional Category category = 6;
7919}
Tony Make2b1b672019-07-29 16:59:47 +01007920
7921/**
7922 * Logs when there is a smart selection related event.
7923 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7924 * Logged from: TextClassifierEventLogger.java
7925 */
7926message TextSelectionEvent {
7927 // A session ID.
7928 optional string session_id = 1;
7929
7930 // Event type of this event.
7931 optional android.stats.textclassifier.EventType event_type = 2;
7932
Tony Mak9c84bd22019-12-09 07:27:25 +00007933 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007934 optional string model_name = 3;
7935
7936 // Type of widget that was involved in triggering this event.
7937 optional android.stats.textclassifier.WidgetType widget_type = 4;
7938
7939 // Index of this event in a session.
7940 optional int32 event_index = 5;
7941
7942 // Entity type that is involved.
7943 optional string entity_type = 6;
7944
7945 // Relative word index of the start of the selection.
7946 optional int32 relative_word_start_index = 7;
7947
7948 // Relative word (exclusive) index of the end of the selection.
7949 optional int32 relative_word_end_index = 8;
7950
7951 // Relative word index of the start of the smart selection.
7952 optional int32 relative_suggested_word_start_index = 9;
7953
7954 // Relative word (exclusive) index of the end of the smart selection.
7955 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007956
7957 // Name of source package.
7958 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007959}
7960
7961/**
7962 * Logs when there is a smart linkify related event.
7963 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7964 * Logged from: TextClassifierEventLogger.java
7965 */
7966message TextLinkifyEvent {
7967 // A session ID.
7968 optional string session_id = 1;
7969
7970 // Event type of this event.
7971 optional android.stats.textclassifier.EventType event_type = 2;
7972
Tony Mak9c84bd22019-12-09 07:27:25 +00007973 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007974 optional string model_name = 3;
7975
7976 // Type of widget that was involved in triggering this event.
7977 optional android.stats.textclassifier.WidgetType widget_type = 4;
7978
7979 // Index of this event in a session.
7980 optional int32 event_index = 5;
7981
7982 // Entity type that is involved.
7983 optional string entity_type = 6;
7984
7985 // Number of links detected.
7986 optional int32 num_links = 7;
7987
7988 // The total length of all links.
7989 optional int32 linked_text_length = 8;
7990
7991 // Length of input text.
7992 optional int32 text_length = 9;
7993
7994 // Time spent on generating links in ms.
7995 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007996
7997 // Name of source package.
7998 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007999}
8000
8001/**
8002 * Logs when there is a conversation actions related event.
8003 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8004 * Logged from: TextClassifierEventLogger.java
8005 */
8006message ConversationActionsEvent {
8007 // A session ID.
8008 optional string session_id = 1;
8009
8010 // Event type of this event.
8011 optional android.stats.textclassifier.EventType event_type = 2;
8012
Tony Mak9c84bd22019-12-09 07:27:25 +00008013 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008014 optional string model_name = 3;
8015
8016 // Type of widget that was involved in triggering this event.
8017 optional android.stats.textclassifier.WidgetType widget_type = 4;
8018
8019 // The first entity type that is involved.
8020 optional string first_entity_type = 5;
8021
8022 // The second entity type that is involved.
8023 optional string second_entity_type = 6;
8024
8025 // The third entity type that is involved.
8026 optional string third_entity_type = 7;
8027
8028 // The score of the first entity type.
8029 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008030
8031 // Name of source package.
8032 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008033
8034 // Name of the annotator model that is involved in this event.
8035 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008036}
8037
8038/**
8039 * Logs when there is a language detection related event.
8040 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8041 * Logged from: TextClassifierEventLogger.java
8042 */
8043message LanguageDetectionEvent {
8044 // A session ID.
8045 optional string session_id = 1;
8046
8047 // Event type of this event.
8048 optional android.stats.textclassifier.EventType event_type = 2;
8049
Tony Mak9c84bd22019-12-09 07:27:25 +00008050 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008051 optional string model_name = 3;
8052
8053 // Type of widget that was involved in triggering this event.
8054 optional android.stats.textclassifier.WidgetType widget_type = 4;
8055
8056 // Detected language.
8057 optional string language_tag = 5;
8058
8059 // Score of the detected language.
8060 optional float score = 6;
8061
8062 // Position of this action.
8063 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008064
8065 // Name of source package.
8066 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008067}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008068
8069/**
8070 * Information about an OTA update attempt by update_engine.
8071 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8072 */
8073message UpdateEngineUpdateAttemptReported {
8074 // The number of attempts for the update engine to apply a given payload.
8075 optional int32 attempt_number = 1;
8076
8077 optional android.stats.otaupdate.PayloadType payload_type = 2;
8078
8079 // The total time in minutes for the update engine to apply a given payload.
8080 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8081 // it's increased when the system is sleeping.
8082 optional int32 duration_boottime_in_minutes = 3;
8083
8084 // The total time in minutes for the update engine to apply a given payload.
8085 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8086 // and it's not increased when the system is sleeping.
8087 optional int32 duration_monotonic_in_minutes = 4;
8088
8089 // The size of the payload in MiBs.
8090 optional int32 payload_size_mib = 5;
8091
8092 // The attempt result reported by the update engine for an OTA update.
8093 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8094
8095 // The error code reported by the update engine after an OTA update attempt
8096 // on A/B devices.
8097 optional android.stats.otaupdate.ErrorCode error_code = 7;
8098
8099 // The build fingerprint of the source system. The value is read from a
8100 // system property when the device takes the update. e.g.
8101 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8102 optional string source_fingerprint = 8;
8103}
8104
8105/**
8106 * Information about all the attempts the device make before finishing the
8107 * successful update.
8108 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8109 */
8110message UpdateEngineSuccessfulUpdateReported {
8111 // The number of attempts for the update engine to apply the payload for a
8112 // successful update.
8113 optional int32 attempt_count = 1;
8114
8115 optional android.stats.otaupdate.PayloadType payload_type = 2;
8116
8117 optional int32 payload_size_mib = 3;
8118
8119 // The total number of bytes downloaded by update_engine since the last
8120 // successful update.
8121 optional int32 total_bytes_downloaded_mib = 4;
8122
8123 // The ratio in percentage of the over-downloaded bytes compared to the
8124 // total bytes needed to successfully install the update. e.g. 200 if we
8125 // download 200MiB in total for a 100MiB package.
8126 optional int32 download_overhead_percentage = 5;
8127
8128 // The total time in minutes for the update engine to apply the payload for a
8129 // successful update.
8130 optional int32 total_duration_minutes = 6;
8131
8132 // The number of reboot of the device during a successful update.
8133 optional int32 reboot_count = 7;
8134}
Alec Mourie088e762019-07-02 13:10:55 -07008135
8136/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008137 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8138 * key to indicate whether it was successful or not.
8139 *
8140 * Logged from:
8141 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8142 */
8143message RebootEscrowRecoveryReported {
8144 optional bool successful = 1;
8145}
8146
8147/**
Alec Mourie088e762019-07-02 13:10:55 -07008148 * Global display pipeline metrics reported by SurfaceFlinger.
8149 * Pulled from:
8150 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8151 */
8152message SurfaceflingerStatsGlobalInfo {
8153 // Total number of frames presented during the tracing period
8154 optional int64 total_frames = 1;
8155 // Total number of frames missed
8156 optional int64 missed_frames = 2;
8157 // Total number of frames that fell back to client composition
8158 optional int64 client_composition_frames = 3;
8159 // Total time the display was turned on
8160 optional int64 display_on_millis = 4;
8161 // Total time that was spent performing animations.
8162 // This is derived from the present-to-present layer histogram
8163 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008164 // Total number of event connections tracked by SurfaceFlinger at the time
8165 // of this pull. If this number grows prohibitively large, then this can
8166 // cause jank due to resource contention.
8167 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008168 // Set of timings measured from when SurfaceFlinger began compositing a
8169 // frame, until the frame was requested to be presented to the display. This
8170 // measures SurfaceFlinger's total CPU walltime on the critical path per
8171 // frame.
8172 optional FrameTimingHistogram frame_duration = 7
8173 [(android.os.statsd.log_mode) = MODE_BYTES];
8174 // Set of timings measured from when SurfaceFlinger first began using the
8175 // GPU to composite a frame, until the GPU has finished compositing that
8176 // frame. This measures the total additional time SurfaceFlinger needed to
8177 // perform due to falling back into GPU composition.
8178 optional FrameTimingHistogram render_engine_timing = 8
8179 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008180}
8181
8182/**
8183 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8184 * The number of layers uploaded will be restricted due to size limitations.
8185 * Pulled from:
8186 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8187 */
8188message SurfaceflingerStatsLayerInfo {
8189 // The layer for this set of metrics
8190 // For now we can infer that the package name is included in the layer
8191 // name.
8192 optional string layer_name = 1;
8193 // Total number of frames presented
8194 optional int64 total_frames = 2;
8195 // Total number of dropped frames while latching a buffer for this layer.
8196 optional int64 dropped_frames = 3;
8197 // Set of timings measured between successive presentation timestamps.
8198 optional FrameTimingHistogram present_to_present = 4
8199 [(android.os.statsd.log_mode) = MODE_BYTES];
8200 // Set of timings measured from when an app queued a buffer for
8201 // presentation, until the buffer was actually presented to the
8202 // display.
8203 optional FrameTimingHistogram post_to_present = 5
8204 [(android.os.statsd.log_mode) = MODE_BYTES];
8205 // Set of timings measured from when a buffer is ready to be presented,
8206 // until the buffer was actually presented to the display.
8207 optional FrameTimingHistogram acquire_to_present = 6
8208 [(android.os.statsd.log_mode) = MODE_BYTES];
8209 // Set of timings measured from when a buffer was latched by
8210 // SurfaceFlinger, until the buffer was presented to the display
8211 optional FrameTimingHistogram latch_to_present = 7
8212 [(android.os.statsd.log_mode) = MODE_BYTES];
8213 // Set of timings measured from the desired presentation to the actual
8214 // presentation time
8215 optional FrameTimingHistogram desired_to_present = 8
8216 [(android.os.statsd.log_mode) = MODE_BYTES];
8217 // Set of timings measured from when an app queued a buffer for
8218 // presentation, until the buffer was ready to be presented.
8219 optional FrameTimingHistogram post_to_acquire = 9
8220 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008221 // Frames missed latch because the acquire fence didn't fire
8222 optional int64 late_acquire_frames = 10;
8223 // Frames latched early because the desired present time was bad
8224 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008225}
8226
8227/**
8228 * Histogram of frame counts bucketed by time in milliseconds.
8229 * Because of size limitations, we hard-cap the number of buckets, with
8230 * buckets for corresponding to larger milliseconds being less precise.
8231 */
8232message FrameTimingHistogram {
8233 // Timings in milliseconds that describes a set of histogram buckets
8234 repeated int32 time_millis_buckets = 1;
8235 // Number of frames that match to each time_millis, i.e. the bucket
8236 // contents
8237 // It's required that len(time_millis) == len(frame_count)
8238 repeated int64 frame_counts = 2;
8239}
Emilian Peev6729f372019-08-29 09:14:09 -07008240
Emilian Peev6729f372019-08-29 09:14:09 -07008241/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008242 * Janky event as reported by SurfaceFlinger.
8243 * This event is intended to be consumed by a Perfetto subscriber for
8244 * automated trace collection.
8245 *
8246 * Logged from:
8247 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8248 */
8249message DisplayJankReported {
8250 // Informational field for how long the janky event lasted in milliseconds
8251 optional int64 event_duration_millis = 1;
8252 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8253 // the display on time.
8254 optional int32 present_deadlines_missed = 2;
8255}
8256
8257/**
Emilian Peev6729f372019-08-29 09:14:09 -07008258 * Information about camera facing and API level usage.
8259 * Logged from:
8260 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8261 */
8262message CameraActionEvent {
8263 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008264 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008265
8266 // Camera API level used
8267 optional int32 api_level = 2;
8268
8269 // Name of client package
8270 optional string package_name = 3;
8271
8272 // Camera facing
8273 enum Facing {
8274 UNKNOWN = 0;
8275 BACK = 1;
8276 FRONT = 2;
8277 EXTERNAL = 3;
8278 }
8279 optional Facing facing = 4;
8280}
atrost01a20932019-08-28 15:40:37 +01008281
8282/**
8283 * Logs when a compatibility change is affecting an app.
8284 *
8285 * Logged from:
8286 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8287 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8288 */
8289message AppCompatibilityChangeReported {
8290 // The UID of the app being affected by the compatibilty change.
8291 optional int32 uid = 1 [(is_uid) = true];
8292
8293 // The ID of the change affecting the app.
8294 optional int64 change_id = 2;
8295
8296 enum State {
8297 UNKNOWN_STATE = 0;
8298 ENABLED = 1;
8299 DISABLED = 2;
8300 LOGGED = 3;
8301 }
8302
8303 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8304 // logged otherwise.
8305 optional State state = 3;
8306
8307 enum Source {
8308 UNKNOWN_SOURCE = 0;
8309 APP_PROCESS = 1;
8310 SYSTEM_SERVER = 2;
8311 }
8312
8313 // Where it was logged from.
8314 optional Source source = 4;
8315
8316}
Hector Dearman40579f62019-11-01 13:19:30 +00008317
8318/**
8319 * Logged from
8320 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8321 */
8322message PerfettoUploaded {
8323 enum Event {
8324 PERFETTO_UNDEFINED = 0;
8325 PERFETTO_TRACE_BEGIN = 1;
8326 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8327 PERFETTO_ON_CONNECT = 3;
8328 PERFETTO_ON_TRACING_DISABLED = 4;
8329 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8330 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8331 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8332 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8333 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8334 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8335 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8336 PERFETTO_TRIGGER_BEGIN = 12;
8337 PERFETTO_TRIGGER_SUCCESS = 13;
8338 PERFETTO_TRIGGER_FAILURE = 14;
8339 PERFETTO_HIT_GUARDRAILS = 15;
8340 PERFETTO_ON_TIMEOUT = 16;
8341 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8342 }
8343
8344 // Which stage of the pipeline we are reporting from.
8345 optional Event event = 1;
8346
8347 // UUID matching the one set inside the SystemInfo trace packet.
8348 optional int64 trace_uuid_lsb = 2;
8349 optional int64 trace_uuid_msb = 3;
8350}
Mark Tabrya824a642019-11-05 12:26:12 -08008351
8352/**
8353 * Pulls client metrics on data transferred via Vehicle Maps Service.
8354 * Metrics are keyed by uid + layer.
8355 *
8356 * Pulled from:
8357 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8358 */
8359message VmsClientStats {
8360 // UID of the VMS client app
8361 optional int32 uid = 1 [(is_uid) = true];
8362
8363 // VMS layer definition
8364 optional int32 layer_type = 2;
8365 optional int32 layer_channel = 3;
8366 optional int32 layer_version = 4;
8367
8368 // Bytes and packets sent by the client for the layer
8369 optional int64 tx_bytes = 5;
8370 optional int64 tx_packets = 6;
8371
8372 // Bytes and packets received by the client for the layer
8373 optional int64 rx_bytes = 7;
8374 optional int64 rx_packets = 8;
8375
8376 // Bytes and packets dropped due to client error
8377 optional int64 dropped_bytes = 9;
8378 optional int64 dropped_packets = 10;
8379}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008380
8381/**
8382 * State of a dangerous permission requested by a package - sampled
8383 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8384*/
8385message DangerousPermissionStateSampled {
8386 // Name of the permission
8387 optional string permission_name = 1;
8388
8389 // Uid of the package
8390 optional int32 uid = 2 [(is_uid) = true];
8391
8392 // If the permission is granted to the uid
8393 optional bool is_granted = 3;
8394
8395 // Permission flags as per android.content.pm.PermissionFlags
8396 optional int32 permission_flags = 4;
8397}
8398
Stan Iliev637ba5e2019-08-16 13:43:08 -04008399/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008400 * HWUI stats for a given app.
8401 */
8402message GraphicsStats {
8403 // The package name of the app
8404 optional string package_name = 1;
8405
8406 // The version code of the app
8407 optional int64 version_code = 2;
8408
8409 // The start & end timestamps in UTC as
8410 // milliseconds since January 1, 1970
8411 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008412 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008413
Stan Ilievb6517192020-02-18 10:12:42 -05008414 optional int64 end_millis = 4;
8415
8416 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8417 enum PipelineType {
8418 UNKNOWN = 0;
8419 GL = 1;
8420 VULKAN = 2;
8421 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008422
8423 // HWUI renders pipeline type: GL or Vulkan.
8424 optional PipelineType pipeline = 5;
8425
8426 // Distinct frame count.
8427 optional int32 total_frames = 6;
8428
8429 // Number of "missed vsync" events.
8430 optional int32 missed_vsync_count = 7;
8431
8432 // Number of frames in triple-buffering scenario (high input latency)
8433 optional int32 high_input_latency_count = 8;
8434
8435 // Number of "slow UI thread" events.
8436 optional int32 slow_ui_thread_count = 9;
8437
8438 // Number of "slow bitmap upload" events.
8439 optional int32 slow_bitmap_upload_count = 10;
8440
8441 // Number of "slow draw" events.
8442 optional int32 slow_draw_count = 11;
8443
8444 // Number of frames that missed their deadline (aka, visibly janked)
8445 optional int32 missed_deadline_count = 12;
8446
8447 // The frame time histogram for the package
8448 optional FrameTimingHistogram cpu_histogram = 13
8449 [(android.os.statsd.log_mode) = MODE_BYTES];
8450
8451 // The gpu frame time histogram for the package
8452 optional FrameTimingHistogram gpu_histogram = 14
8453 [(android.os.statsd.log_mode) = MODE_BYTES];
8454
8455 // UI mainline module version.
8456 optional int64 version_ui_module = 15;
8457
8458 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8459 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8460 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8461 // more apps are running / rendering.
8462 optional bool is_today = 16;
8463}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008464
8465/**
8466 * Message related to dangerous (runtime) app ops access
8467 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008468message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008469 // Uid of the package accessing app op
8470 optional int32 uid = 1 [(is_uid) = true];
8471
8472 // Name of the package accessing app op
8473 optional string package_name = 2;
8474
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008475 // operation string id per OPSTR_ constants in AppOpsManager.java
8476 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008477
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008478 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8479 // API.
8480 // Attributions must be provided through manifest using <attribution> tag available in R and
8481 // above.
8482 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008483
8484 // message related to app op access, limited to 600 chars by API
8485 optional string message = 5;
8486
8487 enum SamplingStrategy {
8488 DEFAULT = 0;
8489 UNIFORM = 1;
8490 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008491 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008492 }
8493
8494 // sampling strategy used to collect this message
8495 optional SamplingStrategy sampling_strategy = 6;
8496}
8497
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008498/*
8499 * Logs userspace reboot outcome and duration.
8500 *
8501 * Logged from:
8502 * frameworks/base/core/java/com/android/server/BootReceiver.java
8503 */
8504message UserspaceRebootReported {
8505 // Possible outcomes of userspace reboot.
8506 enum Outcome {
8507 // Default value in case platform failed to determine the outcome.
8508 OUTCOME_UNKNOWN = 0;
8509 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8510 SUCCESS = 1;
8511 // Userspace reboot shutdown sequence was aborted.
8512 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8513 // Remounting userdata into checkpointing mode failed.
8514 FAILED_USERDATA_REMOUNT = 3;
8515 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8516 // reboot.
8517 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8518 }
8519 // Outcome of userspace reboot. Always set.
8520 optional Outcome outcome = 1;
8521 // Duration of userspace reboot in case it has a successful outcome.
8522 // Duration is measured as time between userspace reboot was initiated and until boot completed
8523 // (e.g. sys.boot_completed=1).
8524 optional int64 duration_millis = 2;
8525 // State of primary user's (user0) credential encryption storage.
8526 enum UserEncryptionState {
8527 // Default value.
8528 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8529 // Credential encrypted storage is unlocked.
8530 UNLOCKED = 1;
8531 // Credential encrypted storage is locked.
8532 LOCKED = 2;
8533 }
8534 // State of primary user's encryption storage at the moment boot completed. Always set.
8535 optional UserEncryptionState user_encryption_state = 3;
8536}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008537
8538/*
8539 * Logs integrity check information during each install.
8540 *
8541 * Logged from:
8542 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8543 */
8544message IntegrityCheckResultReported {
8545 optional string package_name = 1;
8546 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008547 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008548 optional string installer_package_name = 4;
8549 enum Response {
8550 UNKNOWN = 0;
8551 ALLOWED = 1;
8552 REJECTED = 2;
8553 FORCE_ALLOWED = 3;
8554 }
8555 optional Response response = 5;
8556 // An estimate on the cause of the response. This will only be populated for
8557 // REJECTED and FORCE_ALLOWED
8558 optional bool caused_by_app_cert_rule = 6;
8559 optional bool caused_by_installer_rule = 7;
8560}
8561
8562/**
8563 * Logs the information about the rules and the provider whenever rules are
8564 * pushed into AppIntegrityManager.
8565 *
8566 * Logged from:
8567 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8568 */
8569message IntegrityRulesPushed {
8570 optional bool success = 1;
8571 // Package name of the app that pushed the rules.
8572 optional string rule_provider = 2;
8573 // Version string of arbitrary format provided by the rule provider to
8574 // identify the rules.
8575 optional string rule_version = 3;
8576}
Jordan Liubedfa702019-12-20 15:08:45 -08008577
8578/**
8579 * Logs when a cell broadcast message is received on the device.
8580 *
8581 * Logged from CellBroadcastService module:
8582 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8583 */
8584message CellBroadcastMessageReported {
8585 // The type of Cell Broadcast message
8586 enum CbType {
8587 UNKNOWN_TYPE = 0;
8588 GSM = 1;
8589 CDMA = 2;
8590 CDMA_SPC = 3;
8591 }
8592
8593 // GSM, CDMA, CDMA-SCP
8594 optional CbType type = 1;
8595}
8596
8597/**
8598 * Logs when an error occurs while handling a cell broadcast message;
8599 *
8600 * Logged from CellBroadcastService module:
8601 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8602 */
8603message CellBroadcastMessageError {
8604 // The type of error raised when trying to handle a cell broadcast message
8605 enum ErrorType {
8606 UNKNOWN_TYPE = 0;
8607 CDMA_DECODING_ERROR = 1;
8608 CDMA_SCP_EMPTY = 2;
8609 CDMA_SCP_HANDLING_ERROR = 3;
8610 GSM_INVALID_HEADER_LENGTH = 4;
8611 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8612 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8613 GSM_INVALID_PDU = 7;
8614 GSM_INVALID_GEO_FENCING_DATA = 8;
8615 GSM_UMTS_INVALID_WAC = 9;
8616 FAILED_TO_INSERT_TO_DB = 10;
8617 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8618 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8619 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8620 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8621 }
8622
8623 // What kind of error occurred
8624 optional ErrorType type = 1;
8625
8626 // Exception message (or log message) associated with the error (max 1000 chars)
8627 optional string exception_message = 2;
8628}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008629
8630/**
8631 * Logs when the SDK Extensions test app has polled the current version.
8632 * This is atom ID 354.
8633 *
8634 * Logged from:
8635 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8636 */
8637message SdkExtensionStatus {
8638 enum ApiCallStatus {
8639 CALL_NOT_ATTEMPTED = 0;
8640 CALL_SUCCESSFUL = 1;
8641 CALL_FAILED = 2;
8642 }
8643
8644 optional ApiCallStatus result = 1;
8645
8646 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8647 optional int32 r_extension_version = 2;
8648
8649 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8650 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8651 optional int32 failed_call_symbol = 3;
8652}
Marco Ballesio497aff42020-01-24 08:39:42 -08008653
8654/**
8655 * Logs when an app is frozen or unfrozen.
8656 *
8657 * Logged from:
8658 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8659 */
8660message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008661 // The type of event.
8662 enum Action {
8663 UNKNOWN = 0;
8664 FREEZE_APP = 1;
8665 UNFREEZE_APP = 2;
8666 }
8667 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008668
Blake Kragten6ce382a2020-01-16 20:20:46 -08008669 // Pid of the process being frozen.
8670 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008671
Blake Kragten6ce382a2020-01-16 20:20:46 -08008672 // Name of the process being frozen.
8673 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008674
Blake Kragten6ce382a2020-01-16 20:20:46 -08008675 // Time since last unfrozen.
8676 optional int64 time_unfrozen_millis = 4;
8677}
8678
8679/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008680 * Pulls information for a single voice call.
8681 *
8682 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8683 *
8684 * Pulled from:
8685 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8686 */
8687message VoiceCallSession {
8688 // Bearer (IMS or CS) when the call started.
8689 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8690
8691 // Bearer (IMS or CS) when the call ended.
8692 // The bearer may change during the call, e.g. due to SRVCC.
8693 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8694
8695 // Direction of the call (incoming or outgoing).
8696 optional android.telephony.CallDirectionEnum direction = 3;
8697
8698 // Time spent setting up the call.
8699 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8700
8701 // Whether the call ended before the setup was completed.
8702 optional bool setup_failed = 5;
8703
8704 // IMS reason code or CS disconnect cause.
8705 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8706 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8707 optional int32 disconnect_reason_code = 6;
8708
8709 // IMS extra code or CS precise disconnect cause.
8710 // For IMS, this code is vendor-specific
8711 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8712 optional int32 disconnect_extra_code = 7;
8713
8714 // IMS extra message or CS vendor cause.
8715 optional string disconnect_extra_message = 8;
8716
8717 // Radio access technology (RAT) used when call started.
8718 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8719
8720 // Radio access technology (RAT) used when call terminated.
8721 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8722
8723 // Number of times RAT changed during the call.
8724 optional int64 rat_switch_count = 11;
8725
8726 // A bitmask of all codecs used during the call.
8727 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8728 optional int64 codec_bitmask = 12;
8729
8730 // Number of other calls going on during call setup, for the same SIM slot.
8731 optional int32 concurrent_call_count_at_start = 13;
8732
8733 // Number of other calls going on during call termination, for the same SIM slot.
8734 optional int32 concurrent_call_count_at_end = 14;
8735
8736 // Index of the SIM is used, 0 for single-SIM devices.
8737 optional int32 sim_slot_index = 15;
8738
8739 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8740 optional bool is_multi_sim = 16;
8741
8742 // Whether the call was made with an eSIM profile.
8743 optional bool is_esim = 17;
8744
8745 // Carrier ID of the SIM card.
8746 // See https://source.android.com/devices/tech/config/carrierid.
8747 optional int32 carrier_id = 18;
8748
8749 // Whether an SRVCC has been completed successfully.
8750 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8751 // events once the call is switched to CS.
8752 optional bool srvcc_completed = 19;
8753
8754 // Number of SRVCC failures.
8755 optional int64 srvcc_failure_count = 20;
8756
8757 // Number of SRVCC cancellations.
8758 optional int64 srvcc_cancellation_count = 21;
8759
8760 // Whether the Real-Time Text (RTT) was ever used in the call.
8761 optional bool rtt_enabled = 22;
8762
8763 // Whether this was an emergency call.
8764 optional bool is_emergency = 23;
8765
8766 // Whether the call was performed while roaming.
8767 optional bool is_roaming = 24;
8768}
8769
8770/**
8771 * Pulls voice call radio access technology (RAT) usage.
8772 *
8773 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8774 * time. The atom will be skipped if not enough data is available.
8775 *
8776 * Pulled from:
8777 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8778 */
8779message VoiceCallRatUsage {
8780 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8781 optional int32 carrier_id = 1;
8782
8783 // Radio access technology.
8784 optional android.telephony.NetworkTypeEnum rat = 2;
8785
8786 // Total duration that voice calls spent on this carrier and RAT.
8787 optional int64 total_duration_seconds = 3;
8788
8789 // Total number of calls using this carrier and RAT.
8790 // A call is counted once even if it used the RAT multiple times.
8791 optional int64 call_count = 4;
8792}
8793
8794/**
8795 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8796 *
8797 * Pulled from:
8798 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8799 */
8800message SimSlotState {
8801 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8802 optional int32 active_slot_count = 1;
8803
8804 // Number of SIM cards (both physical and active eSIM profiles).
8805 // This number is always equal to or less than the number of active SIM slots.
8806 optional int32 sim_count = 2;
8807
8808 // Number of active eSIM profiles.
8809 // This number is always equal to or less than the number of SIMs.
8810 optional int32 esim_count = 3;
8811}
8812
8813/**
8814 * Pulls supported cellular radio access technologies.
8815 *
8816 * This atom reports the capabilities of the device, rather than the network it has access to.
8817 *
8818 * Pulled from:
8819 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8820 */
8821message SupportedRadioAccessFamily {
8822 // A bitmask of supported radio technologies.
8823 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8824 optional int64 network_type_bitmask = 1;
8825}
8826
8827/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008828 * Logs gnss stats from location service provider
8829 *
8830 * Pulled from:
8831 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8832 */
8833
8834message GnssStats {
8835 // Number of location reports since boot
8836 optional int64 location_reports = 1;
8837
8838 // Total pulled reports of Location failures since boot
8839 optional int64 location_failure_reports = 2;
8840
8841 // Number of time to first fix reports since boot
8842 optional int64 time_to_first_fix_reports = 3;
8843
8844 // Total pulled reported time to first fix (in milli-seconds) since boot
8845 optional int64 time_to_first_fix_milli_s = 4;
8846
8847 // Number of position accuracy reports since boot
8848 optional int64 position_accuracy_reports = 5;
8849
8850 // Total pulled reported position accuracy (in meters) since boot
8851 optional int64 position_accuracy_meters = 6;
8852
8853 // Number of top 4 average CN0 reports since boot
8854 optional int64 top_four_average_cn0_reports = 7;
8855
8856 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8857 optional int64 top_four_average_cn0_db_mhz = 8;
8858
8859 // Number of l5 top 4 average CN0 reports since boot
8860 optional int64 l5_top_four_average_cn0_reports = 9;
8861
8862 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8863 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8864
8865 // Total number of sv status messages reports since boot
8866 optional int64 sv_status_reports = 11;
8867
8868 // Total number of sv status messages reports, where sv is used in fix since boot
8869 optional int64 sv_status_reports_used_in_fix = 12;
8870
8871 // Total number of L5 sv status messages reports since boot
8872 optional int64 l5_sv_status_reports = 13;
8873
8874 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8875 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008876}
Kweku Adams12752132020-02-18 15:36:48 -08008877
8878/**
8879 * Logs when an app is moved to a different standby bucket.
8880 *
8881 * Logged from:
8882 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8883 */
8884message AppStandbyBucketChanged {
8885 optional string package_name = 1;
8886
8887 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8888 optional int32 user_id = 2;
8889
8890 // These enum values match the constants defined in UsageStatsManager.java.
8891 enum Bucket {
8892 BUCKET_UNKNOWN = 0;
8893 BUCKET_EXEMPTED = 5;
8894 BUCKET_ACTIVE = 10;
8895 BUCKET_WORKING_SET = 20;
8896 BUCKET_FREQUENT = 30;
8897 BUCKET_RARE = 40;
8898 BUCKET_RESTRICTED = 45;
8899 BUCKET_NEVER = 50;
8900 }
8901 optional Bucket bucket = 3;
8902
8903 enum MainReason {
8904 MAIN_UNKNOWN = 0;
8905 MAIN_DEFAULT = 0x0100;
8906 MAIN_TIMEOUT = 0x0200;
8907 MAIN_USAGE = 0x0300;
8908 MAIN_FORCED_BY_USER = 0x0400;
8909 MAIN_PREDICTED = 0x0500;
8910 MAIN_FORCED_BY_SYSTEM = 0x0600;
8911 }
8912 optional MainReason main_reason = 4;
8913
8914 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8915 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8916 // UsageStatsManager.java.
8917 optional int32 sub_reason = 5;
8918}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05008919
8920/**
8921* Reports a started sharesheet transaction.
8922*
8923* Logged from:
8924* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8925*/
8926message SharesheetStarted {
8927 // The event_id (as for UiEventReported).
8928 optional int32 event_id = 1;
8929 // The calling app's package name.
8930 optional string package_name = 2;
8931 // An identifier to tie together multiple logs relating to the same share event
8932 optional int32 instance_id = 3;
8933 // The mime type of the share
8934 optional string mime_type = 4;
8935 // The number of direct targets the calling app is providing that will be shown.
8936 optional int32 num_app_provided_direct_targets = 5;
8937 // The number of app targets the calling app is providing that will be shown.
8938 optional int32 num_app_provided_app_targets = 6;
8939 // True if the share originates from the workprofile
8940 optional bool is_workprofile = 7;
8941
8942 enum SharesheetPreviewType { // Constants from ChooserActivity.java
8943 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
8944 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
8945 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
8946 }
8947 // How the sharesheet preview is presented.
8948 optional SharesheetPreviewType previewType = 8;
8949
8950 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
8951 INTENT_DEFAULT = 0;
8952 INTENT_ACTION_VIEW = 1;
8953 INTENT_ACTION_EDIT = 2;
8954 INTENT_ACTION_SEND = 3;
8955 INTENT_ACTION_SENDTO = 4;
8956 INTENT_ACTION_SEND_MULTIPLE = 5;
8957 INTENT_ACTION_IMAGE_CAPTURE = 6;
8958 INTENT_ACTION_MAIN = 7;
8959 }
8960 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
8961 optional ResolverActivityIntent intentType = 9;
8962}
8963
8964/**
8965 * Reports a ranking selection event.
8966 *
8967 * Logged from:
8968 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
8969 */
8970message RankingSelected {
8971 // The event_id (as for UiEventReported).
8972 optional int32 event_id = 1;
8973 // The relevant app's package name (can be source or picked package).
8974 optional string package_name = 2;
8975 // An identifier to tie together multiple logs relating to the same share event.
8976 optional int32 instance_id = 3;
8977 // Which of the ranked targets got picked, default starting position 0.
8978 optional int32 position_picked = 4;
8979}