blob: 257554207ef5d0a10a8e478d52ee5faa2b5b7b4c [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080082 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 SensorStateChanged sensor_state_changed = 5 [(module) = "framework"];
85 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
86 SyncStateChanged sync_state_changed = 7 [(module) = "framework"];
87 ScheduledJobStateChanged scheduled_job_state_changed = 8 [(module) = "framework"];
88 ScreenBrightnessChanged screen_brightness_changed = 9 [(module) = "framework"];
89 WakelockStateChanged wakelock_state_changed = 10 [(module) = "framework"];
90 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
91 11 [(module) = "framework"];
92 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
93 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
94 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
95 14 [(module) = "framework"];
96 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
97 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
98 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
99 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800100 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20 [(module) = "framework"];
102 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
103 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
104 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
105 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
106 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
107 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
108 UidProcessStateChanged uid_process_state_changed = 27 [(module) = "framework"];
109 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28 [(module) = "framework"];
110 ScreenStateChanged screen_state_changed = 29 [(module) = "framework"];
111 BatteryLevelChanged battery_level_changed = 30 [(module) = "framework"];
112 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
113 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
114 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800115 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
117 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800118 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
119 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
120 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
122 SettingChanged setting_changed = 41 [(module) = "framework"];
123 ActivityForegroundStateChanged activity_foreground_state_changed =
124 42 [(module) = "framework"];
125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework"];
126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Bookatz8fcd09a2017-12-18 13:01:10 -0800128 AnomalyDetected anomaly_detected = 46;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800130 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
132 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
133 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800134 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800136 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800137 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
139 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800140 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
143 ForegroundServiceStateChanged foreground_service_state_changed
144 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800145 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800146 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
147 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
148 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppDied app_died = 65 [(module) = "framework"];
150 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
151 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800152 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
153 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
155 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800156 SpeakerImpedanceReported speaker_impedance_reported = 71;
157 HardwareFailed hardware_failed = 72;
158 PhysicalDropDetected physical_drop_detected = 73;
159 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800160 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
161 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
163 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework"];
164 ANROccurred anr_occurred = 79 [(module) = "framework"];
165 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
166 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700167 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 KeyValuePairsAtom key_value_pairs_atom =
169 83 [(allow_from_any_uid) = true, (module) = "framework"];
170 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
171 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700172 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
174 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
175 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
176 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700177 BatteryHealthSnapshot battery_health_snapshot = 91;
178 SlowIo slow_io = 92;
179 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
181 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100182 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800183 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700185 // TODO: service state change is very noisy shortly after boot, as well
186 // as at other transitions - coming out of doze, device plugged in, etc.
187 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
189 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
190 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800193 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
194 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
195 105 [(module) = "docsui"];
196 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
197 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
198 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
199 108 [(module) = "docsui"];
200 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
201 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
202 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800205 WifiRunningStateChanged wifi_running_state_changed = 114
206 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800210 117 [(module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
214 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
216 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
217 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
219 125 [(module) = "bluetooth"];
220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
221 126 [(module) = "bluetooth"];
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
223 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
228 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800230 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
231 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
232 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
234 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800236 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
237 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
239 142 [(module) = "framework"];
240 AttentionManagerServiceResultReported attention_manager_service_result_reported =
241 143 [(module) = "framework"];
242 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"];
246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
247 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800248 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800249 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
250 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800251 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
252 151 [(module) = "bluetooth"];
253 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
254 152 [(module) = "bluetooth"];
255 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
256 153 [(module) = "bluetooth"];
257 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
258 154 [(module) = "bluetooth"];
259 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
260 155 [(module) = "bluetooth"];
261 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
262 156 [(module) = "bluetooth"];
263 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
264 157 [(module) = "bluetooth"];
265 BluetoothDeviceFailedContactCounterReported
266 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
267 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
268 159 [(module) = "bluetooth"];
269 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
270 160 [(module) = "bluetooth"];
271 BluetoothQualityReportReported bluetooth_quality_report_reported =
272 161 [(module) = "bluetooth"];
273 BluetoothDeviceInfoReported bluetooth_device_info_reported =
274 162 [(module) = "bluetooth"];
275 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
276 163 [(module) = "bluetooth"];
277 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
278 164 [(module) = "bluetooth"];
279 BluetoothBondStateChanged bluetooth_bond_state_changed =
280 165 [(module) = "bluetooth"];
281 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
282 166 [(module) = "bluetooth"];
283 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
284 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800285 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
286 168 [(module) = "framework"];
287 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700288 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800289 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800290 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800291 DeviceIdentifierAccessDenied device_identifier_access_denied =
292 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800293 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800294 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
295 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
296 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800297 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
298 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800299 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700300 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800301 180 [(module) = "permissioncontroller"];
302 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
303 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
306 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
307 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
308 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800309 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
310 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700311 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 188 [(module) = "intelligence"];
313 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
314 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800315 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800317 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
318 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
319 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
320 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
321 MediametricsCodecReported mediametrics_codec_reported = 195;
322 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
323 MediametricsExtractorReported mediametrics_extractor_reported = 197;
324 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
325 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
326 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700327 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800328 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
329 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800330 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
332 206 [(module) = "framework"];
333 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
334 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
335 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
336 LocationManagerApiUsageReported location_manager_api_usage_reported =
337 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100338 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800339 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100340 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800341 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100342 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800343 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100344 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800345 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100346 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800347 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100348 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800349 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100350 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100352 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800354 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
355 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
356 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
357 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800359 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700360 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
361 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100363 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800365 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800366 VmsClientConnectionStateChanged vms_client_connection_state_changed =
367 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800368 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
369 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700370 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 235 [(module) = "mediaprovider"];
372 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700373 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
376 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
377 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
378 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800379 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800380 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000381 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800382 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman079fdaa2020-01-12 16:45:03 -0500383 NotificationPanelReported notification_panel_reported = 245;
Will Brockman492be332020-02-12 16:46:04 -0500384 NotificationChannelModified notification_channel_modified = 246;
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800385 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
386 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800387 CellBroadcastMessageReported cb_message_reported =
388 249 [(module) = "cellbroadcast"];
389 CellBroadcastMessageError cb_message_error =
390 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700391 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
392 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
393 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800394 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000395 SnapshotMergeReported snapshot_merge_reported = 255;
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000396 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000397 }
David Chenc8a43242017-10-17 16:23:28 -0700398
David Chen6e3e6cb2018-01-03 16:14:06 -0800399 // Pulled events will start at field 10000.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000400 // Next: 10076
David Chenc8a43242017-10-17 16:23:28 -0700401 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800402 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
403 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
404 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
405 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
406 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
407 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800408 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800409 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
410 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
411 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
412 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
413 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
414 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
415 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
416 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
417 SystemUptime system_uptime = 10015 [(module) = "framework"];
418 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
419 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000420 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800421 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
422 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800423 Temperature temperature = 10021 [(module) = "framework"];
424 BinderCalls binder_calls = 10022 [(module) = "framework"];
425 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
426 LooperStats looper_stats = 10024 [(module) = "framework"];
427 DiskStats disk_stats = 10025 [(module) = "framework"];
428 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
429 AppSize app_size = 10027 [(module) = "framework"];
430 CategorySize category_size = 10028 [(module) = "framework"];
431 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800432 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
434 DiskIo disk_io = 10032 [(module) = "framework"];
435 PowerProfile power_profile = 10033 [(module) = "framework"];
436 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
437 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
438 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700439 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800440 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
441 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
442 10040 [(module) = "framework"];
443 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
444 10041 [(module) = "framework"];
445 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800446 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800447 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800448 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800449 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
450 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
451 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
452 RoleHolder role_holder = 10049 [(module) = "framework"];
453 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800454 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
456 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800457 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
458 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
460 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
461 FaceSettings face_settings = 10058 [(module) = "framework"];
462 CoolingDevice cooling_device = 10059 [(module) = "framework"];
463 AppOps app_ops = 10060 [(module) = "framework"];
464 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700465 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
466 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800468 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
470 DangerousPermissionStateSampled dangerous_permission_state_sampled =
471 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400472 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000473 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000474 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200475 PackageNotificationPreferences package_notification_preferences =
476 10071 [(module) = "framework"];
477 PackageNotificationChannelPreferences package_notification_channel_preferences =
478 10072 [(module) = "framework"];
479 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
480 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800481 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000482 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700483 }
yroa1fe77c2018-02-26 14:22:54 -0800484
Bookatz76aafcf2018-09-17 16:17:10 -0700485 // DO NOT USE field numbers above 100,000 in AOSP.
486 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
487 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100488
489 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700490}
491
Yao Chend54f9dd2017-10-17 17:37:48 +0000492/**
Yangster-mac20877162017-12-22 17:19:39 -0800493 * This proto represents a node of an attribution chain.
494 * Note: All attribution chains are represented as a repeated field of type
495 * AttributionNode. It is understood that in such arrays, the order is that
496 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000497 */
Yangster-mac20877162017-12-22 17:19:39 -0800498message AttributionNode {
499 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800500 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800501
Yangster-mac20877162017-12-22 17:19:39 -0800502 // The (optional) string tag for an element in the attribution chain. If the
503 // element has no tag, it is encoded as an empty string.
504 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700505}
506
Yangster-mac48b3d622018-08-18 12:38:11 -0700507message KeyValuePair {
508 optional int32 key = 1;
509 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700510 int32 value_int = 2;
511 int64 value_long = 3;
512 string value_str = 4;
513 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700514 }
515}
516
517message KeyValuePairsAtom {
518 optional int32 uid = 1;
519 repeated KeyValuePair pairs = 2;
520}
521
Yao Chend54f9dd2017-10-17 17:37:48 +0000522/*
523 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800524 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000525 *
526 * RULES:
527 * - The field ids for each atom must start at 1, and count upwards by 1.
528 * Skipping field ids is not allowed.
529 * - These form an API, so renaming, renumbering or removing fields is
530 * not allowed between android releases. (This is not currently enforced,
531 * but there will be a tool to enforce this restriction).
532 * - The types must be built-in protocol buffer types, namely, no sub-messages
533 * are allowed (yet). The bytes type is also not allowed.
534 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800535 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000536 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800537 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000538 * - A field that is a uid should be a string field, tagged with the [xxx]
539 * annotation. The generated code on android will be represented by UIDs,
540 * and those UIDs will be translated in xxx to those strings.
541 *
542 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700543 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000544 * - If there is a UID, it goes first. Think in an object-oriented fashion.
545 * *****************************************************************************
546 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700547
Yao Chend54f9dd2017-10-17 17:37:48 +0000548/**
Tej Singha72344992019-04-17 18:55:08 -0700549 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700550 * Logs when the Thermal service HAL notifies the throttling start/stop events.
551 *
552 * Logged from:
553 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
554 */
555message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700556 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700557 optional android.os.TemperatureTypeEnum sensor_type = 1;
558
Maggie White442b6312019-04-05 16:26:44 -0700559 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700560 enum State {
561 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700562 START = 1; // START indicated that throttling was triggered.
563 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700564 }
Yangster-mace16189a2018-08-26 12:20:16 -0700565 optional State state = 2;
566
567 optional float temperature = 3;
568}
569
570/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000571 * Logs when the screen state changes.
572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
575 */
576message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800577 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800578 optional android.view.DisplayStateEnum state = 1
579 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700580}
Yao Chend54f9dd2017-10-17 17:37:48 +0000581
582/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700583 * Logs that the process state of the uid, as determined by ActivityManager
584 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000585 *
586 * Logged from:
587 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
588 */
Bookatzc1a050a2017-10-10 15:49:28 -0700589message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800590 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000591
Bookatzdb026a22018-01-10 19:01:56 -0800592 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800593 optional android.app.ProcessStateEnum state = 2
594 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000595}
596
597/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700598 * Logs process state change of a process, as per the activity manager.
599 *
600 * Logged from:
601 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
602 */
603message ProcessStateChanged {
604 optional int32 uid = 1;
605 optional string process_name = 2;
606 optional string package_name = 3;
607 // TODO: remove this when validation is done
608 optional int64 version = 5;
609 // The state, from frameworks/base/core/proto/android/app/enums.proto.
610 optional android.app.ProcessStateEnum state = 4;
611}
612
613/**
614 * Logs when ActivityManagerService sleep state is changed.
615 *
616 * Logged from:
617 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
618 */
619message ActivityManagerSleepStateChanged {
620 // TODO: import frameworks proto
621 enum State {
622 UNKNOWN = 0;
623 ASLEEP = 1;
624 AWAKE = 2;
625 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800626 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700627}
628
629/**
630 * Logs when system memory state changes.
631 *
632 * Logged from:
633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
634 */
635message MemoryFactorStateChanged {
636 // TODO: import frameworks proto
637 enum State {
638 MEMORY_UNKNOWN = 0;
639 NORMAL = 1; // normal.
640 MODERATE = 2; // moderate memory pressure.
641 LOW = 3; // low memory.
642 CRITICAL = 4; // critical memory.
643
644 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800645 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700646}
647
648/**
649 * Logs when app is using too much cpu, according to ActivityManagerService.
650 *
651 * Logged from:
652 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
653 */
654message ExcessiveCpuUsageReported {
655 optional int32 uid = 1;
656 optional string process_name = 2;
657 optional string package_name = 3;
658 // package version. TODO: remove this when validation is done
659 optional int64 version = 4;
660}
661
662/**
663 * Logs when a cached process is killed, along with its pss.
664 *
665 * Logged from:
666 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
667 */
668message CachedKillReported {
669 optional int32 uid = 1;
670 optional string process_name = 2;
671 optional string package_name = 3;
672 // TODO: remove this when validation is done
673 optional int64 version = 5;
674 optional int64 pss = 4;
675}
676
677/**
xshu2c3d9e42019-09-26 17:54:02 -0700678 * Logs the change in wifi health.
679 *
680 * Logged from:
681 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
682 */
683message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800684 enum Band {
685 UNKNOWN = 0;
686 // All of 2.4GHz band
687 BAND_2G = 1;
688 // Frequencies in the range of [5150, 5250) GHz
689 BAND_5G_LOW = 2;
690 // Frequencies in the range of [5250, 5725) GHz
691 BAND_5G_MIDDLE = 3;
692 // Frequencies in the range of [5725, 5850) GHz
693 BAND_5G_HIGH = 4;
694 // Frequencies in the range of [5925, 6425) GHz
695 BAND_6G_LOW = 5;
696 // Frequencies in the range of [6425, 6875) GHz
697 BAND_6G_MIDDLE = 6;
698 // Frequencies in the range of [6875, 7125) GHz
699 BAND_6G_HIGH = 7;
700 }
xshu2c3d9e42019-09-26 17:54:02 -0700701 // duration this stat is obtained over in milliseconds
702 optional int32 duration_millis = 1;
703 // whether wifi is classified as sufficient for the user's data traffic, determined
704 // by whether the calculated throughput exceeds the average demand within |duration_millis|
705 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700706 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800707 optional bool is_cell_data_available = 3;
708 // the Band bucket the connected network is on
709 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700710}
711
712/**
713 * Logged when wifi detects a significant change in connection failure rate.
714 *
715 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
716 *
717 */
718message WifiFailureStatReported {
719 enum AbnormalityType {
720 UNKNOWN = 0;
721 SIGNIFICANT_INCREASE = 1;
722 SIGNIFICANT_DECREASE = 2;
723 SIMPLY_HIGH = 3;
724 }
725 enum FailureType {
726 FAILURE_UNKNOWN = 0;
727 FAILURE_CONNECTION = 1;
728 FAILURE_ASSOCIATION_REJECTION = 2;
729 FAILURE_ASSOCIATION_TIMEOUT = 3;
730 FAILURE_AUTHENTICATION = 4;
731 FAILURE_NON_LOCAL_DISCONNECTION = 5;
732 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
733 }
734 // Reason for uploading this stat
735 optional AbnormalityType abnormality_type = 1;
736 // The particular type of failure
737 optional FailureType failure_type = 2;
738 // How many times we have encountered this combination of AbnormalityType and FailureType
739 optional int32 failure_count = 3;
740}
741
742/**
743 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
744 *
745 * Logged from:
746 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
747 */
748message WifiConnectionResultReported {
749 enum FailureCode {
750 FAILURE_UNKNOWN = 0;
751 FAILURE_ASSOCIATION_TIMEOUT = 1;
752 FAILURE_ASSOCIATION_REJECTION = 2;
753 FAILURE_AUTHENTICATION_GENERAL = 3;
754 FAILURE_AUTHENTICATION_EAP = 4;
755 FAILURE_DHCP = 5;
756 FAILURE_NETWORK_DISCONNECTION = 6;
757 FAILURE_ROAM_TIMEOUT = 7;
758 }
759 // true represents a successful connection
760 optional bool connection_result = 1;
761 // reason for the connection failure
762 optional FailureCode failure_code = 2;
763 // scan rssi before the connection attempt
764 optional int32 rssi = 3;
765}
766
767/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700768 * Logs when memory stats of a process is reported.
769 *
770 * Logged from:
771 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
772 */
773message ProcessMemoryStatReported {
774 optional int32 uid = 1;
775 optional string process_name = 2;
776 optional string package_name = 3;
777 //TODO: remove this when validation is done
778 optional int64 version = 9;
779 optional int64 pss = 4;
780 optional int64 uss = 5;
781 optional int64 rss = 6;
782 enum Type {
783 ADD_PSS_INTERNAL_SINGLE = 0;
784 ADD_PSS_INTERNAL_ALL_MEM = 1;
785 ADD_PSS_INTERNAL_ALL_POLL = 2;
786 ADD_PSS_EXTERNAL = 3;
787 ADD_PSS_EXTERNAL_SLOW = 4;
788 }
789 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800790 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700791}
792
793/**
Bookatzc1a050a2017-10-10 15:49:28 -0700794 * Logs that a process started, finished, crashed, or ANRed.
795 *
796 * Logged from:
797 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
798 */
799message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700800 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700801
David Chen0b5c90c2018-01-25 16:51:49 -0800802 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800803 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700804
Bookatzddccf0a2017-11-28 16:48:14 -0800805 // What lifecycle state the process changed to.
806 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800807 enum State {
808 FINISHED = 0;
809 STARTED = 1;
810 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800811 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800812 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700813}
814
Bookatzc1a050a2017-10-10 15:49:28 -0700815/**
816 * Logs when the ble scan state changes.
817 *
818 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700819 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700820 */
821message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800822 repeated AttributionNode attribution_node = 1
823 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700824
825 enum State {
826 OFF = 0;
827 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700828 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
829 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700830 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800831 optional State state = 2 [
832 (state_field_option).option = EXCLUSIVE_STATE,
833 (state_field_option).default_state_value = 0 /* State.OFF */,
834 (state_field_option).reset_state_value = 2 /* State.RESET */,
835 (state_field_option).nested = true
836 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700837
Bookatze5ec0b42018-03-26 13:34:56 -0700838 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800839 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700840 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800841 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700842 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800843 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700844}
845
846/**
847 * Logs reporting of a ble scan finding results.
848 *
849 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700850 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700851 */
Bookatzae6738e2018-09-13 11:38:56 -0700852// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700853message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800854 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800857 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700858}
859
860/**
861 * Logs when a sensor state changes.
862 *
863 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700864 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700865 */
866message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800867 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700868
Bookatzc1a050a2017-10-10 15:49:28 -0700869 // The id (int) of the sensor.
870 optional int32 sensor_id = 2;
871
872 enum State {
873 OFF = 0;
874 ON = 1;
875 }
876 optional State state = 3;
877}
878
Bookatzc1a050a2017-10-10 15:49:28 -0700879/**
880 * Logs when GPS state changes.
881 *
882 * Logged from:
883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
884 */
885message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800886 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700887
888 enum State {
889 OFF = 0;
890 ON = 1;
891 }
892 optional State state = 2;
893}
894
Bookatz48d362e2018-11-06 15:49:08 -0800895/**
896 * Logs when GPS signal quality.
897 *
898 * Logged from:
899 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
900 */
901message GpsSignalQualityChanged {
902 optional android.server.location.GpsSignalQualityEnum level = 1;
903}
904
Bookatzc1a050a2017-10-10 15:49:28 -0700905
906/**
907 * Logs when a sync manager sync state changes.
908 *
909 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700910 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700911 */
912message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
David Chen0b5c90c2018-01-25 16:51:49 -0800915 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800916 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700917
918 enum State {
919 OFF = 0;
920 ON = 1;
921 }
922 optional State state = 3;
923}
924
Yangster-mac96353002018-09-05 11:18:55 -0700925/*
926 * Deferred job stats.
927 *
928 * Logged from:
929 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
930*/
931message DeferredJobStatsReported {
932 repeated AttributionNode attribution_node = 1;
933
934 // Number of jobs deferred.
935 optional int32 num_jobs_deferred = 2;
936
937 // Time since the last job runs.
938 optional int64 time_since_last_job_millis = 3;
939}
940
Bookatzc1a050a2017-10-10 15:49:28 -0700941/**
942 * Logs when a job scheduler job state changes.
943 *
944 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700945 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700946 */
947message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800948 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700949
950 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800951 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700952
953 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800954 FINISHED = 0;
955 STARTED = 1;
956 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700957 }
958 optional State state = 3;
959
Tej Singh33a412b2018-03-16 18:43:59 -0700960 // The reason a job has stopped.
961 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700962 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700963 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100964
965 // The standby bucket of the app that scheduled the job. These match the framework constants
966 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
967 // already assigned 0.
968 enum Bucket {
969 UNKNOWN = -1;
970 ACTIVE = 0;
971 WORKING_SET = 1;
972 FREQUENT = 2;
973 RARE = 3;
974 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800975 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100976 }
977 optional Bucket standby_bucket = 5 [default = UNKNOWN];
978
979 // The job id (as assigned by the app).
980 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700981}
982
983/**
984 * Logs when the audio state changes.
985 *
986 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700987 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700988 */
989message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700991
992 enum State {
993 OFF = 0;
994 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700995 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
996 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700997 }
998 optional State state = 2;
999}
1000
1001/**
1002 * Logs when the video codec state changes.
1003 *
1004 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001005 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001006 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001007message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001008 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001009
1010 enum State {
1011 OFF = 0;
1012 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001013 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1014 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001015 }
1016 optional State state = 2;
1017}
1018
1019/**
1020 * Logs when the flashlight state changes.
1021 *
1022 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001023 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001024 */
1025message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001026 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001027
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001031 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1032 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001033 }
1034 optional State state = 2;
1035}
1036
1037/**
1038 * Logs when the camera state changes.
1039 *
1040 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001041 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001042 */
1043message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001044 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001045
1046 enum State {
1047 OFF = 0;
1048 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001049 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1050 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001051 }
1052 optional State state = 2;
1053}
1054
1055/**
1056 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001057 *
1058 * Logged from:
1059 * TODO
1060 */
Bookatzd6746242017-10-24 18:39:35 -07001061message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001062 repeated AttributionNode attribution_node = 1
1063 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001064
Bookatz1a1b0462018-01-12 11:47:03 -08001065 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1066 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001067 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001068 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001071 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001072
1073 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001074 RELEASE = 0;
1075 ACQUIRE = 1;
1076 CHANGE_RELEASE = 2;
1077 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001078 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001079 optional State state = 4 [
1080 (state_field_option).option = EXCLUSIVE_STATE,
1081 (state_field_option).default_state_value = 0,
1082 (state_field_option).nested = true
1083 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001084}
1085
1086/**
Bookatzc1a050a2017-10-10 15:49:28 -07001087 * Logs when a partial wakelock is considered 'long' (over 1 min).
1088 *
1089 * Logged from:
1090 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1091 */
1092message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001093 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001094
Yao Chend54f9dd2017-10-17 17:37:48 +00001095 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1096 optional string tag = 2;
1097
Bookatzc1a050a2017-10-10 15:49:28 -07001098 // TODO: I have no idea what this is.
1099 optional string history_tag = 3;
1100
1101 enum State {
1102 OFF = 0;
1103 ON = 1;
1104 }
1105 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001106}
1107
Bookatzc1a050a2017-10-10 15:49:28 -07001108/**
Bookatza66083f2018-09-20 17:24:00 -07001109 * Logs when the device is interactive, according to the PowerManager Notifier.
1110 *
1111 * Logged from:
1112 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1113 */
1114message InteractiveStateChanged {
1115 enum State {
1116 OFF = 0;
1117 ON = 1;
1118 }
1119 optional State state = 1;
1120}
1121
1122/**
Bookatzc1a050a2017-10-10 15:49:28 -07001123 * Logs Battery Saver state change.
1124 *
1125 * Logged from:
1126 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1127 */
1128message BatterySaverModeStateChanged {
1129 enum State {
1130 OFF = 0;
1131 ON = 1;
1132 }
1133 optional State state = 1;
1134}
1135
1136/**
1137 * Logs Doze mode state change.
1138 *
1139 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001140 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001141 */
1142message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001143 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001144}
1145
1146
1147/**
1148 * Logs state change of Doze mode including maintenance windows.
1149 *
1150 * Logged from:
1151 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1152 */
1153message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001154 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001155}
1156
1157/**
1158 * Logs screen brightness level.
1159 *
1160 * Logged from:
1161 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1162 */
1163message ScreenBrightnessChanged {
1164 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1165 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001166}
1167
1168/**
1169 * Logs battery level (percent full, from 0 to 100).
1170 *
1171 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001173 */
1174message BatteryLevelChanged {
1175 // Battery level. Should be in [0, 100].
1176 optional int32 battery_level = 1;
1177}
1178
1179/**
1180 * Logs change in charging status of the device.
1181 *
1182 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001183 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001184 */
1185message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001186 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1187 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001188}
1189
1190/**
1191 * Logs whether the device is plugged in, and what power source it is using.
1192 *
1193 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001194 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001195 */
1196message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001197 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1198 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001199}
1200
Bookatz8c6571b2017-10-24 15:04:41 -07001201/**
1202 * Logs when an app's wakeup alarm fires.
1203 *
1204 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001205 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001206 */
1207message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001208 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001209
1210 // Name of the wakeup alarm.
1211 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001212
1213 // Name of source package (for historical reasons, since BatteryStats tracked it).
1214 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001215
1216 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1217 enum Bucket {
1218 UNKNOWN = 0;
1219 EXEMPTED = 5;
1220 ACTIVE = 10;
1221 WORKING_SET = 20;
1222 FREQUENT = 30;
1223 RARE = 40;
1224 NEVER = 50;
1225 }
1226 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1227 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001228}
1229
1230/**
1231 * Logs when an an app causes the mobile radio to change state.
1232 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1233 *
1234 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001235 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001236 */
1237message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001238 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001239
Bookatz1a1b0462018-01-12 11:47:03 -08001240 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1241 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001242}
1243
1244/**
1245 * Logs when an an app causes the wifi radio to change state.
1246 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1247 *
1248 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001249 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001250 */
1251message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001252 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001253
Bookatz1a1b0462018-01-12 11:47:03 -08001254 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1255 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001256}
1257
1258/**
1259 * Logs kernel wakeup reasons and aborts.
1260 *
1261 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001262 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001263 */
1264message KernelWakeupReported {
1265 // Name of the kernel wakeup reason (or abort).
1266 optional string wakeup_reason_name = 1;
1267
1268 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001269 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001270}
1271
1272/**
Bookatzda1798c2018-12-13 14:16:00 -08001273 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001274 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001275 *
1276 * Logged from:
1277 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1278 */
1279message WifiEnabledStateChanged {
1280 enum State {
1281 OFF = 0;
1282 ON = 1;
1283 }
1284 optional State state = 1;
1285}
1286
1287/**
tsaichristinececebdc2020-02-04 14:05:56 -08001288 * This atom is deprecated starting in R.
1289 *
Bookatzda1798c2018-12-13 14:16:00 -08001290 * 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 -08001291 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1292 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001293 *
1294 * Logged from:
1295 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1296 */
1297message WifiRunningStateChanged {
1298 repeated AttributionNode attribution_node = 1;
1299
1300 enum State {
1301 OFF = 0;
1302 ON = 1;
1303 }
1304 optional State state = 2;
1305}
1306
1307/**
Bookatze5885242017-10-24 20:10:31 -07001308 * Logs wifi locks held by an app.
1309 *
1310 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001311 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001312 */
1313message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001314 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001315
1316 enum State {
1317 OFF = 0;
1318 ON = 1;
1319 }
1320 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001321
1322 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1323 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001324}
1325
1326/**
1327 * Logs wifi signal strength changes.
1328 *
1329 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001330 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001331 */
1332message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001333 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1334 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001335}
1336
1337/**
1338 * Logs wifi scans performed by an app.
1339 *
1340 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001341 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001342 */
1343message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001344 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001345
1346 enum State {
1347 OFF = 0;
1348 ON = 1;
1349 }
1350 optional State state = 2;
1351}
1352
1353/**
Tej Singh4503e102018-01-04 14:35:01 -08001354 * Logs wifi multicast locks held by an app
1355 *
1356 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001357 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001358 */
1359message WifiMulticastLockStateChanged {
1360 repeated AttributionNode attribution_node = 1;
1361
1362 enum State {
1363 OFF = 0;
1364 ON = 1;
1365 }
1366 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001367
1368 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001369}
1370
1371/**
Tej Singh1ea42892018-01-19 09:27:00 -08001372 * Logs shutdown reason and duration on next boot.
1373 *
1374 * Logged from:
1375 * frameworks/base/core/java/com/android/server/BootReceiver.java
1376 */
1377message ShutdownSequenceReported {
1378 // True if shutdown is for a reboot. Default: false if we do not know.
1379 optional bool reboot = 1;
1380
1381 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1382 optional string reason = 2;
1383
1384 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1385 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001386 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001387
1388 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001389 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001390}
1391
Tej Singh6483ea42018-01-25 17:45:49 -08001392
1393/**
1394 * Logs boot reason and duration.
1395 *
1396 * Logged from:
1397 * system/core/bootstat/bootstat.cpp
1398 */
1399message BootSequenceReported {
1400 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1401 // Default: "<EMPTY>" if not available.
1402 optional string bootloader_reason = 1;
1403
1404 // Reason for system boot. Eg. bootloader, reboot,userrequested
1405 // Default: "<EMPTY>" if not available.
1406 optional string system_reason = 2;
1407
1408 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001409 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001410
1411 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001412 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001413
1414 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001415 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001416
1417 // Time since last boot in ms. Default: 0 if not available.
1418 optional int64 time_since_last_boot = 6;
1419}
1420
Tej Singhc477d9c2018-02-05 18:31:39 -08001421
1422/**
1423 * Logs call state and disconnect cause (if applicable).
1424 *
1425 * Logged from:
1426 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1427 */
1428message CallStateChanged {
1429 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1430 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1431 optional android.telecom.CallStateEnum call_state = 1;
1432
1433 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1434 // This value is only applicable when the call_state is DISCONNECTED, and
1435 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1436 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1437 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1438
1439 // True if the call is self-managed, which are apps that use the
1440 // telecom infrastructure to make their own calls.
1441 optional bool self_managed = 3;
1442
1443 // True if call is external. External calls are calls on connected Wear
1444 // devices but show up in Telecom so the user can pull them onto the device.
1445 optional bool external_call = 4;
1446}
1447
Tej Singh1ea42892018-01-19 09:27:00 -08001448/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001449 * Logs keyguard state. The keyguard is the lock screen.
1450 *
1451 * Logged from:
1452 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1453 */
1454message KeyguardStateChanged {
1455 enum State {
1456 UNKNOWN = 0;
1457 // The keyguard is hidden when the phone is unlocked.
1458 HIDDEN = 1;
1459 // The keyguard is shown when the phone is locked (screen turns off).
1460 SHOWN= 2;
1461 // The keyguard is occluded when something is overlaying the keyguard.
1462 // Eg. Opening the camera while on the lock screen.
1463 OCCLUDED = 3;
1464 }
1465 optional State state = 1;
1466}
1467
1468/**
1469 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1470 * prompts the user to enter a password (pattern, pin, etc).
1471 *
1472 * Logged from:
1473 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1474 */
1475
1476message KeyguardBouncerStateChanged {
1477 enum State {
1478 UNKNOWN = 0;
1479 // Bouncer is hidden, either as a result of successfully entering the
1480 // password, screen timing out, or user going back to lock screen.
1481 HIDDEN = 1;
1482 // This is when the user is being prompted to enter the password.
1483 SHOWN = 2;
1484 }
1485 optional State state = 1;
1486}
1487
1488/**
1489 * Logs the result of entering a password into the keyguard bouncer.
1490 *
1491 * Logged from:
1492 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1493 */
1494message KeyguardBouncerPasswordEntered {
1495 enum BouncerResult {
1496 UNKNOWN = 0;
1497 // The password entered was incorrect.
1498 FAILURE = 1;
1499 // The password entered was correct.
1500 SUCCESS = 2;
1501 }
1502 optional BouncerResult result = 1;
1503}
1504
Tej Singha883b372018-02-15 11:30:01 -08001505/*
1506 * Logs changes to the configuration of the device. The configuration is defined
1507 * in frameworks/base/core/java/android/content/res/Configuration.java
1508 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1509 * Please go there to interpret the possible values each field can be.
1510 *
1511 * Logged from:
1512 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1513 */
1514message ResourceConfigurationChanged {
1515 // Bit mask of color capabilities of the screen.
1516 // Contains information about the color gamut and hdr mode of the screen.
1517 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001518 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001519
1520 // The target screen density being rendered to.
1521 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001522 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001523
1524 // Current user preference for the scaling factor for fonts,
1525 // relative to the base density scaling.
1526 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001527 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001528
1529 // Flag indicating whether the hard keyboard is hidden.
1530 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001531 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001532
1533 // The type of keyboard attached to the device.
1534 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1535 optional int32 keyboard = 5;
1536
1537 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1538 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001539 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001540
1541 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1542 // 0 if undefined.
1543 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1544 optional int32 mcc = 7;
1545
1546 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1547 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1548 // MNC_ZERO symbol defined in Configuration.java.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1550 optional int32 mnc = 8;
1551
1552 // The kind of navigation available on the device.
1553 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1554 optional int32 navigation = 9;
1555
1556 // Flag indicating whether the navigation is available.
1557 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001558 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001559
1560 // Overall orientation of the screen.
1561 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1562 optional int32 orientation = 11;
1563
1564 // The current height of the available screen space, in dp units.
1565 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001566 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001567
1568 // Bit mask of overall layout of the screen.
1569 // Contains information about screen size, whether the screen is wider/taller
1570 // than normal, whether the screen layout is right-tl-left or left-to-right,
1571 // and whether the screen has a rounded shape.
1572 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001573 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001574
1575 // Current width of the available screen space, in dp units.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001578
1579 // The smallest screen size an application will see in normal operation.
1580 // This is the smallest value of both screenWidthDp and screenHeightDp
1581 // in portrait and landscape.
1582 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001583 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001584
1585 // The type of touch screen attached to the device.
1586 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1587 optional int32 touchscreen = 16;
1588
1589 // Bit mask of the ui mode.
1590 // Contains information about the overall ui mode of the device.
1591 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1592 // Also contains information about whether the device is in night mode.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001594 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001595}
1596
Tej Singheee317b2018-03-07 19:28:05 -08001597
1598/**
1599 * Logs changes in the connection state of the mobile radio.
1600 *
1601 * Logged from:
1602 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1603 */
1604message MobileConnectionStateChanged {
1605 // States are from the state machine DataConnection.java.
1606 enum State {
1607 UNKNOWN = 0;
1608 // The connection is inactive, or disconnected.
1609 INACTIVE = 1;
1610 // The connection is being activated, or connecting.
1611 ACTIVATING = 2;
1612 // The connection is active, or connected.
1613 ACTIVE = 3;
1614 // The connection is disconnecting.
1615 DISCONNECTING = 4;
1616 // The connection is disconnecting after creating a connection.
1617 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1618 }
1619 optional State state = 1;
1620 // For multi-sim phones, this distinguishes between the sim cards.
1621 optional int32 sim_slot_index = 2;
1622 // Used to identify the connection. Starts at 0 and increments by 1 for
1623 // every new network created. Resets whenever the device reboots.
1624 optional int32 data_connection_id = 3;
1625 // A bitmask for the capabilities of this connection.
1626 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1627 // Default value (if we have no information): 0
1628 optional int64 capabilities = 4;
1629 // If this connection has internet.
1630 // This just checks if the DEFAULT bit of capabilities is set.
1631 optional bool has_internet = 5;
1632}
1633
1634/**
1635 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1636 *
1637 * Logged from:
1638 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1639 */
1640message MobileRadioTechnologyChanged {
1641 optional android.telephony.NetworkTypeEnum state = 1;
1642 // For multi-sim phones, this distinguishes between the sim cards.
1643 optional int32 sim_slot_index = 2;
1644}
1645
Andrew Chantb56388b2018-03-22 21:07:33 -07001646/**
1647 * Logs the VID and PID of any connected USB devices.
1648 *
1649 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1650 *
1651 * Logged by Vendor.
1652 */
1653message UsbDeviceAttached {
1654 optional int32 vid = 1;
1655 optional int32 pid = 2;
1656 optional bool has_audio = 3;
1657 optional bool has_hid = 4;
1658 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001659 enum State {
1660 STATE_DISCONNECTED = 0;
1661 STATE_CONNECTED = 1;
1662 }
1663 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001664 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001665}
1666
Tej Singheee317b2018-03-07 19:28:05 -08001667
Tej Singhdd7bd352018-02-09 19:33:15 -08001668/**
Tej Singh5d991e12018-03-09 19:48:11 -08001669 * Logs when Bluetooth is enabled and disabled.
1670 *
1671 * Logged from:
1672 * services/core/java/com/android/server/BluetoothManagerService.java
1673 */
1674message BluetoothEnabledStateChanged {
1675 repeated AttributionNode attribution_node = 1;
1676 // Whether or not bluetooth is enabled on the device.
1677 enum State {
1678 UNKNOWN = 0;
1679 ENABLED = 1;
1680 DISABLED = 2;
1681 }
1682 optional State state = 2;
1683 // The reason for being enabled/disabled.
1684 // Eg. Airplane mode, crash, application request.
1685 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1686 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001687 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001688}
1689
1690/**
Jack Hed9837c82019-01-09 01:19:13 -08001691 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001692 *
1693 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001694 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1695 *
1696 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001697 */
1698message BluetoothConnectionStateChanged {
1699 // The state of the connection.
1700 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1701 optional android.bluetooth.ConnectionStateEnum state = 1;
1702 // An identifier that can be used to match connect and disconnect events.
1703 // Currently is last two bytes of a hash of a device level ID and
1704 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001705 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001706 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001707 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1708 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001709 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001710 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001711 // An identifier that can be used to match events for this device.
1712 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1713 // Salt: Randomly generated 256 bit value
1714 // Hash algorithm: HMAC-SHA256
1715 // Size: 32 byte
1716 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001717 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001718}
1719
1720/**
1721 * Logs when a Bluetooth device connects and disconnects over ACL
1722 *
1723 * Logged from:
1724 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1725 *
1726 * Next Tag: 3
1727 */
1728message BluetoothAclConnectionStateChanged {
1729 // An identifier that can be used to match events for this device.
1730 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1731 // Salt: Randomly generated 256 bit value
1732 // Hash algorithm: HMAC-SHA256
1733 // Size: 32 byte
1734 // Default: null or empty if the device identifier is not known
1735 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1736 // The state of the connection.
1737 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1738 optional android.bluetooth.ConnectionStateEnum state = 2;
1739}
1740
1741/**
1742 * Logs when a Bluetooth device connects and disconnects over SCO
1743 *
1744 * Logged from:
1745 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1746 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1747 *
1748 * Next Tag: 4
1749 */
1750message BluetoothScoConnectionStateChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // The state of the connection.
1759 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1760 optional android.bluetooth.ConnectionStateEnum state = 2;
1761 // Codec used for this SCO connection
1762 // Default: UNKNOWN
1763 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001764}
1765
Jack Hec27040a2019-01-09 20:54:41 -08001766/**
1767 * Logged when active device of a profile changes
1768 *
1769 * Logged from:
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1772 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1773 */
1774message BluetoothActiveDeviceChanged {
1775 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1776 // From android.bluetooth.BluetoothProfile
1777 optional int32 bt_profile = 1;
1778 // An identifier that can be used to match events for this new active device.
1779 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1780 // Salt: Randomly generated 256 bit value
1781 // Hash algorithm: HMAC-SHA256
1782 // Size: 32 byte
1783 // Default: null or empty if there is no active device for this profile
1784 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1785}
1786
Jack Heab86dbd22018-12-18 15:43:27 -08001787// Logs when there is an event affecting Bluetooth device's link layer connection.
1788// - This event is triggered when there is a related HCI command or event
1789// - Users of this metrics can deduce Bluetooth device's connection state from these events
1790// - HCI commands are logged before the command is sent, after receiving command status, and after
1791// receiving command complete
1792// - HCI events are logged when they arrive
1793//
1794// Low level log from system/bt
1795//
1796// Bluetooth classic commands:
1797// - CMD_CREATE_CONNECTION
1798// - CMD_DISCONNECT
1799// - CMD_CREATE_CONNECTION_CANCEL
1800// - CMD_ACCEPT_CONNECTION_REQUEST
1801// - CMD_REJECT_CONNECTION_REQUEST
1802// - CMD_SETUP_ESCO_CONNECTION
1803// - CMD_ACCEPT_ESCO_CONNECTION
1804// - CMD_REJECT_ESCO_CONNECTION
1805// - CMD_ENH_SETUP_ESCO_CONNECTION
1806// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1807//
1808// Bluetooth low energy commands:
1809// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1810// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1811// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1812// - CMD_BLE_CLEAR_WHITE_LIST
1813// - CMD_BLE_ADD_WHITE_LIST
1814// - CMD_BLE_REMOVE_WHITE_LIST
1815//
1816// Bluetooth classic events:
1817// - EVT_CONNECTION_COMP
1818// - EVT_CONNECTION_REQUEST
1819// - EVT_DISCONNECTION_COMP
1820// - EVT_ESCO_CONNECTION_COMP
1821// - EVT_ESCO_CONNECTION_CHANGED
1822//
1823// Bluetooth low energy meta events:
1824// - BLE_EVT_CONN_COMPLETE_EVT
1825// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1826//
1827// Next tag: 10
1828message BluetoothLinkLayerConnectionEvent {
1829 // An identifier that can be used to match events for this device.
1830 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1831 // Salt: Randomly generated 256 bit value
1832 // Hash algorithm: HMAC-SHA256
1833 // Size: 32 byte
1834 // Default: null or empty if the device identifier is not known
1835 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1836 // Connection handle of this connection if available
1837 // Range: 0x0000 - 0x0EFF (12 bits)
1838 // Default: 0xFFFF if the handle is unknown
1839 optional int32 connection_handle = 2;
1840 // Direction of the link
1841 // Default: DIRECTION_UNKNOWN
1842 optional android.bluetooth.DirectionEnum direction = 3;
1843 // Type of this link
1844 // Default: LINK_TYPE_UNKNOWN
1845 optional android.bluetooth.LinkTypeEnum type = 4;
1846
1847 // Reason metadata for this link layer connection event, rules for interpretation:
1848 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1849 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1850 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1851 // set and valid, ignore hci_ble_event
1852
1853 // HCI command associated with this event
1854 // Default: CMD_UNKNOWN
1855 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1856 // HCI event associated with this event
1857 // Default: EVT_UNKNOWN
1858 optional android.bluetooth.hci.EventEnum hci_event = 6;
1859 // HCI BLE meta event associated with this event
1860 // Default: BLE_EVT_UNKNOWN
1861 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1862 // HCI command status code if this is triggerred by hci_cmd
1863 // Default: STATUS_UNKNOWN
1864 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1865 // HCI reason code associated with this event
1866 // Default: STATUS_UNKNOWN
1867 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1868}
1869
Howard Roe103fe22019-01-17 16:52:16 -08001870/**
1871 * Logs when a module is rolled back by Watchdog.
1872 *
1873 * Logged from: Rollback Manager
1874 */
1875message WatchdogRollbackOccurred {
1876 enum RollbackType {
1877 UNKNOWN = 0;
1878 ROLLBACK_INITIATE = 1;
1879 ROLLBACK_SUCCESS = 2;
1880 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001881 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001882 }
1883 optional RollbackType rollback_type = 1;
1884
1885 optional string package_name = 2;
1886
1887 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001888
1889 enum RollbackReasonType {
1890 REASON_UNKNOWN = 0;
1891 REASON_NATIVE_CRASH = 1;
1892 REASON_EXPLICIT_HEALTH_CHECK = 2;
1893 REASON_APP_CRASH = 3;
1894 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001895 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001896 }
1897 optional RollbackReasonType rollback_reason = 4;
1898
1899 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1900 // is initiated. Empty if the package is unknown.
1901 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001902
1903 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001904}
1905
Jack Hec27040a2019-01-09 20:54:41 -08001906/**
1907 * Logs when there is a change in Bluetooth A2DP playback state
1908 *
1909 * Logged from:
1910 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1911 */
1912message BluetoothA2dpPlaybackStateChanged {
1913 // An identifier that can be used to match events for this device.
1914 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1915 // Salt: Randomly generated 256 bit value
1916 // Hash algorithm: HMAC-SHA256
1917 // Size: 32 byte
1918 // Default: null or empty if the device identifier is not known
1919 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1920 // Current playback state
1921 // Default: PLAYBACK_STATE_UNKNOWN
1922 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1923 // Current audio coding mode
1924 // Default: AUDIO_CODING_MODE_UNKNOWN
1925 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1926}
1927
1928/**
1929 * Logs when there is a change in A2DP codec config for a particular remote device
1930 *
1931 * Logged from:
1932 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1933 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1934 */
1935message BluetoothA2dpCodecConfigChanged {
1936 // An identifier that can be used to match events for this device.
1937 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1938 // Salt: Randomly generated 256 bit value
1939 // Hash algorithm: HMAC-SHA256
1940 // Size: 32 byte
1941 // Default: null or empty if the device identifier is not known
1942 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1943 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1944 // Default SOURCE_CODEC_TYPE_INVALID
1945 optional int32 codec_type = 2;
1946 // Codec priroity, the higher the more preferred, -1 for disabled
1947 // Default: CODEC_PRIORITY_DEFAULT
1948 optional int32 codec_priority = 3;
1949 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1950 // Default: SAMPLE_RATE_NONE
1951 optional int32 sample_rate = 4;
1952 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1953 // Default: BITS_PER_SAMPLE_NONE
1954 optional int32 bits_per_sample = 5;
1955 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1956 // Default: CHANNEL_MODE_NONE
1957 optional int32 channel_mode = 6;
1958 // Codec specific values
1959 // Default 0
1960 optional int64 codec_specific_1 = 7;
1961 optional int64 codec_specific_2 = 8;
1962 optional int64 codec_specific_3 = 9;
1963 optional int64 codec_specific_4 = 10;
1964}
1965
1966/**
1967 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1968 * Each codec's capability is logged separately due to statsd restriction
1969 *
1970 * Logged from:
1971 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1972 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1973 */
1974message BluetoothA2dpCodecCapabilityChanged {
1975 // An identifier that can be used to match events for this device.
1976 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1977 // Salt: Randomly generated 256 bit value
1978 // Hash algorithm: HMAC-SHA256
1979 // Size: 32 byte
1980 // Default: null or empty if the device identifier is not known
1981 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1982 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1983 // Default SOURCE_CODEC_TYPE_INVALID
1984 optional int32 codec_type = 2;
1985 // Codec priroity, the higher the more preferred, -1 for disabled
1986 // Default: CODEC_PRIORITY_DEFAULT
1987 optional int32 codec_priority = 3;
1988 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1989 // in BluetoothCodecConfig
1990 // Default: empty and SAMPLE_RATE_NONE for individual item
1991 optional int32 sample_rate = 4;
1992 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1993 // in BluetoothCodecConfig
1994 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1995 optional int32 bits_per_sample = 5;
1996 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1997 // BluetoothCodecConfig
1998 // Default: empty and CHANNEL_MODE_NONE for individual item
1999 optional int32 channel_mode = 6;
2000 // Codec specific values
2001 // Default 0
2002 optional int64 codec_specific_1 = 7;
2003 optional int64 codec_specific_2 = 8;
2004 optional int64 codec_specific_3 = 9;
2005 optional int64 codec_specific_4 = 10;
2006}
2007
2008/**
2009 * Logs when A2DP failed to read from PCM source.
2010 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2011 *
2012 * Logged from:
2013 * system/bt
2014 */
2015message BluetoothA2dpAudioUnderrunReported {
2016 // An identifier that can be used to match events for this device.
2017 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2018 // Salt: Randomly generated 256 bit value
2019 // Hash algorithm: HMAC-SHA256
2020 // Size: 32 byte
2021 // Default: null or empty if the device identifier is not known
2022 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2023 // Encoding interval in nanoseconds
2024 // Default: 0
2025 optional int64 encoding_interval_nanos = 2;
2026 // Number of bytes of PCM data that could not be read from the source
2027 // Default: 0
2028 optional int32 num_missing_pcm_bytes = 3;
2029}
2030
2031/**
2032 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2033 * buffer queue is full and we have to drop data
2034 *
2035 * Logged from:
2036 * system/bt
2037 */
2038message BluetoothA2dpAudioOverrunReported {
2039 // An identifier that can be used to match events for this device.
2040 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2041 // Salt: Randomly generated 256 bit value
2042 // Hash algorithm: HMAC-SHA256
2043 // Size: 32 byte
2044 // Default: null or empty if the device identifier is not known
2045 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2046 // Encoding interval in nanoseconds
2047 // Default: 0
2048 optional int64 encoding_interval_nanos = 2;
2049 // Number of buffers dropped in this event
2050 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2051 // Default: 0
2052 optional int32 num_dropped_buffers = 3;
2053 // Number of encoded buffers dropped in this event
2054 // Default 0
2055 optional int32 num_dropped_encoded_frames = 4;
2056 // Number of encoded bytes dropped in this event
2057 // Default: 0
2058 optional int32 num_dropped_encoded_bytes = 5;
2059}
2060
2061/**
2062 * Logs when we receive reports regarding a device's RSSI value
2063 *
2064 * Logged from:
2065 * system/bt
2066 */
2067message BluetoothDeviceRssiReported {
2068 // An identifier that can be used to match events for this device.
2069 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2070 // Salt: Randomly generated 256 bit value
2071 // Hash algorithm: HMAC-SHA256
2072 // Size: 32 byte
2073 // Default: null or empty if the device identifier is not known
2074 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2075 // Connection handle of this connection if available
2076 // Range: 0x0000 - 0x0EFF (12 bits)
2077 // Default: 0xFFFF if the handle is unknown
2078 optional int32 connection_handle = 2;
2079 // HCI command status code if this is triggerred by hci_cmd
2080 // Default: STATUS_UNKNOWN
2081 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2082 // BR/EDR
2083 // Range: -128 ≤ N ≤ 127 (signed integer)
2084 // Units: dB
2085 // LE:
2086 // Range: -127 to 20, 127 (signed integer)
2087 // Units: dBm
2088 // Invalid when an out of range value is reported
2089 optional int32 rssi = 4;
2090}
2091
2092/**
2093 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2094 *
2095 * Logged from:
2096 * system/bt
2097 */
2098message BluetoothDeviceFailedContactCounterReported {
2099 // An identifier that can be used to match events for this device.
2100 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2101 // Salt: Randomly generated 256 bit value
2102 // Hash algorithm: HMAC-SHA256
2103 // Size: 32 byte
2104 // Default: null or empty if the device identifier is not known
2105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2106 // Connection handle of this connection if available
2107 // Range: 0x0000 - 0x0EFF (12 bits)
2108 // Default: 0xFFFF if the handle is unknown
2109 optional int32 connection_handle = 2;
2110 // HCI command status code if this is triggerred by hci_cmd
2111 // Default: STATUS_UNKNOWN
2112 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2113 // Number of consecutive failed contacts for a connection corresponding to the Handle
2114 // Range: uint16_t, 0-0xFFFF
2115 // Default: 0xFFFFF
2116 optional int32 failed_contact_counter = 4;
2117}
2118
2119/**
2120 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2121 *
2122 * Logged from:
2123 * system/bt
2124 */
2125message BluetoothDeviceTxPowerLevelReported {
2126 // An identifier that can be used to match events for this device.
2127 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2128 // Salt: Randomly generated 256 bit value
2129 // Hash algorithm: HMAC-SHA256
2130 // Size: 32 byte
2131 // Default: null or empty if the device identifier is not known
2132 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2133 // Connection handle of this connection if available
2134 // Range: 0x0000 - 0x0EFF (12 bits)
2135 // Default: 0xFFFF if the handle is unknown
2136 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002137 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002138 // Default: STATUS_UNKNOWN
2139 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2140 // Range: -30 ≤ N ≤ 20
2141 // Units: dBm
2142 // Invalid when an out of range value is reported
2143 optional int32 transmit_power_level = 4;
2144}
Jack Heab86dbd22018-12-18 15:43:27 -08002145
Tej Singh5d991e12018-03-09 19:48:11 -08002146/**
Jack He1021a612019-01-20 21:22:46 -08002147 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2148 * receiving an HCI command from the host
2149 *
2150 * Logged from: system/bt
2151 */
2152message BluetoothHciTimeoutReported {
2153 // HCI command associated with this event
2154 // Default: CMD_UNKNOWN
2155 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2156}
2157
2158/**
2159 * Logs when we receive Bluetooth Link Quality Report event from the controller
2160 * See Android Bluetooth HCI specification for more details
2161 *
2162 * Note: all count and bytes field are counted since last event
2163 *
2164 * Logged from: system/bt
2165 */
2166message BluetoothQualityReportReported {
2167 // Quality report ID
2168 // Original type: uint8_t
2169 // Default: BQR_ID_UNKNOWN
2170 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2171 // Packet type of the connection
2172 // Original type: uint8_t
2173 // Default: BQR_PACKET_TYPE_UNKNOWN
2174 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2175 // Connection handle of the connection
2176 // Original type: uint16_t
2177 optional int32 connection_handle = 3;
2178 // Performing Role for the connection
2179 // Original type: uint8_t
2180 optional int32 connection_role = 4;
2181 // Current Transmit Power Level for the connection. This value is the same as the controller's
2182 // response to the HCI_Read_Transmit_Power_Level HCI command
2183 // Original type: uint8_t
2184 optional int32 tx_power_level = 5;
2185 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2186 // absolute receiver signal strength value
2187 // Original type: int8_t
2188 optional int32 rssi = 6;
2189 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2190 // channels used by the link currently
2191 // Original type: uint8_t
2192 optional int32 snr = 7;
2193 // Indicates the number of unused channels in AFH_channel_map
2194 // Original type: uint8_t
2195 optional int32 unused_afh_channel_count = 8;
2196 // Indicates the number of the channels which are interfered and quality is bad but are still
2197 // selected for AFH
2198 // Original type: uint8_t
2199 optional int32 afh_select_unideal_channel_count = 9;
2200 // Current Link Supervision Timeout Setting
2201 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2202 // Original type: uint16_t
2203 optional int32 lsto = 10;
2204 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2205 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2206 // 0x01 (Piconet Clock)
2207 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2208 // Original type: uint32_t
2209 optional int64 connection_piconet_clock = 11;
2210 // The count of retransmission
2211 // Original type: uint32_t
2212 optional int64 retransmission_count = 12;
2213 // The count of no RX
2214 // Original type: uint32_t
2215 optional int64 no_rx_count = 13;
2216 // The count of NAK (Negative Acknowledge)
2217 // Original type: uint32_t
2218 optional int64 nak_count = 14;
2219 // Controller timestamp of last TX ACK
2220 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2221 // Original type: uint32_t
2222 optional int64 last_tx_ack_timestamp = 15;
2223 // The count of Flow-off (STOP)
2224 // Original type: uint32_t
2225 optional int64 flow_off_count = 16;
2226 // Controller timestamp of last Flow-on (GO)
2227 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2228 // Original type: uint32_t
2229 optional int64 last_flow_on_timestamp = 17;
2230 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2231 // Original type: uint32_t
2232 optional int64 buffer_overflow_bytes = 18;
2233 // Buffer underflow count (in byte) since last event
2234 // Original type: uint32_t
2235 optional int64 buffer_underflow_bytes = 19;
2236}
2237
2238/**
2239 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2240 *
2241 * Notes:
2242 * - Each event can be partially filled as we might learn different pieces of device
2243 * information at different time
2244 * - Multiple device info events can be combined to give more complete picture
2245 * - When multiple device info events tries to describe the same information, the
2246 * later one wins
2247 *
2248 * Logged from:
2249 * packages/apps/Bluetooth
2250 */
Jack Heaea26982019-04-04 11:19:48 -07002251message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002252 // An identifier that can be used to match events for this device.
2253 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2254 // Salt: Randomly generated 256 bit value
2255 // Hash algorithm: HMAC-SHA256
2256 // Size: 32 byte
2257 // Default: null or empty if the device identifier is not known
2258 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2259 // Where is this device info obtained from
2260 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2261 // Name of the data source
2262 // For EXTERNAL: package name of the data source
2263 // For INTERNAL: null for general case, component name otherwise
2264 optional string source_name = 3;
2265 // Name of the manufacturer of this device
2266 optional string manufacturer = 4;
2267 // Model of this device
2268 optional string model = 5;
2269 // Hardware version of this device
2270 optional string hardware_version = 6;
2271 // Software version of this device
2272 optional string software_version = 7;
2273}
2274
2275/**
2276 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2277 * device, as documented by the Bluetooth Core HCI specification
2278 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2279 * Vol 2, Part E, Page 1118
2280 *
2281 * Logged from:
2282 * system/bt
2283 */
2284message BluetoothRemoteVersionInfoReported {
2285 // Connection handle of the connection
2286 // Original type: uint16_t
2287 optional int32 connection_handle = 1;
2288 // HCI command status code
2289 // Default: STATUS_UNKNOWN
2290 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2291 // 1 byte Version of current LMP in the remote controller
2292 optional int32 lmp_version = 3;
2293 // 2 bytes LMP manufacturer code of the remote controller
2294 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2295 optional int32 lmp_manufacturer_code = 4;
2296 // 4 bytes subversion of the LMP in the remote controller
2297 optional int32 lmp_subversion = 5;
2298}
2299
2300/**
2301 * Logs when certain Bluetooth SDP attributes are discovered
2302 * Constant definitions are from:
2303 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2304 *
2305 * Current logged attributes:
2306 * - BluetoothProfileDescriptorList
2307 * - Supported Features Bitmask
2308 *
2309 * Logged from:
2310 * system/bt
2311 */
2312message BluetoothSdpAttributeReported {
2313 // An identifier that can be used to match events for this device.
2314 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2315 // Salt: Randomly generated 256 bit value
2316 // Hash algorithm: HMAC-SHA256
2317 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2318 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2319 // Original type: uint16_t
2320 optional int32 protocol_uuid = 2;
2321 // Short form UUIDs used to identify Bluetooth SDP attribute types
2322 // Original type: uint16_t
2323 optional int32 attribute_id = 3;
2324 // Attribute value for the particular attribute
2325 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2326}
2327
2328/**
2329 * Logs when bond state of a Bluetooth device changes
2330 *
2331 * Logged from:
2332 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2333 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2334 */
2335message BluetoothBondStateChanged {
2336 // An identifier that can be used to match events for this device.
2337 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2338 // Salt: Randomly generated 256 bit value
2339 // Hash algorithm: HMAC-SHA256
2340 // Size: 32 byte
2341 // Default: null or empty if the device identifier is not known
2342 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2343 // Preferred transport type to remote dual mode device
2344 // Default: TRANSPORT_AUTO means no preference
2345 optional android.bluetooth.TransportTypeEnum transport = 2;
2346 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2347 // Default: UNKNOWN
2348 optional android.bluetooth.DeviceTypeEnum type = 3;
2349 // Current bond state (NONE, BONDING, BONDED)
2350 // Default: BOND_STATE_UNKNOWN
2351 optional android.bluetooth.BondStateEnum bond_state = 4;
2352 // Bonding sub state
2353 // Default: BOND_SUB_STATE_UNKNOWN
2354 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2355 // Unbond Reason
2356 // Default: UNBOND_REASON_UNKNOWN
2357 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2358}
2359
2360/**
2361 * Logs there is an event related Bluetooth classic pairing
2362 *
2363 * Logged from:
2364 * system/bt
2365 */
2366message BluetoothClassicPairingEventReported {
2367 // An identifier that can be used to match events for this device.
2368 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2369 // Salt: Randomly generated 256 bit value
2370 // Hash algorithm: HMAC-SHA256
2371 // Size: 32 byte
2372 // Default: null or empty if the device identifier is not known
2373 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2374 // Connection handle of this connection if available
2375 // Range: 0x0000 - 0x0EFF (12 bits)
2376 // Default: 0xFFFF if the handle is unknown
2377 optional int32 connection_handle = 2;
2378 // HCI command associated with this event
2379 // Default: CMD_UNKNOWN
2380 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2381 // HCI event associated with this event
2382 // Default: EVT_UNKNOWN
2383 optional android.bluetooth.hci.EventEnum hci_event = 4;
2384 // HCI command status code if this is triggerred by hci_cmd
2385 // Default: STATUS_UNKNOWN
2386 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2387 // HCI reason code associated with this event
2388 // Default: STATUS_UNKNOWN
2389 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002390 // A status value related to this specific event
2391 // Default: 0
2392 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002393}
2394
2395/**
2396 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2397 *
2398 * Logged from:
2399 * system/bt
2400 */
2401message BluetoothSmpPairingEventReported {
2402 // An identifier that can be used to match events for this device.
2403 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2404 // Salt: Randomly generated 256 bit value
2405 // Hash algorithm: HMAC-SHA256
2406 // Size: 32 byte
2407 // Default: null or empty if the device identifier is not known
2408 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2409 // SMP command sent or received over L2CAP
2410 // Default: CMD_UNKNOWN
2411 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2412 // Whether this command is sent or received
2413 // Default: DIRECTION_UNKNOWN
2414 optional android.bluetooth.DirectionEnum direction = 3;
2415 // SMP failure reason code
2416 // Default: PAIRING_FAIL_REASON_DEFAULT
2417 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2418}
2419
2420/**
Jack He815cdba2019-01-30 17:24:55 -08002421 * Logs when a Bluetooth socket’s connection state changed
2422 *
2423 * Logged from:
2424 * system/bt
2425 */
2426message BluetoothSocketConnectionStateChanged {
2427 // An identifier that can be used to match events for this device.
2428 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2429 // Salt: Randomly generated 256 bit value
2430 // Hash algorithm: HMAC-SHA256
2431 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002432 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002433 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002434 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002435 // Default 0 when unknown or don't care
2436 optional int32 port = 2;
2437 // Socket type as mentioned in
2438 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2439 // Default: SOCKET_TYPE_UNKNOWN
2440 optional android.bluetooth.SocketTypeEnum type = 3;
2441 // Socket connection state
2442 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2443 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2444 // Number of bytes sent to remote device during this connection
2445 optional int64 tx_bytes = 5;
2446 // Number of bytes received from remote device during this connection
2447 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002448 // Socket owner's UID
2449 optional int32 uid = 7 [(is_uid) = true];
2450 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2451 // |port| must be spawned by |server_port|
2452 // Default 0 when unknown or don't care
2453 optional int32 server_port = 8;
2454 // Whether this is a server listener socket
2455 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002456}
2457
2458/**
Jack He71426802019-04-02 13:32:52 -07002459 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2460 *
2461 * Logged from:
2462 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2463 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2464 *
2465 */
2466message BluetoothClassOfDeviceReported {
2467 // An identifier that can be used to match events for this device.
2468 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2469 // Salt: Randomly generated 256 bit value
2470 // Hash algorithm: HMAC-SHA256
2471 // Size: 32 byte
2472 // Default: null or empty if this is a server listener socket
2473 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2474 // Class of Device (CoD) value including both Major, Minor device class and service class
2475 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2476 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2477 // Default: 0
2478 optional int32 class_of_device = 2;
2479}
2480
2481/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002482 * Logs when something is plugged into or removed from the USB-C connector.
2483 *
2484 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002485 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002486 */
2487message UsbConnectorStateChanged {
2488 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002489 STATE_DISCONNECTED = 0;
2490 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002491 }
2492 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002493 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002494 // Last active session in ms.
2495 // 0 when the port is in connected state.
2496 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002497}
2498
2499/**
2500 * Logs the reported speaker impedance.
2501 *
2502 * Logged from:
2503 * Vendor audio implementation.
2504 */
2505message SpeakerImpedanceReported {
2506 optional int32 speaker_location = 1;
2507 optional int32 impedance = 2;
2508}
2509
2510/**
2511 * Logs the report of a failed hardware.
2512 *
2513 * Logged from:
2514 * Vendor HALs.
2515 *
2516 */
2517message HardwareFailed {
2518 enum HardwareType {
2519 HARDWARE_FAILED_UNKNOWN = 0;
2520 HARDWARE_FAILED_MICROPHONE = 1;
2521 HARDWARE_FAILED_CODEC = 2;
2522 HARDWARE_FAILED_SPEAKER = 3;
2523 HARDWARE_FAILED_FINGERPRINT = 4;
2524 }
2525 optional HardwareType hardware_type = 1;
2526
Maggie White6dcd8572019-01-31 14:11:50 -08002527 /**
2528 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002529 * the same hardware_type. The specific locations are vendor defined integers,
2530 * referring to board-specific numbering schemes.
2531 */
2532 optional int32 hardware_location = 2;
2533
Maggie White6dcd8572019-01-31 14:11:50 -08002534 /**
2535 * failure_code is specific to the HardwareType of the failed hardware.
2536 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002537 */
Maggie White6dcd8572019-01-31 14:11:50 -08002538 enum HardwareErrorCode {
2539 UNKNOWN = 0;
2540 COMPLETE = 1;
2541 SPEAKER_HIGH_Z = 2;
2542 SPEAKER_SHORT = 3;
2543 FINGERPRINT_SENSOR_BROKEN = 4;
2544 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002545 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002546 }
2547 optional int32 failure_code = 3;
2548}
2549
2550/**
2551 * Log an event when the device has been physically dropped.
2552 * Reported from the /vendor partition.
2553 */
2554message PhysicalDropDetected {
2555 // Confidence that the event was actually a drop, 0 -> 100
2556 optional int32 confidence_pctg = 1;
2557 // Peak acceleration of the drop, in 1/1000s of a g.
2558 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002559 // Duration of freefall in ms
2560 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002561}
2562
2563/**
2564 * Log bucketed battery charge cycles.
2565 *
2566 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002567 * a given charge point. For example, if 10 cycle buckets are
2568 * initialized, bucket 1 is the lowest 1/10th of the battery,
2569 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002570 *
2571 * Logged from:
2572 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2573 */
2574message ChargeCyclesReported {
2575 optional int32 cycle_bucket_1 = 1;
2576 optional int32 cycle_bucket_2 = 2;
2577 optional int32 cycle_bucket_3 = 3;
2578 optional int32 cycle_bucket_4 = 4;
2579 optional int32 cycle_bucket_5 = 5;
2580 optional int32 cycle_bucket_6 = 6;
2581 optional int32 cycle_bucket_7 = 7;
2582 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002583 optional int32 cycle_bucket_9 = 9;
2584 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002585}
2586
2587/**
Howard Roa46b6582018-09-18 16:45:02 -07002588 * Log battery health snapshot.
2589 *
2590 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2591 * are snapshotted periodically over 24hrs.
2592 */
2593message BatteryHealthSnapshot {
2594 enum BatterySnapshotType {
2595 UNKNOWN = 0;
2596 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2597 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2598 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2599 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2600 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2601 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2602 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2603 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2604 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2605 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2606 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2607 }
2608 optional BatterySnapshotType type = 1;
2609 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002610 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002611 // Voltage Battery Voltage, in microVolts.
2612 optional int32 voltage_micro_volt = 3;
2613 // Current Battery current, in microAmps.
2614 optional int32 current_micro_amps = 4;
2615 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2616 optional int32 open_circuit_micro_volt = 5;
2617 // Resistance Battery Resistance, in microOhms.
2618 optional int32 resistance_micro_ohm = 6;
2619 // Level Battery Level, as % of full.
2620 optional int32 level_percent = 7;
2621}
2622
2623/**
2624 * Log slow I/O operations on the primary storage.
2625 */
2626message SlowIo {
2627 // Classifications of IO Operations.
2628 enum IoOperation {
2629 UNKNOWN = 0;
2630 READ = 1;
2631 WRITE = 2;
2632 UNMAP = 3;
2633 SYNC = 4;
2634 }
2635 optional IoOperation operation = 1;
2636
2637 // The number of slow IO operations of this type over 24 hours.
2638 optional int32 count = 2;
2639}
2640
2641/**
2642 * Log battery caused shutdown with the last recorded voltage.
2643 */
2644message BatteryCausedShutdown {
2645 // The last recorded battery voltage prior to shutdown.
2646 optional int32 last_recorded_micro_volt = 1;
2647}
2648
2649/**
Tej Singha72344992019-04-17 18:55:08 -07002650 * Logs when ThermalService receives throttling events.
2651 *
2652 * Logged from:
2653 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2654 */
2655message ThermalThrottlingSeverityStateChanged {
2656 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2657 optional android.os.TemperatureTypeEnum sensor_type = 1;
2658
2659 // The name of the temperature source. Eg. CPU0
2660 optional string sensor_name = 2;
2661
2662 // Temperature in tenths of a degree C.
2663 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2664 optional int32 temperature_deci_celsius = 3;
2665
2666 // Relative severity of the throttling, see enum definition.
2667 optional android.os.ThrottlingSeverityEnum severity = 4;
2668}
2669
2670/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002671 * Logs the duration of a davey (jank of >=700ms) when it occurs
2672 *
2673 * Logged from:
2674 * frameworks/base/libs/hwui/JankTracker.cpp
2675 */
2676message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002677 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002679
Tej Singhbb8554a2018-01-26 11:59:14 -08002680 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002681 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002682}
2683
2684/**
Bookatze5885242017-10-24 20:10:31 -07002685 * Logs phone signal strength changes.
2686 *
2687 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002688 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002689 */
2690message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002691 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2692 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002693}
2694
Yangster4ccebea2018-10-09 17:09:02 -07002695
2696/**
2697 * Logs when the phone state, sim state or signal strength changes
2698 *
2699 * Logged from:
2700 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2701 */
2702message PhoneServiceStateChanged {
2703 optional android.telephony.ServiceStateEnum state = 1;
2704 optional android.telephony.SimStateEnum sim_state = 2;
2705 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2706}
2707
2708/**
2709 * Logs when the phone becomes on or off.
2710 *
2711 * Logged from:
2712 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2713 */
2714message PhoneStateChanged {
2715 enum State {
2716 OFF = 0;
2717 ON = 1;
2718 }
2719 optional State state = 1;
2720}
2721
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002722message BackGesture {
2723 enum BackType {
2724 DEFAULT_BACK_TYPE = 0;
2725 COMPLETED = 1;
2726 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2727 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2728 INCOMPLETE = 4;
2729 }
2730 optional BackType type = 1;
2731
2732 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2733 enum WindowHorizontalLocation {
2734 DEFAULT_LOCATION = 0;
2735 LEFT = 1;
2736 RIGHT = 2;
2737 }
2738 optional WindowHorizontalLocation x_location = 3;
2739}
2740
2741message ExclusionRectStateChanged {
2742 optional string component_name = 1; // if not available, simply packageName
2743 optional int32 requested_height = 2; // px
2744 optional int32 rejected_height = 3; // px
2745
2746 enum WindowHorizontalLocation {
2747 DEFAULT_LOCATION = 0;
2748 LEFT = 1;
2749 RIGHT = 2;
2750 }
2751 optional WindowHorizontalLocation x_location = 4;
2752 optional bool landscape = 5;
2753 optional bool splitscreen = 6;
2754 optional int32 duration_millis = 7;
2755}
2756
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002757message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002758 optional android.stats.launcher.LauncherAction action = 1;
2759 optional android.stats.launcher.LauncherState src_state = 2;
2760 optional android.stats.launcher.LauncherState dst_state = 3;
2761 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002762 optional bool is_swipe_up_enabled = 5;
2763}
2764
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002765message StyleUIChanged {
2766 optional android.stats.style.Action action = 1;
2767 optional int32 color_package_hash = 2;
2768 optional int32 font_package_hash = 3;
2769 optional int32 shape_package_hash = 4;
2770 optional int32 clock_package_hash = 5;
2771 optional int32 launcher_grid = 6;
2772 optional int32 wallpaper_category_hash = 7;
2773 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002774 optional int32 color_preference = 9;
2775 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002776}
2777
David Chenc28b2bb2017-10-24 12:52:52 -07002778/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002779 * Logs when Settings UI has changed.
2780 *
2781 * Logged from:
2782 * packages/apps/Settings
2783 */
2784message SettingsUIChanged {
2785 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002786 * Where this SettingsUIChange event comes from. For example, if
2787 * it's a PAGE_VISIBLE event, where the page is opened from.
2788 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002789 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002790
2791 /**
2792 * What the UI action is.
2793 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002794 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002795
2796 /**
2797 * Where the action is happening
2798 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002799 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002800
2801 /**
2802 * What preference changed in this event.
2803 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002804 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002805
2806 /**
2807 * The new value of the changed preference.
2808 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002809 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002810}
2811
2812/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002813 * Logs basic timing information about touch events.
2814 * Reported at most every 5 minutes while device is being interacted with.
2815 *
2816 * Logged from:
2817 * frameworks/native/services/inputflinger
2818 */
2819message TouchEventReported {
2820 /**
2821 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002822 * and the standard deviation of the time spent processing touchscreen events
2823 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002824 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002825 * On supported devices, the starting point is taken during the hard interrupt inside the
2826 * kernel touch driver. On all other devices, the starting point is taken inside
2827 * the kernel's input event subsystem upon receipt of the input event.
2828 * The ending point is taken inside InputDispatcher, just after the input event
2829 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002830 */
2831 // Minimum value
2832 optional float latency_min_micros = 1;
2833 // Maximum value
2834 optional float latency_max_micros = 2;
2835 // Average value
2836 optional float latency_mean_micros = 3;
2837 // Standard deviation
2838 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002839 // Number of touch events (input_event) in this report
2840 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002841}
2842
2843/**
Philip Quinn0eded622019-01-29 12:46:28 -08002844 * Logs gesture classification and timing information for touch events.
2845 *
2846 * Logged from:
2847 * frameworks/base/core/java/android/view/GestureDetector.java
2848 * frameworks/base/core/java/android/view/View.java
2849 */
2850message TouchGestureClassified {
2851 // The source of the classification (e.g. Java class name).
2852 optional string source = 1;
2853
2854 enum Classification {
2855 UNKNOWN_CLASSIFICATION = 0;
2856 SINGLE_TAP = 1;
2857 DOUBLE_TAP = 2;
2858 LONG_PRESS = 3;
2859 DEEP_PRESS = 4;
2860 SCROLL = 5;
2861 }
2862 // The classification of the gesture.
2863 optional Classification classification = 2;
2864
2865 // The interval from the start of a touch event stream until the
2866 // classification was made.
2867 optional int32 latency_millis = 3;
2868
2869 // The distance from the location of the first touch event to the
2870 // location of the touch event when the classification was made.
2871 optional float displacement_px = 4;
2872}
2873
2874/**
David Chenc28b2bb2017-10-24 12:52:52 -07002875 * Logs that a setting was updated.
2876 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002877 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002878 * The tag and is_default allow resetting of settings to default values based on the specified
2879 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2880 */
2881message SettingChanged {
2882 // The name of the setting.
2883 optional string setting = 1;
2884
2885 // The change being imposed on this setting. May represent a number, eg "3".
2886 optional string value = 2;
2887
2888 // The new value of this setting. For most settings, this is same as value. For some settings,
2889 // value is +X or -X where X represents an element in a set. For example, if the previous value
2890 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2891 // The +/- feature is currently only used for location_providers_allowed.
2892 optional string new_value = 3;
2893
2894 // The previous value of this setting.
2895 optional string prev_value = 4;
2896
2897 // The tag used with the is_default for resetting sets of settings. This is generally null.
2898 optional string tag = 5;
2899
Bookatz90867622018-01-31 15:05:57 -08002900 // True if this setting with tag should be resettable.
2901 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002902
David Chenbd789912018-03-16 17:19:55 -07002903 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002904 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002905
2906 enum ChangeReason {
2907 UPDATED = 1; // Updated can be an insertion or an update.
2908 DELETED = 2;
2909 }
2910 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002911}
Chenjie Yub3dda412017-10-24 13:41:59 -07002912
Chenjie Yu05013b32017-11-21 10:21:41 -08002913/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002914 * Logs activity going to foreground or background
2915 *
2916 * Logged from:
2917 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2918 */
2919message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002920 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002921 optional string pkg_name = 2;
2922 optional string class_name = 3;
2923
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002924 enum State {
2925 BACKGROUND = 0;
2926 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002927 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002928 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002929}
David Chenc8a43242017-10-17 16:23:28 -07002930
2931/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002932 * Logs when a volume entered low Storage state.
2933 * Logged from:
2934 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2935 */
2936message LowStorageStateChanged {
2937 // Volume that ran out of storage.
2938 optional string volume_description = 1;
2939
2940 enum State {
2941 UNKNOWN = 0;
2942 OFF = 1;
2943 ON = 2;
2944 }
2945 optional State state = 2;
2946}
2947
2948/**
2949 * Logs when an app is downgraded.
2950 * Logged from:
2951 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2952 */
2953message AppDowngraded {
2954 optional string package_name = 1;
2955 // Size of the package (all data) before being downgraded.
2956 optional int64 size_in_bytes_before = 2;
2957 // Size of the package (all data) after being downgraded.
2958 optional int64 size_in_bytes_after = 3;
2959
2960 optional bool aggressive = 4;
2961}
2962
2963/**
2964 * Logs when an app is optimized after being downgraded.
2965 * Logged from:
2966 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2967 */
2968message AppOptimizedAfterDowngraded {
2969 optional string package_name = 1;
2970}
2971
2972/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002973 * Logs whenever an app is installed on external storage.
2974 * Logged from:
2975 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2976 */
2977message AppInstallOnExternalStorageReported {
2978 // The type of external storage.
2979 optional android.stats.storage.ExternalStorageType storage_type = 1;
2980 // The name of the package that is installed on the sd card.
2981 optional string package_name = 2;
2982}
2983
2984/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002985 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002986 * Logged from:
2987 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2988 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002989message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002990 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002991
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002993
2994 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002995 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002996 optional string process_name = 3;
2997
2998 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002999 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003000
3001 optional string package_name = 5;
3002
3003 enum InstantApp {
3004 UNAVAILABLE = 0;
3005 FALSE = 1;
3006 TRUE = 2;
3007 }
3008 optional InstantApp is_instant_app = 6;
3009
3010 enum ForegroundState {
3011 UNKNOWN = 0;
3012 BACKGROUND = 1;
3013 FOREGROUND = 2;
3014 }
3015 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003016
3017 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003018}
David Chen9e3808c2017-11-20 17:25:34 -08003019
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020/**
3021 * Logs when a WTF (What a Terrible Failure) happened.
3022 * Logged from:
3023 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3024 */
3025message WTFOccurred {
3026 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003027
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003028 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003029
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003030 // The name of the process.
3031 // system_server if it is not by an app
3032 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003033
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003034 // The pid if available. -1 means not available.
3035 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003036
3037 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003038}
3039
3040/**
3041 * Logs when system server reports low memory.
3042 * Logged from:
3043 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3044 */
3045message LowMemReported {
3046}
3047
3048/**
3049 * Logs when an app ANR (App Not Responding) occurs.
3050 * Logged from:
3051 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3052 */
3053message ANROccurred {
3054 optional int32 uid = 1 [(is_uid) = true];
3055
3056 optional string process_name = 2;
3057
3058 optional string short_component_name = 3;
3059
3060 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003061
3062 enum InstantApp {
3063 UNAVAILABLE = 0;
3064 FALSE = 1;
3065 TRUE = 2;
3066 }
3067 optional InstantApp is_instant_app = 5;
3068
3069 enum ForegroundState {
3070 UNKNOWN = 0;
3071 BACKGROUND = 1;
3072 FOREGROUND = 2;
3073 }
3074 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003075
3076 optional android.server.ErrorSource error_source = 7;
3077
3078 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003079}
3080
Bookatza7020bd2018-08-28 16:29:35 -07003081/**
3082 * Logs when the vibrator state changes.
3083 * Logged from:
3084 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3085 */
3086message VibratorStateChanged {
3087 repeated AttributionNode attribution_node = 1;
3088
3089 enum State {
3090 OFF = 0;
3091 ON = 1;
3092 }
3093 optional State state = 2;
3094
3095 // Duration (in milliseconds) requested to keep the vibrator on.
3096 // Only applicable for State == ON.
3097 optional int64 duration_millis = 3;
3098}
3099
David Chen0a368b22017-12-06 16:28:16 -08003100/*
3101 * Allows other apps to push events into statsd.
3102 * Logged from:
3103 * frameworks/base/core/java/android/util/StatsLog.java
3104 */
David Chen0b5c90c2018-01-25 16:51:49 -08003105message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003106 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003107 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003108
3109 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3110 optional int32 label = 2;
3111
3112 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3113 // predicates for the metrics).
3114 enum State {
3115 UNKNOWN = 0;
3116 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3117 STOP = 2;
3118 START = 3;
3119 }
3120 optional State state = 3;
3121}
3122
David Chen9e3808c2017-11-20 17:25:34 -08003123/**
Bookatz7948c872018-09-04 12:58:33 -07003124 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3125 * For example, this could be due to the user manually changing the time.
3126 *
3127 * Logged from:
3128 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3129 */
3130message WallClockTimeShifted {
3131 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3132 optional int64 wall_clock_timestamp_millis = 1;
3133}
3134
3135/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003136 * Logs when statsd detects an anomaly.
3137 *
3138 * Logged from:
3139 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3140 */
3141message AnomalyDetected {
3142 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003143 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003144
Yangster-mac94e197c2018-01-02 16:03:03 -08003145 // Id of the config whose anomaly detection alert fired.
3146 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003147
Yangster-mac94e197c2018-01-02 16:03:03 -08003148 // Id of the alert (i.e. name of the anomaly that was detected).
3149 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003150}
3151
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003152message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003153 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003154 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003155
3156 // The app package name.
3157 optional string pkg_name = 2;
3158
3159 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003160 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003161 WARM = 1;
3162 HOT = 2;
3163 COLD = 3;
3164 }
3165 // The transition type.
3166 optional TransitionType type = 3;
3167
3168 // The activity name.
3169 optional string activity_name = 4;
3170
3171 // The name of the calling app. Empty if not set.
3172 optional string calling_pkg_name = 5;
3173
3174 // Whether the app is an instant app.
3175 optional bool is_instant_app = 6;
3176
3177 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003178 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003179
Bookatz80d11a02018-01-16 10:46:35 -08003180 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003181
David Chen0b5c90c2018-01-25 16:51:49 -08003182 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003183 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003184 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003186 optional int32 bind_application_delay_millis = 11;
3187 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003188
3189 // Empty if not set.
3190 optional string launch_token = 13;
3191
Calin Juravle759fbda2018-02-20 19:52:30 +00003192 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003193 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003194
3195 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003196 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003197}
3198
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003199message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003201 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003202
3203 // The app package name.
3204 optional string pkg_name = 2;
3205
3206 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003207 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003208 WARM = 1;
3209 HOT = 2;
3210 COLD = 3;
3211 }
3212 // The transition type.
3213 optional TransitionType type = 3;
3214
3215 // The activity name.
3216 optional string activity_name = 4;
3217}
3218
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003219message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003220 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003221 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003222
3223 // The app package name.
3224 optional string pkg_name = 2;
3225
3226 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003227 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003228 WITH_BUNDLE = 1;
3229 WITHOUT_BUNDLE = 2;
3230 }
3231 // The transition type.
3232 optional TransitionType type = 3;
3233
3234 // The activity name.
3235 optional string activity_name = 4;
3236
3237 optional bool transition_process_running = 5;
3238
3239 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003240 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003241}
3242
Bookatz8fcd09a2017-12-18 13:01:10 -08003243/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003244 * Logs a picture-in-picture action
3245 * Logged from:
3246 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3247 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3248 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3249 */
3250message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003251 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003252 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003253
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003254 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003255
Chenjie Yu52cacc62017-12-08 18:11:45 -08003256 enum State {
3257 ENTERED = 1;
3258 EXPANDED_TO_FULL_SCREEN = 2;
3259 MINIMIZED = 3;
3260 DISMISSED = 4;
3261 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003262 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003263}
3264
3265/**
Chenjie Yue8904192017-12-08 19:12:57 -08003266 * Logs overlay action
3267 * Logged from:
3268 * services/core/java/com/android/server/wm/Session.java
3269 */
3270message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003271 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003272
tsaichristine5adc7e02020-01-14 17:07:39 -08003273 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003274
3275 optional bool using_alert_window = 3;
3276
3277 enum State {
3278 ENTERED = 1;
3279 EXITED = 2;
3280 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003281 optional State state = 4 [
3282 (state_field_option).option = EXCLUSIVE_STATE,
3283 (state_field_option).nested = false,
3284 (state_field_option).default_state_value = 2
3285 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003286}
3287
Chenjie Yuccfe6452018-01-30 11:33:21 -08003288/*
3289 * Logs foreground service starts and stops.
3290 * Note that this is not when a service starts or stops, but when it is
3291 * considered foreground.
3292 * Logged from
3293 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3294 */
3295message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003296 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003297 // package_name + "/" + class_name
3298 optional string short_name = 2;
3299
3300 enum State {
3301 ENTER = 1;
3302 EXIT = 2;
3303 }
3304 optional State state = 3;
3305}
3306
Chenjie Yue8904192017-12-08 19:12:57 -08003307/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003308 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3309 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3310 * attributed back to the parent (host) uid. One example is Chrome.
3311 *
3312 * Logged from:
3313 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3314 */
3315message IsolatedUidChanged {
3316 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003317 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003318 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003319 optional int32 parent_uid = 1;
3320
3321 optional int32 isolated_uid = 2;
3322
3323 // We expect an isolated uid to be removed before if it's used for another parent uid.
3324 enum Event {
3325 REMOVED = 0;
3326 CREATED = 1;
3327 }
3328 optional Event event = 3;
3329}
3330
3331/*
3332 * Logs the reception of an incoming network packet causing the main system to wake up for
3333 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3334 * and processed by WakeupController.cpp.
3335 */
3336message PacketWakeupOccurred {
3337 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3338 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003339 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003340 // The interface name on which the packet was received.
3341 optional string iface = 2;
3342 // The ethertype value of the packet.
3343 optional int32 ethertype = 3;
3344 // String representation of the destination MAC address of the packet.
3345 optional string destination_hardware_address = 4;
3346 // String representation of the source address of the packet if this was an IP packet.
3347 optional string source_ip = 5;
3348 // String representation of the destination address of the packet if this was an IP packet.
3349 optional string destination_ip = 6;
3350 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3351 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3352 // families.
3353 optional int32 ip_next_header = 7;
3354 // The source port if this was a TCP or UDP packet.
3355 optional int32 source_port = 8;
3356 // The destination port if this was a TCP or UDP packet.
3357 optional int32 destination_port = 9;
3358}
3359
3360/*
3361 * Logs the memory stats for an app on startup.
3362 * Logged from:
3363 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3364 */
3365message AppStartMemoryStateCaptured {
3366 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003367 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003368
3369 // The process name.
3370 optional string process_name = 2;
3371
3372 // The activity name.
3373 optional string activity_name = 3;
3374
3375 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003376 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003377
3378 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003379 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003380
3381 // RSS
3382 optional int64 rss_in_bytes = 6;
3383
3384 // CACHE
3385 optional int64 cache_in_bytes = 7;
3386
3387 // SWAP
3388 optional int64 swap_in_bytes = 8;
3389}
3390
3391/*
3392 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3393 * for LMK event.
3394 * Logged from:
3395 * system/core/lmkd/lmkd.c
3396 */
3397message LmkStateChanged {
3398 enum State {
3399 UNKNOWN = 0;
3400 START = 1;
3401 STOP = 2;
3402 }
3403 optional State state = 1;
3404}
3405
3406/*
3407 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3408 * Logged from:
3409 * system/core/lmkd/lmkd.c
3410 */
3411message LmkKillOccurred {
3412 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003413 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003414
3415 // The process name.
3416 optional string process_name = 2;
3417
3418 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003419 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003420
3421 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003422 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003423
3424 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003425 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003426
3427 // RSS
3428 optional int64 rss_in_bytes = 6;
3429
3430 // CACHE
3431 optional int64 cache_in_bytes = 7;
3432
3433 // SWAP
3434 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003435
3436 // The elapsed real time of start of the process.
3437 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003438
3439 // Min oom adj score considered by lmkd.
3440 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003441}
3442
Rajeev Kumar51b54602018-03-01 12:18:26 -08003443/*
3444 * Logs when the ActivityManagerService detects that an app died.
3445 *
3446 * Logged from:
3447 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3448 */
3449message AppDied {
3450 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003451 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003452}
3453
Howard Ro21a039c2018-08-06 14:55:47 -07003454/**
3455 * An atom for generic metrics logging. Available from Android Q.
3456 */
3457message GenericAtom {
3458 // The uid of the application that sent this custom atom.
3459 optional int32 uid = 1 [(is_uid) = true];
3460
3461 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003462 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003463}
3464
Tej Singhd6d6d772018-09-05 17:41:25 -07003465/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003466 * Atom for simple logging of user interaction and impression events, such as "the user touched
3467 * this button" or "this dialog was displayed".
3468 * Keep the UI event stream clean: don't use for system or background events.
3469 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003470 *
3471 * Logged from:
3472 * frameworks/base/services/core/java/com/android/server/
3473 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003474 */
3475message UiEventReported {
3476 // The event_id.
3477 optional int32 event_id = 1;
3478 // The event's source or target uid and package, if applicable.
3479 // For example, the package posting a notification, or the destination package of a share.
3480 optional int32 uid = 2 [(is_uid) = true];
3481 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003482 // An identifier used to disambiguate which logs refer to a particular instance of some
3483 // UI element. Useful when there might be multiple instances simultaneously active.
3484 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003485}
3486
3487/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003488 * Reports a notification was created or updated.
3489 *
3490 * Logged from:
3491 * frameworks/base/services/core/java/com/android/server/notification/
3492 */
3493message NotificationReported {
3494 // The event_id (as for UiEventReported).
3495 optional int32 event_id = 1;
3496 // The notifying app's uid and package.
3497 optional int32 uid = 2 [(is_uid) = true];
3498 optional string package_name = 3;
3499 // A small system-assigned identifier for the notification.
3500 // Locally probably-unique, but expect collisions across users and/or days.
3501 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003502 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3503 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003504
3505 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003506 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3507 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3508 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003509
3510 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003511 optional string category = 10; // App-assigned notification category (API-defined strings)
3512 optional int32 style = 11; // App-assigned notification style
3513 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003514
3515 // Ordering, importance and interruptiveness
3516
Will Brockman7614f6962020-02-10 19:43:03 -05003517 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003518
Will Brockman7614f6962020-02-10 19:43:03 -05003519 optional android.stats.sysui.NotificationImportance importance = 14;
3520 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003521
3522 enum NotificationImportanceExplanation {
3523 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3524 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3525 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3526 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3527 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3528 // Like _APP, but based on pre-channels priority signal.
3529 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3530 }
3531
Will Brockman7614f6962020-02-10 19:43:03 -05003532 optional NotificationImportanceExplanation importance_source = 16;
3533 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3534 optional NotificationImportanceExplanation importance_initial_source = 18;
3535 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3536 optional int32 assistant_hash = 20;
3537 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003538}
3539
3540message Notification {
3541 // The notifying app's uid and package.
3542 optional int32 uid = 1 [(is_uid) = true];
3543 optional string package_name = 2;
3544 // A small system-assigned identifier for the notification.
3545 optional int32 instance_id = 3;
3546
3547 // Grouping information.
3548 optional int32 group_instance_id = 4;
3549 optional bool is_group_summary = 5;
3550
3551 // The section of the shade that the notification is in.
3552 // See NotificationSectionsManager.PriorityBucket.
3553 enum NotificationSection {
3554 SECTION_UNKNOWN = 0;
3555 SECTION_PEOPLE = 1;
3556 SECTION_ALERTING = 2;
3557 SECTION_SILENT = 3;
3558 }
3559 optional NotificationSection section = 6;
3560}
3561
3562message NotificationList {
3563 repeated Notification notifications = 1; // An ordered sequence of notifications.
3564}
3565
3566/**
3567 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3568 *
3569 * Logged from:
3570 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3571 */
3572message NotificationPanelReported {
3573 // The event_id (as for UiEventReported).
3574 optional int32 event_id = 1;
3575 optional int32 num_notifications = 2;
3576 // The notifications in the panel, in the order that they appear there.
3577 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3578}
3579
3580/**
3581 * Reports a notification channel, or channel group, was created, updated, or deleted.
3582 *
3583 * Logged from:
3584 * frameworks/base/services/core/java/com/android/server/notification/
3585 */
3586message NotificationChannelModified {
3587 // The event_id (as for UiEventReported).
3588 optional int32 event_id = 1;
3589 // The notifying app's uid and package.
3590 optional int32 uid = 2 [(is_uid) = true];
3591 optional string package_name = 3;
3592 // App-assigned notification channel ID or channel-group ID
3593 optional string channel_id = 4;
3594 // Previous importance setting, if applicable
3595 optional android.stats.sysui.NotificationImportance old_importance = 5;
3596 // New importance setting
3597 optional android.stats.sysui.NotificationImportance importance = 6;
3598}
3599
3600
3601/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003602 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003603 *
3604 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003605 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003606 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003607message BiometricAcquired {
3608 // Biometric modality that was acquired.
3609 optional android.hardware.biometrics.ModalityEnum modality = 1;
3610 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3611 optional int32 user = 2;
3612 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3613 optional bool is_crypto = 3;
3614 // Action that the device is performing. Acquired messages are only expected for enroll and
3615 // authenticate. Other actions may indicate an error.
3616 optional android.hardware.biometrics.ActionEnum action = 4;
3617 // The client that this acquisition was received for.
3618 optional android.hardware.biometrics.ClientEnum client = 5;
3619 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3620 optional int32 acquire_info = 6;
3621 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3622 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003623 // Dictates if this message should trigger additional debugging.
3624 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003625}
3626
3627/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003628 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003629 *
3630 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003631 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003632 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003633message BiometricAuthenticated {
3634 // Biometric modality that was used.
3635 optional android.hardware.biometrics.ModalityEnum modality = 1;
3636 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3637 optional int32 user = 2;
3638 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3639 // storage.
3640 optional bool is_crypto = 3;
3641 // The client that this acquisition was received for.
3642 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003643 // If authentication requires user confirmation. See BiometricPrompt's
3644 // setRequireConfirmation(bool) method.
3645 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003646
Kevin Chyn1741a072019-01-17 11:54:40 -08003647 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003648 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003649 REJECTED = 1;
3650 PENDING_CONFIRMATION = 2;
3651 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003652 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003653
3654 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003655 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003656 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3657 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3658 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3659 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003660 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003661 // Dictates if this message should trigger additional debugging.
3662 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003663}
3664
3665/**
3666 * Logs when a biometric error occurs.
3667 *
3668 * Logged from:
3669 * frameworks/base/services/core/java/com/android/server/biometrics
3670 */
3671message BiometricErrorOccurred {
3672 // Biometric modality that was used.
3673 optional android.hardware.biometrics.ModalityEnum modality = 1;
3674 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3675 optional int32 user = 2;
3676 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3677 optional bool is_crypto = 3;
3678 // Action that the device is performing.
3679 optional android.hardware.biometrics.ActionEnum action = 4;
3680 // The client that this acquisition was received for.
3681 optional android.hardware.biometrics.ClientEnum client = 5;
3682 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3683 // are unique to modality.
3684 optional int32 error_info = 6;
3685 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3686 // by the vendor and not specified by the HIDL interface.
3687 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003688 // Dictates if this message should trigger additional debugging.
3689 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003690 // Time spent during the authentication attempt.
3691 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003692}
3693
3694/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003695 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003696 * Logged from:
3697 * frameworks/base/services/core/java/com/android/server/biometrics
3698 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003699message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003700 // Biometric modality.
3701 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003702 // Type of issue detected.
3703 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003704 // Dictates if this message should trigger additional debugging.
3705 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003706}
Howard Ro688ae182018-09-25 00:09:36 -07003707
joshmccloskey6f952b22019-03-25 20:59:35 -07003708/**
3709 * Logs when a biometric enrollment occurs.
3710 *
3711 * Logged from:
3712 * frameworks/base/services/core/java/com/android/server/biometrics
3713 */
3714message BiometricEnrolled {
3715 // Biometric modality that was used.
3716 optional android.hardware.biometrics.ModalityEnum modality = 1;
3717 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3718 optional int32 user = 2;
3719 // The amount of time the enrollment took in milliseconds.
3720 optional int64 latency_millis = 3;
3721 // Whether or not the enrollment was successful.
3722 optional bool success = 4;
3723}
3724
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003725/*
Tej Singh0d176952019-01-16 19:10:54 -08003726 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003727 */
Tej Singh0d176952019-01-16 19:10:54 -08003728message FlagFlipUpdateOccurred {
3729 // If the event is from a flag config package, specify the package name.
3730 optional string flag_flip_package_name = 1;
3731
3732 // The order id of the package
3733 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003734}
3735
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003736/**
3737 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003738 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003739 */
3740message TrainExperimentIds {
3741 repeated int64 experiment_id = 1;
3742}
3743
Yangster-macb89807e2018-11-15 21:10:57 -08003744/*
3745 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003746 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003747 */
3748message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003749 // Name of the train.
3750 optional string train_name = 1;
3751 // Version code for a "train" of packages that need to be installed atomically
3752 optional int64 train_version_code = 2;
3753 // After installation of this package, device requires a restart.
3754 optional bool requires_staging = 3;
3755 // Rollback should be enabled for this install.
3756 optional bool rollback_enabled = 4;
3757 // Requires low latency monitoring if possible.
3758 optional bool requires_low_latency_monitor = 5;
3759
Yangster-macb89807e2018-11-15 21:10:57 -08003760 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003761 UNKNOWN = 0;
3762 INSTALL_REQUESTED = 1;
3763 INSTALL_STARTED = 2;
3764 INSTALL_STAGED_NOT_READY = 3;
3765 INSTALL_STAGED_READY = 4;
3766 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003767 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3768 // and INSTALL_FAILURE_COMMIT.
3769 INSTALL_FAILURE = 6 [deprecated = true];
3770 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003771 INSTALL_CANCELLED = 7;
3772 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003773 INSTALLER_ROLLBACK_INITIATED = 9;
3774 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3775 INSTALLER_ROLLBACK_STAGED = 11;
3776 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3777 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3778 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3779 INSTALLER_ROLLBACK_SUCCESS = 15;
3780 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003781 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3782 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3783 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3784 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3785 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3786 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003787 INSTALL_FAILURE_DOWNLOAD = 23;
3788 INSTALL_FAILURE_STATE_MISMATCH = 24;
3789 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003790 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003791 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003792 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003793 // Possible experiment ids for monitoring this push.
3794 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3795 // user id
3796 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003797 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003798 // Whether or not this is a rollback event
3799 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003800}
3801
Tej Singhc9203082019-05-03 13:42:23 -07003802/* Test atom, is not logged anywhere */
3803message TestAtomReported {
3804 repeated AttributionNode attribution_node = 1;
3805 optional int32 int_field = 2;
3806 optional int64 long_field = 3;
3807 optional float float_field = 4;
3808 optional string string_field = 5;
3809 optional bool boolean_field = 6;
3810 enum State {
3811 UNKNOWN = 0;
3812 OFF = 1;
3813 ON = 2;
3814 }
3815 optional State state = 7;
3816 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3817}
3818
Maggie Whitefc1aa592018-11-28 21:55:23 -08003819/** Represents USB port overheat event. */
3820message UsbPortOverheatEvent {
3821 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3822 optional int32 plug_temperature_deci_c = 1;
3823
3824 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3825 optional int32 max_temperature_deci_c = 2;
3826
3827 /* Time between USB plug event and overheat threshold trip, in seconds. */
3828 optional int32 time_to_overheat_secs = 3;
3829
3830 /* Time between overheat threshold trip and hysteresis, in seconds. */
3831 optional int32 time_to_hysteresis_secs = 4;
3832
3833 /* Time between hysteresis and active mitigation ending, in seconds. */
3834 optional int32 time_to_inactive_secs = 5;
3835};
3836
Maggie White8735b852019-01-18 11:40:49 -08003837/**
3838 * Logs total effective full charge and discharge cycles on a battery.
3839 * Here are some examples of one effective cycle:
3840 * 1) the battery charges from 0% to 100% and drains back to 0%,
3841 * 2) charging from 50% to 100% and draining back to 50% twice.
3842 * Pulled from:
3843 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3844 */
3845message BatteryCycleCount {
3846 /* Number of total charge and discharge cycles on the system battery. */
3847 optional int32 cycle_count = 1;
3848}
3849
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003850/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003851 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3852 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003853 * Pulled from:
3854 * StatsCompanionService
3855 */
3856
Carmen Agimof12dec122019-03-06 16:14:38 +00003857message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003858
Carmen Agimof12dec122019-03-06 16:14:38 +00003859 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003860 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003861 PUBLIC = 1;
3862 PRIVATE = 2;
3863 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003864 }
3865
Carmen Agimof12dec122019-03-06 16:14:38 +00003866 // The type of external storage.
3867 optional android.stats.storage.ExternalStorageType storage_type = 1;
3868 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3869 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003870 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003871 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003872}
3873
Yangster-macb89807e2018-11-15 21:10:57 -08003874/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003875 * Logs when a connection becomes available and lost.
3876 * Logged in StatsCompanionService.java
3877 */
3878message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003879 // Id of the network.
3880 optional int32 net_id = 1;
3881
3882 enum State {
3883 UNKNOWN = 0;
3884 CONNECTED = 1;
3885 DISCONNECTED = 2;
3886 }
3887 // Connected state of a network.
3888 optional State state = 2;
3889}
3890
3891/**
3892 * Logs when a service starts and stops.
3893 * Logged from:
3894 * services/core/java/com/android/server/am/ActiveServices.java
3895 */
3896message ServiceStateChanged {
3897
3898 optional int32 uid = 1 [(is_uid) = true];
3899
3900 optional string package_name = 2;
3901
3902 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003903
3904 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003905 START = 1;
3906 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003907 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003908
3909 optional State state = 4;
3910}
3911
3912/**
3913 * Logs when a service is launched.
3914 * Logged from:
3915 * services/core/java/com/android/server/am/ActiveServices.java
3916 */
3917message ServiceLaunchReported {
3918
3919 optional int32 uid = 1 [(is_uid) = true];
3920
3921 optional string package_name = 2;
3922
3923 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003924}
Howard Ro688ae182018-09-25 00:09:36 -07003925
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003926/**
3927 * Logs when a hidden API is used.
3928 *
3929 * Logged from:
3930 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3931 */
3932message HiddenApiUsed {
3933 // The uid of the app making the hidden access.
3934 optional int32 uid = 1 [(is_uid) = true];
3935
3936 // Signature of the method or field accessed.
3937 optional string signature = 2;
3938
3939 enum AccessMethod {
3940 NONE = 0;
3941 REFLECTION = 1;
3942 JNI = 2;
3943 LINKING = 3;
3944 }
3945
3946 // Type of access.
3947 optional AccessMethod access_method = 3;
3948
3949 // Whether the access was prevented or not.
3950 optional bool access_denied = 4;
3951}
3952
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003953/**
3954 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3955 * - When user sees privacy chip
3956 * - When user clicks privacy chip
3957 * - How does the user exit the Privacy Dialog
3958 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003959 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3960 */
3961message PrivacyIndicatorsInteracted {
3962
3963 enum Type {
3964 UNKNOWN = 0;
3965 CHIP_VIEWED = 1;
3966 CHIP_CLICKED = 2;
3967 DIALOG_PRIVACY_SETTINGS = 3;
3968 DIALOG_DISMISS = 4;
3969 DIALOG_LINE_ITEM = 5;
3970 }
3971
tsaichristine5adc7e02020-01-14 17:07:39 -08003972 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003973
3974 // Used if the type is LINE_ITEM
3975 optional string package_name = 2;
3976}
3977
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003978/**
3979 * Logs information about a package that is moved from the internal to external storage and vice
3980 * versa.
3981 * It logs the package name, the type of the external storage where the package is installed
3982 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3983 * and the move type: if it's from internal to external or the other way around.
3984 *
3985 * Logged from:
3986 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3987 */
3988message AppMovedStorageReported {
3989 enum MoveType {
3990 UNKNOWN = 0;
3991 TO_EXTERNAL = 1;
3992 TO_INTERNAL = 2;
3993 }
3994 // The type of the external storage.
3995 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3996 // The type of move.
3997 optional MoveType move_type = 2;
3998 // The name of the package that was moved.
3999 optional string package_name = 3;
4000}
4001
jianjin8f2dee02019-03-29 14:03:08 -07004002/**
4003 * Logs when system server watchdog occurs.
4004 * Logged from:
4005 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4006 */
4007message SystemServerWatchdogOccurred {
4008 optional string subject = 1;
4009}
4010
4011/**
4012 * Logs when new file added to tombstones.
4013 * Logged from:
4014 * frameworks/base/core/java/com/android/server/BootReceiver.java
4015 */
4016message TombStoneOccurred {
4017}
4018
Hai Zhang5d3328d2019-04-13 21:25:06 +08004019/*
4020 * Information about a role request
4021 *
4022 * Logged from:
4023 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4024 */
4025message RoleRequestResultReported {
4026 // UID of application requesting the role
4027 optional int32 requesting_uid = 1;
4028
4029 // Package name of application requesting the role
4030 optional string requesting_package_name = 2;
4031
4032 // The role to be granted
4033 optional string role_name = 3;
4034
4035 // The count of applications qualifying for the role
4036 optional int32 qualifying_count = 4;
4037
4038 // UID of application current granted the role
4039 optional int32 current_uid = 5;
4040
4041 // Package name of application current granted the role
4042 optional string current_package_name = 6;
4043
4044 // UID of another application that user chose to grant the role to, instead of the requesting
4045 // application
4046 optional int32 granted_another_uid = 7;
4047
4048 // Package name of another application that user chose to grant the role to, instead of the
4049 // requesting application
4050 optional string granted_another_package_name = 8;
4051
4052 enum Result {
4053 UNDEFINED = 0;
4054 // role request was ignored
4055 IGNORED = 1;
4056 // role request was ignored because it's already granted
4057 IGNORED_ALREADY_GRANTED = 2;
4058 // role request was ignored because the application isn't qualified
4059 IGNORED_NOT_QUALIFIED = 3;
4060 // role request was ignored because user said it should be always denied
4061 IGNORED_USER_ALWAYS_DENIED = 4;
4062 // role was granted by user action
4063 USER_GRANTED = 5;
4064 // role was denied by user action
4065 USER_DENIED = 6;
4066 // role was denied by user granting another application the role
4067 USER_DENIED_GRANTED_ANOTHER = 7;
4068 // role was denied and set to be always denied by the user
4069 USER_DENIED_WITH_ALWAYS = 8;
4070 }
4071 // The result of the role request
4072 optional Result result = 9;
4073}
4074
Mark Tabrya824a642019-11-05 12:26:12 -08004075/**
4076 * Logs when a Vehicle Maps Service client's connection state has changed
4077 *
4078 * Logged from:
4079 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4080 */
4081message VmsClientConnectionStateChanged {
4082 // The UID of the VMS client app
4083 optional int32 uid = 1 [(is_uid) = true];
4084
4085 enum State {
4086 UNKNOWN = 0;
4087 // Attempting to connect to the client
4088 CONNECTING = 1;
4089 // Client connection established
4090 CONNECTED = 2;
4091 // Client connection closed unexpectedly
4092 DISCONNECTED = 3;
4093 // Client connection closed by VMS
4094 TERMINATED = 4;
4095 // Error establishing the client connection
4096 CONNECTION_ERROR = 5;
4097 }
4098
4099 optional State state = 2;
4100}
4101
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004102/**
4103 * Logs when MediaProvider has successfully finished scanning a storage volume.
4104 *
4105 * Logged from:
4106 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4107 */
4108message MediaProviderScanEvent {
4109 enum Reason {
4110 // Scan triggered due to unknown reason
4111 UNKNOWN = 0;
4112 // Scan triggered due to storage volume being mounted
4113 MOUNTED = 1;
4114 // Scan triggered due to explicit user action or app request
4115 DEMAND = 2;
4116 // Scan triggered due to idle maintenance
4117 IDLE = 3;
4118 }
4119
4120 // Volume type that this event pertains to
4121 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4122 // Reason why this scan was triggered
4123 optional Reason reason = 2;
4124 // Total number of files scanned
4125 optional int64 item_count = 3;
4126 // Duration of scan, normalized per file
4127 optional float normalized_duration_millis = 4;
4128 // Number of database inserts, normalized per file
4129 optional float normalized_insert_count = 5;
4130 // Number of database updates, normalized per file
4131 optional float normalized_update_count = 6;
4132 // Number of database deletes, normalized per file
4133 optional float normalized_delete_count = 7;
4134}
4135
4136/**
4137 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4138 *
4139 * Logged from:
4140 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4141 */
4142message MediaProviderDeletionEvent {
4143 // Volume type that this event pertains to
4144 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4145 // Device timestamp when this deletion event occurred
4146 optional int64 timestamp_millis = 2;
4147 // App that requested deletion
4148 optional string package_name = 3;
4149 // Number of items that were deleted
4150 optional int32 item_count = 4;
4151}
4152
4153/**
4154 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4155 *
4156 * Logged from:
4157 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4158 */
4159message MediaProviderPermissionEvent {
4160 enum Result {
4161 UNKNOWN = 0;
4162 USER_GRANTED = 1;
4163 AUTO_GRANTED = 2;
4164 USER_DENIED = 3;
4165 USER_DENIED_WITH_PREJUDICE = 4;
4166 AUTO_DENIED = 5;
4167 }
4168
4169 // Volume type that this event pertains to
4170 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4171 // Device timestamp when this permission event occurred
4172 optional int64 timestamp_millis = 2;
4173 // App that requested permission
4174 optional string package_name = 3;
4175 // Number of items that were requested
4176 optional int32 item_count = 4;
4177 // Result of this request
4178 optional Result result = 5;
4179}
4180
4181/**
4182 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4183 *
4184 * Logged from:
4185 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4186 */
4187message MediaProviderSchemaChange {
4188 // Volume type that this event pertains to
4189 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4190 // Old database version code
4191 optional int32 version_from = 2;
4192 // New database version code
4193 optional int32 version_to = 3;
4194 // Total number of files in database
4195 optional int64 item_count = 4;
4196 // Duration of schema change, normalized per file
4197 optional float normalized_duration_millis = 5;
4198}
4199
4200/**
4201 * Logs when MediaProvider has finished an idle maintenance job.
4202 *
4203 * Logged from:
4204 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4205 */
4206message MediaProviderIdleMaintenance {
4207 // Volume type that this event pertains to
4208 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4209
4210 // Total number of files in database
4211 optional int64 item_count = 2;
4212 // Duration of idle maintenance, normalized per file
4213 optional float normalized_duration_millis = 3;
4214 // Number of thumbnails found to be stale, normalized per file
4215 optional float normalized_stale_thumbnails = 4;
4216 // Number of items found to be expired, normalized per file
4217 optional float normalized_expired_media = 5;
4218}
4219
Keun young Park3e033cb2019-12-18 11:27:35 -08004220/**
4221 * Represents boot time event with duration in ms.
4222 *
4223 * Logged from: bootstat and various system server components. Check each enums for details.
4224 */
4225message BootTimeEventDuration {
4226 enum DurationEvent {
4227 UNKNOWN = 0;
4228 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4229 ABSOLUTE_BOOT_TIME = 1;
4230 // Bootloader's 1st stage execution time.
4231 // Logged from bootstat.
4232 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4233 // Bootloader's 1st stage loading time.
4234 // Logged from bootstat.
4235 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4236 // Bootloader's kernel loading time.
4237 // Logged from bootstat.
4238 BOOTLOADER_KERNEL_LOAD = 4;
4239 // Bootloader's 2nd stage execution time.
4240 // Logged from bootstat.
4241 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4242 // Bootloader's 2nd stage loading time.
4243 // Logged from bootstat.
4244 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4245 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4246 // for locked device.
4247 // Logged from bootstat.
4248 BOOTLOADER_UI_WAIT = 7;
4249 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4250 // Logged from bootstat.
4251 BOOTLOADER_TOTAL = 8;
4252 // Shutdown duration inside init for the reboot before the current boot up.
4253 // Logged from f/b/services/.../BootReceiver.java.
4254 SHUTDOWN_DURATION = 9;
4255 // Total time for mounting of disk devices during bootup.
4256 // Logged from f/b/services/.../BootReceiver.java.
4257 MOUNT_DEFAULT_DURATION = 10;
4258 // Total time for early stage mounting of disk devices during bootup.
4259 // Logged from f/b/services/.../BootReceiver.java.
4260 MOUNT_EARLY_DURATION = 11;
4261 // Total time for late stage mounting of disk devices during bootup.
4262 // Logged from f/b/services/.../BootReceiver.java.
4263 MOUNT_LATE_DURATION = 12;
4264 // Average time to scan non-system app after OTA
4265 // Logged from f/b/services/.../PackageManagerService.java
4266 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4267 // Time to initialize Package manager after OTA
4268 // Logged from f/b/services/.../PackageManagerService.java
4269 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4270 // Time to scan all system app from Package manager after OTA
4271 // Logged from f/b/services/.../PackageManagerService.java
4272 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4273 // Init's total time for cold boot stage.
4274 // Logged from bootstat.
4275 COLDBOOT_WAIT = 16;
4276 // Init's total time for initializing selinux.
4277 // Logged from bootstat.
4278 SELINUX_INIT = 17;
4279 // Time since last factory reset.
4280 // Logged from bootstat.
4281 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004282 // Init's total time spent for completing the 1st stage.
4283 // Logged from bootstat.
4284 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004285 }
4286
4287 // Type of the event.
4288 optional DurationEvent event = 1;
4289 // Duration of the event in ms.
4290 optional int64 duration_millis = 2;
4291}
4292
4293/**
4294 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4295 * since boot-up.
4296 *
4297 * Logged from: bootstat and various system server components. Check each enums for details.
4298 */
4299message BootTimeEventElapsedTime {
4300 enum ElapsedTimeEvent {
4301 UNKNOWN = 0;
4302 // Time when init starts 1st stage. Logged from bootstat.
4303 ANDROID_INIT_STAGE_1 = 1;
4304 // Time when sys.boot_completed prop is set.
4305 // Logged from bootstat.
4306 BOOT_COMPLETE = 2;
4307 // BOOT_COMPLETE for encrypted device.
4308 BOOT_COMPLETE_ENCRYPTION = 3;
4309 // BOOT_COMPLETE for device with no encryption.
4310 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4311 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004312 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004313 // BOOT_COMPLETE after factory reset.
4314 FACTORY_RESET_BOOT_COMPLETE = 6;
4315 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4316 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004317 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4318 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004319 // BOOT_COMPLETE after OTA.
4320 OTA_BOOT_COMPLETE = 9;
4321 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4322 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004323 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4324 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004325 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4326 // Logged from f/b/services/.../UserController.java
4327 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4328 // Time when the system starts sending BOOT_COMPLETED broadcast.
4329 // Logged from f/b/services/.../UserController.java
4330 FRAMEWORK_BOOT_COMPLETED = 13;
4331 // Time when the package manager starts init.
4332 // Logged from f/b/services/.../SystemServer.java
4333 PACKAGE_MANAGER_INIT_START = 14;
4334 // Time when package manager is ready
4335 // Logged from f/b/services/.../SystemServer.java
4336 PACKAGE_MANAGER_INIT_READY = 15;
4337 // Represents the time when user has entered unlock credential for system with user pin.
4338 // Logged from bootstat.
4339 POST_DECRYPT = 16;
4340 // Represents the start of zygote's init.
4341 // Logged from zygote itself.
4342 ZYGOTE_INIT_START = 17;
4343 // Represents the start of secondary zygote's init.
4344 // TODO: add logging to zygote
4345 SECONDARY_ZYGOTE_INIT_START = 18;
4346 // Represents the start of system server's init.
4347 // Logged from f/b/services/.../SystemServer.java
4348 SYSTEM_SERVER_INIT_START = 19;
4349 // Represents the completion of system server's init.
4350 // Logged from f/b/services/.../SystemServer.java
4351 SYSTEM_SERVER_READY = 20;
4352 // Represents the start of launcher during boot-up.
4353 // TODO: add logging
4354 LAUNCHER_START = 21;
4355 // Represents the completion of launcher's initial rendering. User can use other apps from
4356 // launcher from this point.
4357 // TODO: add logging
4358 LAUNCHER_SHOWN = 22;
4359 }
4360
4361 // Type of the event.
4362 optional ElapsedTimeEvent event = 1;
4363 // Time since bootup for the event.
4364 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4365 optional int64 time_millis = 2;
4366}
4367
4368/**
4369 * Boot time events with UTC time.
4370 *
4371 * Logged from: bootstat and various system server components. Check each enums for details.
4372 */
4373message BootTimeEventUtcTime {
4374 enum UtcTimeEvent {
4375 UNKNOWN = 0;
4376 // Time of the bootstat's marking of 1st boot after the last factory reset.
4377 // Logged from bootstat.
4378 FACTORY_RESET_RESET_TIME = 1;
4379 // The time when bootstat records FACTORY_RESET_* events. This is close to
4380 // BOOT_COMPLETE time for the current bootup.
4381 // Logged from bootstat.
4382 FACTORY_RESET_CURRENT_TIME = 2;
4383 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4384 // Logged from bootstat.
4385 FACTORY_RESET_RECORD_VALUE = 3;
4386 }
4387
4388 // Type of the event.
4389 optional UtcTimeEvent event = 1;
4390 // UTC time for the event.
4391 optional int64 utc_time_secs = 2;
4392}
4393
4394/**
4395 * Boot time events representing specific error code during bootup.
4396 * Meaning of error code can be different per each event type.
4397 *
4398 * Logged from: bootstat and various system server components. Check each enums for details.
4399 */
4400message BootTimeEventErrorCode {
4401 enum ErrorCodeEvent {
4402 UNKNOWN = 0;
4403 // Linux error code for time() call to get the current UTC time.
4404 // Logged from bootstat.
4405 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4406 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4407 // as UMOUNT_STAT_* from init/reboot.cpp.
4408 // Logged from f/b/services/.../BootReceiver.java.
4409 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004410 // Reprepsents fie system mounting error code of /data partition for the current boot.
4411 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004412 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004413 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004414 }
4415
4416 // Type of the event.
4417 optional ErrorCodeEvent event = 1;
4418 // error code defined per each event type.
4419 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4420 // FS_MGR_FS_STAT.
4421 optional int32 error_code = 2;
4422}
4423
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004424/**
4425 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4426 * after an OTA.
4427 *
4428 * Logged from:
4429 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4430 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4431 */
4432message SnapshotMergeReported {
4433 // Keep in sync with
4434 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4435 enum UpdateState {
4436 // No update or merge is in progress.
4437 NONE = 0;
4438 // An update is applying; snapshots may already exist.
4439 INITIATED = 1;
4440 // An update is pending, but has not been successfully booted yet.
4441 UNVERIFIED = 2;
4442 // The kernel is merging in the background.
4443 MERGING = 3;
4444 // Post-merge cleanup steps could not be completed due to a transient
4445 // error, but the next reboot will finish any pending operations.
4446 MERGE_NEEDS_REBOOT = 4;
4447 // Merging is complete, and needs to be acknowledged.
4448 MERGE_COMPLETED = 5;
4449 // Merging failed due to an unrecoverable error.
4450 MERGE_FAILED = 6;
4451 // The update was implicitly cancelled, either by a rollback or a flash
4452 // operation via fastboot. This state can only be returned by WaitForMerge.
4453 CANCELLED = 7;
4454 };
4455
4456 // Status of the update after the merge attempts.
4457 optional UpdateState final_state = 1;
4458
4459 // Time to complete a merge operation in milliseconds.
4460 // A negative value corresponds to the case in which the merge operation
4461 // was interrupted and resumed (e.g. in case of a system reboot during the
4462 // merge).
4463 optional int64 duration_millis = 2;
4464
4465 // Number of reboots that occurred after issuing and before completing the
4466 // merge of all the snapshot devices.
4467 optional int32 intermediate_reboots = 3;
4468}
4469
Chenjie Yubbcbc602018-02-05 16:51:52 -08004470//////////////////////////////////////////////////////////////////////
4471// Pulled atoms below this line //
4472//////////////////////////////////////////////////////////////////////
4473
4474/**
David Chenc8a43242017-10-17 16:23:28 -07004475 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4476 *
4477 * Pulled from:
4478 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4479 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004480message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004481 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004482
4483 optional int64 rx_bytes = 2;
4484
4485 optional int64 rx_packets = 3;
4486
4487 optional int64 tx_bytes = 4;
4488
4489 optional int64 tx_packets = 5;
4490}
4491
4492/**
4493 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4494 *
4495 * Pulled from:
4496 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4497 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004498message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004499 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004500
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004501 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4502 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004503
4504 optional int64 rx_bytes = 3;
4505
4506 optional int64 rx_packets = 4;
4507
4508 optional int64 tx_bytes = 5;
4509
4510 optional int64 tx_packets = 6;
4511}
4512
4513/**
4514 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4515 *
4516 * Pulled from:
4517 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4518 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004519message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004520 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004521
4522 optional int64 rx_bytes = 2;
4523
4524 optional int64 rx_packets = 3;
4525
4526 optional int64 tx_bytes = 4;
4527
4528 optional int64 tx_packets = 5;
4529}
4530
4531/**
4532 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4533 *
4534 * Pulled from:
4535 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4536 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004537message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004538 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004539
Yao Chenc40a19d2018-03-15 16:48:25 -07004540 // 1 denotes foreground and 0 denotes background. This is called Set in
4541 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004542 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004543
4544 optional int64 rx_bytes = 3;
4545
4546 optional int64 rx_packets = 4;
4547
4548 optional int64 tx_bytes = 5;
4549
4550 optional int64 tx_packets = 6;
4551}
4552
4553/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004554 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4555 *
4556 * Pulled from:
4557 * StatsCompanionService
4558 */
4559message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004560 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004561
4562 optional int64 rx_bytes = 2;
4563
4564 optional int64 tx_bytes = 3;
4565}
4566
4567/**
David Chenc8a43242017-10-17 16:23:28 -07004568 * Pulls the kernel wakelock durations. This atom is adapted from
4569 * android/internal/os/KernelWakelockStats.java
4570 *
4571 * Pulled from:
4572 * StatsCompanionService using KernelWakelockReader.
4573 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004574message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004575 optional string name = 1;
4576
4577 optional int32 count = 2;
4578
4579 optional int32 version = 3;
4580
Yangster-maca8a30442018-10-13 23:46:34 -07004581 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004582}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004583
Chenjie Yu05013b32017-11-21 10:21:41 -08004584/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004585 * Pulls low power state information. If power.stats HAL is not available, this
4586 * includes platform and subsystem sleep state information,
4587 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4588 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004589 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004590 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004591 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4592 * as defined in:
4593 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004594 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004595message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004596 // Subsystem name
4597 optional string subsystem_name = 1;
4598 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4599 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004600 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4601 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004602 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004603 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004604 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004605 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004606 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004607}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004608
Chenjie Yu05013b32017-11-21 10:21:41 -08004609/**
Bookatz92da2832018-11-01 18:10:03 -07004610 * Pulls on-device power measurement information.
4611 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4612 * Pulled from:
4613 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4614 */
4615message OnDevicePowerMeasurement {
4616 // Name of the subsystem (to which the rail belongs).
4617 optional string subsystem_name = 1;
4618
4619 // Rail name. The rail lies within the subsystem.
4620 optional string rail_name = 2;
4621
4622 // Time (in ms since boot) at which the rail energy value was measured.
4623 // This may differ slightly from the time that statsd logs this information.
4624 optional uint64 measurement_timestamp_millis = 3;
4625
4626 // Accumulated energy used via the rail since device boot in uWs.
4627 optional uint64 energy_microwatt_secs = 4;
4628}
4629
4630/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004631 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004632 * Pulls the time the cpu spend on the frequency index. Frequency index
4633 * starts from highest to lowest. The value should be monotonically
4634 * increasing since boot. However, if there is a cpu
4635 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004636 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004637message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004638 optional uint32 cluster = 1;
4639 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004640 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004641}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004642
Chenjie Yu05013b32017-11-21 10:21:41 -08004643/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004644 * Pulls Cpu Time Per Uid.
4645 * Note that isolated process uid time should be attributed to host uids.
4646 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004647message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004648 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004649 optional uint64 user_time_micros = 2;
4650 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004651}
4652
4653/**
4654 * Pulls Cpu Time Per Uid per frequency.
4655 * Note that isolated process uid time should be attributed to host uids.
4656 * For each uid, we order the time by descending frequencies.
4657 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004658message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004659 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004660 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004661 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004662}
Hugo Benichi884970e2017-11-14 22:42:46 +09004663
Chenjie Yu05013b32017-11-21 10:21:41 -08004664/**
4665 * Pulls Wifi Controller Activity Energy Info
4666 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004667message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004668 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004669 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004670 // stack reported state
4671 // TODO: replace this with proto enum
4672 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004673 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004674 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004675 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004676 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004677 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004678 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004679 // product of current(mA), voltage(V) and time(ms)
4680 optional uint64 controller_energy_used = 6;
4681}
4682
4683/**
4684 * Pulls Modem Activity Energy Info
4685 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004686message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004687 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004688 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004689 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004690 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004691 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004692 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004693 /**
4694 * Tx power index
4695 * index 0 = tx_power < 0dBm
4696 * index 1 = 0dBm < tx_power < 5dBm
4697 * index 2 = 5dBm < tx_power < 15dBm
4698 * index 3 = 15dBm < tx_power < 20dBm
4699 * index 4 = tx_power > 20dBm
4700 */
4701 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004702 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004703 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004704 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004705 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004706 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004707 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004708 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004709 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004710 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004711 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004712 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004713 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004714 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004715}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004716
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004717/**
4718 * Pulls Bluetooth Activity Energy Info
4719 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4720 */
4721message BluetoothActivityInfo {
4722 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004723 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004724 // bluetooth stack state
4725 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004726 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004727 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004728 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004729 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004730 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004731 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004732 // product of current(mA), voltage(V) and time(ms)
4733 optional uint64 energy_used = 6;
4734}
4735
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004736/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004737 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004738 *
4739 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004740 */
4741message ProcessMemoryState {
4742 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004743 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004744
4745 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004746 // Usually package name, "system" for system server.
4747 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004748 optional string process_name = 2;
4749
Rafal Slawikda51b932018-12-13 16:31:33 +00004750 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004751 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004752
4753 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004754 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004755
4756 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004757 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004758
Rajeev Kumar90235992018-01-29 11:06:48 -08004759 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004760 // Value is read from memory.stat, field total_rss if per-app memory
4761 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004762 optional int64 rss_in_bytes = 6;
4763
4764 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004765 // Value is read from memory.stat, field total_cache if per-app memory
4766 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004767 optional int64 cache_in_bytes = 7;
4768
4769 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004770 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004771 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004772 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004773
Rafal Slawik203c3db2019-09-25 19:53:01 +01004774 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004775 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004776
Rafal Slawik203c3db2019-09-25 19:53:01 +01004777 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4778 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004779
Rafal Slawik203c3db2019-09-25 19:53:01 +01004780 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4781 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004782}
4783
4784/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004785 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004786 *
4787 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4788 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004789 *
4790 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004791 */
4792message ProcessMemoryHighWaterMark {
4793 // The uid if available. -1 means not available.
4794 optional int32 uid = 1 [(is_uid) = true];
4795
Rafal Slawikda51b932018-12-13 16:31:33 +00004796 // The process name.
4797 // Usually package name or process cmdline.
4798 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004799 optional string process_name = 2;
4800
Rafal Slawik239b6802019-09-09 18:46:01 +01004801 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4802 // computed by converting kilobytes to bytes.
4803 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4804
Rafal Slawik3bea8952018-11-15 12:39:33 +00004805 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4806 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004807 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004808}
4809
4810/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004811 * Logs the memory stats for a process.
4812 *
4813 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4814 * and for selected native processes.
4815 */
4816message ProcessMemorySnapshot {
4817 // The uid if available. -1 means not available.
4818 optional int32 uid = 1 [(is_uid) = true];
4819
4820 // The process name.
4821 // Usually package name or process cmdline.
4822 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4823 optional string process_name = 2;
4824
4825 // The pid of the process.
4826 // Allows to disambiguate instances of the process.
4827 optional int32 pid = 3;
4828
4829 // The current OOM score adjustment value.
4830 // Read from ProcessRecord for managed processes.
4831 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4832 optional int32 oom_score_adj = 4;
4833
4834 // The current RSS of the process.
4835 // VmRSS from /proc/pid/status.
4836 optional int32 rss_in_kilobytes = 5;
4837
4838 // The current anon RSS of the process.
4839 // RssAnon from /proc/pid/status.
4840 optional int32 anon_rss_in_kilobytes = 6;
4841
4842 // The current swap size of the process.
4843 // VmSwap from /proc/pid/status.
4844 optional int32 swap_in_kilobytes = 7;
4845
4846 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4847 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4848}
4849
4850/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004851 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004852 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004853message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004854 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004855}
4856
4857/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004858 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004859 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004860message SystemUptime {
4861 // Milliseconds since the system was booted.
4862 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4863 // for external input).
4864 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004865 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004866}
4867
4868/*
4869 * Reads from /proc/uid_concurrent_active_time which has the format:
4870 * active: X (X is # cores)
4871 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4872 * [uid1]: [time-0] [time-1] [time-2] ... ...
4873 * ...
4874 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4875 * The file contains a monotonically increasing count of time for a single boot.
4876 */
4877message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004878 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004879 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004880}
4881
4882/**
4883 * Reads from /proc/uid_concurrent_policy_time which has the format:
4884 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4885 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4886 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4887 * ...
4888 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4889 * The file contains a monotonically increasing count of time for a single boot.
4890 */
4891message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004892 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004893 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004894 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004895}
4896
4897/*
4898 * Pulls free disk space, for data, system partition and temporary directory.
4899 */
4900message DiskSpace {
4901 // available bytes in data partition
4902 optional uint64 data_available_bytes = 1;
4903 // available bytes in system partition
4904 optional uint64 system_available_bytes = 2;
4905 // available bytes in download cache or temp directories
4906 optional uint64 temp_available_bytes = 3;
4907}
Tej Singhbf972d92018-01-10 20:51:13 -08004908
4909/**
4910 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004911 *
4912 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004913 */
4914message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004915 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004916}
4917
4918/**
4919 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004920 * Pulled from:
4921 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004922 */
4923message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004924 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004925}
4926
4927/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004928 * Pulls battery voltage.
4929 * Pulled from:
4930 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4931 */
4932message BatteryVoltage {
4933 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004934 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004935}
4936
4937/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004938 * Pulls battery level (percent full, from 0 to 100).
4939 *
4940 * Pulled from:
4941 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4942 */
4943message BatteryLevel {
4944 // Battery level. Should be in [0, 100].
4945 optional int32 battery_level = 1;
4946}
4947
4948/**
Tej Singhd89137e2018-03-26 14:51:40 -07004949 * Pulls the temperature of various parts of the device.
4950 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004951 *
Maggie White442b6312019-04-05 16:26:44 -07004952 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004953 */
4954message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004955 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004956 optional android.os.TemperatureTypeEnum sensor_location = 1;
4957
4958 // The name of the temperature source. Eg. CPU0
4959 optional string sensor_name = 2;
4960
Tej Singhd89137e2018-03-26 14:51:40 -07004961 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004962 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004963 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004964
4965 // Relative severity of the throttling, see enum definition.
4966 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004967}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004968
4969/**
4970 * Pulls the statistics of calls to Binder.
4971 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004972 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4973 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004974 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004975 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004976 */
4977message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004978 // UID of the process responsible for the binder transaction. It will be set if the process
4979 // executing the binder transaction attribute the transaction to another uid using
4980 // Binder.setThreadWorkSource().
4981 //
4982 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004983 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004984 // UID of the process executing the binder transaction.
4985 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004986 // Fully qualified class name of the API call.
4987 //
4988 // This is a system server class name.
4989 //
4990 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4991 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4992 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4993 // commonly used APIs.
4994 optional string service_class_name = 2;
4995 // Method name of the API call. It can also be a transaction code if we cannot
4996 // resolve it to a name. See Binder#getTransactionName.
4997 //
4998 // This is a system server method name.
4999 optional string service_method_name = 3;
5000 // Total number of API calls.
5001 optional int64 call_count = 4;
5002 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5003 optional bool screen_interactive = 13;
5004 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5005 // call_count will be equal to recorded_call_count.
5006 //
5007 // If recorded_call_count is different than call_count, it means data collection has been
5008 // sampled. All the fields below will be sampled in this case.
5009 optional int64 recorded_call_count = 12;
5010 // Number of exceptions thrown by the API.
5011 optional int64 recorded_exception_count = 5;
5012 // Total latency of all API calls.
5013 // Average can be computed using total_latency_micros / recorded_call_count.
5014 optional int64 recorded_total_latency_micros = 6;
5015 // Maximum latency of one API call.
5016 optional int64 recorded_max_latency_micros = 7;
5017 // Total CPU usage of all API calls.
5018 // Average can be computed using total_cpu_micros / recorded_call_count.
5019 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5020 optional int64 recorded_total_cpu_micros = 8;
5021 // Maximum CPU usage of one API call.
5022 optional int64 recorded_max_cpu_micros = 9;
5023 // Maximum parcel reply size of one API call.
5024 optional int64 recorded_max_reply_size_bytes = 10;
5025 // Maximum parcel request size of one API call.
5026 optional int64 recorded_max_request_size_bytes = 11;
5027}
5028
5029/**
5030 * Pulls the statistics of exceptions during calls to Binder.
5031 *
5032 * Binder stats are cumulative from boot unless somebody reset the data using
5033 * > adb shell dumpsys binder_calls_stats --reset
5034 */
5035message BinderCallsExceptions {
5036 // Exception class name, e.g. java.lang.IllegalArgumentException.
5037 //
5038 // This is an exception class name thrown by the system server.
5039 optional string exception_class_name = 1;
5040 // Total number of exceptions.
5041 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005042}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005043
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005044/**
5045 * Pulls the statistics of message dispatching on HandlerThreads.
5046 *
5047 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5048 * config on the device.
5049 *
5050 * Next tag: 11
5051 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005052message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005053 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005054 optional int32 uid = 1 [(is_uid) = true];
5055
5056 // Fully qualified class name of the handler target class.
5057 //
5058 // This field does not contain PII. This is a system server class name.
5059 optional string handler_class_name = 2;
5060
5061 // The name of the thread that runs the Looper.
5062 //
5063 // This field does not contain PII. This is a system server thread name.
5064 optional string looper_thread_name = 3;
5065
5066 // The name of the dispatched message.
5067 //
5068 // This field does not contain PII. This is a system server constant or class
5069 // name.
5070 optional string message_name = 4;
5071
5072 // Total number of successfully dispatched messages.
5073 optional int64 message_count = 5;
5074
5075 // Total number of messages that failed dispatching.
5076 optional int64 exception_count = 6;
5077
5078 // Total number of processed messages we have data recorded for. If we
5079 // collected data for all the messages, message_count will be equal to
5080 // recorded_message_count.
5081 //
5082 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005083 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005084 optional int64 recorded_message_count = 7;
5085
5086 // Total latency of all processed messages.
5087 // Average can be computed using recorded_total_latency_micros /
5088 // recorded_message_count.
5089 optional int64 recorded_total_latency_micros = 8;
5090
5091 // Total CPU usage of all processed message.
5092 // Average can be computed using recorded_total_cpu_micros /
5093 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005094 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005095 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005096
5097 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5098 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005099
5100 // Max recorded CPU usage of all processed messages.
5101 optional int64 recorded_max_cpu_micros = 11;
5102
5103 // Max recorded latency of all processed messages.
5104 optional int64 recorded_max_latency_micros = 12;
5105
5106 // Total number of messages we tracked the dispatching delay for. If we
5107 // collected data for all the messages, message_count will be equal to
5108 // recorded_delay_message_count.
5109 //
5110 // If recorded_delay_message_count is different than message_count, it means data
5111 // collection has been sampled or/and not all messages specified the target dispatch time.
5112 // The fields below will be sampled in this case.
5113 optional int64 recorded_delay_message_count = 13;
5114
5115 // Total dispatching delay of all processed messages.
5116 // Calculated as a difference between the target dispatching time (Message.when)
5117 // and the actual dispatching time.
5118 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5119 optional int64 recorded_total_delay_millis = 14;
5120
5121 // Max dispatching delay of all processed messages.
5122 // Calculated as a difference between the target dispatching time (Message.when)
5123 // and the actual dispatching time.
5124 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005125}
Tej Singh86dc9db2018-09-06 00:39:57 +00005126
5127/**
5128 * Pulls disk information, such as write speed and latency.
5129 */
5130message DiskStats {
5131 // Time taken to open, write 512B to, and close a file.
5132 // -1 if error performing the check.
5133 optional int64 data_write_latency_millis = 1;
5134
5135 optional bool file_based_encryption = 2;
5136
5137 // Recent disk write speed in kB/s.
5138 // -1 if error querying storageed.
5139 // 0 if data is unavailable.
5140 optional int32 recent_disk_write_speed = 3;
5141}
5142
5143
5144/**
5145 * Free and total bytes of the Data, Cache, and System partition.
5146 */
5147message DirectoryUsage {
5148 enum Directory {
5149 UNKNOWN = 0;
5150 DATA = 1;
5151 CACHE = 2;
5152 SYSTEM = 3;
5153 }
5154 optional Directory directory = 1;
5155 optional int64 free_bytes = 2;
5156 optional int64 total_bytes = 3;
5157}
5158
5159
5160/**
5161 * Size of an application: apk size, data size, and cache size.
5162 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5163 * Information is only reported for apps with the primary user (user 0).
5164 * Sizes are aggregated by package name.
5165 */
5166message AppSize {
5167 // Including uids will involve modifying diskstats logic.
5168 optional string package_name = 1;
5169 // App size in bytes. -1 if unavailable.
5170 optional int64 app_size_bytes = 2;
5171 // App data size in bytes. -1 if unavailable.
5172 optional int64 app_data_size_bytes = 3;
5173 // App cache size in bytes. -1 if unavailable.
5174 optional int64 app_cache_size_bytes = 4;
5175 // Time that the cache file was produced.
5176 // Uses System.currentTimeMillis(), which is wall clock time.
5177 optional int64 cache_time_millis = 5;
5178}
5179
5180
5181/**
5182 * Size of a particular category. Eg: photos, videos.
5183 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5184 */
5185message CategorySize {
5186 enum Category {
5187 UNKNOWN = 0;
5188 APP_SIZE = 1;
5189 APP_DATA_SIZE = 2;
5190 APP_CACHE_SIZE = 3;
5191 PHOTOS = 4;
5192 VIDEOS = 5;
5193 AUDIO = 6;
5194 DOWNLOADS = 7;
5195 SYSTEM = 8;
5196 OTHER = 9;
5197 }
5198 optional Category category = 1;
5199 // Category size in bytes.
5200 optional int64 size_bytes = 2;
5201 // Time that the cache file was produced.
5202 // Uses System.currentTimeMillis(), which is wall clock time.
5203 optional int64 cache_time_millis = 3;
5204}
Tej Singhd6d6d772018-09-05 17:41:25 -07005205
5206/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005207 * Pulls per uid I/O stats. The stats are cumulative since boot.
5208 *
5209 * Read/write bytes are I/O events from a storage device
5210 * Read/write chars are data requested by read/write syscalls, and can be
5211 * satisfied by caching.
5212 *
5213 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5214 */
5215message DiskIo {
5216 optional int32 uid = 1 [(is_uid) = true];
5217 optional int64 fg_chars_read = 2;
5218 optional int64 fg_chars_write = 3;
5219 optional int64 fg_bytes_read = 4;
5220 optional int64 fg_bytes_write = 5;
5221 optional int64 bg_chars_read = 6;
5222 optional int64 bg_chars_write = 7;
5223 optional int64 bg_bytes_read = 8;
5224 optional int64 bg_bytes_write = 9;
5225 optional int64 fg_fsync = 10;
5226 optional int64 bg_fsync= 11;
5227}
5228
5229
5230/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005231 * Pulls the number of fingerprints for each user.
5232 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005233 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005234 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005235message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005236 // The associated user. Eg: 0 for owners, 10+ for others.
5237 // Defined in android/os/UserHandle.java
5238 optional int32 user = 1;
5239 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005240 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005241}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005242
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005243/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005244 * Pulls the number of faces for each user.
5245 *
5246 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5247 */
5248message NumFacesEnrolled {
5249 // The associated user. Eg: 0 for owners, 10+ for others.
5250 // Defined in android/os/UserHandle.java
5251 optional int32 user = 1;
5252 // Number of faces registered to that user.
5253 optional int32 num_faces_enrolled = 2;
5254}
5255/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005256 * A mapping of role holder -> role
5257 */
5258message RoleHolder {
5259 // uid of the role holder
5260 optional int32 uid = 1 [(is_uid) = true];
5261
5262 // package name of the role holder
5263 optional string package_name = 2;
5264
5265 // the role held
5266 optional string role = 3;
5267}
5268
Yangsteraf9aee72018-10-12 09:26:16 -07005269message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005270 // These are all in byte resolution.
5271 optional int64 min = 1 [deprecated = true];
5272 optional int64 average = 2 [deprecated = true];
5273 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005274
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005275 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5276 // int64 fields.
5277 optional int32 mean_kb = 4;
5278 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005279}
5280
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005281// A reduced subset of process states; reducing the number of possible states allows more
5282// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5283enum ProcessStateAggregated {
5284 PROCESS_STATE_UNKNOWN = 0;
5285 // Persistent system process.
5286 PROCESS_STATE_PERSISTENT = 1;
5287 // Top activity; actually any visible activity.
5288 PROCESS_STATE_TOP = 2;
5289 // Process binding to top or a foreground service.
5290 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5291 // Processing running a foreground service.
5292 PROCESS_STATE_FGS = 4;
5293 // Important foreground process (ime, wallpaper, etc).
5294 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5295 // Important background process.
5296 PROCESS_STATE_BACKGROUND = 6;
5297 // Process running a receiver.
5298 PROCESS_STATE_RECEIVER = 7;
5299 // All kinds of cached processes.
5300 PROCESS_STATE_CACHED = 8;
5301}
5302
5303// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005304message ProcessStatsStateProto {
5305 optional android.service.procstats.ScreenState screen_state = 1;
5306
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005307 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005308
5309 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5310 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005311 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5312
5313 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005314
5315 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005316 optional int64 duration_millis = 4 [deprecated = true];
5317 // Same as above, but with minute resolution so it fits into an int32.
5318 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005319
5320 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005321 optional int64 realtime_duration_millis = 9 [deprecated = true];
5322 // Same as above, but with minute resolution so it fits into an int32.
5323 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005324
5325 // # of samples taken
5326 optional int32 sample_size = 5;
5327
5328 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005329 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005330
5331 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005332 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005333
5334 // RSS is memory resident for this process
5335 optional AggStats rss = 8;
5336}
5337
5338// Next Tag: 7
5339message ProcessStatsProto {
5340 // Name of process.
5341 optional string process = 1;
5342
5343 // Uid of the process.
5344 optional int32 uid = 2;
5345
5346 // Information about how often kills occurred
5347 message Kill {
5348 // Count of excessive CPU kills
5349 optional int32 cpu = 1;
5350
5351 // Count of kills when cached
5352 optional int32 cached = 2;
5353
5354 // PSS stats during cached kill
5355 optional AggStats cached_pss = 3;
5356 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005357 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005358
5359 // Time and memory spent in various states.
5360 repeated ProcessStatsStateProto states = 5;
5361
5362 // Total time process has been running... screen_state, memory_state, and process_state
5363 // will not be set.
5364 optional ProcessStatsStateProto total_running_state = 6;
5365}
5366
5367message PackageServiceOperationStatsProto {
5368 // Operate enum: Started, Foreground, Bound, Executing
5369 optional android.service.procstats.ServiceOperationState operation = 1;
5370
5371 // Number of times the service was in this operation.
5372 optional int32 count = 2;
5373
5374 // Information about a state the service can be in.
5375 message StateStats {
5376 // Screen state enum.
5377 optional android.service.procstats.ScreenState screen_state = 1;
5378 // Memory state enum.
5379 optional android.service.procstats.MemoryState memory_state = 2;
5380
5381 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005382 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005383 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005384 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005385 }
5386 repeated StateStats state_stats = 3;
5387}
5388
5389message PackageServiceStatsProto {
5390 // Name of service component.
5391 optional string service_name = 1;
5392
5393 // The operation stats.
5394 // The package_name, package_uid, package_version, service_name will not be set to save space.
5395 repeated PackageServiceOperationStatsProto operation_stats = 2;
5396}
5397
5398message PackageAssociationSourceProcessStatsProto {
5399 // Uid of the process.
5400 optional int32 process_uid = 1;
5401 // Process name.
5402 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005403 // Package name.
5404 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005405 // Total count of the times this association appeared.
5406 optional int32 total_count = 3;
5407
5408 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005409 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005410
5411 // Total count of the times this association became actively impacting its target process.
5412 optional int32 active_count = 5;
5413
5414 // Information on one source in this association.
5415 message StateStats {
5416 // Process state enum.
5417 optional android.service.procstats.ProcessState process_state = 1;
5418 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005419 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005420 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005421 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005422 }
5423 repeated StateStats active_state_stats = 6;
5424}
5425
5426message PackageAssociationProcessStatsProto {
5427 // Name of the target component.
5428 optional string component_name = 1;
5429 // Information on one source in this association.
5430 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5431}
5432
5433
5434message ProcessStatsPackageProto {
5435 // Name of package.
5436 optional string package = 1;
5437
5438 // Uid of the package.
5439 optional int32 uid = 2;
5440
5441 // Version of the package.
5442 optional int64 version = 3;
5443
5444 // Stats for each process running with the package loaded in to it.
5445 repeated ProcessStatsProto process_stats = 4;
5446
5447 // Stats for each of the package's services.
5448 repeated PackageServiceStatsProto service_stats = 5;
5449
5450 // Stats for each association with the package.
5451 repeated PackageAssociationProcessStatsProto association_stats = 6;
5452}
5453
5454message ProcessStatsSectionProto {
5455 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005456 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005457
5458 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005459 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005460
5461 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005462 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005463
5464 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005465 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005466
5467 // System runtime library. e.g. "libdvm.so", "libart.so".
5468 optional string runtime = 5;
5469
5470 // whether kernel reports swapped pss.
5471 optional bool has_swapped_pss = 6;
5472
5473 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5474 enum Status {
5475 STATUS_UNKNOWN = 0;
5476 STATUS_COMPLETE = 1;
5477 STATUS_PARTIAL = 2;
5478 STATUS_SHUTDOWN = 3;
5479 STATUS_SYSPROPS = 4;
5480 }
5481 repeated Status status = 7;
5482
Chenjie Yub2ecc792019-01-17 10:27:26 -08005483 // Number of pages available of various types and sizes, representation fragmentation.
5484 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5485
Yangsteraf9aee72018-10-12 09:26:16 -07005486 // Stats for each process.
5487 repeated ProcessStatsProto process_stats = 8;
5488
5489 // Stats for each package.
5490 repeated ProcessStatsPackageProto package_stats = 9;
5491}
5492
Chenjie Yub2ecc792019-01-17 10:27:26 -08005493message ProcessStatsAvailablePagesProto {
5494 // Node these pages are in (as per /proc/pagetypeinfo)
5495 optional int32 node = 1;
5496
5497 // Zone these pages are in (as per /proc/pagetypeinfo)
5498 optional string zone = 2;
5499
5500 // Label for the type of these pages (as per /proc/pagetypeinfo)
5501 optional string label = 3;
5502
5503 // Distribution of number of pages available by order size. First entry in array is
5504 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5505 repeated int32 pages_per_order = 4;
5506}
5507
Chenjie Yu12e5e672018-09-14 15:54:59 -07005508/**
5509 * Pulled from ProcessStatsService.java
5510 */
5511message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005512 optional ProcessStatsSectionProto proc_stats_section = 1;
5513}
5514
Chenjie Yuf910b7802019-01-11 16:08:20 -08005515/**
5516 * Pulled from ProcessStatsService.java
5517 */
5518message ProcStatsPkgProc {
5519 optional ProcessStatsSectionProto proc_stats_section = 1;
5520}
5521
Chris Wrencdea3b72019-11-22 16:58:17 -05005522// Next Tag: 2
5523message PackageRemoteViewInfoProto {
5524 optional string package_name = 1;
5525 // add per-package additional info here (like channels)
5526}
5527
5528// Next Tag: 2
5529message NotificationRemoteViewsProto {
5530 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5531}
5532
5533/**
5534 * Pulled from NotificationManagerService.java
5535 */
5536message NotificationRemoteViews {
5537 optional NotificationRemoteViewsProto notification_remote_views = 1;
5538}
5539
Yotam Aron74299972020-01-16 16:20:58 +02005540/**
5541 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5542 */
5543message PackageNotificationPreferences {
5544 // Uid under which the package is installed.
5545 optional int32 uid = 1;
5546 // Notification importance, which specifies when and how a notification is displayed.
5547 // Specified under core/java/android/app/NotificationManager.java.
5548 optional int32 importance = 2;
5549 // Lockscreen visibility as set by the user.
5550 optional int32 visibility = 3;
5551 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5552 // PreferencesHelper.java)
5553 optional int32 user_locked_fields = 4;
5554}
5555
5556/**
5557 * Atom that contains a list of a package's channel preferences, pulled from
5558 * NotificationManagerService.java.
5559 */
5560message PackageNotificationChannelPreferences {
5561 // Uid under which the package is installed.
5562 optional int32 uid = 1;
5563 // Channel's ID. Should always be available.
5564 optional string channel_id = 2;
5565 // Channel's name. Should always be available.
5566 optional string channel_name = 3;
5567 // Channel's description. Optionally set by the channel creator.
5568 optional string description = 4;
5569 // Notification importance, which specifies when and how a notification is displayed. Specified
5570 // under core/java/android/app/NotificationManager.java.
5571 optional int32 importance = 5;
5572 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5573 // at core/java/android/app/NotificationChannel.java
5574 optional int32 user_locked_fields = 6;
5575 // Indicates if the channel was deleted by the app.
5576 optional bool is_deleted = 7;
5577}
5578
5579/**
5580 * Atom that contains a list of a package's channel group preferences, pulled from
5581 * NotificationManagerService.java.
5582 */
5583message PackageNotificationChannelGroupPreferences {
5584 // Uid under which the package is installed.
5585 optional int32 uid = 1;
5586 // Channel Group's ID. Should always be available.
5587 optional string group_id = 2;
5588 // Channel Group's name. Should always be available.
5589 optional string group_name = 3;
5590 // Channel Group's description. Optionally set by group creator.
5591 optional string description = 4;
5592 // Indicates if notifications from this channel group are blocked.
5593 optional bool is_blocked = 5;
5594 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5595 // at core/java/android/app/NotificationChannelGroup.java
5596 optional int32 user_locked_fields = 6;
5597}
5598
Yangsteraf9aee72018-10-12 09:26:16 -07005599message PowerProfileProto {
5600 optional double cpu_suspend = 1;
5601
5602 optional double cpu_idle = 2;
5603
5604 optional double cpu_active = 3;
5605
5606 message CpuCluster {
5607 optional int32 id = 1;
5608 optional double cluster_power = 2;
5609 optional int32 cores = 3;
5610 repeated int64 speed = 4;
5611 repeated double core_power = 5;
5612 }
5613
5614 repeated CpuCluster cpu_cluster = 40;
5615
5616 optional double wifi_scan = 4;
5617
5618 optional double wifi_on = 5;
5619
5620 optional double wifi_active = 6;
5621
5622 optional double wifi_controller_idle = 7;
5623
5624 optional double wifi_controller_rx = 8;
5625
5626 optional double wifi_controller_tx = 9;
5627
5628 repeated double wifi_controller_tx_levels = 10;
5629
5630 optional double wifi_controller_operating_voltage = 11;
5631
5632 optional double bluetooth_controller_idle = 12;
5633
5634 optional double bluetooth_controller_rx = 13;
5635
5636 optional double bluetooth_controller_tx = 14;
5637
5638 optional double bluetooth_controller_operating_voltage = 15;
5639
5640 optional double modem_controller_sleep = 16;
5641
5642 optional double modem_controller_idle = 17;
5643
5644 optional double modem_controller_rx = 18;
5645
5646 repeated double modem_controller_tx = 19;
5647
5648 optional double modem_controller_operating_voltage = 20;
5649
5650 optional double gps_on = 21;
5651
5652 repeated double gps_signal_quality_based = 22;
5653
5654 optional double gps_operating_voltage = 23;
5655
5656 optional double bluetooth_on = 24;
5657
5658 optional double bluetooth_active = 25;
5659
5660 optional double bluetooth_at_cmd = 26;
5661
5662 optional double ambient_display = 27;
5663
5664 optional double screen_on = 28;
5665
5666 optional double radio_on = 29;
5667
5668 optional double radio_scanning = 30;
5669
5670 optional double radio_active = 31;
5671
5672 optional double screen_full = 32;
5673
5674 optional double audio = 33;
5675
5676 optional double video = 34;
5677
5678 optional double flashlight = 35;
5679
5680 optional double memory = 36;
5681
5682 optional double camera = 37;
5683
5684 optional double wifi_batched_scan = 38;
5685
5686 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005687}
Chenjie Yuab530202018-09-26 12:39:20 -07005688
5689/**
5690 * power_profile.xml and other constants for power model calculations.
5691 * Pulled from PowerProfile.java
5692 */
5693message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005694 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005695}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005696
5697/**
arangelovd5db50e2018-10-12 20:24:39 +01005698 * Logs when a user restriction was added or removed.
5699 *
5700 * Logged from:
5701 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5702 */
5703message UserRestrictionChanged {
5704 // The raw string of the user restriction as defined in UserManager.
5705 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5706 optional string restriction = 1;
5707 // Whether the restriction is enabled or disabled.
5708 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005709}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005710
5711/**
5712 * Pulls process user time and system time. Puller takes a snapshot of all pids
5713 * in the system and returns cpu stats for those that are working at the time.
5714 * Dead pids will be dropped. Kernel processes are excluded.
5715 * Min cool-down is 5 sec.
5716 */
5717message ProcessCpuTime {
5718 optional int32 uid = 1 [(is_uid) = true];
5719
5720 optional string process_name = 2;
5721 // Process cpu time in user space, cumulative from boot/process start
5722 optional int64 user_time_millis = 3;
5723 // Process cpu time in system space, cumulative from boot/process start
5724 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005725}
Misha Wagner5a51e002018-10-03 15:04:09 +01005726
5727/**
5728 * Pulls the CPU usage for each thread.
5729 *
5730 * Read from /proc/$PID/task/$TID/time_in_state files.
5731 *
5732 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5733 * time_in_state files not being present on some phones, have not been addressed. These should be
5734 * considered before a public release.
5735 */
5736message CpuTimePerThreadFreq {
5737 // UID that owns the process.
5738 optional int32 uid = 1 [(is_uid) = true];
5739 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005740 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005741 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005742 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005743 // Name of the process taken from `/proc/$PID/cmdline`.
5744 optional string process_name = 4;
5745 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5746 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005747
5748 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5749 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5750 // frequencies are given here as the alternative is sending eight separate atoms. This method
5751 // significantly reduces the amount of data created
5752 optional int32 frequency1_khz = 6;
5753 optional int32 time1_millis = 7;
5754 optional int32 frequency2_khz = 8;
5755 optional int32 time2_millis = 9;
5756 optional int32 frequency3_khz = 10;
5757 optional int32 time3_millis = 11;
5758 optional int32 frequency4_khz = 12;
5759 optional int32 time4_millis = 13;
5760 optional int32 frequency5_khz = 14;
5761 optional int32 time5_millis = 15;
5762 optional int32 frequency6_khz = 16;
5763 optional int32 time6_millis = 17;
5764 optional int32 frequency7_khz = 18;
5765 optional int32 time7_millis = 19;
5766 optional int32 frequency8_khz = 20;
5767 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005768}
Bookatz75ee60422018-11-09 12:27:37 -08005769
5770/**
Bookatz366a4432018-11-20 09:42:33 -08005771 * Pulls information about the device's build.
5772 */
5773message BuildInformation {
5774 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5775 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5776 optional string fingerprint = 1;
5777
5778 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5779 optional string brand = 2;
5780
5781 // Build.PRODUCT. The name of the overall product.
5782 optional string product = 3;
5783
5784 // Build.DEVICE. The name of the industrial design.
5785 optional string device = 4;
5786
5787 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5788 optional string version_release = 5;
5789
5790 // Build.ID. E.g. a label like "M4-rc20".
5791 optional string id = 6;
5792
5793 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5794 // represent this build.
5795 optional string version_incremental = 7;
5796
5797 // Build.TYPE. The type of build, like "user" or "eng".
5798 optional string type = 8;
5799
5800 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5801 optional string tags = 9;
5802}
5803
5804/**
Adam He420947c2019-01-23 15:59:09 -08005805 * Logs information about mismatched caller for content capture.
5806 *
5807 * Logged from:
5808 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5809 */
5810message ContentCaptureCallerMismatchReported {
5811 optional string intended_package = 1;
5812 optional string calling_package = 2;
5813}
5814
5815/**
5816 * Logs information about content capture service events.
5817 *
5818 * Logged from:
5819 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5820 */
5821message ContentCaptureServiceEvents {
5822 // The type of event.
5823 enum Event {
5824 UNKNOWN = 0;
5825 ON_CONNECTED = 1;
5826 ON_DISCONNECTED = 2;
5827 SET_WHITELIST = 3;
5828 SET_DISABLED = 4;
5829 ON_USER_DATA_REMOVED = 5;
5830 }
5831 optional Event event = 1;
5832 // component/package of content capture service.
5833 optional string service_info = 2;
5834 // component/package of target.
5835 // it's a concatenated list of component/package for SET_WHITELIST event
5836 // separated by " ".
5837 optional string target_info = 3;
5838}
5839
5840/**
5841 * Logs information about content capture session events.
5842 *
5843 * Logged from:
5844 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5845 */
5846message ContentCaptureSessionEvents {
5847 // The type of event.
5848 enum Event {
5849 UNKNOWN = 0;
5850 ON_SESSION_STARTED = 1;
5851 ON_SESSION_FINISHED = 2;
5852 SESSION_NOT_CREATED = 3;
5853 }
5854 optional int32 session_id = 1;
5855 optional Event event = 2;
5856 // (n/a on session finished)
5857 optional int32 state_flags = 3;
5858 // component/package of content capture service.
5859 optional string service_info = 4;
5860 // component/package of app.
5861 // (n/a on session finished)
5862 optional string app_info = 5;
5863 optional bool is_child_session = 6;
5864}
5865
5866/**
5867 * Logs information about session being flushed.
5868 *
5869 * Logged from:
5870 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5871 */
5872message ContentCaptureFlushed {
5873 optional int32 session_id = 1;
5874 // component/package of content capture service.
5875 optional string service_info = 2;
5876 // component/package of app.
5877 optional string app_info = 3;
5878 // session start/finish events
5879 optional int32 child_session_started = 4;
5880 optional int32 child_session_finished = 5;
5881 // count of view events.
5882 optional int32 view_appeared_count = 6;
5883 optional int32 view_disappeared_count = 7;
5884 optional int32 view_text_changed_count = 8;
5885
5886 // Flush stats.
5887 optional int32 max_events = 9;
5888 optional int32 idle_flush_freq = 10;
5889 optional int32 text_flush_freq = 11;
5890 optional int32 flush_reason = 12;
5891}
5892
5893/**
Bookatz75ee60422018-11-09 12:27:37 -08005894 * Pulls on-device BatteryStats power use calculations for the overall device.
5895 */
5896message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005897 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5898 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5899 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5900 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005901}
5902
5903/**
5904 * Pulls on-device BatteryStats power use calculations broken down by uid.
5905 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5906 * that is attributed to non-uid items. They must all be included to get the total power use.
5907 */
5908message DeviceCalculatedPowerBlameUid {
5909 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5910 optional int32 uid = 1 [(is_uid) = true];
5911
Bookatz3dbc13a2018-12-21 12:16:51 -08005912 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5913 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5914 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005915}
5916
5917/**
5918 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5919 * drain type.
5920 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5921 * is attributed uids. They must all be included to get the total power use.
5922 */
5923message DeviceCalculatedPowerBlameOther {
5924 // The type of item whose power use is being reported.
5925 enum DrainType {
5926 AMBIENT_DISPLAY = 0;
5927 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5928 BLUETOOTH = 2;
5929 CAMERA = 3;
5930 // Cell-standby
5931 CELL = 4;
5932 FLASHLIGHT = 5;
5933 IDLE = 6;
5934 MEMORY = 7;
5935 // Amount that total computed drain exceeded the drain estimated using the
5936 // battery level changes and capacity.
5937 OVERCOUNTED = 8;
5938 PHONE = 9;
5939 SCREEN = 10;
5940 // Amount that total computed drain was below the drain estimated using the
5941 // battery level changes and capacity.
5942 UNACCOUNTED = 11;
5943 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5944 WIFI = 13;
5945 }
5946 optional DrainType drain_type = 1;
5947
Bookatz3dbc13a2018-12-21 12:16:51 -08005948 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5949 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5950 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005951}
arangelov4e994062018-11-13 16:12:38 +00005952
5953/**
5954 * Logs device policy features.
5955 *
5956 * Logged from:
5957 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5958 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5959 */
5960message DevicePolicyEvent {
5961 // The event id - unique for each event.
5962 optional android.stats.devicepolicy.EventId event_id = 1;
5963 // The admin package name.
5964 optional string admin_package_name = 2;
5965 // A generic integer parameter.
5966 optional int32 integer_value = 3;
5967 // A generic boolean parameter.
5968 optional bool boolean_value = 4;
5969 // A parameter specifying a time period in milliseconds.
5970 optional uint64 time_period_millis = 5;
5971 // A parameter specifying a list of package names, bundle extras or string parameters.
5972 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5973}
shawnlinea5b66b2018-11-13 15:05:29 +08005974
5975/**
5976 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5977 *
5978 * Logged from:
5979 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5980 */
5981message DocsUILaunchReported {
5982 optional android.stats.docsui.LaunchAction launch_action = 1;
5983 optional bool has_initial_uri = 2;
5984 optional android.stats.docsui.MimeType mime_type = 3;
5985 optional android.stats.docsui.Root initial_root = 4;
5986}
5987
5988/**
5989 * Logs root/app visited event in file managers/picker. Call this when the user
5990 * taps on root/app in hamburger menu.
5991 *
5992 * Logged from:
5993 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5994 */
5995message DocsUIRootVisitedReported {
5996 optional android.stats.docsui.ContextScope scope = 1;
5997 optional android.stats.docsui.Root root = 2;
5998}
5999
6000/**
6001 * Logs file operation stats. Call this when a file operation has completed.
6002 *
6003 * Logged from:
6004 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6005 */
6006message DocsUIFileOperationReported {
6007 optional android.stats.docsui.Provider provider = 1;
6008 optional android.stats.docsui.FileOperation file_op = 2;
6009}
6010
6011/**
6012 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6013 * mode.
6014 *
6015 * Logged from:
6016 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6017 */
6018message DocsUIFileOperationCopyMoveModeReported {
6019 optional android.stats.docsui.FileOperation file_op = 1;
6020 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6021}
6022
6023
6024/**
6025 * Logs file sub operation stats. Call this when a file operation has failed.
6026 *
6027 * Logged from:
6028 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6029 */
6030message DocsUIFileOperationFailureReported {
6031 optional android.stats.docsui.Authority authority = 1;
6032 optional android.stats.docsui.SubFileOperation sub_op = 2;
6033}
6034
6035/**
6036* Logs the cancellation of a file operation. Call this when a job is canceled
6037*
6038* Logged from:
6039* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6040*/
6041message DocsUIFileOperationCanceledReported {
6042 optional android.stats.docsui.FileOperation file_op = 1;
6043}
6044
6045/**
6046 * Logs startup time in milliseconds.
6047 *
6048 * Logged from:
6049 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6050 */
6051message DocsUIStartupMsReported {
6052 optional int32 startup_millis = 1;
6053}
6054
6055/**
6056 * Logs the action that was started by user.
6057 *
6058 * Logged from:
6059 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6060 */
6061message DocsUIUserActionReported {
6062 optional android.stats.docsui.UserAction action = 1;
6063}
6064
6065/**
6066 * Logs the invalid type when invalid scoped access is requested.
6067 *
6068 * Logged from:
6069 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6070 */
6071message DocsUIInvalidScopedAccessRequestReported {
6072 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006073}
Ben Murdochbab399f62018-12-06 11:01:38 +00006074
6075/**
shawnlina75e82d2019-01-07 10:31:12 +08006076 * Logs the package name that launches docsui picker mode.
6077 *
6078 * Logged from:
6079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6080 */
6081message DocsUIPickerLaunchedFromReported {
6082 optional string package_name = 1;
6083}
6084
6085/**
6086 * Logs the search type.
6087 *
6088 * Logged from:
6089 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6090 */
6091message DocsUISearchTypeReported {
6092 optional android.stats.docsui.SearchType search_type = 1;
6093}
6094
6095/**
6096 * Logs the search mode.
6097 *
6098 * Logged from:
6099 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6100 */
6101message DocsUISearchModeReported {
6102 optional android.stats.docsui.SearchMode search_mode = 1;
6103}
6104
6105/**
6106 * Logs the pick result information.
6107 *
6108 * Logged from:
6109 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6110 */
6111message DocsUIPickResultReported {
6112 optional int32 total_action_count = 1;
6113 optional int64 duration_millis = 2;
6114 optional int32 file_count= 3;
6115 optional bool is_searching = 4;
6116 optional android.stats.docsui.Root picked_from = 5;
6117 optional android.stats.docsui.MimeType mime_type = 6;
6118 optional int32 repeatedly_pick_times = 7;
6119}
6120
6121/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006122 * Logs when an app's memory is compacted.
6123 *
6124 * Logged from:
6125 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6126 */
6127message AppCompacted {
6128 // The pid of the process being compacted.
6129 optional int32 pid = 1;
6130
6131 // The name of the process being compacted.
6132 optional string process_name = 2;
6133
6134 // The type of compaction.
6135 enum Action {
6136 UNKNOWN = 0;
6137 SOME = 1;
6138 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006139 PERSISTENT = 3;
6140 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006141 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006142 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006143
6144 // Total RSS in kilobytes consumed by the process prior to compaction.
6145 optional int64 before_rss_total_kilobytes = 4;
6146
6147 // File RSS in kilobytes consumed by the process prior to compaction.
6148 optional int64 before_rss_file_kilobytes = 5;
6149
6150 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6151 optional int64 before_rss_anon_kilobytes = 6;
6152
6153 // Swap in kilobytes consumed by the process prior to compaction.
6154 optional int64 before_swap_kilobytes = 7;
6155
6156 // Total RSS in kilobytes consumed by the process after compaction.
6157 optional int64 after_rss_total_kilobytes = 8;
6158
6159 // File RSS in kilobytes consumed by the process after compaction.
6160 optional int64 after_rss_file_kilobytes = 9;
6161
6162 // Anonymous RSS in kilobytes consumed by the process after compaction.
6163 optional int64 after_rss_anon_kilobytes = 10;
6164
6165 // Swap in kilobytes consumed by the process after compaction.
6166 optional int64 after_swap_kilobytes = 11;
6167
6168 // The time taken to perform compaction in milliseconds.
6169 optional int64 time_to_compact_millis = 12;
6170
6171 // The last compaction action performed for this app.
6172 optional Action last_action = 13;
6173
Ben Murdoch01720b82018-12-19 18:03:44 +00006174 // The last time that compaction was attempted on this process in milliseconds
6175 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6176 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006177
Ben Murdoch885c21b2019-03-15 18:02:04 +00006178 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006179 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006180
6181 // The process state at the time of compaction.
6182 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006183
6184 // Free ZRAM in kilobytes before compaction.
6185 optional int64 before_zram_free_kilobytes = 17;
6186
6187 // Free ZRAM in kilobytes after compaction.
6188 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006189}
lifr157fc552018-12-12 16:38:04 +08006190
6191/**
lifrb6b90b62019-03-29 00:40:17 +08006192 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6193 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6194 *
lifr1f74b052019-04-16 22:16:30 +08006195 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6196 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6197 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6198 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006199 */
6200message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006201 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006202
lifr1f74b052019-04-16 22:16:30 +08006203 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006204
6205 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006206 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006207
lifr1f74b052019-04-16 22:16:30 +08006208 // Only valid for event_type = EVENT_GETADDRINFO.
6209 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006210
lifr1f74b052019-04-16 22:16:30 +08006211 // Flags passed to android_res_nsend() defined in multinetwork.h
6212 // Only valid for event_type = EVENT_RESNSEND.
6213 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006214
lifrad9becc2019-05-20 11:04:41 +08006215 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006216
6217 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006218 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006219
6220 // Additional pass-through fields opaque to statsd.
6221 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006222 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006223
6224 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6225 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006226}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006227
6228/**
6229 * Logs when a data stall event occurs.
6230 *
6231 * Log from:
6232 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6233 */
6234message DataStallEvent {
6235 // Data stall evaluation type.
6236 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6237 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6238 optional int32 evaluation_type = 1;
6239 // See definition in data_stall_event.proto.
6240 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6241 // See definition in data_stall_event.proto.
6242 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6243 // See definition in data_stall_event.proto.
6244 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6245 // See definition in data_stall_event.proto.
6246 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6247 // See definition in data_stall_event.proto.
6248 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6249}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006250
6251/*
6252 * Logs when RescueParty resets some set of experiment flags.
6253 *
6254 * Logged from:
6255 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6256 */
6257message RescuePartyResetReported {
6258 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6259 optional int32 rescue_level = 1;
6260}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006261
6262/**
6263 * Logs when signed config is received from an APK, and if that config was applied successfully.
6264 * Logged from:
6265 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6266 */
6267message SignedConfigReported {
6268 enum Type {
6269 UNKNOWN_TYPE = 0;
6270 GLOBAL_SETTINGS = 1;
6271 }
6272 optional Type type = 1;
6273
6274 // The final status of the signed config received.
6275 enum Status {
6276 UNKNOWN_STATUS = 0;
6277 APPLIED = 1;
6278 BASE64_FAILURE_CONFIG = 2;
6279 BASE64_FAILURE_SIGNATURE = 3;
6280 SECURITY_EXCEPTION = 4;
6281 INVALID_CONFIG = 5;
6282 OLD_CONFIG = 6;
6283 SIGNATURE_CHECK_FAILED = 7;
6284 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006285 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006286 }
6287 optional Status status = 2;
6288
6289 // The version of the signed config processed.
6290 optional int32 version = 3;
6291
6292 // The package name that the config was extracted from.
6293 optional string from_package = 4;
6294
6295 enum Key {
6296 NO_KEY = 0;
6297 DEBUG = 1;
6298 PRODUCTION = 2;
6299 }
6300 // Which key was used to verify the config.
6301 optional Key verified_with = 5;
6302}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006303
6304/*
6305 * Logs GNSS Network-Initiated (NI) location events.
6306 *
6307 * Logged from:
6308 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6309 */
6310message GnssNiEventReported {
6311 // The type of GnssNiEvent.
6312 enum EventType {
6313 UNKNOWN = 0;
6314 NI_REQUEST = 1;
6315 NI_RESPONSE = 2;
6316 }
6317 optional EventType event_type = 1;
6318
6319 // An ID generated by HAL to associate NI notifications and UI responses.
6320 optional int32 notification_id = 2;
6321
6322 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006323 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006324
6325 // NI requires notification.
6326 optional bool need_notify = 4;
6327
6328 // NI requires verification.
6329 optional bool need_verify = 5;
6330
6331 // NI requires privacy override, no notification/minimal trace.
6332 optional bool privacy_override = 6;
6333
6334 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6335 // seconds.
6336 optional int32 timeout = 7;
6337
6338 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006339 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006340
6341 // String representing the requester of the network inititated location request.
6342 optional string requestor_id = 9;
6343
6344 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6345 // network initiated location request.
6346 optional string text = 10;
6347
6348 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006349 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006350
6351 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006352 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006353
6354 // True if SUPL ES is enabled.
6355 optional bool is_supl_es_enabled = 13;
6356
6357 // True if GNSS location is enabled.
6358 optional bool is_location_enabled = 14;
6359
6360 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006361 optional android.server.location.GnssUserResponseType user_response = 15;
6362}
6363
6364/**
6365 * Logs GNSS non-framework (NFW) location notification.
6366 *
6367 * Logged from:
6368 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6369 */
6370message GnssNfwNotificationReported {
6371 // Package name of the Android proxy application representing the non-framework entity that
6372 // requested location. Set to empty string if unknown.
6373 optional string proxy_app_package_name = 1;
6374
6375 // Protocol stack that initiated the non-framework location request.
6376 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6377
6378 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6379 // set to empty string. This field is opaque to the framework and used for logging purposes.
6380 optional string other_protocol_stack_name = 3;
6381
6382 // Source initiating/receiving the location information.
6383 optional android.server.location.NfwRequestor requestor = 4;
6384
6385 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6386 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6387 // and used for logging purposes.
6388 optional string requestor_id = 5;
6389
6390 // Indicates whether location information was provided for this request.
6391 optional android.server.location.NfwResponseType response_type = 6;
6392
6393 // True if the device is in user initiated emergency session.
6394 optional bool in_emergency_mode = 7;
6395
6396 // True if cached location is provided.
6397 optional bool is_cached_location = 8;
6398
6399 // True if proxy app permission mismatch between framework and GNSS HAL.
6400 optional bool is_permission_mismatched = 9;
6401}
6402
6403/**
6404 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6405 *
6406 * Logged from:
6407 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6408 */
6409message GnssConfigurationReported {
6410 // SUPL host name.
6411 optional string supl_host = 1;
6412
6413 // SUPL port number.
6414 optional int32 supl_port = 2;
6415
6416 // C2K host name.
6417 optional string c2k_host = 3;
6418
6419 // C2K port number.
6420 optional int32 c2k_port = 4;
6421
6422 // The SUPL version requested by Carrier.
6423 optional int32 supl_ver = 5;
6424
6425 // The SUPL mode.
6426 optional android.server.location.SuplMode supl_mode = 6;
6427
6428 // True if NI emergency SUPL restrictions is enabled.
6429 optional bool supl_es = 7;
6430
6431 // LTE Positioning Profile settings
6432 optional android.server.location.LppProfile lpp_profile = 8;
6433
6434 // Positioning protocol on A-Glonass system.
6435 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6436
6437 // True if emergency PDN is used. Otherwise, regular PDN is used.
6438 optional bool use_emergency_pdn_for_emergency_supl= 10;
6439
6440 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6441 optional android.server.location.GpsLock gps_lock = 11;
6442
6443 // Number of seconds to extend the emergency session duration post emergency call.
6444 optional int32 es_extension_sec = 12;
6445
6446 // The full list of package names of proxy Android applications representing the non-framework
6447 // location access entities (on/off the device) for which the framework user has granted
6448 // non-framework location access permission. The package names are concatenated in one string
6449 // with spaces as separators.
6450 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006451}
Jack Yu95b64f32018-12-13 18:26:11 +08006452
6453/**
6454 * Logs when a NFC device's error occurred.
6455 * Logged from:
6456 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6457 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6458 */
6459message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006460 enum Type {
6461 UNKNOWN = 0;
6462 CMD_TIMEOUT = 1;
6463 ERROR_NOTIFICATION = 2;
6464 AID_OVERFLOW = 3;
6465 }
6466 optional Type type = 1;
6467 // If it's nci cmd timeout, log the timeout command.
6468 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006469
Alex Salod7c3eef2019-01-25 14:43:27 -08006470 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006471}
6472
6473/**
6474 * Logs when a NFC device's state changed event
6475 * Logged from:
6476 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6477 */
6478message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006479 enum State {
6480 UNKNOWN = 0;
6481 OFF = 1;
6482 ON = 2;
6483 ON_LOCKED = 3; // Secure Nfc enabled.
6484 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6485 }
6486 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006487}
6488
6489/**
6490 * Logs when a NFC Beam Transaction occurred.
6491 * Logged from:
6492 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6493 */
6494message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006495 enum Operation {
6496 UNKNOWN = 0;
6497 SEND = 1;
6498 RECEIVE = 2;
6499 }
6500 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006501}
6502
6503/**
6504 * Logs when a NFC Card Emulation Transaction occurred.
6505 * Logged from:
6506 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6507 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6508 */
6509message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006510 enum Category {
6511 UNKNOWN = 0;
6512 HCE_PAYMENT = 1;
6513 HCE_OTHER = 2;
6514 OFFHOST = 3;
6515 }
6516 // Transaction belongs to HCE payment or HCE other category, or offhost.
6517 optional Category category = 1;
6518 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6519 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006520}
6521
6522/**
6523 * Logs when a NFC Tag event occurred.
6524 * Logged from:
6525 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6526 */
6527message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006528 enum Type {
6529 UNKNOWN = 0;
6530 URL = 1;
6531 BT_PAIRING = 2;
6532 PROVISION = 3;
6533 WIFI_CONNECT = 4;
6534 APP_LAUNCH = 5;
6535 OTHERS = 6;
6536 }
6537 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006538}
6539
6540/**
6541 * Logs when Hce transaction triggered
6542 * Logged from:
6543 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6544 */
6545message NfcHceTransactionOccurred {
6546 // The latency period(in microseconds) it took for the first HCE data
6547 // exchange.
6548 optional uint32 latency_micros = 1;
6549}
6550
6551/**
6552 * Logs when SecureElement state event changed
6553 * Logged from:
6554 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6555 */
6556message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006557 enum State {
6558 UNKNOWN = 0;
6559 INITIALIZED = 1;
6560 DISCONNECTED = 2;
6561 CONNECTED = 3;
6562 HALCRASH = 4;
6563 }
6564 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006565
Alex Salod7c3eef2019-01-25 14:43:27 -08006566 optional string state_change_reason = 2;
6567 // SIMx or eSEx.
6568 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006569}
6570
6571/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006572 * Information about a permission grant request
6573 */
6574message PermissionGrantRequestResultReported {
6575 // unique value identifying an API call. A API call might result in multiple of these atoms
6576 optional int64 request_id = 1;
6577
6578 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006579 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006580
6581 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006582 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006583
6584 // The permission to be granted
6585 optional string permission_name = 4;
6586
6587 // If the permission was explicitly requested via the API or added by the system
6588 optional bool is_implicit = 5;
6589
6590 enum Result {
6591 UNDEFINED = 0;
6592 // permission request was ignored
6593 IGNORED = 1;
6594 // permission request was ignored because it was user fixed
6595 IGNORED_USER_FIXED = 2;
6596 // permission request was ignored because it was policy fixed
6597 IGNORED_POLICY_FIXED = 3;
6598 // permission was granted by user action
6599 USER_GRANTED = 4;
6600 // permission was automatically granted
6601 AUTO_GRANTED = 5;
6602 // permission was denied by user action
6603 USER_DENIED = 6;
6604 // permission was denied with prejudice by the user
6605 USER_DENIED_WITH_PREJUDICE = 7;
6606 // permission was automatically denied
6607 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006608 // permission request was ignored because permission is restricted
6609 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006610 // one time permission was granted by user action
6611 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006612 // user ignored request by leaving the request screen without choosing any option
6613 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006614 // user granted the permission after being linked to settings
6615 USER_GRANTED_IN_SETTINGS = 12;
6616 // user denied the permission after being linked to settings
6617 USER_DENIED_IN_SETTINGS = 13;
6618 // user denied the permission with prejudice after being linked to settings
6619 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6620 // permission was automatically revoked after one-time permission expired
6621 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006622 // permission was automatically revoked for unused app
6623 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006624 }
6625 // The result of the permission grant
6626 optional Result result = 6;
6627}
6628
6629/**
Jack Yu95b64f32018-12-13 18:26:11 +08006630 * Logs when Omapi API used
6631 * Logged from:
6632 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6633 */
6634message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006635 enum Operation {
6636 UNKNOWN = 0;
6637 OPEN_CHANNEL = 1;
6638 }
6639 optional Operation operation = 1;
6640 // SIMx or eSEx.
6641 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006642
Alex Salod7c3eef2019-01-25 14:43:27 -08006643 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006644}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006645
6646/**
Alex Saloa060aee2019-01-21 14:36:41 -08006647 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6648 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006649 * Logged from:
6650 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6651 */
6652message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006653 optional int64 dispatch_latency_millis = 1;
6654}
6655
6656/**
6657 * Logs AttentionManagerService attention check result.
6658 *
6659 * Logged from:
6660 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6661 */
6662message AttentionManagerServiceResultReported {
6663 // See core/java/android/service/attention/AttentionService.java
6664 enum AttentionCheckResult {
6665 UNKNOWN = 20;
6666 ATTENTION_SUCCESS_ABSENT = 0;
6667 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006668 ATTENTION_FAILURE_UNKNOWN = 2;
6669 ATTENTION_FAILURE_CANCELLED = 3;
6670 ATTENTION_FAILURE_PREEMPTED = 4;
6671 ATTENTION_FAILURE_TIMED_OUT = 5;
6672 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006673 }
6674 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006675}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006676
6677/**
6678 * Logs when an adb connection changes state.
6679 *
6680 * Logged from:
6681 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6682 */
6683message AdbConnectionChanged {
6684 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6685 // previously selected for this system.
6686 optional int64 last_connection_time_millis = 1;
6687
6688 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6689 // to reconnect via adb without user interaction.
6690 optional int64 auth_window_millis = 2;
6691
6692 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6693 optional android.debug.AdbConnectionStateEnum state = 3;
6694
6695 // True if the 'always allow' option was selected for this system.
6696 optional bool always_allow = 4;
6697}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006698
6699/*
6700 * Logs the reported speech DSP status.
6701 *
6702 * Logged from:
6703 * Vendor audio implementation.
6704 */
6705message SpeechDspStatReported {
6706 // The total Speech DSP uptime in milliseconds.
6707 optional int32 total_uptime_millis = 1;
6708 // The total Speech DSP downtime in milliseconds.
6709 optional int32 total_downtime_millis = 2;
6710 optional int32 total_crash_count = 3;
6711 optional int32 total_recover_count = 4;
6712}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006713
6714/**
6715 * Logs USB connector contaminant status.
6716 *
6717 * Logged from: USB Service.
6718 */
6719message UsbContaminantReported {
6720 optional string id = 1;
6721 optional android.service.usb.ContaminantPresenceStatus status = 2;
6722}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006723
6724/**
6725 * This atom is for debugging purpose.
6726 */
6727message DebugElapsedClock {
6728 // Monotically increasing value for each pull.
6729 optional int64 pull_count = 1;
6730 // Time from System.elapsedRealtime.
6731 optional int64 elapsed_clock_millis = 2;
6732 // Time from System.elapsedRealtime.
6733 optional int64 same_elapsed_clock_millis = 3;
6734 // Diff between current elapsed time and elapsed time from previous pull.
6735 optional int64 elapsed_clock_diff_millis = 4;
6736
6737 enum Type {
6738 TYPE_UNKNOWN = 0;
6739 ALWAYS_PRESENT = 1;
6740 PRESENT_ON_ODD_PULLS = 2;
6741 }
6742 // Type of behavior for the pulled data.
6743 optional Type type = 5;
6744}
6745
6746/**
6747 * This atom is for debugging purpose.
6748 */
6749message DebugFailingElapsedClock {
6750 // Monotically increasing value for each pull.
6751 optional int64 pull_count = 1;
6752 // Time from System.elapsedRealtime.
6753 optional int64 elapsed_clock_millis = 2;
6754 // Time from System.elapsedRealtime.
6755 optional int64 same_elapsed_clock_millis = 3;
6756 // Diff between current elapsed time and elapsed time from previous pull.
6757 optional int64 elapsed_clock_diff_millis = 4;
6758}
Steven Wuacef6bb2019-01-23 14:21:17 -05006759
6760/** Logs System UI bubbles event changed.
6761 *
6762 * Logged from:
6763 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6764 */
6765message BubbleUIChanged {
6766
6767 // The app package that is posting the bubble.
6768 optional string package_name = 1;
6769
6770 // The notification channel that is posting the bubble.
6771 optional string notification_channel = 2;
6772
6773 // The notification id associated with the posted bubble.
6774 optional int32 notification_id = 3;
6775
6776 // The position of the bubble within the bubble stack.
6777 optional int32 position = 4;
6778
6779 // The total number of bubbles within the bubble stack.
6780 optional int32 total_number = 5;
6781
6782 // User interactions with the bubble.
6783 enum Action {
6784 UNKNOWN = 0;
6785 POSTED = 1;
6786 UPDATED = 2;
6787 EXPANDED = 3;
6788 COLLAPSED = 4;
6789 DISMISSED = 5;
6790 STACK_DISMISSED = 6;
6791 STACK_MOVED = 7;
6792 HEADER_GO_TO_APP = 8;
6793 HEADER_GO_TO_SETTINGS = 9;
6794 PERMISSION_OPT_IN = 10;
6795 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006796 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006797 SWIPE_LEFT = 13;
6798 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006799 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006800 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006801 }
6802 optional Action action = 6;
6803
6804 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6805 optional float normalized_x_position = 7;
6806 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006807
6808 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6809 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006810
6811 // Whether the bubble is an on-going one.
6812 optional bool is_ongoing = 10;
6813
6814 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006815 // This is deprecated and the value should be ignored.
6816 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006817}
Kweku Adams8845d012018-12-11 20:06:45 -08006818
6819/**
Steven Wu552f63f2019-02-05 13:41:36 -05006820 * Logs System UI bubbles developer errors.
6821 *
6822 * Logged from:
6823 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6824 */
6825message BubbleDeveloperErrorReported {
6826
6827 // The app package that is posting the bubble.
6828 optional string package_name = 1;
6829
6830 // Bubble developer error type enums.
6831 enum Error {
6832 UNKNOWN = 0;
6833 ACTIVITY_INFO_MISSING = 1;
6834 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6835 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6836 }
6837 optional Error error = 2 [default = UNKNOWN];
6838}
6839
6840/**
Kweku Adams8845d012018-12-11 20:06:45 -08006841 * Logs that a constraint for a scheduled job has changed.
6842 *
6843 * Logged from:
6844 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6845 */
6846message ScheduledJobConstraintChanged {
6847 repeated AttributionNode attribution_node = 1;
6848
6849 // Name of the job.
6850 optional string job_name = 2;
6851
6852 optional com.android.server.job.ConstraintEnum constraint = 3;
6853
6854 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006855 UNKNOWN = 0;
6856 UNSATISFIED = 1;
6857 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006858 }
6859 optional State state = 4;
6860}
Alex Salod7c3eef2019-01-25 14:43:27 -08006861
6862/**
6863 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6864 * returns true.
6865 *
6866 * Logged from:
6867 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6868 */
6869message ScreenTimeoutExtensionReported {
6870 // Describes how many times in a row did the power manager reset the screen off timeout.
6871 optional uint32 consecutive_timeout_extended_count = 1;
6872}
Hui Yu885aca12019-01-10 17:11:34 -08006873
6874/*
6875* Logs number of milliseconds it takes to start a process.
6876* The definition of app process start time is from the app launch time to
6877* the time that Zygote finished forking the app process and loaded the
6878* application package's java classes.
6879
6880* This metric is different from AppStartOccurred which is for foreground
6881* activity only.
6882
6883* ProcessStartTime can report all processes (both foreground and background)
6884* start time.
6885*
6886* Logged from:
6887* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6888*/
6889message ProcessStartTime {
6890 // The uid of the ProcessRecord.
6891 optional int32 uid = 1 [(is_uid) = true];
6892
6893 // The process pid.
6894 optional int32 pid = 2;
6895
6896 // The process name.
6897 // Usually package name, "system" for system server.
6898 // Provided by ActivityManagerService.
6899 optional string process_name = 3;
6900
6901 enum StartType {
6902 UNKNOWN = 0;
6903 WARM = 1;
6904 HOT = 2;
6905 COLD = 3;
6906 }
6907
6908 // The start type.
6909 optional StartType type = 4;
6910
6911 // The elapsed realtime at the start of the process.
6912 optional int64 process_start_time_millis = 5;
6913
6914 // Number of milliseconds it takes to reach bind application.
6915 optional int32 bind_application_delay_millis = 6;
6916
6917 // Number of milliseconds it takes to finish start of the process.
6918 optional int32 process_start_delay_millis = 7;
6919
6920 // hostingType field in ProcessRecord, the component type such as "activity",
6921 // "service", "content provider", "broadcast" or other strings.
6922 optional string hosting_type = 8;
6923
6924 // hostingNameStr field in ProcessRecord. The component class name that runs
6925 // in this process.
6926 optional string hosting_name = 9;
6927}
6928
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006929/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006930 * Track Media Codec usage
6931 * Logged from:
6932 * frameworks/av/media/libstagefright/MediaCodec.cpp
6933 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6934 */
6935message MediametricsCodecReported {
6936 optional int64 timestamp_nanos = 1;
6937 optional string package_name = 2;
6938 optional int64 package_version_code = 3;
6939 optional int64 media_apex_version = 4;
6940
6941 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6942}
6943
6944/**
6945 * Track Media Extractor (pulling video/audio streams out of containers) usage
6946 * Logged from:
6947 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6948 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6949 */
6950message MediametricsExtractorReported {
6951 optional int64 timestamp_nanos = 1;
6952 optional string package_name = 2;
6953 optional int64 package_version_code = 3;
6954 optional int64 media_apex_version = 4;
6955
6956 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6957}
6958
6959/**
6960 * Track how we arbitrate between microphone/input requests.
6961 * Logged from
6962 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6963 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6964 */
6965message MediametricsAudiopolicyReported {
6966 optional int64 timestamp_nanos = 1;
6967 optional string package_name = 2;
6968 optional int64 package_version_code = 3;
6969 optional int64 media_apex_version = 4;
6970
6971 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6972}
6973
6974/**
6975 * Track how we arbitrate between microphone requests.
6976 * Logged from
6977 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6978 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6979 */
6980message MediametricsAudiorecordReported {
6981 optional int64 timestamp_nanos = 1;
6982 optional string package_name = 2;
6983 optional int64 package_version_code = 3;
6984 optional int64 media_apex_version = 4;
6985
6986 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6987}
6988
6989/**
6990 * Track how we arbitrate between microphone/input requests.
6991 * Logged from
6992 * frameworks/av/media/libnblog/ReportPerformance.cpp
6993 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6994 */
6995message MediametricsAudiothreadReported {
6996 optional int64 timestamp_nanos = 1;
6997 optional string package_name = 2;
6998 optional int64 package_version_code = 3;
6999 optional int64 media_apex_version = 4;
7000
7001 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7002}
7003
7004/**
7005 * Track how we arbitrate between microphone/input requests.
7006 * Logged from
7007 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7008 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7009 */
7010message MediametricsAudiotrackReported {
7011 optional int64 timestamp_nanos = 1;
7012 optional string package_name = 2;
7013 optional int64 package_version_code = 3;
7014 optional int64 media_apex_version = 4;
7015
7016 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7017}
7018
7019/**
7020 * Track information about DRM framework performance
7021 * Logged from
7022 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7023 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7024 */
7025message MediametricsMediadrmReported {
7026 optional int64 timestamp_nanos = 1;
7027 optional string package_name = 2;
7028 optional int64 package_version_code = 3;
7029 optional int64 media_apex_version = 4;
7030
7031 // vendor+description tell about which DRM plugin is in use on this device
7032 optional string vendor = 5;
7033 optional string description = 6;
7034 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7035 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7036}
7037
7038/**
7039 * Track information about the widevine DRM plugin performance
7040 * Logged from
7041 * vendor/widevine/libwvdrmengine/cdm/metrics
7042 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7043 */
7044message MediametricsDrmWidevineReported {
7045 optional int64 timestamp_nanos = 1;
7046 optional string package_name = 2;
7047 optional int64 package_version_code = 3;
7048 optional int64 media_apex_version = 4;
7049
7050 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7051}
7052
7053/**
7054 * Track information about recordings (e.g. camcorder)
7055 * Logged from
7056 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7057 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7058 */
7059message MediametricsRecorderReported {
7060 optional int64 timestamp_nanos = 1;
7061 optional string package_name = 2;
7062 optional int64 package_version_code = 3;
7063 optional int64 media_apex_version = 4;
7064
7065 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7066}
7067
7068/**
7069 * Track Media Player usage
7070 * Logged from:
7071 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7072 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7073 */
7074message MediametricsNuPlayerReported {
7075 optional int64 timestamp_nanos = 1;
7076 optional string package_name = 2;
7077 optional int64 package_version_code = 3;
7078 optional int64 media_apex_version = 4;
7079
7080 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7081}
7082
7083/**
Robert Shiha4beed32019-08-19 14:15:23 -07007084 * Track Legacy DRM usage
7085 * Logged from
7086 * frameworks/av/drm/drmserver/DrmManager.cpp
7087 */
7088message MediametricsDrmManagerReported {
7089 optional int64 timestamp_nanos = 1;
7090 optional string package_name = 2;
7091 optional int64 package_version_code = 3;
7092 optional int64 media_apex_version = 4;
7093
7094 enum Method {
7095 METHOD_NOT_FOUND = -1;
7096 GET_CONSTRAINTS = 0;
7097 GET_METADATA = 1;
7098 CAN_HANDLE = 2;
7099 PROCESS_DRM_INFO = 3;
7100 ACQUIRE_DRM_INFO = 4;
7101 SAVE_RIGHTS = 5;
7102 GET_ORIGINAL_MIME_TYPE = 6;
7103 GET_DRM_OBJECT_TYPE = 7;
7104 CHECK_RIGHTS_STATUS = 8;
7105 REMOVE_RIGHTS = 9;
7106 REMOVE_ALL_RIGHTS = 10;
7107 OPEN_CONVERT_SESSION = 11;
7108 OPEN_DECRYPT_SESSION = 12;
7109 }
7110
7111 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7112 optional string plugin_id = 5;
7113 optional string description = 6;
7114 optional Method method = 7;
7115 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007116
7117 optional int64 get_constraints_count = 9;
7118 optional int64 get_metadata_count = 10;
7119 optional int64 can_handle_count = 11;
7120 optional int64 process_drm_info_count = 12;
7121 optional int64 acquire_drm_info_count = 13;
7122 optional int64 save_rights_count = 14;
7123 optional int64 get_original_mime_type_count = 15;
7124 optional int64 get_drm_object_type_count = 16;
7125 optional int64 check_rights_status_count = 17;
7126 optional int64 remove_rights_count = 18;
7127 optional int64 remove_all_rights_count = 19;
7128 optional int64 open_convert_session_count = 20;
7129 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007130}
7131
7132/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007133 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007134 * Pulled from: StatsCompanionService
7135*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007136message DangerousPermissionState {
7137 // Name of the permission
7138 optional string permission_name = 1;
7139
7140 // Uid of the package
7141 optional int32 uid = 2 [(is_uid) = true];
7142
7143 // Package requesting the permission
7144 optional string package_name = 3;
7145
7146 // If the permission is granted to the uid
7147 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007148
7149 // Permission flags as per android.content.pm.PermissionFlags
7150 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007151}
7152
Michael Groover4a0ca942019-01-24 17:41:25 -08007153/**
7154 * Logs when a package is denied access to a device identifier based on the new access requirements.
7155 *
7156 * Logged from:
7157 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7158 */
7159message DeviceIdentifierAccessDenied {
7160 // The name of the package denied access to the requested device identifier.
7161 optional string package_name = 1;
7162
7163 // The name of the device identifier method the package attempted to invoke.
7164 optional string method_name = 2;
7165
7166 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007167 // Starting from Android 11, this boolean is not set and will always be false.
7168 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007169
7170 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007171 // Starting from Android 11, this boolean is not set and will always be false.
7172 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007173}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007174
7175/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007176 * Pulls the ongoing mainline install train version code.
7177 * Pulled from StatsCompanionService
7178 */
7179message TrainInfo {
7180 optional int64 train_version_code = 1;
7181
7182 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007183
7184 optional string train_name = 3;
7185
7186 enum Status {
7187 UNKNOWN = 0;
7188 INSTALL_REQUESTED = 1;
7189 INSTALL_STARTED = 2;
7190 INSTALL_STAGED_NOT_READY = 3;
7191 INSTALL_STAGED_READY = 4;
7192 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007193 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7194 // and INSTALL_FAILURE_COMMIT.
7195 INSTALL_FAILURE = 6 [deprecated = true];
7196 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007197 INSTALL_CANCELLED = 7;
7198 INSTALLER_ROLLBACK_REQUESTED = 8;
7199 INSTALLER_ROLLBACK_INITIATED = 9;
7200 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7201 INSTALLER_ROLLBACK_STAGED = 11;
7202 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7203 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7204 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7205 INSTALLER_ROLLBACK_SUCCESS = 15;
7206 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007207 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7208 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7209 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7210 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7211 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7212 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007213 INSTALL_FAILURE_DOWNLOAD = 23;
7214 INSTALL_FAILURE_STATE_MISMATCH = 24;
7215 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007216 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007217 }
7218 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007219}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007220
7221/**
7222 * Logs the gesture stage changed event.
7223 *
7224 * Logged from:
7225 * frameworks/base/packages/SystemUI/
7226 */
7227message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007228 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007229}
7230
7231/**
7232 * Logs the feedback type.
7233 *
7234 * Logged from:
7235 * frameworks/base/packages/SystemUI/
7236 */
7237message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007238 // Whether or not the gesture was used.
7239 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007240}
7241
7242/**
7243 * Logs the progress.
7244 *
7245 * Logged from:
7246 * frameworks/base/packages/SystemUI/
7247 */
7248message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007249 // [0,100] progress for the assist gesture.
7250 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007251}
Neil Fullerdb14b482019-02-05 19:44:44 +00007252
7253/*
7254 * Information about the time zone data on a device.
7255 */
7256message TimeZoneDataInfo {
7257 // A version identifier for the data set on device. e.g. "2018i"
7258 optional string tzdb_version = 1;
7259}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007260
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007261/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007262 * Logs the GPU stats global health information.
7263 *
7264 * Logged from:
7265 * frameworks/native/services/gpuservice/gpustats/
7266 */
7267message GpuStatsGlobalInfo {
7268 // Package name of the gpu driver.
7269 optional string driver_package_name = 1;
7270
7271 // Version name of the gpu driver.
7272 optional string driver_version_name = 2;
7273
7274 // Version code of the gpu driver.
7275 optional int64 driver_version_code = 3;
7276
7277 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7278 optional int64 driver_build_time = 4;
7279
7280 // Total count of the gl driver gets loaded.
7281 optional int64 gl_loading_count = 5;
7282
7283 // Total count of the gl driver fails to be loaded.
7284 optional int64 gl_loading_failure_count = 6;
7285
7286 // Total count of the Vulkan driver gets loaded.
7287 optional int64 vk_loading_count = 7;
7288
7289 // Total count of the Vulkan driver fails to be loaded.
7290 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007291
7292 // Api version of the system Vulkan driver.
7293 optional int32 vulkan_version = 9;
7294
7295 // Api version of the system CPU Vulkan driver.
7296 optional int32 cpu_vulkan_version = 10;
7297
7298 // Api version of the system GLES driver.
7299 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007300
7301 // Total count of the angle driver gets loaded.
7302 optional int64 angle_loading_count = 12;
7303
7304 // Total count of the angle driver fails to be loaded.
7305 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007306}
7307
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007308/**
7309 * GPU driver loading time info.
7310 */
7311message GpuDriverLoadingTime {
7312 // List of all the driver loading times for this app. The list size is
7313 // capped at 50.
7314 repeated int64 driver_loading_time = 1;
7315}
7316
7317/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007318 * Logs the GPU stats per app health information.
7319 *
7320 * Logged from:
7321 * frameworks/native/services/gpuservice/gpustats/
7322 */
7323message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007324 // Package name of the application that loads the gpu driver. Total number
7325 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007326 optional string app_package_name = 1;
7327
7328 // Version code of the gpu driver this app loads.
7329 optional int64 driver_version_code = 2;
7330
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007331 // gl driver loading time info.
7332 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7333 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007334
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007335 // Vulkan driver loading time info.
7336 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7337 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007338
7339 // Angle driver loading time info.
7340 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7341 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007342
7343 // CPU Vulkan implementation is in use.
7344 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007345
7346 // App is not doing pre-rotation correctly.
7347 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007348
7349 // App creates GLESv1 context.
7350 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007351}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007352
7353/*
7354 * Logs the size of the system ion heap.
7355 *
7356 * Pulled from StatsCompanionService.
7357 */
7358message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007359 // Deprecated due to limited support of ion stats in debugfs.
7360 // Use `IonHeapSize` instead.
7361 option deprecated = true;
7362
Rafal Slawikd4e87572019-03-12 13:08:38 +00007363 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007364 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007365 optional int64 size_in_bytes = 1;
7366}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007367
Rafal Slawik77987ed2019-06-17 12:28:23 +01007368/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007369 * Logs the total size of the ion heap.
7370 *
7371 * Pulled from StatsCompanionService.
7372 */
7373message IonHeapSize {
7374 // Total size of all ion heaps in kilobytes.
7375 // Read from: /sys/kernel/ion/total_heaps_kb.
7376 optional int32 total_size_kb = 1;
7377}
7378
7379/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007380 * Logs the per-process size of the system ion heap.
7381 *
7382 * Pulled from StatsCompanionService.
7383 */
7384message ProcessSystemIonHeapSize {
7385 // The uid if available. -1 means not available.
7386 optional int32 uid = 1 [(is_uid) = true];
7387
7388 // The process name (from /proc/PID/cmdline).
7389 optional string process_name = 2;
7390
7391 // Sum of sizes of all allocations.
7392 optional int32 total_size_in_kilobytes = 3;
7393
7394 // Number of allocations.
7395 optional int32 allocation_count = 4;
7396
7397 // Size of the largest allocation.
7398 optional int32 max_size_in_kilobytes = 5;
7399}
7400
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007401/**
7402 * Push network stack events.
7403 *
7404 * Log from:
7405 * frameworks/base/packages/NetworkStack/
7406 */
7407message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007408 // The id that indicates the event reported from NetworkStack.
7409 optional int32 event_id = 1;
7410 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007411 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7412}
Carmen Agimofa769c152019-03-04 14:39:14 +00007413
7414/**
7415 * Logs the apps that are installed on the external storage.
7416 * Pulled from:
7417 * StatsCompanionService
7418 */
7419message AppsOnExternalStorageInfo {
7420 // The type of the external storage.
7421 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7422 // The name of the package that is installed on the external storage.
7423 optional string package_name = 2;
7424}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007425
7426/**
7427 * Logs the settings related to Face.
7428 * Logged from:
7429 * frameworks/base/services/core/java/com/android/server/stats
7430 */
7431message FaceSettings {
7432 // Whether or not face unlock is allowed on Keyguard.
7433 optional bool unlock_keyguard_enabled = 1;
7434 // Whether or not face unlock dismisses the Keyguard.
7435 optional bool unlock_dismisses_keyguard = 2;
7436 // Whether or not face unlock requires attention.
7437 optional bool unlock_attention_required = 3;
7438 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7439 optional bool unlock_app_enabled = 4;
7440 // Whether or not face unlock always requires user confirmation.
7441 optional bool unlock_always_require_confirmation = 5;
7442 // Whether or not a diverse set of poses are required during enrollment.
7443 optional bool unlock_diversity_required = 6;
7444}
Maggie White442b6312019-04-05 16:26:44 -07007445
7446/**
7447 * Logs cooling devices maintained by the kernel.
7448 *
7449 * Pulled from StatsCompanionService.java
7450 */
7451message CoolingDevice {
7452 // The type of cooling device being reported. Eg. CPU, GPU...
7453 optional android.os.CoolingTypeEnum device_location = 1;
7454 // The name of the cooling device source. Eg. CPU0
7455 optional string device_name = 2;
7456 // Current throttle state of the cooling device. The value can any unsigned
7457 // integer between 0 and max_state defined in its driver. 0 means device is
7458 // not in throttling, higher value means deeper throttling.
7459 optional int32 state = 3;
7460}
Ben Blount763a5d52019-04-10 11:48:58 -07007461
7462/**
7463 * Intelligence has several counter-type events that don't warrant a
7464 * full separate atom. These are primarily API call counters but also include
7465 * counters for feature usage and specific failure modes.
7466 *
7467 * Logged from the Intelligence mainline module.
7468 */
7469message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007470 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007471 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007472 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007473 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007474 // How many times the event occured (to report a batch of high frequency events).
7475 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007476 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007477 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007478}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007479
7480/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007481 * Logs when Car Power state changed.
7482 *
7483 * Logged from:
7484 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7485 */
7486message CarPowerStateChanged {
7487 // States come from CpmsState in CarPowerManagementService.java.
7488 enum State {
7489 WAIT_FOR_VHAL = 0;
7490 ON = 1;
7491 SHUTDOWN_PREPARE = 2;
7492 WAIT_FOR_FINISH = 3;
7493 SUSPEND = 4;
7494 SIMULATE_SLEEP = 5;
7495 }
7496 optional State state = 1;
7497}
7498
7499/**
7500 * Logs whether GarageMode is entered.
7501 *
7502 * Logged from:
7503 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7504 */
7505message GarageModeInfo {
7506 // Whether GarageMode is entered.
7507 optional bool is_garage_mode = 1;
7508}
Martijn Coenencd95d462019-04-25 17:09:45 +02007509
7510/**
7511 * Historical app ops data per package.
7512 */
7513message AppOps {
7514 // Uid of the package requesting the op
7515 optional int32 uid = 1 [(is_uid) = true];
7516
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007517 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007518 optional string package_name = 2;
7519
7520 // operation id; maps to the OP_* constants in AppOpsManager.java
7521 optional int32 op_id = 3;
7522
7523 // The number of times the op was granted while the app was in the
7524 // foreground (only for trusted requests)
7525 optional int64 trusted_foreground_granted_count = 4;
7526
7527 // The number of times the op was granted while the app was in the
7528 // background (only for trusted requests)
7529 optional int64 trusted_background_granted_count = 5;
7530
7531 // The number of times the op was rejected while the app was in the
7532 // foreground (only for trusted requests)
7533 optional int64 trusted_foreground_rejected_count = 6;
7534
7535 // The number of times the op was rejected while the app was in the
7536 // background (only for trusted requests)
7537 optional int64 trusted_background_rejected_count = 7;
7538
7539 // For long-running operations, total duration of the operation
7540 // while the app was in the foreground (only for trusted requests)
7541 optional int64 trusted_foreground_duration_millis = 8;
7542
7543 // For long-running operations, total duration of the operation
7544 // while the app was in the background (only for trusted requests)
7545 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007546
7547 // Whether AppOps is guarded by Runtime permission
7548 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007549}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007550
7551/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007552 * Historical app ops data per package and features.
7553 */
7554message AppFeaturesOps {
7555 // Uid of the package requesting the op
7556 optional int32 uid = 1 [(is_uid) = true];
7557
7558 // Name of the package performing the op
7559 optional string package_name = 2;
7560
7561 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7562 // Features must be provided through manifest using <feature> tag available in R and above.
7563 optional string feature_id = 3;
7564
7565 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7566 optional string op = 4;
7567
7568 // The number of times the op was granted while the app was in the
7569 // foreground (only for trusted requests)
7570 optional int64 trusted_foreground_granted_count = 5;
7571
7572 // The number of times the op was granted while the app was in the
7573 // background (only for trusted requests)
7574 optional int64 trusted_background_granted_count = 6;
7575
7576 // The number of times the op was rejected while the app was in the
7577 // foreground (only for trusted requests)
7578 optional int64 trusted_foreground_rejected_count = 7;
7579
7580 // The number of times the op was rejected while the app was in the
7581 // background (only for trusted requests)
7582 optional int64 trusted_background_rejected_count = 8;
7583
7584 // For long-running operations, total duration of the operation
7585 // while the app was in the foreground (only for trusted requests)
7586 optional int64 trusted_foreground_duration_millis = 9;
7587
7588 // For long-running operations, total duration of the operation
7589 // while the app was in the background (only for trusted requests)
7590 optional int64 trusted_background_duration_millis = 10;
7591
7592 // Whether AppOps is guarded by Runtime permission
7593 optional bool is_runtime_permission = 11;
7594}
7595
7596/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007597 * Location Manager API Usage information(e.g. API under usage,
7598 * API call's parameters).
7599 * Logged from:
7600 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7601 */
7602message LocationManagerApiUsageReported {
7603
7604 // Indicating if usage starts or usage ends.
7605 optional android.stats.location.UsageState state = 1;
7606
7607 // LocationManagerService's API in use.
7608 // We can identify which API from LocationManager is
7609 // invoking current LMS API by the combination of
7610 // API parameter(e.g. is_listener_null, is_intent_null,
7611 // is_location_request_null)
7612 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7613
7614 // Name of the package calling the API.
7615 optional string calling_package_name = 3;
7616
7617 // Type of the location provider.
7618 optional android.stats.location.ProviderType provider = 4;
7619
7620 // Quality of the location request
7621 optional android.stats.location.LocationRequestQuality quality = 5;
7622
7623 // The desired interval for active location updates, in milliseconds.
7624 // Bucketized to reduce cardinality.
7625 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7626
7627 // Minimum distance between location updates, in meters.
7628 // Bucketized to reduce cardinality.
7629 optional android.stats.location.SmallestDisplacementBucket
7630 bucketized_smallest_displacement = 7;
7631
7632 // The number of location updates.
7633 optional int64 num_updates = 8;
7634
7635 // The request expiration time, in millisecond since boot.
7636 // Bucketized to reduce cardinality.
7637 optional android.stats.location.ExpirationBucket
7638 bucketized_expire_in = 9;
7639
7640 // Type of Callback passed in for this API.
7641 optional android.stats.location.CallbackType callback_type = 10;
7642
7643 // The radius of the central point of the alert
7644 // region, in meters. Only for API REQUEST_GEOFENCE.
7645 // Bucketized to reduce cardinality.
7646 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7647
7648 // Activity Importance of API caller.
7649 // Categorized to 3 types that are interesting from location's perspective.
7650 optional android.stats.location.ActivityImportance activiy_importance = 12;
7651}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007652
7653/**
7654 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7655 */
7656message ReviewPermissionsFragmentResultReported {
7657 // unique value identifying a permission group change. A permission group change might result
7658 // in multiple of these atoms
7659 optional int64 change_id = 1;
7660
7661 // UID of package the permission belongs to
7662 optional int32 uid = 2 [(is_uid) = true];
7663
7664 // Name of package the permission belongs to
7665 optional string package_name = 3;
7666
7667 // The permission to be granted
7668 optional string permission_name = 4;
7669
7670 // The result of the permission grant
7671 optional bool permission_granted = 5;
7672}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007673
7674/**
7675* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7676* Logged from: RuntimePermissionUpdgradeController
7677*/
7678message RuntimePermissionsUpgradeResult {
7679 // Permission granted as result of upgrade
7680 optional string permission_name = 1;
7681
7682 // UID of package granted permission
7683 optional int32 uid = 2 [(is_uid) = true];
7684
7685 // Name of package granted permission
7686 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007687}
7688
7689/**
7690* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7691*/
7692message GrantPermissionsActivityButtonActions {
7693 // Permission granted as result of upgrade
7694 optional string permission_group_name = 1;
7695
7696 // UID of package granted permission
7697 optional int32 uid = 2 [(is_uid) = true];
7698
7699 // Name of package requesting permission
7700 optional string package_name = 3;
7701
7702 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7703 // LABEL_ constants in GrantPermissionActivity.java
7704 optional int32 buttons_presented = 4;
7705
7706 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7707 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007708
7709 // id which identifies single session of user interacting with permission controller
7710 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007711}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007712
7713/**
7714 * Information about LocationAccessCheck notification presented to user
7715 */
7716message LocationAccessCheckNotificationAction {
7717
7718 // id which identifies single session of user interacting with permission controller
7719 optional int64 session_id = 1;
7720
7721 // Uid of package for which location access check is presented
7722 optional int32 package_uid = 2;
7723
7724 // Name of package for which location access check is presented
7725 optional string package_name = 3;
7726
7727 enum Result {
7728 UNDEFINED = 0;
7729 // notification was presented to the user
7730 NOTIFICATION_PRESENTED = 1;
7731 // notification was declined by the user
7732 NOTIFICATION_DECLINED = 2;
7733 // notification was clicked by the user
7734 NOTIFICATION_CLICKED = 3;
7735 }
7736
7737 // View / interaction recorded
7738 optional Result result = 4;
7739}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007740
7741/**
7742 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7743 */
7744message AppPermissionFragmentActionReported {
7745 // id which identifies single session of user interacting with permission controller
7746 optional int64 session_id = 1;
7747
7748 // unique value identifying a permission group change. A permission group change might result
7749 // in multiple of these atoms
7750 optional int64 change_id = 2;
7751
7752 // UID of package the permission belongs to
7753 optional int32 uid = 3 [(is_uid) = true];
7754
7755 // Name of package the permission belongs to
7756 optional string package_name = 4;
7757
7758 // The permission to be granted
7759 optional string permission_name = 5;
7760
7761 // The result of the permission grant
7762 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007763
7764 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7765 optional int32 permission_flags = 7;
7766
7767 enum Button {
7768 UNDEFINED = 0;
7769 // Allow button
7770 ALLOW = 1;
7771 // Deny button
7772 DENY = 2;
7773 // Ask every time button
7774 ASK_EVERY_TIME = 3;
7775 // Allow all the time button
7776 ALLOW_ALWAYS = 4;
7777 // Allow only while using the app button
7778 ALLOW_FOREGROUND = 5;
7779 // Same is Deny button but shown in while in use dialog
7780 DENY_FOREGROUND = 6;
7781 }
7782
7783 // Button pressed in the dialog
7784 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007785}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007786
7787/**
7788* Information about a AppPermissionFragment viewed by user
7789*/
7790message AppPermissionFragmentViewed {
7791 // id which identifies single session of user interacting with permission controller
7792 optional int64 session_id = 1;
7793
7794 // UID of package for which permissions are viewed
7795 optional int32 uid = 2 [(is_uid) = true];
7796
7797 // Name of package for which permissions are viewed
7798 optional string package_name = 3;
7799
7800 // Permission group viewed
7801 optional string permission_group_name = 4;
7802}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007803
7804/**
7805* Information about a AppPermissionsFragment viewed by user
7806*/
7807message AppPermissionsFragmentViewed {
7808 // id which identifies single session of user interacting with permission controller
7809 optional int64 session_id = 1;
7810
7811 // id which identifies single view as every view might have several logging records
7812 // with different package information attached
7813 optional int64 view_id = 2;
7814
7815 // Permission group viewed
7816 optional string permission_group_name = 3;
7817
7818 // UID of package for which permissions are viewed
7819 optional int32 uid = 4 [(is_uid) = true];
7820
7821 // Name of package for which permissions are viewed
7822 optional string package_name = 5;
7823
7824 // Category in which permission is included
7825 enum Category {
7826 UNDEFINED = 0;
7827 ALLOWED = 1;
7828 ALLOWED_FOREGROUND = 2;
7829 DENIED = 3;
7830 }
7831 optional Category category = 6;
7832}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007833
7834/**
7835* Information about a PermissionAppsFragment viewed by user.
7836* Logged from ui/handheld/PermissionAppsFragment.java
7837*/
7838message PermissionAppsFragmentViewed {
7839 // id which identifies single session of user interacting with permission controller
7840 optional int64 session_id = 1;
7841
7842 // id which identifies single view as every view might have several logging records
7843 // with different package information attached
7844 optional int64 view_id = 2;
7845
7846 // Permission group viewed
7847 optional string permission_group_name = 3;
7848
7849 // UID of package for which permissions are viewed
7850 optional int32 uid = 4 [(is_uid) = true];
7851
7852 // Name of package for which permissions are viewed
7853 optional string package_name = 5;
7854
7855 // Category in which app is included
7856 enum Category {
7857 UNDEFINED = 0;
7858 ALLOWED = 1;
7859 ALLOWED_FOREGROUND = 2;
7860 DENIED = 3;
7861 }
7862 optional Category category = 6;
7863}
Tony Make2b1b672019-07-29 16:59:47 +01007864
7865/**
7866 * Logs when there is a smart selection related event.
7867 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7868 * Logged from: TextClassifierEventLogger.java
7869 */
7870message TextSelectionEvent {
7871 // A session ID.
7872 optional string session_id = 1;
7873
7874 // Event type of this event.
7875 optional android.stats.textclassifier.EventType event_type = 2;
7876
Tony Mak9c84bd22019-12-09 07:27:25 +00007877 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007878 optional string model_name = 3;
7879
7880 // Type of widget that was involved in triggering this event.
7881 optional android.stats.textclassifier.WidgetType widget_type = 4;
7882
7883 // Index of this event in a session.
7884 optional int32 event_index = 5;
7885
7886 // Entity type that is involved.
7887 optional string entity_type = 6;
7888
7889 // Relative word index of the start of the selection.
7890 optional int32 relative_word_start_index = 7;
7891
7892 // Relative word (exclusive) index of the end of the selection.
7893 optional int32 relative_word_end_index = 8;
7894
7895 // Relative word index of the start of the smart selection.
7896 optional int32 relative_suggested_word_start_index = 9;
7897
7898 // Relative word (exclusive) index of the end of the smart selection.
7899 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007900
7901 // Name of source package.
7902 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007903}
7904
7905/**
7906 * Logs when there is a smart linkify related event.
7907 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7908 * Logged from: TextClassifierEventLogger.java
7909 */
7910message TextLinkifyEvent {
7911 // A session ID.
7912 optional string session_id = 1;
7913
7914 // Event type of this event.
7915 optional android.stats.textclassifier.EventType event_type = 2;
7916
Tony Mak9c84bd22019-12-09 07:27:25 +00007917 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007918 optional string model_name = 3;
7919
7920 // Type of widget that was involved in triggering this event.
7921 optional android.stats.textclassifier.WidgetType widget_type = 4;
7922
7923 // Index of this event in a session.
7924 optional int32 event_index = 5;
7925
7926 // Entity type that is involved.
7927 optional string entity_type = 6;
7928
7929 // Number of links detected.
7930 optional int32 num_links = 7;
7931
7932 // The total length of all links.
7933 optional int32 linked_text_length = 8;
7934
7935 // Length of input text.
7936 optional int32 text_length = 9;
7937
7938 // Time spent on generating links in ms.
7939 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007940
7941 // Name of source package.
7942 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007943}
7944
7945/**
7946 * Logs when there is a conversation actions related event.
7947 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7948 * Logged from: TextClassifierEventLogger.java
7949 */
7950message ConversationActionsEvent {
7951 // A session ID.
7952 optional string session_id = 1;
7953
7954 // Event type of this event.
7955 optional android.stats.textclassifier.EventType event_type = 2;
7956
Tony Mak9c84bd22019-12-09 07:27:25 +00007957 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007958 optional string model_name = 3;
7959
7960 // Type of widget that was involved in triggering this event.
7961 optional android.stats.textclassifier.WidgetType widget_type = 4;
7962
7963 // The first entity type that is involved.
7964 optional string first_entity_type = 5;
7965
7966 // The second entity type that is involved.
7967 optional string second_entity_type = 6;
7968
7969 // The third entity type that is involved.
7970 optional string third_entity_type = 7;
7971
7972 // The score of the first entity type.
7973 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007974
7975 // Name of source package.
7976 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007977
7978 // Name of the annotator model that is involved in this event.
7979 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007980}
7981
7982/**
7983 * Logs when there is a language detection related event.
7984 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7985 * Logged from: TextClassifierEventLogger.java
7986 */
7987message LanguageDetectionEvent {
7988 // A session ID.
7989 optional string session_id = 1;
7990
7991 // Event type of this event.
7992 optional android.stats.textclassifier.EventType event_type = 2;
7993
Tony Mak9c84bd22019-12-09 07:27:25 +00007994 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007995 optional string model_name = 3;
7996
7997 // Type of widget that was involved in triggering this event.
7998 optional android.stats.textclassifier.WidgetType widget_type = 4;
7999
8000 // Detected language.
8001 optional string language_tag = 5;
8002
8003 // Score of the detected language.
8004 optional float score = 6;
8005
8006 // Position of this action.
8007 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008008
8009 // Name of source package.
8010 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008011}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008012
8013/**
8014 * Information about an OTA update attempt by update_engine.
8015 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8016 */
8017message UpdateEngineUpdateAttemptReported {
8018 // The number of attempts for the update engine to apply a given payload.
8019 optional int32 attempt_number = 1;
8020
8021 optional android.stats.otaupdate.PayloadType payload_type = 2;
8022
8023 // The total time in minutes for the update engine to apply a given payload.
8024 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8025 // it's increased when the system is sleeping.
8026 optional int32 duration_boottime_in_minutes = 3;
8027
8028 // The total time in minutes for the update engine to apply a given payload.
8029 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8030 // and it's not increased when the system is sleeping.
8031 optional int32 duration_monotonic_in_minutes = 4;
8032
8033 // The size of the payload in MiBs.
8034 optional int32 payload_size_mib = 5;
8035
8036 // The attempt result reported by the update engine for an OTA update.
8037 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8038
8039 // The error code reported by the update engine after an OTA update attempt
8040 // on A/B devices.
8041 optional android.stats.otaupdate.ErrorCode error_code = 7;
8042
8043 // The build fingerprint of the source system. The value is read from a
8044 // system property when the device takes the update. e.g.
8045 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8046 optional string source_fingerprint = 8;
8047}
8048
8049/**
8050 * Information about all the attempts the device make before finishing the
8051 * successful update.
8052 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8053 */
8054message UpdateEngineSuccessfulUpdateReported {
8055 // The number of attempts for the update engine to apply the payload for a
8056 // successful update.
8057 optional int32 attempt_count = 1;
8058
8059 optional android.stats.otaupdate.PayloadType payload_type = 2;
8060
8061 optional int32 payload_size_mib = 3;
8062
8063 // The total number of bytes downloaded by update_engine since the last
8064 // successful update.
8065 optional int32 total_bytes_downloaded_mib = 4;
8066
8067 // The ratio in percentage of the over-downloaded bytes compared to the
8068 // total bytes needed to successfully install the update. e.g. 200 if we
8069 // download 200MiB in total for a 100MiB package.
8070 optional int32 download_overhead_percentage = 5;
8071
8072 // The total time in minutes for the update engine to apply the payload for a
8073 // successful update.
8074 optional int32 total_duration_minutes = 6;
8075
8076 // The number of reboot of the device during a successful update.
8077 optional int32 reboot_count = 7;
8078}
Alec Mourie088e762019-07-02 13:10:55 -07008079
8080/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008081 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8082 * key to indicate whether it was successful or not.
8083 *
8084 * Logged from:
8085 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8086 */
8087message RebootEscrowRecoveryReported {
8088 optional bool successful = 1;
8089}
8090
8091/**
Alec Mourie088e762019-07-02 13:10:55 -07008092 * Global display pipeline metrics reported by SurfaceFlinger.
8093 * Pulled from:
8094 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8095 */
8096message SurfaceflingerStatsGlobalInfo {
8097 // Total number of frames presented during the tracing period
8098 optional int64 total_frames = 1;
8099 // Total number of frames missed
8100 optional int64 missed_frames = 2;
8101 // Total number of frames that fell back to client composition
8102 optional int64 client_composition_frames = 3;
8103 // Total time the display was turned on
8104 optional int64 display_on_millis = 4;
8105 // Total time that was spent performing animations.
8106 // This is derived from the present-to-present layer histogram
8107 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008108 // Total number of event connections tracked by SurfaceFlinger at the time
8109 // of this pull. If this number grows prohibitively large, then this can
8110 // cause jank due to resource contention.
8111 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008112 // Set of timings measured from when SurfaceFlinger began compositing a
8113 // frame, until the frame was requested to be presented to the display. This
8114 // measures SurfaceFlinger's total CPU walltime on the critical path per
8115 // frame.
8116 optional FrameTimingHistogram frame_duration = 7
8117 [(android.os.statsd.log_mode) = MODE_BYTES];
8118 // Set of timings measured from when SurfaceFlinger first began using the
8119 // GPU to composite a frame, until the GPU has finished compositing that
8120 // frame. This measures the total additional time SurfaceFlinger needed to
8121 // perform due to falling back into GPU composition.
8122 optional FrameTimingHistogram render_engine_timing = 8
8123 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008124}
8125
8126/**
8127 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8128 * The number of layers uploaded will be restricted due to size limitations.
8129 * Pulled from:
8130 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8131 */
8132message SurfaceflingerStatsLayerInfo {
8133 // The layer for this set of metrics
8134 // For now we can infer that the package name is included in the layer
8135 // name.
8136 optional string layer_name = 1;
8137 // Total number of frames presented
8138 optional int64 total_frames = 2;
8139 // Total number of dropped frames while latching a buffer for this layer.
8140 optional int64 dropped_frames = 3;
8141 // Set of timings measured between successive presentation timestamps.
8142 optional FrameTimingHistogram present_to_present = 4
8143 [(android.os.statsd.log_mode) = MODE_BYTES];
8144 // Set of timings measured from when an app queued a buffer for
8145 // presentation, until the buffer was actually presented to the
8146 // display.
8147 optional FrameTimingHistogram post_to_present = 5
8148 [(android.os.statsd.log_mode) = MODE_BYTES];
8149 // Set of timings measured from when a buffer is ready to be presented,
8150 // until the buffer was actually presented to the display.
8151 optional FrameTimingHistogram acquire_to_present = 6
8152 [(android.os.statsd.log_mode) = MODE_BYTES];
8153 // Set of timings measured from when a buffer was latched by
8154 // SurfaceFlinger, until the buffer was presented to the display
8155 optional FrameTimingHistogram latch_to_present = 7
8156 [(android.os.statsd.log_mode) = MODE_BYTES];
8157 // Set of timings measured from the desired presentation to the actual
8158 // presentation time
8159 optional FrameTimingHistogram desired_to_present = 8
8160 [(android.os.statsd.log_mode) = MODE_BYTES];
8161 // Set of timings measured from when an app queued a buffer for
8162 // presentation, until the buffer was ready to be presented.
8163 optional FrameTimingHistogram post_to_acquire = 9
8164 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008165 // Frames missed latch because the acquire fence didn't fire
8166 optional int64 late_acquire_frames = 10;
8167 // Frames latched early because the desired present time was bad
8168 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008169}
8170
8171/**
8172 * Histogram of frame counts bucketed by time in milliseconds.
8173 * Because of size limitations, we hard-cap the number of buckets, with
8174 * buckets for corresponding to larger milliseconds being less precise.
8175 */
8176message FrameTimingHistogram {
8177 // Timings in milliseconds that describes a set of histogram buckets
8178 repeated int32 time_millis_buckets = 1;
8179 // Number of frames that match to each time_millis, i.e. the bucket
8180 // contents
8181 // It's required that len(time_millis) == len(frame_count)
8182 repeated int64 frame_counts = 2;
8183}
Emilian Peev6729f372019-08-29 09:14:09 -07008184
Emilian Peev6729f372019-08-29 09:14:09 -07008185/**
8186 * Information about camera facing and API level usage.
8187 * Logged from:
8188 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8189 */
8190message CameraActionEvent {
8191 // Camera session duration
8192 optional int64 duration = 1;
8193
8194 // Camera API level used
8195 optional int32 api_level = 2;
8196
8197 // Name of client package
8198 optional string package_name = 3;
8199
8200 // Camera facing
8201 enum Facing {
8202 UNKNOWN = 0;
8203 BACK = 1;
8204 FRONT = 2;
8205 EXTERNAL = 3;
8206 }
8207 optional Facing facing = 4;
8208}
atrost01a20932019-08-28 15:40:37 +01008209
8210/**
8211 * Logs when a compatibility change is affecting an app.
8212 *
8213 * Logged from:
8214 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8215 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8216 */
8217message AppCompatibilityChangeReported {
8218 // The UID of the app being affected by the compatibilty change.
8219 optional int32 uid = 1 [(is_uid) = true];
8220
8221 // The ID of the change affecting the app.
8222 optional int64 change_id = 2;
8223
8224 enum State {
8225 UNKNOWN_STATE = 0;
8226 ENABLED = 1;
8227 DISABLED = 2;
8228 LOGGED = 3;
8229 }
8230
8231 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8232 // logged otherwise.
8233 optional State state = 3;
8234
8235 enum Source {
8236 UNKNOWN_SOURCE = 0;
8237 APP_PROCESS = 1;
8238 SYSTEM_SERVER = 2;
8239 }
8240
8241 // Where it was logged from.
8242 optional Source source = 4;
8243
8244}
Hector Dearman40579f62019-11-01 13:19:30 +00008245
8246/**
8247 * Logged from
8248 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8249 */
8250message PerfettoUploaded {
8251 enum Event {
8252 PERFETTO_UNDEFINED = 0;
8253 PERFETTO_TRACE_BEGIN = 1;
8254 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8255 PERFETTO_ON_CONNECT = 3;
8256 PERFETTO_ON_TRACING_DISABLED = 4;
8257 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8258 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8259 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8260 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8261 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8262 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8263 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8264 PERFETTO_TRIGGER_BEGIN = 12;
8265 PERFETTO_TRIGGER_SUCCESS = 13;
8266 PERFETTO_TRIGGER_FAILURE = 14;
8267 PERFETTO_HIT_GUARDRAILS = 15;
8268 PERFETTO_ON_TIMEOUT = 16;
8269 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8270 }
8271
8272 // Which stage of the pipeline we are reporting from.
8273 optional Event event = 1;
8274
8275 // UUID matching the one set inside the SystemInfo trace packet.
8276 optional int64 trace_uuid_lsb = 2;
8277 optional int64 trace_uuid_msb = 3;
8278}
Mark Tabrya824a642019-11-05 12:26:12 -08008279
8280/**
8281 * Pulls client metrics on data transferred via Vehicle Maps Service.
8282 * Metrics are keyed by uid + layer.
8283 *
8284 * Pulled from:
8285 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8286 */
8287message VmsClientStats {
8288 // UID of the VMS client app
8289 optional int32 uid = 1 [(is_uid) = true];
8290
8291 // VMS layer definition
8292 optional int32 layer_type = 2;
8293 optional int32 layer_channel = 3;
8294 optional int32 layer_version = 4;
8295
8296 // Bytes and packets sent by the client for the layer
8297 optional int64 tx_bytes = 5;
8298 optional int64 tx_packets = 6;
8299
8300 // Bytes and packets received by the client for the layer
8301 optional int64 rx_bytes = 7;
8302 optional int64 rx_packets = 8;
8303
8304 // Bytes and packets dropped due to client error
8305 optional int64 dropped_bytes = 9;
8306 optional int64 dropped_packets = 10;
8307}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008308
8309/**
8310 * State of a dangerous permission requested by a package - sampled
8311 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8312*/
8313message DangerousPermissionStateSampled {
8314 // Name of the permission
8315 optional string permission_name = 1;
8316
8317 // Uid of the package
8318 optional int32 uid = 2 [(is_uid) = true];
8319
8320 // If the permission is granted to the uid
8321 optional bool is_granted = 3;
8322
8323 // Permission flags as per android.content.pm.PermissionFlags
8324 optional int32 permission_flags = 4;
8325}
8326
Stan Iliev637ba5e2019-08-16 13:43:08 -04008327/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008328 * HWUI stats for a given app.
8329 */
8330message GraphicsStats {
8331 // The package name of the app
8332 optional string package_name = 1;
8333
8334 // The version code of the app
8335 optional int64 version_code = 2;
8336
8337 // The start & end timestamps in UTC as
8338 // milliseconds since January 1, 1970
8339 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008340 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008341
Stan Ilievb6517192020-02-18 10:12:42 -05008342 optional int64 end_millis = 4;
8343
8344 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8345 enum PipelineType {
8346 UNKNOWN = 0;
8347 GL = 1;
8348 VULKAN = 2;
8349 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008350
8351 // HWUI renders pipeline type: GL or Vulkan.
8352 optional PipelineType pipeline = 5;
8353
8354 // Distinct frame count.
8355 optional int32 total_frames = 6;
8356
8357 // Number of "missed vsync" events.
8358 optional int32 missed_vsync_count = 7;
8359
8360 // Number of frames in triple-buffering scenario (high input latency)
8361 optional int32 high_input_latency_count = 8;
8362
8363 // Number of "slow UI thread" events.
8364 optional int32 slow_ui_thread_count = 9;
8365
8366 // Number of "slow bitmap upload" events.
8367 optional int32 slow_bitmap_upload_count = 10;
8368
8369 // Number of "slow draw" events.
8370 optional int32 slow_draw_count = 11;
8371
8372 // Number of frames that missed their deadline (aka, visibly janked)
8373 optional int32 missed_deadline_count = 12;
8374
8375 // The frame time histogram for the package
8376 optional FrameTimingHistogram cpu_histogram = 13
8377 [(android.os.statsd.log_mode) = MODE_BYTES];
8378
8379 // The gpu frame time histogram for the package
8380 optional FrameTimingHistogram gpu_histogram = 14
8381 [(android.os.statsd.log_mode) = MODE_BYTES];
8382
8383 // UI mainline module version.
8384 optional int64 version_ui_module = 15;
8385
8386 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8387 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8388 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8389 // more apps are running / rendering.
8390 optional bool is_today = 16;
8391}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008392
8393/**
8394 * Message related to dangerous (runtime) app ops access
8395 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008396message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008397 // Uid of the package accessing app op
8398 optional int32 uid = 1 [(is_uid) = true];
8399
8400 // Name of the package accessing app op
8401 optional string package_name = 2;
8402
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008403 // operation string id per OPSTR_ constants in AppOpsManager.java
8404 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008405
8406 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8407 // Features must be provided through manifest using <feature> tag available in R and above.
8408 optional string feature_id = 4;
8409
8410 // message related to app op access, limited to 600 chars by API
8411 optional string message = 5;
8412
8413 enum SamplingStrategy {
8414 DEFAULT = 0;
8415 UNIFORM = 1;
8416 RARELY_USED = 2;
8417 }
8418
8419 // sampling strategy used to collect this message
8420 optional SamplingStrategy sampling_strategy = 6;
8421}
8422
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008423/*
8424 * Logs userspace reboot outcome and duration.
8425 *
8426 * Logged from:
8427 * frameworks/base/core/java/com/android/server/BootReceiver.java
8428 */
8429message UserspaceRebootReported {
8430 // Possible outcomes of userspace reboot.
8431 enum Outcome {
8432 // Default value in case platform failed to determine the outcome.
8433 OUTCOME_UNKNOWN = 0;
8434 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8435 SUCCESS = 1;
8436 // Userspace reboot shutdown sequence was aborted.
8437 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8438 // Remounting userdata into checkpointing mode failed.
8439 FAILED_USERDATA_REMOUNT = 3;
8440 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8441 // reboot.
8442 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8443 }
8444 // Outcome of userspace reboot. Always set.
8445 optional Outcome outcome = 1;
8446 // Duration of userspace reboot in case it has a successful outcome.
8447 // Duration is measured as time between userspace reboot was initiated and until boot completed
8448 // (e.g. sys.boot_completed=1).
8449 optional int64 duration_millis = 2;
8450 // State of primary user's (user0) credential encryption storage.
8451 enum UserEncryptionState {
8452 // Default value.
8453 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8454 // Credential encrypted storage is unlocked.
8455 UNLOCKED = 1;
8456 // Credential encrypted storage is locked.
8457 LOCKED = 2;
8458 }
8459 // State of primary user's encryption storage at the moment boot completed. Always set.
8460 optional UserEncryptionState user_encryption_state = 3;
8461}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008462
8463/*
8464 * Logs integrity check information during each install.
8465 *
8466 * Logged from:
8467 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8468 */
8469message IntegrityCheckResultReported {
8470 optional string package_name = 1;
8471 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008472 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008473 optional string installer_package_name = 4;
8474 enum Response {
8475 UNKNOWN = 0;
8476 ALLOWED = 1;
8477 REJECTED = 2;
8478 FORCE_ALLOWED = 3;
8479 }
8480 optional Response response = 5;
8481 // An estimate on the cause of the response. This will only be populated for
8482 // REJECTED and FORCE_ALLOWED
8483 optional bool caused_by_app_cert_rule = 6;
8484 optional bool caused_by_installer_rule = 7;
8485}
8486
8487/**
8488 * Logs the information about the rules and the provider whenever rules are
8489 * pushed into AppIntegrityManager.
8490 *
8491 * Logged from:
8492 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8493 */
8494message IntegrityRulesPushed {
8495 optional bool success = 1;
8496 // Package name of the app that pushed the rules.
8497 optional string rule_provider = 2;
8498 // Version string of arbitrary format provided by the rule provider to
8499 // identify the rules.
8500 optional string rule_version = 3;
8501}
Jordan Liubedfa702019-12-20 15:08:45 -08008502
8503/**
8504 * Logs when a cell broadcast message is received on the device.
8505 *
8506 * Logged from CellBroadcastService module:
8507 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8508 */
8509message CellBroadcastMessageReported {
8510 // The type of Cell Broadcast message
8511 enum CbType {
8512 UNKNOWN_TYPE = 0;
8513 GSM = 1;
8514 CDMA = 2;
8515 CDMA_SPC = 3;
8516 }
8517
8518 // GSM, CDMA, CDMA-SCP
8519 optional CbType type = 1;
8520}
8521
8522/**
8523 * Logs when an error occurs while handling a cell broadcast message;
8524 *
8525 * Logged from CellBroadcastService module:
8526 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8527 */
8528message CellBroadcastMessageError {
8529 // The type of error raised when trying to handle a cell broadcast message
8530 enum ErrorType {
8531 UNKNOWN_TYPE = 0;
8532 CDMA_DECODING_ERROR = 1;
8533 CDMA_SCP_EMPTY = 2;
8534 CDMA_SCP_HANDLING_ERROR = 3;
8535 GSM_INVALID_HEADER_LENGTH = 4;
8536 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8537 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8538 GSM_INVALID_PDU = 7;
8539 GSM_INVALID_GEO_FENCING_DATA = 8;
8540 GSM_UMTS_INVALID_WAC = 9;
8541 FAILED_TO_INSERT_TO_DB = 10;
8542 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8543 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8544 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8545 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8546 }
8547
8548 // What kind of error occurred
8549 optional ErrorType type = 1;
8550
8551 // Exception message (or log message) associated with the error (max 1000 chars)
8552 optional string exception_message = 2;
8553}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008554
8555/**
8556 * Logs when the SDK Extensions test app has polled the current version.
8557 * This is atom ID 354.
8558 *
8559 * Logged from:
8560 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8561 */
8562message SdkExtensionStatus {
8563 enum ApiCallStatus {
8564 CALL_NOT_ATTEMPTED = 0;
8565 CALL_SUCCESSFUL = 1;
8566 CALL_FAILED = 2;
8567 }
8568
8569 optional ApiCallStatus result = 1;
8570
8571 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8572 optional int32 r_extension_version = 2;
8573
8574 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8575 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8576 optional int32 failed_call_symbol = 3;
8577}
Marco Ballesio497aff42020-01-24 08:39:42 -08008578
8579/**
8580 * Logs when an app is frozen or unfrozen.
8581 *
8582 * Logged from:
8583 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8584 */
8585message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008586 // The type of event.
8587 enum Action {
8588 UNKNOWN = 0;
8589 FREEZE_APP = 1;
8590 UNFREEZE_APP = 2;
8591 }
8592 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008593
Blake Kragten6ce382a2020-01-16 20:20:46 -08008594 // Pid of the process being frozen.
8595 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008596
Blake Kragten6ce382a2020-01-16 20:20:46 -08008597 // Name of the process being frozen.
8598 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008599
Blake Kragten6ce382a2020-01-16 20:20:46 -08008600 // Time since last unfrozen.
8601 optional int64 time_unfrozen_millis = 4;
8602}
8603
8604/**
8605 * Logs gnss stats from location service provider
8606 *
8607 * Pulled from:
8608 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8609 */
8610
8611message GnssStats {
8612 // Number of location reports since boot
8613 optional int64 location_reports = 1;
8614
8615 // Total pulled reports of Location failures since boot
8616 optional int64 location_failure_reports = 2;
8617
8618 // Number of time to first fix reports since boot
8619 optional int64 time_to_first_fix_reports = 3;
8620
8621 // Total pulled reported time to first fix (in milli-seconds) since boot
8622 optional int64 time_to_first_fix_milli_s = 4;
8623
8624 // Number of position accuracy reports since boot
8625 optional int64 position_accuracy_reports = 5;
8626
8627 // Total pulled reported position accuracy (in meters) since boot
8628 optional int64 position_accuracy_meters = 6;
8629
8630 // Number of top 4 average CN0 reports since boot
8631 optional int64 top_four_average_cn0_reports = 7;
8632
8633 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8634 optional int64 top_four_average_cn0_db_mhz = 8;
8635
8636 // Number of l5 top 4 average CN0 reports since boot
8637 optional int64 l5_top_four_average_cn0_reports = 9;
8638
8639 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8640 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8641
8642 // Total number of sv status messages reports since boot
8643 optional int64 sv_status_reports = 11;
8644
8645 // Total number of sv status messages reports, where sv is used in fix since boot
8646 optional int64 sv_status_reports_used_in_fix = 12;
8647
8648 // Total number of L5 sv status messages reports since boot
8649 optional int64 l5_sv_status_reports = 13;
8650
8651 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8652 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008653}