blob: 43d0fce316add8d5b51323606ee92d67c91a034f [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.
Yotam Aron74299972020-01-16 16:20:58 +0200400 // Next: 10074
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"];
David Chenc8a43242017-10-17 16:23:28 -0700481 }
yroa1fe77c2018-02-26 14:22:54 -0800482
Bookatz76aafcf2018-09-17 16:17:10 -0700483 // DO NOT USE field numbers above 100,000 in AOSP.
484 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
485 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100486
487 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700488}
489
Yao Chend54f9dd2017-10-17 17:37:48 +0000490/**
Yangster-mac20877162017-12-22 17:19:39 -0800491 * This proto represents a node of an attribution chain.
492 * Note: All attribution chains are represented as a repeated field of type
493 * AttributionNode. It is understood that in such arrays, the order is that
494 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000495 */
Yangster-mac20877162017-12-22 17:19:39 -0800496message AttributionNode {
497 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800498 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800499
Yangster-mac20877162017-12-22 17:19:39 -0800500 // The (optional) string tag for an element in the attribution chain. If the
501 // element has no tag, it is encoded as an empty string.
502 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700503}
504
Yangster-mac48b3d622018-08-18 12:38:11 -0700505message KeyValuePair {
506 optional int32 key = 1;
507 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700508 int32 value_int = 2;
509 int64 value_long = 3;
510 string value_str = 4;
511 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700512 }
513}
514
515message KeyValuePairsAtom {
516 optional int32 uid = 1;
517 repeated KeyValuePair pairs = 2;
518}
519
Yao Chend54f9dd2017-10-17 17:37:48 +0000520/*
521 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800522 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000523 *
524 * RULES:
525 * - The field ids for each atom must start at 1, and count upwards by 1.
526 * Skipping field ids is not allowed.
527 * - These form an API, so renaming, renumbering or removing fields is
528 * not allowed between android releases. (This is not currently enforced,
529 * but there will be a tool to enforce this restriction).
530 * - The types must be built-in protocol buffer types, namely, no sub-messages
531 * are allowed (yet). The bytes type is also not allowed.
532 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800533 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000534 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800535 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000536 * - A field that is a uid should be a string field, tagged with the [xxx]
537 * annotation. The generated code on android will be represented by UIDs,
538 * and those UIDs will be translated in xxx to those strings.
539 *
540 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700541 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 * - If there is a UID, it goes first. Think in an object-oriented fashion.
543 * *****************************************************************************
544 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700545
Yao Chend54f9dd2017-10-17 17:37:48 +0000546/**
Tej Singha72344992019-04-17 18:55:08 -0700547 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700548 * Logs when the Thermal service HAL notifies the throttling start/stop events.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
552 */
553message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700554 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700555 optional android.os.TemperatureTypeEnum sensor_type = 1;
556
Maggie White442b6312019-04-05 16:26:44 -0700557 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700558 enum State {
559 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700560 START = 1; // START indicated that throttling was triggered.
561 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700562 }
Yangster-mace16189a2018-08-26 12:20:16 -0700563 optional State state = 2;
564
565 optional float temperature = 3;
566}
567
568/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * Logs when the screen state changes.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
573 */
574message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800575 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800576 optional android.view.DisplayStateEnum state = 1
577 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578}
Yao Chend54f9dd2017-10-17 17:37:48 +0000579
580/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700581 * Logs that the process state of the uid, as determined by ActivityManager
582 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 *
584 * Logged from:
585 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
586 */
Bookatzc1a050a2017-10-10 15:49:28 -0700587message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800588 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000589
Bookatzdb026a22018-01-10 19:01:56 -0800590 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800591 optional android.app.ProcessStateEnum state = 2
592 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000593}
594
595/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700596 * Logs process state change of a process, as per the activity manager.
597 *
598 * Logged from:
599 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
600 */
601message ProcessStateChanged {
602 optional int32 uid = 1;
603 optional string process_name = 2;
604 optional string package_name = 3;
605 // TODO: remove this when validation is done
606 optional int64 version = 5;
607 // The state, from frameworks/base/core/proto/android/app/enums.proto.
608 optional android.app.ProcessStateEnum state = 4;
609}
610
611/**
612 * Logs when ActivityManagerService sleep state is changed.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
616 */
617message ActivityManagerSleepStateChanged {
618 // TODO: import frameworks proto
619 enum State {
620 UNKNOWN = 0;
621 ASLEEP = 1;
622 AWAKE = 2;
623 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700625}
626
627/**
628 * Logs when system memory state changes.
629 *
630 * Logged from:
631 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
632 */
633message MemoryFactorStateChanged {
634 // TODO: import frameworks proto
635 enum State {
636 MEMORY_UNKNOWN = 0;
637 NORMAL = 1; // normal.
638 MODERATE = 2; // moderate memory pressure.
639 LOW = 3; // low memory.
640 CRITICAL = 4; // critical memory.
641
642 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800643 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700644}
645
646/**
647 * Logs when app is using too much cpu, according to ActivityManagerService.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
651 */
652message ExcessiveCpuUsageReported {
653 optional int32 uid = 1;
654 optional string process_name = 2;
655 optional string package_name = 3;
656 // package version. TODO: remove this when validation is done
657 optional int64 version = 4;
658}
659
660/**
661 * Logs when a cached process is killed, along with its pss.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message CachedKillReported {
667 optional int32 uid = 1;
668 optional string process_name = 2;
669 optional string package_name = 3;
670 // TODO: remove this when validation is done
671 optional int64 version = 5;
672 optional int64 pss = 4;
673}
674
675/**
xshu2c3d9e42019-09-26 17:54:02 -0700676 * Logs the change in wifi health.
677 *
678 * Logged from:
679 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
680 */
681message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800682 enum Band {
683 UNKNOWN = 0;
684 // All of 2.4GHz band
685 BAND_2G = 1;
686 // Frequencies in the range of [5150, 5250) GHz
687 BAND_5G_LOW = 2;
688 // Frequencies in the range of [5250, 5725) GHz
689 BAND_5G_MIDDLE = 3;
690 // Frequencies in the range of [5725, 5850) GHz
691 BAND_5G_HIGH = 4;
692 // Frequencies in the range of [5925, 6425) GHz
693 BAND_6G_LOW = 5;
694 // Frequencies in the range of [6425, 6875) GHz
695 BAND_6G_MIDDLE = 6;
696 // Frequencies in the range of [6875, 7125) GHz
697 BAND_6G_HIGH = 7;
698 }
xshu2c3d9e42019-09-26 17:54:02 -0700699 // duration this stat is obtained over in milliseconds
700 optional int32 duration_millis = 1;
701 // whether wifi is classified as sufficient for the user's data traffic, determined
702 // by whether the calculated throughput exceeds the average demand within |duration_millis|
703 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700704 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800705 optional bool is_cell_data_available = 3;
706 // the Band bucket the connected network is on
707 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700708}
709
710/**
711 * Logged when wifi detects a significant change in connection failure rate.
712 *
713 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
714 *
715 */
716message WifiFailureStatReported {
717 enum AbnormalityType {
718 UNKNOWN = 0;
719 SIGNIFICANT_INCREASE = 1;
720 SIGNIFICANT_DECREASE = 2;
721 SIMPLY_HIGH = 3;
722 }
723 enum FailureType {
724 FAILURE_UNKNOWN = 0;
725 FAILURE_CONNECTION = 1;
726 FAILURE_ASSOCIATION_REJECTION = 2;
727 FAILURE_ASSOCIATION_TIMEOUT = 3;
728 FAILURE_AUTHENTICATION = 4;
729 FAILURE_NON_LOCAL_DISCONNECTION = 5;
730 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
731 }
732 // Reason for uploading this stat
733 optional AbnormalityType abnormality_type = 1;
734 // The particular type of failure
735 optional FailureType failure_type = 2;
736 // How many times we have encountered this combination of AbnormalityType and FailureType
737 optional int32 failure_count = 3;
738}
739
740/**
741 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
742 *
743 * Logged from:
744 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
745 */
746message WifiConnectionResultReported {
747 enum FailureCode {
748 FAILURE_UNKNOWN = 0;
749 FAILURE_ASSOCIATION_TIMEOUT = 1;
750 FAILURE_ASSOCIATION_REJECTION = 2;
751 FAILURE_AUTHENTICATION_GENERAL = 3;
752 FAILURE_AUTHENTICATION_EAP = 4;
753 FAILURE_DHCP = 5;
754 FAILURE_NETWORK_DISCONNECTION = 6;
755 FAILURE_ROAM_TIMEOUT = 7;
756 }
757 // true represents a successful connection
758 optional bool connection_result = 1;
759 // reason for the connection failure
760 optional FailureCode failure_code = 2;
761 // scan rssi before the connection attempt
762 optional int32 rssi = 3;
763}
764
765/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700766 * Logs when memory stats of a process is reported.
767 *
768 * Logged from:
769 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
770 */
771message ProcessMemoryStatReported {
772 optional int32 uid = 1;
773 optional string process_name = 2;
774 optional string package_name = 3;
775 //TODO: remove this when validation is done
776 optional int64 version = 9;
777 optional int64 pss = 4;
778 optional int64 uss = 5;
779 optional int64 rss = 6;
780 enum Type {
781 ADD_PSS_INTERNAL_SINGLE = 0;
782 ADD_PSS_INTERNAL_ALL_MEM = 1;
783 ADD_PSS_INTERNAL_ALL_POLL = 2;
784 ADD_PSS_EXTERNAL = 3;
785 ADD_PSS_EXTERNAL_SLOW = 4;
786 }
787 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800788 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700789}
790
791/**
Bookatzc1a050a2017-10-10 15:49:28 -0700792 * Logs that a process started, finished, crashed, or ANRed.
793 *
794 * Logged from:
795 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
796 */
797message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700798 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700799
David Chen0b5c90c2018-01-25 16:51:49 -0800800 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800801 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700802
Bookatzddccf0a2017-11-28 16:48:14 -0800803 // What lifecycle state the process changed to.
804 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800805 enum State {
806 FINISHED = 0;
807 STARTED = 1;
808 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800809 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800810 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700811}
812
Bookatzc1a050a2017-10-10 15:49:28 -0700813/**
814 * Logs when the ble scan state changes.
815 *
816 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700817 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700818 */
819message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800820 repeated AttributionNode attribution_node = 1
821 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700822
823 enum State {
824 OFF = 0;
825 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700826 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
827 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700828 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800829 optional State state = 2 [
830 (state_field_option).option = EXCLUSIVE_STATE,
831 (state_field_option).default_state_value = 0 /* State.OFF */,
832 (state_field_option).reset_state_value = 2 /* State.RESET */,
833 (state_field_option).nested = true
834 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700835
Bookatze5ec0b42018-03-26 13:34:56 -0700836 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800837 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700838 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800839 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700840 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800841 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700842}
843
844/**
845 * Logs reporting of a ble scan finding results.
846 *
847 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700848 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700849 */
Bookatzae6738e2018-09-13 11:38:56 -0700850// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700851message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800852 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700853
854 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800855 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700856}
857
858/**
859 * Logs when a sensor state changes.
860 *
861 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700862 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700863 */
864message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800865 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700866
Bookatzc1a050a2017-10-10 15:49:28 -0700867 // The id (int) of the sensor.
868 optional int32 sensor_id = 2;
869
870 enum State {
871 OFF = 0;
872 ON = 1;
873 }
874 optional State state = 3;
875}
876
Bookatzc1a050a2017-10-10 15:49:28 -0700877/**
878 * Logs when GPS state changes.
879 *
880 * Logged from:
881 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
882 */
883message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800884 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700885
886 enum State {
887 OFF = 0;
888 ON = 1;
889 }
890 optional State state = 2;
891}
892
Bookatz48d362e2018-11-06 15:49:08 -0800893/**
894 * Logs when GPS signal quality.
895 *
896 * Logged from:
897 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
898 */
899message GpsSignalQualityChanged {
900 optional android.server.location.GpsSignalQualityEnum level = 1;
901}
902
Bookatzc1a050a2017-10-10 15:49:28 -0700903
904/**
905 * Logs when a sync manager sync state changes.
906 *
907 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700908 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700909 */
910message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800911 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700912
David Chen0b5c90c2018-01-25 16:51:49 -0800913 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800914 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700915
916 enum State {
917 OFF = 0;
918 ON = 1;
919 }
920 optional State state = 3;
921}
922
Yangster-mac96353002018-09-05 11:18:55 -0700923/*
924 * Deferred job stats.
925 *
926 * Logged from:
927 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
928*/
929message DeferredJobStatsReported {
930 repeated AttributionNode attribution_node = 1;
931
932 // Number of jobs deferred.
933 optional int32 num_jobs_deferred = 2;
934
935 // Time since the last job runs.
936 optional int64 time_since_last_job_millis = 3;
937}
938
Bookatzc1a050a2017-10-10 15:49:28 -0700939/**
940 * Logs when a job scheduler job state changes.
941 *
942 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700943 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700944 */
945message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800946 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700947
948 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800949 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700950
951 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800952 FINISHED = 0;
953 STARTED = 1;
954 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700955 }
956 optional State state = 3;
957
Tej Singh33a412b2018-03-16 18:43:59 -0700958 // The reason a job has stopped.
959 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700960 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700961 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100962
963 // The standby bucket of the app that scheduled the job. These match the framework constants
964 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
965 // already assigned 0.
966 enum Bucket {
967 UNKNOWN = -1;
968 ACTIVE = 0;
969 WORKING_SET = 1;
970 FREQUENT = 2;
971 RARE = 3;
972 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800973 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100974 }
975 optional Bucket standby_bucket = 5 [default = UNKNOWN];
976
977 // The job id (as assigned by the app).
978 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700979}
980
981/**
982 * Logs when the audio state changes.
983 *
984 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700985 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700986 */
987message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800988 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700989
990 enum State {
991 OFF = 0;
992 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700993 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
994 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700995 }
996 optional State state = 2;
997}
998
999/**
1000 * Logs when the video codec state changes.
1001 *
1002 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001003 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001004 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001005message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001006 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001007
1008 enum State {
1009 OFF = 0;
1010 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001011 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1012 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001013 }
1014 optional State state = 2;
1015}
1016
1017/**
1018 * Logs when the flashlight state changes.
1019 *
1020 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001021 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001022 */
1023message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001024 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001025
1026 enum State {
1027 OFF = 0;
1028 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001029 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1030 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001031 }
1032 optional State state = 2;
1033}
1034
1035/**
1036 * Logs when the camera state changes.
1037 *
1038 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001039 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001040 */
1041message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001043
1044 enum State {
1045 OFF = 0;
1046 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001047 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1048 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001049 }
1050 optional State state = 2;
1051}
1052
1053/**
1054 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001055 *
1056 * Logged from:
1057 * TODO
1058 */
Bookatzd6746242017-10-24 18:39:35 -07001059message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001060 repeated AttributionNode attribution_node = 1
1061 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001062
Bookatz1a1b0462018-01-12 11:47:03 -08001063 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1064 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001065 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001066 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001067
1068 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001069 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001070
1071 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001072 RELEASE = 0;
1073 ACQUIRE = 1;
1074 CHANGE_RELEASE = 2;
1075 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001076 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001077 optional State state = 4 [
1078 (state_field_option).option = EXCLUSIVE_STATE,
1079 (state_field_option).default_state_value = 0,
1080 (state_field_option).nested = true
1081 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001082}
1083
1084/**
Bookatzc1a050a2017-10-10 15:49:28 -07001085 * Logs when a partial wakelock is considered 'long' (over 1 min).
1086 *
1087 * Logged from:
1088 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1089 */
1090message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001091 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001092
Yao Chend54f9dd2017-10-17 17:37:48 +00001093 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1094 optional string tag = 2;
1095
Bookatzc1a050a2017-10-10 15:49:28 -07001096 // TODO: I have no idea what this is.
1097 optional string history_tag = 3;
1098
1099 enum State {
1100 OFF = 0;
1101 ON = 1;
1102 }
1103 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001104}
1105
Bookatzc1a050a2017-10-10 15:49:28 -07001106/**
Bookatza66083f2018-09-20 17:24:00 -07001107 * Logs when the device is interactive, according to the PowerManager Notifier.
1108 *
1109 * Logged from:
1110 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1111 */
1112message InteractiveStateChanged {
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
1116 }
1117 optional State state = 1;
1118}
1119
1120/**
Bookatzc1a050a2017-10-10 15:49:28 -07001121 * Logs Battery Saver state change.
1122 *
1123 * Logged from:
1124 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1125 */
1126message BatterySaverModeStateChanged {
1127 enum State {
1128 OFF = 0;
1129 ON = 1;
1130 }
1131 optional State state = 1;
1132}
1133
1134/**
1135 * Logs Doze mode state change.
1136 *
1137 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001138 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001139 */
1140message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001141 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001142}
1143
1144
1145/**
1146 * Logs state change of Doze mode including maintenance windows.
1147 *
1148 * Logged from:
1149 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1150 */
1151message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001152 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001153}
1154
1155/**
1156 * Logs screen brightness level.
1157 *
1158 * Logged from:
1159 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1160 */
1161message ScreenBrightnessChanged {
1162 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1163 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001164}
1165
1166/**
1167 * Logs battery level (percent full, from 0 to 100).
1168 *
1169 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001170 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001171 */
1172message BatteryLevelChanged {
1173 // Battery level. Should be in [0, 100].
1174 optional int32 battery_level = 1;
1175}
1176
1177/**
1178 * Logs change in charging status of the device.
1179 *
1180 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001181 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001182 */
1183message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001184 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1185 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001186}
1187
1188/**
1189 * Logs whether the device is plugged in, and what power source it is using.
1190 *
1191 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001192 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001193 */
1194message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001195 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1196 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001197}
1198
Bookatz8c6571b2017-10-24 15:04:41 -07001199/**
1200 * Logs when an app's wakeup alarm fires.
1201 *
1202 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001203 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001204 */
1205message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001206 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001207
1208 // Name of the wakeup alarm.
1209 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001210
1211 // Name of source package (for historical reasons, since BatteryStats tracked it).
1212 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001213
1214 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1215 enum Bucket {
1216 UNKNOWN = 0;
1217 EXEMPTED = 5;
1218 ACTIVE = 10;
1219 WORKING_SET = 20;
1220 FREQUENT = 30;
1221 RARE = 40;
1222 NEVER = 50;
1223 }
1224 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1225 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001226}
1227
1228/**
1229 * Logs when an an app causes the mobile radio to change state.
1230 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1231 *
1232 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001233 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001234 */
1235message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001236 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001237
Bookatz1a1b0462018-01-12 11:47:03 -08001238 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1239 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001240}
1241
1242/**
1243 * Logs when an an app causes the wifi radio to change state.
1244 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1245 *
1246 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001247 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001248 */
1249message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001250 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001251
Bookatz1a1b0462018-01-12 11:47:03 -08001252 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1253 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001254}
1255
1256/**
1257 * Logs kernel wakeup reasons and aborts.
1258 *
1259 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001260 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001261 */
1262message KernelWakeupReported {
1263 // Name of the kernel wakeup reason (or abort).
1264 optional string wakeup_reason_name = 1;
1265
1266 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001267 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001268}
1269
1270/**
Bookatzda1798c2018-12-13 14:16:00 -08001271 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001272 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001273 *
1274 * Logged from:
1275 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1276 */
1277message WifiEnabledStateChanged {
1278 enum State {
1279 OFF = 0;
1280 ON = 1;
1281 }
1282 optional State state = 1;
1283}
1284
1285/**
tsaichristinececebdc2020-02-04 14:05:56 -08001286 * This atom is deprecated starting in R.
1287 *
Bookatzda1798c2018-12-13 14:16:00 -08001288 * 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 -08001289 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1290 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001291 *
1292 * Logged from:
1293 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1294 */
1295message WifiRunningStateChanged {
1296 repeated AttributionNode attribution_node = 1;
1297
1298 enum State {
1299 OFF = 0;
1300 ON = 1;
1301 }
1302 optional State state = 2;
1303}
1304
1305/**
Bookatze5885242017-10-24 20:10:31 -07001306 * Logs wifi locks held by an app.
1307 *
1308 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001309 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001310 */
1311message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001312 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001313
1314 enum State {
1315 OFF = 0;
1316 ON = 1;
1317 }
1318 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001319
1320 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1321 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001322}
1323
1324/**
1325 * Logs wifi signal strength changes.
1326 *
1327 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001328 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001329 */
1330message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001331 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1332 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001333}
1334
1335/**
1336 * Logs wifi scans performed by an app.
1337 *
1338 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001339 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001340 */
1341message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001342 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001343
1344 enum State {
1345 OFF = 0;
1346 ON = 1;
1347 }
1348 optional State state = 2;
1349}
1350
1351/**
Tej Singh4503e102018-01-04 14:35:01 -08001352 * Logs wifi multicast locks held by an app
1353 *
1354 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001355 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001356 */
1357message WifiMulticastLockStateChanged {
1358 repeated AttributionNode attribution_node = 1;
1359
1360 enum State {
1361 OFF = 0;
1362 ON = 1;
1363 }
1364 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001365
1366 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001367}
1368
1369/**
Tej Singh1ea42892018-01-19 09:27:00 -08001370 * Logs shutdown reason and duration on next boot.
1371 *
1372 * Logged from:
1373 * frameworks/base/core/java/com/android/server/BootReceiver.java
1374 */
1375message ShutdownSequenceReported {
1376 // True if shutdown is for a reboot. Default: false if we do not know.
1377 optional bool reboot = 1;
1378
1379 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1380 optional string reason = 2;
1381
1382 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1383 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001384 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001385
1386 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001387 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001388}
1389
Tej Singh6483ea42018-01-25 17:45:49 -08001390
1391/**
1392 * Logs boot reason and duration.
1393 *
1394 * Logged from:
1395 * system/core/bootstat/bootstat.cpp
1396 */
1397message BootSequenceReported {
1398 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1399 // Default: "<EMPTY>" if not available.
1400 optional string bootloader_reason = 1;
1401
1402 // Reason for system boot. Eg. bootloader, reboot,userrequested
1403 // Default: "<EMPTY>" if not available.
1404 optional string system_reason = 2;
1405
1406 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001407 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001408
1409 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001410 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001411
1412 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001413 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001414
1415 // Time since last boot in ms. Default: 0 if not available.
1416 optional int64 time_since_last_boot = 6;
1417}
1418
Tej Singhc477d9c2018-02-05 18:31:39 -08001419
1420/**
1421 * Logs call state and disconnect cause (if applicable).
1422 *
1423 * Logged from:
1424 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1425 */
1426message CallStateChanged {
1427 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1428 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1429 optional android.telecom.CallStateEnum call_state = 1;
1430
1431 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1432 // This value is only applicable when the call_state is DISCONNECTED, and
1433 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1434 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1435 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1436
1437 // True if the call is self-managed, which are apps that use the
1438 // telecom infrastructure to make their own calls.
1439 optional bool self_managed = 3;
1440
1441 // True if call is external. External calls are calls on connected Wear
1442 // devices but show up in Telecom so the user can pull them onto the device.
1443 optional bool external_call = 4;
1444}
1445
Tej Singh1ea42892018-01-19 09:27:00 -08001446/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001447 * Logs keyguard state. The keyguard is the lock screen.
1448 *
1449 * Logged from:
1450 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1451 */
1452message KeyguardStateChanged {
1453 enum State {
1454 UNKNOWN = 0;
1455 // The keyguard is hidden when the phone is unlocked.
1456 HIDDEN = 1;
1457 // The keyguard is shown when the phone is locked (screen turns off).
1458 SHOWN= 2;
1459 // The keyguard is occluded when something is overlaying the keyguard.
1460 // Eg. Opening the camera while on the lock screen.
1461 OCCLUDED = 3;
1462 }
1463 optional State state = 1;
1464}
1465
1466/**
1467 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1468 * prompts the user to enter a password (pattern, pin, etc).
1469 *
1470 * Logged from:
1471 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1472 */
1473
1474message KeyguardBouncerStateChanged {
1475 enum State {
1476 UNKNOWN = 0;
1477 // Bouncer is hidden, either as a result of successfully entering the
1478 // password, screen timing out, or user going back to lock screen.
1479 HIDDEN = 1;
1480 // This is when the user is being prompted to enter the password.
1481 SHOWN = 2;
1482 }
1483 optional State state = 1;
1484}
1485
1486/**
1487 * Logs the result of entering a password into the keyguard bouncer.
1488 *
1489 * Logged from:
1490 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1491 */
1492message KeyguardBouncerPasswordEntered {
1493 enum BouncerResult {
1494 UNKNOWN = 0;
1495 // The password entered was incorrect.
1496 FAILURE = 1;
1497 // The password entered was correct.
1498 SUCCESS = 2;
1499 }
1500 optional BouncerResult result = 1;
1501}
1502
Tej Singha883b372018-02-15 11:30:01 -08001503/*
1504 * Logs changes to the configuration of the device. The configuration is defined
1505 * in frameworks/base/core/java/android/content/res/Configuration.java
1506 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1507 * Please go there to interpret the possible values each field can be.
1508 *
1509 * Logged from:
1510 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1511 */
1512message ResourceConfigurationChanged {
1513 // Bit mask of color capabilities of the screen.
1514 // Contains information about the color gamut and hdr mode of the screen.
1515 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001516 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001517
1518 // The target screen density being rendered to.
1519 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001520 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001521
1522 // Current user preference for the scaling factor for fonts,
1523 // relative to the base density scaling.
1524 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001525 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001526
1527 // Flag indicating whether the hard keyboard is hidden.
1528 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001529 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001530
1531 // The type of keyboard attached to the device.
1532 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1533 optional int32 keyboard = 5;
1534
1535 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1536 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001537 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001538
1539 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1540 // 0 if undefined.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1542 optional int32 mcc = 7;
1543
1544 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1545 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1546 // MNC_ZERO symbol defined in Configuration.java.
1547 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1548 optional int32 mnc = 8;
1549
1550 // The kind of navigation available on the device.
1551 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1552 optional int32 navigation = 9;
1553
1554 // Flag indicating whether the navigation is available.
1555 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001556 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001557
1558 // Overall orientation of the screen.
1559 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1560 optional int32 orientation = 11;
1561
1562 // The current height of the available screen space, in dp units.
1563 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001564 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001565
1566 // Bit mask of overall layout of the screen.
1567 // Contains information about screen size, whether the screen is wider/taller
1568 // than normal, whether the screen layout is right-tl-left or left-to-right,
1569 // and whether the screen has a rounded shape.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // Current width of the available screen space, in dp units.
1574 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001575 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001576
1577 // The smallest screen size an application will see in normal operation.
1578 // This is the smallest value of both screenWidthDp and screenHeightDp
1579 // in portrait and landscape.
1580 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001581 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001582
1583 // The type of touch screen attached to the device.
1584 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1585 optional int32 touchscreen = 16;
1586
1587 // Bit mask of the ui mode.
1588 // Contains information about the overall ui mode of the device.
1589 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1590 // Also contains information about whether the device is in night mode.
1591 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001592 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001593}
1594
Tej Singheee317b2018-03-07 19:28:05 -08001595
1596/**
1597 * Logs changes in the connection state of the mobile radio.
1598 *
1599 * Logged from:
1600 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1601 */
1602message MobileConnectionStateChanged {
1603 // States are from the state machine DataConnection.java.
1604 enum State {
1605 UNKNOWN = 0;
1606 // The connection is inactive, or disconnected.
1607 INACTIVE = 1;
1608 // The connection is being activated, or connecting.
1609 ACTIVATING = 2;
1610 // The connection is active, or connected.
1611 ACTIVE = 3;
1612 // The connection is disconnecting.
1613 DISCONNECTING = 4;
1614 // The connection is disconnecting after creating a connection.
1615 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1616 }
1617 optional State state = 1;
1618 // For multi-sim phones, this distinguishes between the sim cards.
1619 optional int32 sim_slot_index = 2;
1620 // Used to identify the connection. Starts at 0 and increments by 1 for
1621 // every new network created. Resets whenever the device reboots.
1622 optional int32 data_connection_id = 3;
1623 // A bitmask for the capabilities of this connection.
1624 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1625 // Default value (if we have no information): 0
1626 optional int64 capabilities = 4;
1627 // If this connection has internet.
1628 // This just checks if the DEFAULT bit of capabilities is set.
1629 optional bool has_internet = 5;
1630}
1631
1632/**
1633 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1634 *
1635 * Logged from:
1636 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1637 */
1638message MobileRadioTechnologyChanged {
1639 optional android.telephony.NetworkTypeEnum state = 1;
1640 // For multi-sim phones, this distinguishes between the sim cards.
1641 optional int32 sim_slot_index = 2;
1642}
1643
Andrew Chantb56388b2018-03-22 21:07:33 -07001644/**
1645 * Logs the VID and PID of any connected USB devices.
1646 *
1647 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1648 *
1649 * Logged by Vendor.
1650 */
1651message UsbDeviceAttached {
1652 optional int32 vid = 1;
1653 optional int32 pid = 2;
1654 optional bool has_audio = 3;
1655 optional bool has_hid = 4;
1656 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001657 enum State {
1658 STATE_DISCONNECTED = 0;
1659 STATE_CONNECTED = 1;
1660 }
1661 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001662 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001663}
1664
Tej Singheee317b2018-03-07 19:28:05 -08001665
Tej Singhdd7bd352018-02-09 19:33:15 -08001666/**
Tej Singh5d991e12018-03-09 19:48:11 -08001667 * Logs when Bluetooth is enabled and disabled.
1668 *
1669 * Logged from:
1670 * services/core/java/com/android/server/BluetoothManagerService.java
1671 */
1672message BluetoothEnabledStateChanged {
1673 repeated AttributionNode attribution_node = 1;
1674 // Whether or not bluetooth is enabled on the device.
1675 enum State {
1676 UNKNOWN = 0;
1677 ENABLED = 1;
1678 DISABLED = 2;
1679 }
1680 optional State state = 2;
1681 // The reason for being enabled/disabled.
1682 // Eg. Airplane mode, crash, application request.
1683 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1684 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001685 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001686}
1687
1688/**
Jack Hed9837c82019-01-09 01:19:13 -08001689 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001690 *
1691 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001692 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1693 *
1694 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001695 */
1696message BluetoothConnectionStateChanged {
1697 // The state of the connection.
1698 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1699 optional android.bluetooth.ConnectionStateEnum state = 1;
1700 // An identifier that can be used to match connect and disconnect events.
1701 // Currently is last two bytes of a hash of a device level ID and
1702 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001703 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001704 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001705 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1706 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001707 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001708 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001709 // An identifier that can be used to match events for this device.
1710 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1711 // Salt: Randomly generated 256 bit value
1712 // Hash algorithm: HMAC-SHA256
1713 // Size: 32 byte
1714 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001715 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001716}
1717
1718/**
1719 * Logs when a Bluetooth device connects and disconnects over ACL
1720 *
1721 * Logged from:
1722 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1723 *
1724 * Next Tag: 3
1725 */
1726message BluetoothAclConnectionStateChanged {
1727 // An identifier that can be used to match events for this device.
1728 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1729 // Salt: Randomly generated 256 bit value
1730 // Hash algorithm: HMAC-SHA256
1731 // Size: 32 byte
1732 // Default: null or empty if the device identifier is not known
1733 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1734 // The state of the connection.
1735 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1736 optional android.bluetooth.ConnectionStateEnum state = 2;
1737}
1738
1739/**
1740 * Logs when a Bluetooth device connects and disconnects over SCO
1741 *
1742 * Logged from:
1743 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1744 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1745 *
1746 * Next Tag: 4
1747 */
1748message BluetoothScoConnectionStateChanged {
1749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
1755 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1756 // The state of the connection.
1757 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1758 optional android.bluetooth.ConnectionStateEnum state = 2;
1759 // Codec used for this SCO connection
1760 // Default: UNKNOWN
1761 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001762}
1763
Jack Hec27040a2019-01-09 20:54:41 -08001764/**
1765 * Logged when active device of a profile changes
1766 *
1767 * Logged from:
1768 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1769 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1771 */
1772message BluetoothActiveDeviceChanged {
1773 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1774 // From android.bluetooth.BluetoothProfile
1775 optional int32 bt_profile = 1;
1776 // An identifier that can be used to match events for this new active device.
1777 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1778 // Salt: Randomly generated 256 bit value
1779 // Hash algorithm: HMAC-SHA256
1780 // Size: 32 byte
1781 // Default: null or empty if there is no active device for this profile
1782 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1783}
1784
Jack Heab86dbd22018-12-18 15:43:27 -08001785// Logs when there is an event affecting Bluetooth device's link layer connection.
1786// - This event is triggered when there is a related HCI command or event
1787// - Users of this metrics can deduce Bluetooth device's connection state from these events
1788// - HCI commands are logged before the command is sent, after receiving command status, and after
1789// receiving command complete
1790// - HCI events are logged when they arrive
1791//
1792// Low level log from system/bt
1793//
1794// Bluetooth classic commands:
1795// - CMD_CREATE_CONNECTION
1796// - CMD_DISCONNECT
1797// - CMD_CREATE_CONNECTION_CANCEL
1798// - CMD_ACCEPT_CONNECTION_REQUEST
1799// - CMD_REJECT_CONNECTION_REQUEST
1800// - CMD_SETUP_ESCO_CONNECTION
1801// - CMD_ACCEPT_ESCO_CONNECTION
1802// - CMD_REJECT_ESCO_CONNECTION
1803// - CMD_ENH_SETUP_ESCO_CONNECTION
1804// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1805//
1806// Bluetooth low energy commands:
1807// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1808// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1809// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1810// - CMD_BLE_CLEAR_WHITE_LIST
1811// - CMD_BLE_ADD_WHITE_LIST
1812// - CMD_BLE_REMOVE_WHITE_LIST
1813//
1814// Bluetooth classic events:
1815// - EVT_CONNECTION_COMP
1816// - EVT_CONNECTION_REQUEST
1817// - EVT_DISCONNECTION_COMP
1818// - EVT_ESCO_CONNECTION_COMP
1819// - EVT_ESCO_CONNECTION_CHANGED
1820//
1821// Bluetooth low energy meta events:
1822// - BLE_EVT_CONN_COMPLETE_EVT
1823// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1824//
1825// Next tag: 10
1826message BluetoothLinkLayerConnectionEvent {
1827 // An identifier that can be used to match events for this device.
1828 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1829 // Salt: Randomly generated 256 bit value
1830 // Hash algorithm: HMAC-SHA256
1831 // Size: 32 byte
1832 // Default: null or empty if the device identifier is not known
1833 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1834 // Connection handle of this connection if available
1835 // Range: 0x0000 - 0x0EFF (12 bits)
1836 // Default: 0xFFFF if the handle is unknown
1837 optional int32 connection_handle = 2;
1838 // Direction of the link
1839 // Default: DIRECTION_UNKNOWN
1840 optional android.bluetooth.DirectionEnum direction = 3;
1841 // Type of this link
1842 // Default: LINK_TYPE_UNKNOWN
1843 optional android.bluetooth.LinkTypeEnum type = 4;
1844
1845 // Reason metadata for this link layer connection event, rules for interpretation:
1846 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1847 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1848 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1849 // set and valid, ignore hci_ble_event
1850
1851 // HCI command associated with this event
1852 // Default: CMD_UNKNOWN
1853 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1854 // HCI event associated with this event
1855 // Default: EVT_UNKNOWN
1856 optional android.bluetooth.hci.EventEnum hci_event = 6;
1857 // HCI BLE meta event associated with this event
1858 // Default: BLE_EVT_UNKNOWN
1859 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1860 // HCI command status code if this is triggerred by hci_cmd
1861 // Default: STATUS_UNKNOWN
1862 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1863 // HCI reason code associated with this event
1864 // Default: STATUS_UNKNOWN
1865 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1866}
1867
Howard Roe103fe22019-01-17 16:52:16 -08001868/**
1869 * Logs when a module is rolled back by Watchdog.
1870 *
1871 * Logged from: Rollback Manager
1872 */
1873message WatchdogRollbackOccurred {
1874 enum RollbackType {
1875 UNKNOWN = 0;
1876 ROLLBACK_INITIATE = 1;
1877 ROLLBACK_SUCCESS = 2;
1878 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001879 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001880 }
1881 optional RollbackType rollback_type = 1;
1882
1883 optional string package_name = 2;
1884
1885 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001886
1887 enum RollbackReasonType {
1888 REASON_UNKNOWN = 0;
1889 REASON_NATIVE_CRASH = 1;
1890 REASON_EXPLICIT_HEALTH_CHECK = 2;
1891 REASON_APP_CRASH = 3;
1892 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001893 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001894 }
1895 optional RollbackReasonType rollback_reason = 4;
1896
1897 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1898 // is initiated. Empty if the package is unknown.
1899 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001900
1901 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001902}
1903
Jack Hec27040a2019-01-09 20:54:41 -08001904/**
1905 * Logs when there is a change in Bluetooth A2DP playback state
1906 *
1907 * Logged from:
1908 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1909 */
1910message BluetoothA2dpPlaybackStateChanged {
1911 // An identifier that can be used to match events for this device.
1912 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1913 // Salt: Randomly generated 256 bit value
1914 // Hash algorithm: HMAC-SHA256
1915 // Size: 32 byte
1916 // Default: null or empty if the device identifier is not known
1917 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1918 // Current playback state
1919 // Default: PLAYBACK_STATE_UNKNOWN
1920 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1921 // Current audio coding mode
1922 // Default: AUDIO_CODING_MODE_UNKNOWN
1923 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1924}
1925
1926/**
1927 * Logs when there is a change in A2DP codec config for a particular remote device
1928 *
1929 * Logged from:
1930 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1931 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1932 */
1933message BluetoothA2dpCodecConfigChanged {
1934 // An identifier that can be used to match events for this device.
1935 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1936 // Salt: Randomly generated 256 bit value
1937 // Hash algorithm: HMAC-SHA256
1938 // Size: 32 byte
1939 // Default: null or empty if the device identifier is not known
1940 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1941 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1942 // Default SOURCE_CODEC_TYPE_INVALID
1943 optional int32 codec_type = 2;
1944 // Codec priroity, the higher the more preferred, -1 for disabled
1945 // Default: CODEC_PRIORITY_DEFAULT
1946 optional int32 codec_priority = 3;
1947 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1948 // Default: SAMPLE_RATE_NONE
1949 optional int32 sample_rate = 4;
1950 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1951 // Default: BITS_PER_SAMPLE_NONE
1952 optional int32 bits_per_sample = 5;
1953 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1954 // Default: CHANNEL_MODE_NONE
1955 optional int32 channel_mode = 6;
1956 // Codec specific values
1957 // Default 0
1958 optional int64 codec_specific_1 = 7;
1959 optional int64 codec_specific_2 = 8;
1960 optional int64 codec_specific_3 = 9;
1961 optional int64 codec_specific_4 = 10;
1962}
1963
1964/**
1965 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1966 * Each codec's capability is logged separately due to statsd restriction
1967 *
1968 * Logged from:
1969 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1970 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1971 */
1972message BluetoothA2dpCodecCapabilityChanged {
1973 // An identifier that can be used to match events for this device.
1974 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1975 // Salt: Randomly generated 256 bit value
1976 // Hash algorithm: HMAC-SHA256
1977 // Size: 32 byte
1978 // Default: null or empty if the device identifier is not known
1979 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1980 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1981 // Default SOURCE_CODEC_TYPE_INVALID
1982 optional int32 codec_type = 2;
1983 // Codec priroity, the higher the more preferred, -1 for disabled
1984 // Default: CODEC_PRIORITY_DEFAULT
1985 optional int32 codec_priority = 3;
1986 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1987 // in BluetoothCodecConfig
1988 // Default: empty and SAMPLE_RATE_NONE for individual item
1989 optional int32 sample_rate = 4;
1990 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1991 // in BluetoothCodecConfig
1992 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1993 optional int32 bits_per_sample = 5;
1994 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1995 // BluetoothCodecConfig
1996 // Default: empty and CHANNEL_MODE_NONE for individual item
1997 optional int32 channel_mode = 6;
1998 // Codec specific values
1999 // Default 0
2000 optional int64 codec_specific_1 = 7;
2001 optional int64 codec_specific_2 = 8;
2002 optional int64 codec_specific_3 = 9;
2003 optional int64 codec_specific_4 = 10;
2004}
2005
2006/**
2007 * Logs when A2DP failed to read from PCM source.
2008 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2009 *
2010 * Logged from:
2011 * system/bt
2012 */
2013message BluetoothA2dpAudioUnderrunReported {
2014 // An identifier that can be used to match events for this device.
2015 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2016 // Salt: Randomly generated 256 bit value
2017 // Hash algorithm: HMAC-SHA256
2018 // Size: 32 byte
2019 // Default: null or empty if the device identifier is not known
2020 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2021 // Encoding interval in nanoseconds
2022 // Default: 0
2023 optional int64 encoding_interval_nanos = 2;
2024 // Number of bytes of PCM data that could not be read from the source
2025 // Default: 0
2026 optional int32 num_missing_pcm_bytes = 3;
2027}
2028
2029/**
2030 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2031 * buffer queue is full and we have to drop data
2032 *
2033 * Logged from:
2034 * system/bt
2035 */
2036message BluetoothA2dpAudioOverrunReported {
2037 // An identifier that can be used to match events for this device.
2038 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2039 // Salt: Randomly generated 256 bit value
2040 // Hash algorithm: HMAC-SHA256
2041 // Size: 32 byte
2042 // Default: null or empty if the device identifier is not known
2043 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2044 // Encoding interval in nanoseconds
2045 // Default: 0
2046 optional int64 encoding_interval_nanos = 2;
2047 // Number of buffers dropped in this event
2048 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2049 // Default: 0
2050 optional int32 num_dropped_buffers = 3;
2051 // Number of encoded buffers dropped in this event
2052 // Default 0
2053 optional int32 num_dropped_encoded_frames = 4;
2054 // Number of encoded bytes dropped in this event
2055 // Default: 0
2056 optional int32 num_dropped_encoded_bytes = 5;
2057}
2058
2059/**
2060 * Logs when we receive reports regarding a device's RSSI value
2061 *
2062 * Logged from:
2063 * system/bt
2064 */
2065message BluetoothDeviceRssiReported {
2066 // An identifier that can be used to match events for this device.
2067 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2068 // Salt: Randomly generated 256 bit value
2069 // Hash algorithm: HMAC-SHA256
2070 // Size: 32 byte
2071 // Default: null or empty if the device identifier is not known
2072 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2073 // Connection handle of this connection if available
2074 // Range: 0x0000 - 0x0EFF (12 bits)
2075 // Default: 0xFFFF if the handle is unknown
2076 optional int32 connection_handle = 2;
2077 // HCI command status code if this is triggerred by hci_cmd
2078 // Default: STATUS_UNKNOWN
2079 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2080 // BR/EDR
2081 // Range: -128 ≤ N ≤ 127 (signed integer)
2082 // Units: dB
2083 // LE:
2084 // Range: -127 to 20, 127 (signed integer)
2085 // Units: dBm
2086 // Invalid when an out of range value is reported
2087 optional int32 rssi = 4;
2088}
2089
2090/**
2091 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2092 *
2093 * Logged from:
2094 * system/bt
2095 */
2096message BluetoothDeviceFailedContactCounterReported {
2097 // An identifier that can be used to match events for this device.
2098 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2099 // Salt: Randomly generated 256 bit value
2100 // Hash algorithm: HMAC-SHA256
2101 // Size: 32 byte
2102 // Default: null or empty if the device identifier is not known
2103 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2104 // Connection handle of this connection if available
2105 // Range: 0x0000 - 0x0EFF (12 bits)
2106 // Default: 0xFFFF if the handle is unknown
2107 optional int32 connection_handle = 2;
2108 // HCI command status code if this is triggerred by hci_cmd
2109 // Default: STATUS_UNKNOWN
2110 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2111 // Number of consecutive failed contacts for a connection corresponding to the Handle
2112 // Range: uint16_t, 0-0xFFFF
2113 // Default: 0xFFFFF
2114 optional int32 failed_contact_counter = 4;
2115}
2116
2117/**
2118 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2119 *
2120 * Logged from:
2121 * system/bt
2122 */
2123message BluetoothDeviceTxPowerLevelReported {
2124 // An identifier that can be used to match events for this device.
2125 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2126 // Salt: Randomly generated 256 bit value
2127 // Hash algorithm: HMAC-SHA256
2128 // Size: 32 byte
2129 // Default: null or empty if the device identifier is not known
2130 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2131 // Connection handle of this connection if available
2132 // Range: 0x0000 - 0x0EFF (12 bits)
2133 // Default: 0xFFFF if the handle is unknown
2134 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002135 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002136 // Default: STATUS_UNKNOWN
2137 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2138 // Range: -30 ≤ N ≤ 20
2139 // Units: dBm
2140 // Invalid when an out of range value is reported
2141 optional int32 transmit_power_level = 4;
2142}
Jack Heab86dbd22018-12-18 15:43:27 -08002143
Tej Singh5d991e12018-03-09 19:48:11 -08002144/**
Jack He1021a612019-01-20 21:22:46 -08002145 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2146 * receiving an HCI command from the host
2147 *
2148 * Logged from: system/bt
2149 */
2150message BluetoothHciTimeoutReported {
2151 // HCI command associated with this event
2152 // Default: CMD_UNKNOWN
2153 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2154}
2155
2156/**
2157 * Logs when we receive Bluetooth Link Quality Report event from the controller
2158 * See Android Bluetooth HCI specification for more details
2159 *
2160 * Note: all count and bytes field are counted since last event
2161 *
2162 * Logged from: system/bt
2163 */
2164message BluetoothQualityReportReported {
2165 // Quality report ID
2166 // Original type: uint8_t
2167 // Default: BQR_ID_UNKNOWN
2168 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2169 // Packet type of the connection
2170 // Original type: uint8_t
2171 // Default: BQR_PACKET_TYPE_UNKNOWN
2172 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2173 // Connection handle of the connection
2174 // Original type: uint16_t
2175 optional int32 connection_handle = 3;
2176 // Performing Role for the connection
2177 // Original type: uint8_t
2178 optional int32 connection_role = 4;
2179 // Current Transmit Power Level for the connection. This value is the same as the controller's
2180 // response to the HCI_Read_Transmit_Power_Level HCI command
2181 // Original type: uint8_t
2182 optional int32 tx_power_level = 5;
2183 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2184 // absolute receiver signal strength value
2185 // Original type: int8_t
2186 optional int32 rssi = 6;
2187 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2188 // channels used by the link currently
2189 // Original type: uint8_t
2190 optional int32 snr = 7;
2191 // Indicates the number of unused channels in AFH_channel_map
2192 // Original type: uint8_t
2193 optional int32 unused_afh_channel_count = 8;
2194 // Indicates the number of the channels which are interfered and quality is bad but are still
2195 // selected for AFH
2196 // Original type: uint8_t
2197 optional int32 afh_select_unideal_channel_count = 9;
2198 // Current Link Supervision Timeout Setting
2199 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2200 // Original type: uint16_t
2201 optional int32 lsto = 10;
2202 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2203 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2204 // 0x01 (Piconet Clock)
2205 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2206 // Original type: uint32_t
2207 optional int64 connection_piconet_clock = 11;
2208 // The count of retransmission
2209 // Original type: uint32_t
2210 optional int64 retransmission_count = 12;
2211 // The count of no RX
2212 // Original type: uint32_t
2213 optional int64 no_rx_count = 13;
2214 // The count of NAK (Negative Acknowledge)
2215 // Original type: uint32_t
2216 optional int64 nak_count = 14;
2217 // Controller timestamp of last TX ACK
2218 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2219 // Original type: uint32_t
2220 optional int64 last_tx_ack_timestamp = 15;
2221 // The count of Flow-off (STOP)
2222 // Original type: uint32_t
2223 optional int64 flow_off_count = 16;
2224 // Controller timestamp of last Flow-on (GO)
2225 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2226 // Original type: uint32_t
2227 optional int64 last_flow_on_timestamp = 17;
2228 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2229 // Original type: uint32_t
2230 optional int64 buffer_overflow_bytes = 18;
2231 // Buffer underflow count (in byte) since last event
2232 // Original type: uint32_t
2233 optional int64 buffer_underflow_bytes = 19;
2234}
2235
2236/**
2237 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2238 *
2239 * Notes:
2240 * - Each event can be partially filled as we might learn different pieces of device
2241 * information at different time
2242 * - Multiple device info events can be combined to give more complete picture
2243 * - When multiple device info events tries to describe the same information, the
2244 * later one wins
2245 *
2246 * Logged from:
2247 * packages/apps/Bluetooth
2248 */
Jack Heaea26982019-04-04 11:19:48 -07002249message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002250 // An identifier that can be used to match events for this device.
2251 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2252 // Salt: Randomly generated 256 bit value
2253 // Hash algorithm: HMAC-SHA256
2254 // Size: 32 byte
2255 // Default: null or empty if the device identifier is not known
2256 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2257 // Where is this device info obtained from
2258 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2259 // Name of the data source
2260 // For EXTERNAL: package name of the data source
2261 // For INTERNAL: null for general case, component name otherwise
2262 optional string source_name = 3;
2263 // Name of the manufacturer of this device
2264 optional string manufacturer = 4;
2265 // Model of this device
2266 optional string model = 5;
2267 // Hardware version of this device
2268 optional string hardware_version = 6;
2269 // Software version of this device
2270 optional string software_version = 7;
2271}
2272
2273/**
2274 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2275 * device, as documented by the Bluetooth Core HCI specification
2276 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2277 * Vol 2, Part E, Page 1118
2278 *
2279 * Logged from:
2280 * system/bt
2281 */
2282message BluetoothRemoteVersionInfoReported {
2283 // Connection handle of the connection
2284 // Original type: uint16_t
2285 optional int32 connection_handle = 1;
2286 // HCI command status code
2287 // Default: STATUS_UNKNOWN
2288 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2289 // 1 byte Version of current LMP in the remote controller
2290 optional int32 lmp_version = 3;
2291 // 2 bytes LMP manufacturer code of the remote controller
2292 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2293 optional int32 lmp_manufacturer_code = 4;
2294 // 4 bytes subversion of the LMP in the remote controller
2295 optional int32 lmp_subversion = 5;
2296}
2297
2298/**
2299 * Logs when certain Bluetooth SDP attributes are discovered
2300 * Constant definitions are from:
2301 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2302 *
2303 * Current logged attributes:
2304 * - BluetoothProfileDescriptorList
2305 * - Supported Features Bitmask
2306 *
2307 * Logged from:
2308 * system/bt
2309 */
2310message BluetoothSdpAttributeReported {
2311 // An identifier that can be used to match events for this device.
2312 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2313 // Salt: Randomly generated 256 bit value
2314 // Hash algorithm: HMAC-SHA256
2315 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2316 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2317 // Original type: uint16_t
2318 optional int32 protocol_uuid = 2;
2319 // Short form UUIDs used to identify Bluetooth SDP attribute types
2320 // Original type: uint16_t
2321 optional int32 attribute_id = 3;
2322 // Attribute value for the particular attribute
2323 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2324}
2325
2326/**
2327 * Logs when bond state of a Bluetooth device changes
2328 *
2329 * Logged from:
2330 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2331 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2332 */
2333message BluetoothBondStateChanged {
2334 // An identifier that can be used to match events for this device.
2335 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2336 // Salt: Randomly generated 256 bit value
2337 // Hash algorithm: HMAC-SHA256
2338 // Size: 32 byte
2339 // Default: null or empty if the device identifier is not known
2340 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2341 // Preferred transport type to remote dual mode device
2342 // Default: TRANSPORT_AUTO means no preference
2343 optional android.bluetooth.TransportTypeEnum transport = 2;
2344 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2345 // Default: UNKNOWN
2346 optional android.bluetooth.DeviceTypeEnum type = 3;
2347 // Current bond state (NONE, BONDING, BONDED)
2348 // Default: BOND_STATE_UNKNOWN
2349 optional android.bluetooth.BondStateEnum bond_state = 4;
2350 // Bonding sub state
2351 // Default: BOND_SUB_STATE_UNKNOWN
2352 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2353 // Unbond Reason
2354 // Default: UNBOND_REASON_UNKNOWN
2355 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2356}
2357
2358/**
2359 * Logs there is an event related Bluetooth classic pairing
2360 *
2361 * Logged from:
2362 * system/bt
2363 */
2364message BluetoothClassicPairingEventReported {
2365 // An identifier that can be used to match events for this device.
2366 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2367 // Salt: Randomly generated 256 bit value
2368 // Hash algorithm: HMAC-SHA256
2369 // Size: 32 byte
2370 // Default: null or empty if the device identifier is not known
2371 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2372 // Connection handle of this connection if available
2373 // Range: 0x0000 - 0x0EFF (12 bits)
2374 // Default: 0xFFFF if the handle is unknown
2375 optional int32 connection_handle = 2;
2376 // HCI command associated with this event
2377 // Default: CMD_UNKNOWN
2378 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2379 // HCI event associated with this event
2380 // Default: EVT_UNKNOWN
2381 optional android.bluetooth.hci.EventEnum hci_event = 4;
2382 // HCI command status code if this is triggerred by hci_cmd
2383 // Default: STATUS_UNKNOWN
2384 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2385 // HCI reason code associated with this event
2386 // Default: STATUS_UNKNOWN
2387 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002388 // A status value related to this specific event
2389 // Default: 0
2390 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002391}
2392
2393/**
2394 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2395 *
2396 * Logged from:
2397 * system/bt
2398 */
2399message BluetoothSmpPairingEventReported {
2400 // An identifier that can be used to match events for this device.
2401 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2402 // Salt: Randomly generated 256 bit value
2403 // Hash algorithm: HMAC-SHA256
2404 // Size: 32 byte
2405 // Default: null or empty if the device identifier is not known
2406 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2407 // SMP command sent or received over L2CAP
2408 // Default: CMD_UNKNOWN
2409 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2410 // Whether this command is sent or received
2411 // Default: DIRECTION_UNKNOWN
2412 optional android.bluetooth.DirectionEnum direction = 3;
2413 // SMP failure reason code
2414 // Default: PAIRING_FAIL_REASON_DEFAULT
2415 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2416}
2417
2418/**
Jack He815cdba2019-01-30 17:24:55 -08002419 * Logs when a Bluetooth socket’s connection state changed
2420 *
2421 * Logged from:
2422 * system/bt
2423 */
2424message BluetoothSocketConnectionStateChanged {
2425 // An identifier that can be used to match events for this device.
2426 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2427 // Salt: Randomly generated 256 bit value
2428 // Hash algorithm: HMAC-SHA256
2429 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002430 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002431 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002432 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002433 // Default 0 when unknown or don't care
2434 optional int32 port = 2;
2435 // Socket type as mentioned in
2436 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2437 // Default: SOCKET_TYPE_UNKNOWN
2438 optional android.bluetooth.SocketTypeEnum type = 3;
2439 // Socket connection state
2440 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2441 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2442 // Number of bytes sent to remote device during this connection
2443 optional int64 tx_bytes = 5;
2444 // Number of bytes received from remote device during this connection
2445 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002446 // Socket owner's UID
2447 optional int32 uid = 7 [(is_uid) = true];
2448 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2449 // |port| must be spawned by |server_port|
2450 // Default 0 when unknown or don't care
2451 optional int32 server_port = 8;
2452 // Whether this is a server listener socket
2453 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002454}
2455
2456/**
Jack He71426802019-04-02 13:32:52 -07002457 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2458 *
2459 * Logged from:
2460 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2461 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2462 *
2463 */
2464message BluetoothClassOfDeviceReported {
2465 // An identifier that can be used to match events for this device.
2466 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2467 // Salt: Randomly generated 256 bit value
2468 // Hash algorithm: HMAC-SHA256
2469 // Size: 32 byte
2470 // Default: null or empty if this is a server listener socket
2471 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2472 // Class of Device (CoD) value including both Major, Minor device class and service class
2473 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2474 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2475 // Default: 0
2476 optional int32 class_of_device = 2;
2477}
2478
2479/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002480 * Logs when something is plugged into or removed from the USB-C connector.
2481 *
2482 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002483 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002484 */
2485message UsbConnectorStateChanged {
2486 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002487 STATE_DISCONNECTED = 0;
2488 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002489 }
2490 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002491 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002492 // Last active session in ms.
2493 // 0 when the port is in connected state.
2494 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002495}
2496
2497/**
2498 * Logs the reported speaker impedance.
2499 *
2500 * Logged from:
2501 * Vendor audio implementation.
2502 */
2503message SpeakerImpedanceReported {
2504 optional int32 speaker_location = 1;
2505 optional int32 impedance = 2;
2506}
2507
2508/**
2509 * Logs the report of a failed hardware.
2510 *
2511 * Logged from:
2512 * Vendor HALs.
2513 *
2514 */
2515message HardwareFailed {
2516 enum HardwareType {
2517 HARDWARE_FAILED_UNKNOWN = 0;
2518 HARDWARE_FAILED_MICROPHONE = 1;
2519 HARDWARE_FAILED_CODEC = 2;
2520 HARDWARE_FAILED_SPEAKER = 3;
2521 HARDWARE_FAILED_FINGERPRINT = 4;
2522 }
2523 optional HardwareType hardware_type = 1;
2524
Maggie White6dcd8572019-01-31 14:11:50 -08002525 /**
2526 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002527 * the same hardware_type. The specific locations are vendor defined integers,
2528 * referring to board-specific numbering schemes.
2529 */
2530 optional int32 hardware_location = 2;
2531
Maggie White6dcd8572019-01-31 14:11:50 -08002532 /**
2533 * failure_code is specific to the HardwareType of the failed hardware.
2534 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002535 */
Maggie White6dcd8572019-01-31 14:11:50 -08002536 enum HardwareErrorCode {
2537 UNKNOWN = 0;
2538 COMPLETE = 1;
2539 SPEAKER_HIGH_Z = 2;
2540 SPEAKER_SHORT = 3;
2541 FINGERPRINT_SENSOR_BROKEN = 4;
2542 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002543 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002544 }
2545 optional int32 failure_code = 3;
2546}
2547
2548/**
2549 * Log an event when the device has been physically dropped.
2550 * Reported from the /vendor partition.
2551 */
2552message PhysicalDropDetected {
2553 // Confidence that the event was actually a drop, 0 -> 100
2554 optional int32 confidence_pctg = 1;
2555 // Peak acceleration of the drop, in 1/1000s of a g.
2556 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002557 // Duration of freefall in ms
2558 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002559}
2560
2561/**
2562 * Log bucketed battery charge cycles.
2563 *
2564 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002565 * a given charge point. For example, if 10 cycle buckets are
2566 * initialized, bucket 1 is the lowest 1/10th of the battery,
2567 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002568 *
2569 * Logged from:
2570 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2571 */
2572message ChargeCyclesReported {
2573 optional int32 cycle_bucket_1 = 1;
2574 optional int32 cycle_bucket_2 = 2;
2575 optional int32 cycle_bucket_3 = 3;
2576 optional int32 cycle_bucket_4 = 4;
2577 optional int32 cycle_bucket_5 = 5;
2578 optional int32 cycle_bucket_6 = 6;
2579 optional int32 cycle_bucket_7 = 7;
2580 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002581 optional int32 cycle_bucket_9 = 9;
2582 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002583}
2584
2585/**
Howard Roa46b6582018-09-18 16:45:02 -07002586 * Log battery health snapshot.
2587 *
2588 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2589 * are snapshotted periodically over 24hrs.
2590 */
2591message BatteryHealthSnapshot {
2592 enum BatterySnapshotType {
2593 UNKNOWN = 0;
2594 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2595 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2596 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2597 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2598 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2599 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2600 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2601 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2602 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2603 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2604 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2605 }
2606 optional BatterySnapshotType type = 1;
2607 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002608 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002609 // Voltage Battery Voltage, in microVolts.
2610 optional int32 voltage_micro_volt = 3;
2611 // Current Battery current, in microAmps.
2612 optional int32 current_micro_amps = 4;
2613 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2614 optional int32 open_circuit_micro_volt = 5;
2615 // Resistance Battery Resistance, in microOhms.
2616 optional int32 resistance_micro_ohm = 6;
2617 // Level Battery Level, as % of full.
2618 optional int32 level_percent = 7;
2619}
2620
2621/**
2622 * Log slow I/O operations on the primary storage.
2623 */
2624message SlowIo {
2625 // Classifications of IO Operations.
2626 enum IoOperation {
2627 UNKNOWN = 0;
2628 READ = 1;
2629 WRITE = 2;
2630 UNMAP = 3;
2631 SYNC = 4;
2632 }
2633 optional IoOperation operation = 1;
2634
2635 // The number of slow IO operations of this type over 24 hours.
2636 optional int32 count = 2;
2637}
2638
2639/**
2640 * Log battery caused shutdown with the last recorded voltage.
2641 */
2642message BatteryCausedShutdown {
2643 // The last recorded battery voltage prior to shutdown.
2644 optional int32 last_recorded_micro_volt = 1;
2645}
2646
2647/**
Tej Singha72344992019-04-17 18:55:08 -07002648 * Logs when ThermalService receives throttling events.
2649 *
2650 * Logged from:
2651 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2652 */
2653message ThermalThrottlingSeverityStateChanged {
2654 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2655 optional android.os.TemperatureTypeEnum sensor_type = 1;
2656
2657 // The name of the temperature source. Eg. CPU0
2658 optional string sensor_name = 2;
2659
2660 // Temperature in tenths of a degree C.
2661 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2662 optional int32 temperature_deci_celsius = 3;
2663
2664 // Relative severity of the throttling, see enum definition.
2665 optional android.os.ThrottlingSeverityEnum severity = 4;
2666}
2667
2668/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002669 * Logs the duration of a davey (jank of >=700ms) when it occurs
2670 *
2671 * Logged from:
2672 * frameworks/base/libs/hwui/JankTracker.cpp
2673 */
2674message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002675 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002676 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002677
Tej Singhbb8554a2018-01-26 11:59:14 -08002678 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002679 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002680}
2681
2682/**
Bookatze5885242017-10-24 20:10:31 -07002683 * Logs phone signal strength changes.
2684 *
2685 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002686 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002687 */
2688message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002689 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2690 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002691}
2692
Yangster4ccebea2018-10-09 17:09:02 -07002693
2694/**
2695 * Logs when the phone state, sim state or signal strength changes
2696 *
2697 * Logged from:
2698 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2699 */
2700message PhoneServiceStateChanged {
2701 optional android.telephony.ServiceStateEnum state = 1;
2702 optional android.telephony.SimStateEnum sim_state = 2;
2703 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2704}
2705
2706/**
2707 * Logs when the phone becomes on or off.
2708 *
2709 * Logged from:
2710 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2711 */
2712message PhoneStateChanged {
2713 enum State {
2714 OFF = 0;
2715 ON = 1;
2716 }
2717 optional State state = 1;
2718}
2719
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002720message BackGesture {
2721 enum BackType {
2722 DEFAULT_BACK_TYPE = 0;
2723 COMPLETED = 1;
2724 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2725 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2726 INCOMPLETE = 4;
2727 }
2728 optional BackType type = 1;
2729
2730 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2731 enum WindowHorizontalLocation {
2732 DEFAULT_LOCATION = 0;
2733 LEFT = 1;
2734 RIGHT = 2;
2735 }
2736 optional WindowHorizontalLocation x_location = 3;
2737}
2738
2739message ExclusionRectStateChanged {
2740 optional string component_name = 1; // if not available, simply packageName
2741 optional int32 requested_height = 2; // px
2742 optional int32 rejected_height = 3; // px
2743
2744 enum WindowHorizontalLocation {
2745 DEFAULT_LOCATION = 0;
2746 LEFT = 1;
2747 RIGHT = 2;
2748 }
2749 optional WindowHorizontalLocation x_location = 4;
2750 optional bool landscape = 5;
2751 optional bool splitscreen = 6;
2752 optional int32 duration_millis = 7;
2753}
2754
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002755message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002756 optional android.stats.launcher.LauncherAction action = 1;
2757 optional android.stats.launcher.LauncherState src_state = 2;
2758 optional android.stats.launcher.LauncherState dst_state = 3;
2759 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002760 optional bool is_swipe_up_enabled = 5;
2761}
2762
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002763message StyleUIChanged {
2764 optional android.stats.style.Action action = 1;
2765 optional int32 color_package_hash = 2;
2766 optional int32 font_package_hash = 3;
2767 optional int32 shape_package_hash = 4;
2768 optional int32 clock_package_hash = 5;
2769 optional int32 launcher_grid = 6;
2770 optional int32 wallpaper_category_hash = 7;
2771 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002772 optional int32 color_preference = 9;
2773 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002774}
2775
David Chenc28b2bb2017-10-24 12:52:52 -07002776/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002777 * Logs when Settings UI has changed.
2778 *
2779 * Logged from:
2780 * packages/apps/Settings
2781 */
2782message SettingsUIChanged {
2783 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002784 * Where this SettingsUIChange event comes from. For example, if
2785 * it's a PAGE_VISIBLE event, where the page is opened from.
2786 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002787 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002788
2789 /**
2790 * What the UI action is.
2791 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002792 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002793
2794 /**
2795 * Where the action is happening
2796 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002797 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002798
2799 /**
2800 * What preference changed in this event.
2801 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002802 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002803
2804 /**
2805 * The new value of the changed preference.
2806 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002807 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002808}
2809
2810/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002811 * Logs basic timing information about touch events.
2812 * Reported at most every 5 minutes while device is being interacted with.
2813 *
2814 * Logged from:
2815 * frameworks/native/services/inputflinger
2816 */
2817message TouchEventReported {
2818 /**
2819 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002820 * and the standard deviation of the time spent processing touchscreen events
2821 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002822 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002823 * On supported devices, the starting point is taken during the hard interrupt inside the
2824 * kernel touch driver. On all other devices, the starting point is taken inside
2825 * the kernel's input event subsystem upon receipt of the input event.
2826 * The ending point is taken inside InputDispatcher, just after the input event
2827 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002828 */
2829 // Minimum value
2830 optional float latency_min_micros = 1;
2831 // Maximum value
2832 optional float latency_max_micros = 2;
2833 // Average value
2834 optional float latency_mean_micros = 3;
2835 // Standard deviation
2836 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002837 // Number of touch events (input_event) in this report
2838 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002839}
2840
2841/**
Philip Quinn0eded622019-01-29 12:46:28 -08002842 * Logs gesture classification and timing information for touch events.
2843 *
2844 * Logged from:
2845 * frameworks/base/core/java/android/view/GestureDetector.java
2846 * frameworks/base/core/java/android/view/View.java
2847 */
2848message TouchGestureClassified {
2849 // The source of the classification (e.g. Java class name).
2850 optional string source = 1;
2851
2852 enum Classification {
2853 UNKNOWN_CLASSIFICATION = 0;
2854 SINGLE_TAP = 1;
2855 DOUBLE_TAP = 2;
2856 LONG_PRESS = 3;
2857 DEEP_PRESS = 4;
2858 SCROLL = 5;
2859 }
2860 // The classification of the gesture.
2861 optional Classification classification = 2;
2862
2863 // The interval from the start of a touch event stream until the
2864 // classification was made.
2865 optional int32 latency_millis = 3;
2866
2867 // The distance from the location of the first touch event to the
2868 // location of the touch event when the classification was made.
2869 optional float displacement_px = 4;
2870}
2871
2872/**
David Chenc28b2bb2017-10-24 12:52:52 -07002873 * Logs that a setting was updated.
2874 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002875 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002876 * The tag and is_default allow resetting of settings to default values based on the specified
2877 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2878 */
2879message SettingChanged {
2880 // The name of the setting.
2881 optional string setting = 1;
2882
2883 // The change being imposed on this setting. May represent a number, eg "3".
2884 optional string value = 2;
2885
2886 // The new value of this setting. For most settings, this is same as value. For some settings,
2887 // value is +X or -X where X represents an element in a set. For example, if the previous value
2888 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2889 // The +/- feature is currently only used for location_providers_allowed.
2890 optional string new_value = 3;
2891
2892 // The previous value of this setting.
2893 optional string prev_value = 4;
2894
2895 // The tag used with the is_default for resetting sets of settings. This is generally null.
2896 optional string tag = 5;
2897
Bookatz90867622018-01-31 15:05:57 -08002898 // True if this setting with tag should be resettable.
2899 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002900
David Chenbd789912018-03-16 17:19:55 -07002901 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002902 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002903
2904 enum ChangeReason {
2905 UPDATED = 1; // Updated can be an insertion or an update.
2906 DELETED = 2;
2907 }
2908 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002909}
Chenjie Yub3dda412017-10-24 13:41:59 -07002910
Chenjie Yu05013b32017-11-21 10:21:41 -08002911/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002912 * Logs activity going to foreground or background
2913 *
2914 * Logged from:
2915 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2916 */
2917message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002918 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002919 optional string pkg_name = 2;
2920 optional string class_name = 3;
2921
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002922 enum State {
2923 BACKGROUND = 0;
2924 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002925 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002926 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002927}
David Chenc8a43242017-10-17 16:23:28 -07002928
2929/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002930 * Logs when a volume entered low Storage state.
2931 * Logged from:
2932 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2933 */
2934message LowStorageStateChanged {
2935 // Volume that ran out of storage.
2936 optional string volume_description = 1;
2937
2938 enum State {
2939 UNKNOWN = 0;
2940 OFF = 1;
2941 ON = 2;
2942 }
2943 optional State state = 2;
2944}
2945
2946/**
2947 * Logs when an app is downgraded.
2948 * Logged from:
2949 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2950 */
2951message AppDowngraded {
2952 optional string package_name = 1;
2953 // Size of the package (all data) before being downgraded.
2954 optional int64 size_in_bytes_before = 2;
2955 // Size of the package (all data) after being downgraded.
2956 optional int64 size_in_bytes_after = 3;
2957
2958 optional bool aggressive = 4;
2959}
2960
2961/**
2962 * Logs when an app is optimized after being downgraded.
2963 * Logged from:
2964 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2965 */
2966message AppOptimizedAfterDowngraded {
2967 optional string package_name = 1;
2968}
2969
2970/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002971 * Logs whenever an app is installed on external storage.
2972 * Logged from:
2973 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2974 */
2975message AppInstallOnExternalStorageReported {
2976 // The type of external storage.
2977 optional android.stats.storage.ExternalStorageType storage_type = 1;
2978 // The name of the package that is installed on the sd card.
2979 optional string package_name = 2;
2980}
2981
2982/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002983 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002984 * Logged from:
2985 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2986 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002987message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002988 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002989
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002990 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002991
2992 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002993 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002994 optional string process_name = 3;
2995
2996 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002997 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002998
2999 optional string package_name = 5;
3000
3001 enum InstantApp {
3002 UNAVAILABLE = 0;
3003 FALSE = 1;
3004 TRUE = 2;
3005 }
3006 optional InstantApp is_instant_app = 6;
3007
3008 enum ForegroundState {
3009 UNKNOWN = 0;
3010 BACKGROUND = 1;
3011 FOREGROUND = 2;
3012 }
3013 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003014
3015 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003016}
David Chen9e3808c2017-11-20 17:25:34 -08003017
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003018/**
3019 * Logs when a WTF (What a Terrible Failure) happened.
3020 * Logged from:
3021 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3022 */
3023message WTFOccurred {
3024 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003025
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003026 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003027
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003028 // The name of the process.
3029 // system_server if it is not by an app
3030 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003031
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003032 // The pid if available. -1 means not available.
3033 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003034
3035 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003036}
3037
3038/**
3039 * Logs when system server reports low memory.
3040 * Logged from:
3041 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3042 */
3043message LowMemReported {
3044}
3045
3046/**
3047 * Logs when an app ANR (App Not Responding) occurs.
3048 * Logged from:
3049 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3050 */
3051message ANROccurred {
3052 optional int32 uid = 1 [(is_uid) = true];
3053
3054 optional string process_name = 2;
3055
3056 optional string short_component_name = 3;
3057
3058 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003059
3060 enum InstantApp {
3061 UNAVAILABLE = 0;
3062 FALSE = 1;
3063 TRUE = 2;
3064 }
3065 optional InstantApp is_instant_app = 5;
3066
3067 enum ForegroundState {
3068 UNKNOWN = 0;
3069 BACKGROUND = 1;
3070 FOREGROUND = 2;
3071 }
3072 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003073
3074 optional android.server.ErrorSource error_source = 7;
3075
3076 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003077}
3078
Bookatza7020bd2018-08-28 16:29:35 -07003079/**
3080 * Logs when the vibrator state changes.
3081 * Logged from:
3082 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3083 */
3084message VibratorStateChanged {
3085 repeated AttributionNode attribution_node = 1;
3086
3087 enum State {
3088 OFF = 0;
3089 ON = 1;
3090 }
3091 optional State state = 2;
3092
3093 // Duration (in milliseconds) requested to keep the vibrator on.
3094 // Only applicable for State == ON.
3095 optional int64 duration_millis = 3;
3096}
3097
David Chen0a368b22017-12-06 16:28:16 -08003098/*
3099 * Allows other apps to push events into statsd.
3100 * Logged from:
3101 * frameworks/base/core/java/android/util/StatsLog.java
3102 */
David Chen0b5c90c2018-01-25 16:51:49 -08003103message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003104 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003105 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003106
3107 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3108 optional int32 label = 2;
3109
3110 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3111 // predicates for the metrics).
3112 enum State {
3113 UNKNOWN = 0;
3114 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3115 STOP = 2;
3116 START = 3;
3117 }
3118 optional State state = 3;
3119}
3120
David Chen9e3808c2017-11-20 17:25:34 -08003121/**
Bookatz7948c872018-09-04 12:58:33 -07003122 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3123 * For example, this could be due to the user manually changing the time.
3124 *
3125 * Logged from:
3126 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3127 */
3128message WallClockTimeShifted {
3129 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3130 optional int64 wall_clock_timestamp_millis = 1;
3131}
3132
3133/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003134 * Logs when statsd detects an anomaly.
3135 *
3136 * Logged from:
3137 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3138 */
3139message AnomalyDetected {
3140 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003141 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003142
Yangster-mac94e197c2018-01-02 16:03:03 -08003143 // Id of the config whose anomaly detection alert fired.
3144 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003145
Yangster-mac94e197c2018-01-02 16:03:03 -08003146 // Id of the alert (i.e. name of the anomaly that was detected).
3147 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003148}
3149
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003150message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003151 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003152 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003153
3154 // The app package name.
3155 optional string pkg_name = 2;
3156
3157 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003158 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003159 WARM = 1;
3160 HOT = 2;
3161 COLD = 3;
3162 }
3163 // The transition type.
3164 optional TransitionType type = 3;
3165
3166 // The activity name.
3167 optional string activity_name = 4;
3168
3169 // The name of the calling app. Empty if not set.
3170 optional string calling_pkg_name = 5;
3171
3172 // Whether the app is an instant app.
3173 optional bool is_instant_app = 6;
3174
3175 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003176 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003177
Bookatz80d11a02018-01-16 10:46:35 -08003178 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003179
David Chen0b5c90c2018-01-25 16:51:49 -08003180 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003181 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003182 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003183 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003184 optional int32 bind_application_delay_millis = 11;
3185 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003186
3187 // Empty if not set.
3188 optional string launch_token = 13;
3189
Calin Juravle759fbda2018-02-20 19:52:30 +00003190 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003191 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003192
3193 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003194 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003195}
3196
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003197message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003199 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003200
3201 // The app package name.
3202 optional string pkg_name = 2;
3203
3204 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003205 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003206 WARM = 1;
3207 HOT = 2;
3208 COLD = 3;
3209 }
3210 // The transition type.
3211 optional TransitionType type = 3;
3212
3213 // The activity name.
3214 optional string activity_name = 4;
3215}
3216
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003217message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003218 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003219 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003220
3221 // The app package name.
3222 optional string pkg_name = 2;
3223
3224 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003225 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003226 WITH_BUNDLE = 1;
3227 WITHOUT_BUNDLE = 2;
3228 }
3229 // The transition type.
3230 optional TransitionType type = 3;
3231
3232 // The activity name.
3233 optional string activity_name = 4;
3234
3235 optional bool transition_process_running = 5;
3236
3237 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003238 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003239}
3240
Bookatz8fcd09a2017-12-18 13:01:10 -08003241/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003242 * Logs a picture-in-picture action
3243 * Logged from:
3244 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3245 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3246 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3247 */
3248message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003249 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003250 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003251
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003252 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003253
Chenjie Yu52cacc62017-12-08 18:11:45 -08003254 enum State {
3255 ENTERED = 1;
3256 EXPANDED_TO_FULL_SCREEN = 2;
3257 MINIMIZED = 3;
3258 DISMISSED = 4;
3259 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003260 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003261}
3262
3263/**
Chenjie Yue8904192017-12-08 19:12:57 -08003264 * Logs overlay action
3265 * Logged from:
3266 * services/core/java/com/android/server/wm/Session.java
3267 */
3268message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003269 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003270
tsaichristine5adc7e02020-01-14 17:07:39 -08003271 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003272
3273 optional bool using_alert_window = 3;
3274
3275 enum State {
3276 ENTERED = 1;
3277 EXITED = 2;
3278 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003279 optional State state = 4 [
3280 (state_field_option).option = EXCLUSIVE_STATE,
3281 (state_field_option).nested = false,
3282 (state_field_option).default_state_value = 2
3283 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003284}
3285
Chenjie Yuccfe6452018-01-30 11:33:21 -08003286/*
3287 * Logs foreground service starts and stops.
3288 * Note that this is not when a service starts or stops, but when it is
3289 * considered foreground.
3290 * Logged from
3291 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3292 */
3293message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003294 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003295 // package_name + "/" + class_name
3296 optional string short_name = 2;
3297
3298 enum State {
3299 ENTER = 1;
3300 EXIT = 2;
3301 }
3302 optional State state = 3;
3303}
3304
Chenjie Yue8904192017-12-08 19:12:57 -08003305/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003306 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3307 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3308 * attributed back to the parent (host) uid. One example is Chrome.
3309 *
3310 * Logged from:
3311 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3312 */
3313message IsolatedUidChanged {
3314 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003315 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003316 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003317 optional int32 parent_uid = 1;
3318
3319 optional int32 isolated_uid = 2;
3320
3321 // We expect an isolated uid to be removed before if it's used for another parent uid.
3322 enum Event {
3323 REMOVED = 0;
3324 CREATED = 1;
3325 }
3326 optional Event event = 3;
3327}
3328
3329/*
3330 * Logs the reception of an incoming network packet causing the main system to wake up for
3331 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3332 * and processed by WakeupController.cpp.
3333 */
3334message PacketWakeupOccurred {
3335 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3336 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003337 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003338 // The interface name on which the packet was received.
3339 optional string iface = 2;
3340 // The ethertype value of the packet.
3341 optional int32 ethertype = 3;
3342 // String representation of the destination MAC address of the packet.
3343 optional string destination_hardware_address = 4;
3344 // String representation of the source address of the packet if this was an IP packet.
3345 optional string source_ip = 5;
3346 // String representation of the destination address of the packet if this was an IP packet.
3347 optional string destination_ip = 6;
3348 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3349 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3350 // families.
3351 optional int32 ip_next_header = 7;
3352 // The source port if this was a TCP or UDP packet.
3353 optional int32 source_port = 8;
3354 // The destination port if this was a TCP or UDP packet.
3355 optional int32 destination_port = 9;
3356}
3357
3358/*
3359 * Logs the memory stats for an app on startup.
3360 * Logged from:
3361 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3362 */
3363message AppStartMemoryStateCaptured {
3364 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003365 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003366
3367 // The process name.
3368 optional string process_name = 2;
3369
3370 // The activity name.
3371 optional string activity_name = 3;
3372
3373 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003374 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003375
3376 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003377 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003378
3379 // RSS
3380 optional int64 rss_in_bytes = 6;
3381
3382 // CACHE
3383 optional int64 cache_in_bytes = 7;
3384
3385 // SWAP
3386 optional int64 swap_in_bytes = 8;
3387}
3388
3389/*
3390 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3391 * for LMK event.
3392 * Logged from:
3393 * system/core/lmkd/lmkd.c
3394 */
3395message LmkStateChanged {
3396 enum State {
3397 UNKNOWN = 0;
3398 START = 1;
3399 STOP = 2;
3400 }
3401 optional State state = 1;
3402}
3403
3404/*
3405 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3406 * Logged from:
3407 * system/core/lmkd/lmkd.c
3408 */
3409message LmkKillOccurred {
3410 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003411 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003412
3413 // The process name.
3414 optional string process_name = 2;
3415
3416 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003417 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003418
3419 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003420 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003421
3422 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003423 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003424
3425 // RSS
3426 optional int64 rss_in_bytes = 6;
3427
3428 // CACHE
3429 optional int64 cache_in_bytes = 7;
3430
3431 // SWAP
3432 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003433
3434 // The elapsed real time of start of the process.
3435 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003436
3437 // Min oom adj score considered by lmkd.
3438 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003439}
3440
Rajeev Kumar51b54602018-03-01 12:18:26 -08003441/*
3442 * Logs when the ActivityManagerService detects that an app died.
3443 *
3444 * Logged from:
3445 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3446 */
3447message AppDied {
3448 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003449 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003450}
3451
Howard Ro21a039c2018-08-06 14:55:47 -07003452/**
3453 * An atom for generic metrics logging. Available from Android Q.
3454 */
3455message GenericAtom {
3456 // The uid of the application that sent this custom atom.
3457 optional int32 uid = 1 [(is_uid) = true];
3458
3459 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003460 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003461}
3462
Tej Singhd6d6d772018-09-05 17:41:25 -07003463/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003464 * Atom for simple logging of user interaction and impression events, such as "the user touched
3465 * this button" or "this dialog was displayed".
3466 * Keep the UI event stream clean: don't use for system or background events.
3467 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003468 *
3469 * Logged from:
3470 * frameworks/base/services/core/java/com/android/server/
3471 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003472 */
3473message UiEventReported {
3474 // The event_id.
3475 optional int32 event_id = 1;
3476 // The event's source or target uid and package, if applicable.
3477 // For example, the package posting a notification, or the destination package of a share.
3478 optional int32 uid = 2 [(is_uid) = true];
3479 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003480 // An identifier used to disambiguate which logs refer to a particular instance of some
3481 // UI element. Useful when there might be multiple instances simultaneously active.
3482 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003483}
3484
3485/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003486 * Reports a notification was created or updated.
3487 *
3488 * Logged from:
3489 * frameworks/base/services/core/java/com/android/server/notification/
3490 */
3491message NotificationReported {
3492 // The event_id (as for UiEventReported).
3493 optional int32 event_id = 1;
3494 // The notifying app's uid and package.
3495 optional int32 uid = 2 [(is_uid) = true];
3496 optional string package_name = 3;
3497 // A small system-assigned identifier for the notification.
3498 // Locally probably-unique, but expect collisions across users and/or days.
3499 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003500 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3501 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003502
3503 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003504 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3505 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3506 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003507
3508 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003509 optional string category = 10; // App-assigned notification category (API-defined strings)
3510 optional int32 style = 11; // App-assigned notification style
3511 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003512
3513 // Ordering, importance and interruptiveness
3514
Will Brockman7614f6962020-02-10 19:43:03 -05003515 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003516
Will Brockman7614f6962020-02-10 19:43:03 -05003517 optional android.stats.sysui.NotificationImportance importance = 14;
3518 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003519
3520 enum NotificationImportanceExplanation {
3521 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3522 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3523 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3524 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3525 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3526 // Like _APP, but based on pre-channels priority signal.
3527 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3528 }
3529
Will Brockman7614f6962020-02-10 19:43:03 -05003530 optional NotificationImportanceExplanation importance_source = 16;
3531 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3532 optional NotificationImportanceExplanation importance_initial_source = 18;
3533 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3534 optional int32 assistant_hash = 20;
3535 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003536}
3537
3538message Notification {
3539 // The notifying app's uid and package.
3540 optional int32 uid = 1 [(is_uid) = true];
3541 optional string package_name = 2;
3542 // A small system-assigned identifier for the notification.
3543 optional int32 instance_id = 3;
3544
3545 // Grouping information.
3546 optional int32 group_instance_id = 4;
3547 optional bool is_group_summary = 5;
3548
3549 // The section of the shade that the notification is in.
3550 // See NotificationSectionsManager.PriorityBucket.
3551 enum NotificationSection {
3552 SECTION_UNKNOWN = 0;
3553 SECTION_PEOPLE = 1;
3554 SECTION_ALERTING = 2;
3555 SECTION_SILENT = 3;
3556 }
3557 optional NotificationSection section = 6;
3558}
3559
3560message NotificationList {
3561 repeated Notification notifications = 1; // An ordered sequence of notifications.
3562}
3563
3564/**
3565 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3566 *
3567 * Logged from:
3568 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3569 */
3570message NotificationPanelReported {
3571 // The event_id (as for UiEventReported).
3572 optional int32 event_id = 1;
3573 optional int32 num_notifications = 2;
3574 // The notifications in the panel, in the order that they appear there.
3575 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3576}
3577
3578/**
3579 * Reports a notification channel, or channel group, was created, updated, or deleted.
3580 *
3581 * Logged from:
3582 * frameworks/base/services/core/java/com/android/server/notification/
3583 */
3584message NotificationChannelModified {
3585 // The event_id (as for UiEventReported).
3586 optional int32 event_id = 1;
3587 // The notifying app's uid and package.
3588 optional int32 uid = 2 [(is_uid) = true];
3589 optional string package_name = 3;
3590 // App-assigned notification channel ID or channel-group ID
3591 optional string channel_id = 4;
3592 // Previous importance setting, if applicable
3593 optional android.stats.sysui.NotificationImportance old_importance = 5;
3594 // New importance setting
3595 optional android.stats.sysui.NotificationImportance importance = 6;
3596}
3597
3598
3599/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003600 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003601 *
3602 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003603 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003604 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003605message BiometricAcquired {
3606 // Biometric modality that was acquired.
3607 optional android.hardware.biometrics.ModalityEnum modality = 1;
3608 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3609 optional int32 user = 2;
3610 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3611 optional bool is_crypto = 3;
3612 // Action that the device is performing. Acquired messages are only expected for enroll and
3613 // authenticate. Other actions may indicate an error.
3614 optional android.hardware.biometrics.ActionEnum action = 4;
3615 // The client that this acquisition was received for.
3616 optional android.hardware.biometrics.ClientEnum client = 5;
3617 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3618 optional int32 acquire_info = 6;
3619 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3620 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003621 // Dictates if this message should trigger additional debugging.
3622 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003623}
3624
3625/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003626 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003627 *
3628 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003629 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003630 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003631message BiometricAuthenticated {
3632 // Biometric modality that was used.
3633 optional android.hardware.biometrics.ModalityEnum modality = 1;
3634 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3635 optional int32 user = 2;
3636 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3637 // storage.
3638 optional bool is_crypto = 3;
3639 // The client that this acquisition was received for.
3640 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003641 // If authentication requires user confirmation. See BiometricPrompt's
3642 // setRequireConfirmation(bool) method.
3643 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003644
Kevin Chyn1741a072019-01-17 11:54:40 -08003645 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003646 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003647 REJECTED = 1;
3648 PENDING_CONFIRMATION = 2;
3649 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003650 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003651
3652 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003653 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003654 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3655 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3656 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3657 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003658 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003659 // Dictates if this message should trigger additional debugging.
3660 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003661}
3662
3663/**
3664 * Logs when a biometric error occurs.
3665 *
3666 * Logged from:
3667 * frameworks/base/services/core/java/com/android/server/biometrics
3668 */
3669message BiometricErrorOccurred {
3670 // Biometric modality that was used.
3671 optional android.hardware.biometrics.ModalityEnum modality = 1;
3672 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3673 optional int32 user = 2;
3674 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3675 optional bool is_crypto = 3;
3676 // Action that the device is performing.
3677 optional android.hardware.biometrics.ActionEnum action = 4;
3678 // The client that this acquisition was received for.
3679 optional android.hardware.biometrics.ClientEnum client = 5;
3680 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3681 // are unique to modality.
3682 optional int32 error_info = 6;
3683 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3684 // by the vendor and not specified by the HIDL interface.
3685 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003686 // Dictates if this message should trigger additional debugging.
3687 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003688 // Time spent during the authentication attempt.
3689 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003690}
3691
3692/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003693 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003694 * Logged from:
3695 * frameworks/base/services/core/java/com/android/server/biometrics
3696 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003697message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003698 // Biometric modality.
3699 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003700 // Type of issue detected.
3701 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003702 // Dictates if this message should trigger additional debugging.
3703 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003704}
Howard Ro688ae182018-09-25 00:09:36 -07003705
joshmccloskey6f952b22019-03-25 20:59:35 -07003706/**
3707 * Logs when a biometric enrollment occurs.
3708 *
3709 * Logged from:
3710 * frameworks/base/services/core/java/com/android/server/biometrics
3711 */
3712message BiometricEnrolled {
3713 // Biometric modality that was used.
3714 optional android.hardware.biometrics.ModalityEnum modality = 1;
3715 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3716 optional int32 user = 2;
3717 // The amount of time the enrollment took in milliseconds.
3718 optional int64 latency_millis = 3;
3719 // Whether or not the enrollment was successful.
3720 optional bool success = 4;
3721}
3722
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003723/*
Tej Singh0d176952019-01-16 19:10:54 -08003724 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003725 */
Tej Singh0d176952019-01-16 19:10:54 -08003726message FlagFlipUpdateOccurred {
3727 // If the event is from a flag config package, specify the package name.
3728 optional string flag_flip_package_name = 1;
3729
3730 // The order id of the package
3731 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003732}
3733
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003734/**
3735 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003736 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003737 */
3738message TrainExperimentIds {
3739 repeated int64 experiment_id = 1;
3740}
3741
Yangster-macb89807e2018-11-15 21:10:57 -08003742/*
3743 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003744 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003745 */
3746message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003747 // Name of the train.
3748 optional string train_name = 1;
3749 // Version code for a "train" of packages that need to be installed atomically
3750 optional int64 train_version_code = 2;
3751 // After installation of this package, device requires a restart.
3752 optional bool requires_staging = 3;
3753 // Rollback should be enabled for this install.
3754 optional bool rollback_enabled = 4;
3755 // Requires low latency monitoring if possible.
3756 optional bool requires_low_latency_monitor = 5;
3757
Yangster-macb89807e2018-11-15 21:10:57 -08003758 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003759 UNKNOWN = 0;
3760 INSTALL_REQUESTED = 1;
3761 INSTALL_STARTED = 2;
3762 INSTALL_STAGED_NOT_READY = 3;
3763 INSTALL_STAGED_READY = 4;
3764 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003765 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3766 // and INSTALL_FAILURE_COMMIT.
3767 INSTALL_FAILURE = 6 [deprecated = true];
3768 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003769 INSTALL_CANCELLED = 7;
3770 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003771 INSTALLER_ROLLBACK_INITIATED = 9;
3772 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3773 INSTALLER_ROLLBACK_STAGED = 11;
3774 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3775 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3776 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3777 INSTALLER_ROLLBACK_SUCCESS = 15;
3778 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003779 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3780 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3781 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3782 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3783 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3784 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003785 INSTALL_FAILURE_DOWNLOAD = 23;
3786 INSTALL_FAILURE_STATE_MISMATCH = 24;
3787 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003788 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003789 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003790 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003791 // Possible experiment ids for monitoring this push.
3792 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3793 // user id
3794 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003795 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003796 // Whether or not this is a rollback event
3797 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003798}
3799
Tej Singhc9203082019-05-03 13:42:23 -07003800/* Test atom, is not logged anywhere */
3801message TestAtomReported {
3802 repeated AttributionNode attribution_node = 1;
3803 optional int32 int_field = 2;
3804 optional int64 long_field = 3;
3805 optional float float_field = 4;
3806 optional string string_field = 5;
3807 optional bool boolean_field = 6;
3808 enum State {
3809 UNKNOWN = 0;
3810 OFF = 1;
3811 ON = 2;
3812 }
3813 optional State state = 7;
3814 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3815}
3816
Maggie Whitefc1aa592018-11-28 21:55:23 -08003817/** Represents USB port overheat event. */
3818message UsbPortOverheatEvent {
3819 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3820 optional int32 plug_temperature_deci_c = 1;
3821
3822 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3823 optional int32 max_temperature_deci_c = 2;
3824
3825 /* Time between USB plug event and overheat threshold trip, in seconds. */
3826 optional int32 time_to_overheat_secs = 3;
3827
3828 /* Time between overheat threshold trip and hysteresis, in seconds. */
3829 optional int32 time_to_hysteresis_secs = 4;
3830
3831 /* Time between hysteresis and active mitigation ending, in seconds. */
3832 optional int32 time_to_inactive_secs = 5;
3833};
3834
Maggie White8735b852019-01-18 11:40:49 -08003835/**
3836 * Logs total effective full charge and discharge cycles on a battery.
3837 * Here are some examples of one effective cycle:
3838 * 1) the battery charges from 0% to 100% and drains back to 0%,
3839 * 2) charging from 50% to 100% and draining back to 50% twice.
3840 * Pulled from:
3841 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3842 */
3843message BatteryCycleCount {
3844 /* Number of total charge and discharge cycles on the system battery. */
3845 optional int32 cycle_count = 1;
3846}
3847
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003848/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003849 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3850 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003851 * Pulled from:
3852 * StatsCompanionService
3853 */
3854
Carmen Agimof12dec122019-03-06 16:14:38 +00003855message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003856
Carmen Agimof12dec122019-03-06 16:14:38 +00003857 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003858 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003859 PUBLIC = 1;
3860 PRIVATE = 2;
3861 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003862 }
3863
Carmen Agimof12dec122019-03-06 16:14:38 +00003864 // The type of external storage.
3865 optional android.stats.storage.ExternalStorageType storage_type = 1;
3866 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3867 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003868 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003869 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003870}
3871
Yangster-macb89807e2018-11-15 21:10:57 -08003872/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003873 * Logs when a connection becomes available and lost.
3874 * Logged in StatsCompanionService.java
3875 */
3876message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003877 // Id of the network.
3878 optional int32 net_id = 1;
3879
3880 enum State {
3881 UNKNOWN = 0;
3882 CONNECTED = 1;
3883 DISCONNECTED = 2;
3884 }
3885 // Connected state of a network.
3886 optional State state = 2;
3887}
3888
3889/**
3890 * Logs when a service starts and stops.
3891 * Logged from:
3892 * services/core/java/com/android/server/am/ActiveServices.java
3893 */
3894message ServiceStateChanged {
3895
3896 optional int32 uid = 1 [(is_uid) = true];
3897
3898 optional string package_name = 2;
3899
3900 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003901
3902 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003903 START = 1;
3904 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003905 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003906
3907 optional State state = 4;
3908}
3909
3910/**
3911 * Logs when a service is launched.
3912 * Logged from:
3913 * services/core/java/com/android/server/am/ActiveServices.java
3914 */
3915message ServiceLaunchReported {
3916
3917 optional int32 uid = 1 [(is_uid) = true];
3918
3919 optional string package_name = 2;
3920
3921 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003922}
Howard Ro688ae182018-09-25 00:09:36 -07003923
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003924/**
3925 * Logs when a hidden API is used.
3926 *
3927 * Logged from:
3928 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3929 */
3930message HiddenApiUsed {
3931 // The uid of the app making the hidden access.
3932 optional int32 uid = 1 [(is_uid) = true];
3933
3934 // Signature of the method or field accessed.
3935 optional string signature = 2;
3936
3937 enum AccessMethod {
3938 NONE = 0;
3939 REFLECTION = 1;
3940 JNI = 2;
3941 LINKING = 3;
3942 }
3943
3944 // Type of access.
3945 optional AccessMethod access_method = 3;
3946
3947 // Whether the access was prevented or not.
3948 optional bool access_denied = 4;
3949}
3950
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003951/**
3952 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3953 * - When user sees privacy chip
3954 * - When user clicks privacy chip
3955 * - How does the user exit the Privacy Dialog
3956 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003957 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3958 */
3959message PrivacyIndicatorsInteracted {
3960
3961 enum Type {
3962 UNKNOWN = 0;
3963 CHIP_VIEWED = 1;
3964 CHIP_CLICKED = 2;
3965 DIALOG_PRIVACY_SETTINGS = 3;
3966 DIALOG_DISMISS = 4;
3967 DIALOG_LINE_ITEM = 5;
3968 }
3969
tsaichristine5adc7e02020-01-14 17:07:39 -08003970 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003971
3972 // Used if the type is LINE_ITEM
3973 optional string package_name = 2;
3974}
3975
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003976/**
3977 * Logs information about a package that is moved from the internal to external storage and vice
3978 * versa.
3979 * It logs the package name, the type of the external storage where the package is installed
3980 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3981 * and the move type: if it's from internal to external or the other way around.
3982 *
3983 * Logged from:
3984 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3985 */
3986message AppMovedStorageReported {
3987 enum MoveType {
3988 UNKNOWN = 0;
3989 TO_EXTERNAL = 1;
3990 TO_INTERNAL = 2;
3991 }
3992 // The type of the external storage.
3993 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3994 // The type of move.
3995 optional MoveType move_type = 2;
3996 // The name of the package that was moved.
3997 optional string package_name = 3;
3998}
3999
jianjin8f2dee02019-03-29 14:03:08 -07004000/**
4001 * Logs when system server watchdog occurs.
4002 * Logged from:
4003 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4004 */
4005message SystemServerWatchdogOccurred {
4006 optional string subject = 1;
4007}
4008
4009/**
4010 * Logs when new file added to tombstones.
4011 * Logged from:
4012 * frameworks/base/core/java/com/android/server/BootReceiver.java
4013 */
4014message TombStoneOccurred {
4015}
4016
Hai Zhang5d3328d2019-04-13 21:25:06 +08004017/*
4018 * Information about a role request
4019 *
4020 * Logged from:
4021 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4022 */
4023message RoleRequestResultReported {
4024 // UID of application requesting the role
4025 optional int32 requesting_uid = 1;
4026
4027 // Package name of application requesting the role
4028 optional string requesting_package_name = 2;
4029
4030 // The role to be granted
4031 optional string role_name = 3;
4032
4033 // The count of applications qualifying for the role
4034 optional int32 qualifying_count = 4;
4035
4036 // UID of application current granted the role
4037 optional int32 current_uid = 5;
4038
4039 // Package name of application current granted the role
4040 optional string current_package_name = 6;
4041
4042 // UID of another application that user chose to grant the role to, instead of the requesting
4043 // application
4044 optional int32 granted_another_uid = 7;
4045
4046 // Package name of another application that user chose to grant the role to, instead of the
4047 // requesting application
4048 optional string granted_another_package_name = 8;
4049
4050 enum Result {
4051 UNDEFINED = 0;
4052 // role request was ignored
4053 IGNORED = 1;
4054 // role request was ignored because it's already granted
4055 IGNORED_ALREADY_GRANTED = 2;
4056 // role request was ignored because the application isn't qualified
4057 IGNORED_NOT_QUALIFIED = 3;
4058 // role request was ignored because user said it should be always denied
4059 IGNORED_USER_ALWAYS_DENIED = 4;
4060 // role was granted by user action
4061 USER_GRANTED = 5;
4062 // role was denied by user action
4063 USER_DENIED = 6;
4064 // role was denied by user granting another application the role
4065 USER_DENIED_GRANTED_ANOTHER = 7;
4066 // role was denied and set to be always denied by the user
4067 USER_DENIED_WITH_ALWAYS = 8;
4068 }
4069 // The result of the role request
4070 optional Result result = 9;
4071}
4072
Mark Tabrya824a642019-11-05 12:26:12 -08004073/**
4074 * Logs when a Vehicle Maps Service client's connection state has changed
4075 *
4076 * Logged from:
4077 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4078 */
4079message VmsClientConnectionStateChanged {
4080 // The UID of the VMS client app
4081 optional int32 uid = 1 [(is_uid) = true];
4082
4083 enum State {
4084 UNKNOWN = 0;
4085 // Attempting to connect to the client
4086 CONNECTING = 1;
4087 // Client connection established
4088 CONNECTED = 2;
4089 // Client connection closed unexpectedly
4090 DISCONNECTED = 3;
4091 // Client connection closed by VMS
4092 TERMINATED = 4;
4093 // Error establishing the client connection
4094 CONNECTION_ERROR = 5;
4095 }
4096
4097 optional State state = 2;
4098}
4099
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004100/**
4101 * Logs when MediaProvider has successfully finished scanning a storage volume.
4102 *
4103 * Logged from:
4104 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4105 */
4106message MediaProviderScanEvent {
4107 enum Reason {
4108 // Scan triggered due to unknown reason
4109 UNKNOWN = 0;
4110 // Scan triggered due to storage volume being mounted
4111 MOUNTED = 1;
4112 // Scan triggered due to explicit user action or app request
4113 DEMAND = 2;
4114 // Scan triggered due to idle maintenance
4115 IDLE = 3;
4116 }
4117
4118 // Volume type that this event pertains to
4119 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4120 // Reason why this scan was triggered
4121 optional Reason reason = 2;
4122 // Total number of files scanned
4123 optional int64 item_count = 3;
4124 // Duration of scan, normalized per file
4125 optional float normalized_duration_millis = 4;
4126 // Number of database inserts, normalized per file
4127 optional float normalized_insert_count = 5;
4128 // Number of database updates, normalized per file
4129 optional float normalized_update_count = 6;
4130 // Number of database deletes, normalized per file
4131 optional float normalized_delete_count = 7;
4132}
4133
4134/**
4135 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4136 *
4137 * Logged from:
4138 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4139 */
4140message MediaProviderDeletionEvent {
4141 // Volume type that this event pertains to
4142 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4143 // Device timestamp when this deletion event occurred
4144 optional int64 timestamp_millis = 2;
4145 // App that requested deletion
4146 optional string package_name = 3;
4147 // Number of items that were deleted
4148 optional int32 item_count = 4;
4149}
4150
4151/**
4152 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4153 *
4154 * Logged from:
4155 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4156 */
4157message MediaProviderPermissionEvent {
4158 enum Result {
4159 UNKNOWN = 0;
4160 USER_GRANTED = 1;
4161 AUTO_GRANTED = 2;
4162 USER_DENIED = 3;
4163 USER_DENIED_WITH_PREJUDICE = 4;
4164 AUTO_DENIED = 5;
4165 }
4166
4167 // Volume type that this event pertains to
4168 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4169 // Device timestamp when this permission event occurred
4170 optional int64 timestamp_millis = 2;
4171 // App that requested permission
4172 optional string package_name = 3;
4173 // Number of items that were requested
4174 optional int32 item_count = 4;
4175 // Result of this request
4176 optional Result result = 5;
4177}
4178
4179/**
4180 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4181 *
4182 * Logged from:
4183 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4184 */
4185message MediaProviderSchemaChange {
4186 // Volume type that this event pertains to
4187 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4188 // Old database version code
4189 optional int32 version_from = 2;
4190 // New database version code
4191 optional int32 version_to = 3;
4192 // Total number of files in database
4193 optional int64 item_count = 4;
4194 // Duration of schema change, normalized per file
4195 optional float normalized_duration_millis = 5;
4196}
4197
4198/**
4199 * Logs when MediaProvider has finished an idle maintenance job.
4200 *
4201 * Logged from:
4202 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4203 */
4204message MediaProviderIdleMaintenance {
4205 // Volume type that this event pertains to
4206 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4207
4208 // Total number of files in database
4209 optional int64 item_count = 2;
4210 // Duration of idle maintenance, normalized per file
4211 optional float normalized_duration_millis = 3;
4212 // Number of thumbnails found to be stale, normalized per file
4213 optional float normalized_stale_thumbnails = 4;
4214 // Number of items found to be expired, normalized per file
4215 optional float normalized_expired_media = 5;
4216}
4217
Keun young Park3e033cb2019-12-18 11:27:35 -08004218/**
4219 * Represents boot time event with duration in ms.
4220 *
4221 * Logged from: bootstat and various system server components. Check each enums for details.
4222 */
4223message BootTimeEventDuration {
4224 enum DurationEvent {
4225 UNKNOWN = 0;
4226 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4227 ABSOLUTE_BOOT_TIME = 1;
4228 // Bootloader's 1st stage execution time.
4229 // Logged from bootstat.
4230 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4231 // Bootloader's 1st stage loading time.
4232 // Logged from bootstat.
4233 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4234 // Bootloader's kernel loading time.
4235 // Logged from bootstat.
4236 BOOTLOADER_KERNEL_LOAD = 4;
4237 // Bootloader's 2nd stage execution time.
4238 // Logged from bootstat.
4239 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4240 // Bootloader's 2nd stage loading time.
4241 // Logged from bootstat.
4242 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4243 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4244 // for locked device.
4245 // Logged from bootstat.
4246 BOOTLOADER_UI_WAIT = 7;
4247 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4248 // Logged from bootstat.
4249 BOOTLOADER_TOTAL = 8;
4250 // Shutdown duration inside init for the reboot before the current boot up.
4251 // Logged from f/b/services/.../BootReceiver.java.
4252 SHUTDOWN_DURATION = 9;
4253 // Total time for mounting of disk devices during bootup.
4254 // Logged from f/b/services/.../BootReceiver.java.
4255 MOUNT_DEFAULT_DURATION = 10;
4256 // Total time for early stage mounting of disk devices during bootup.
4257 // Logged from f/b/services/.../BootReceiver.java.
4258 MOUNT_EARLY_DURATION = 11;
4259 // Total time for late stage mounting of disk devices during bootup.
4260 // Logged from f/b/services/.../BootReceiver.java.
4261 MOUNT_LATE_DURATION = 12;
4262 // Average time to scan non-system app after OTA
4263 // Logged from f/b/services/.../PackageManagerService.java
4264 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4265 // Time to initialize Package manager after OTA
4266 // Logged from f/b/services/.../PackageManagerService.java
4267 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4268 // Time to scan all system app from Package manager after OTA
4269 // Logged from f/b/services/.../PackageManagerService.java
4270 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4271 // Init's total time for cold boot stage.
4272 // Logged from bootstat.
4273 COLDBOOT_WAIT = 16;
4274 // Init's total time for initializing selinux.
4275 // Logged from bootstat.
4276 SELINUX_INIT = 17;
4277 // Time since last factory reset.
4278 // Logged from bootstat.
4279 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004280 // Init's total time spent for completing the 1st stage.
4281 // Logged from bootstat.
4282 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004283 }
4284
4285 // Type of the event.
4286 optional DurationEvent event = 1;
4287 // Duration of the event in ms.
4288 optional int64 duration_millis = 2;
4289}
4290
4291/**
4292 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4293 * since boot-up.
4294 *
4295 * Logged from: bootstat and various system server components. Check each enums for details.
4296 */
4297message BootTimeEventElapsedTime {
4298 enum ElapsedTimeEvent {
4299 UNKNOWN = 0;
4300 // Time when init starts 1st stage. Logged from bootstat.
4301 ANDROID_INIT_STAGE_1 = 1;
4302 // Time when sys.boot_completed prop is set.
4303 // Logged from bootstat.
4304 BOOT_COMPLETE = 2;
4305 // BOOT_COMPLETE for encrypted device.
4306 BOOT_COMPLETE_ENCRYPTION = 3;
4307 // BOOT_COMPLETE for device with no encryption.
4308 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4309 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004310 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004311 // BOOT_COMPLETE after factory reset.
4312 FACTORY_RESET_BOOT_COMPLETE = 6;
4313 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4314 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004315 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4316 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004317 // BOOT_COMPLETE after OTA.
4318 OTA_BOOT_COMPLETE = 9;
4319 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4320 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004321 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4322 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004323 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4324 // Logged from f/b/services/.../UserController.java
4325 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4326 // Time when the system starts sending BOOT_COMPLETED broadcast.
4327 // Logged from f/b/services/.../UserController.java
4328 FRAMEWORK_BOOT_COMPLETED = 13;
4329 // Time when the package manager starts init.
4330 // Logged from f/b/services/.../SystemServer.java
4331 PACKAGE_MANAGER_INIT_START = 14;
4332 // Time when package manager is ready
4333 // Logged from f/b/services/.../SystemServer.java
4334 PACKAGE_MANAGER_INIT_READY = 15;
4335 // Represents the time when user has entered unlock credential for system with user pin.
4336 // Logged from bootstat.
4337 POST_DECRYPT = 16;
4338 // Represents the start of zygote's init.
4339 // Logged from zygote itself.
4340 ZYGOTE_INIT_START = 17;
4341 // Represents the start of secondary zygote's init.
4342 // TODO: add logging to zygote
4343 SECONDARY_ZYGOTE_INIT_START = 18;
4344 // Represents the start of system server's init.
4345 // Logged from f/b/services/.../SystemServer.java
4346 SYSTEM_SERVER_INIT_START = 19;
4347 // Represents the completion of system server's init.
4348 // Logged from f/b/services/.../SystemServer.java
4349 SYSTEM_SERVER_READY = 20;
4350 // Represents the start of launcher during boot-up.
4351 // TODO: add logging
4352 LAUNCHER_START = 21;
4353 // Represents the completion of launcher's initial rendering. User can use other apps from
4354 // launcher from this point.
4355 // TODO: add logging
4356 LAUNCHER_SHOWN = 22;
4357 }
4358
4359 // Type of the event.
4360 optional ElapsedTimeEvent event = 1;
4361 // Time since bootup for the event.
4362 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4363 optional int64 time_millis = 2;
4364}
4365
4366/**
4367 * Boot time events with UTC time.
4368 *
4369 * Logged from: bootstat and various system server components. Check each enums for details.
4370 */
4371message BootTimeEventUtcTime {
4372 enum UtcTimeEvent {
4373 UNKNOWN = 0;
4374 // Time of the bootstat's marking of 1st boot after the last factory reset.
4375 // Logged from bootstat.
4376 FACTORY_RESET_RESET_TIME = 1;
4377 // The time when bootstat records FACTORY_RESET_* events. This is close to
4378 // BOOT_COMPLETE time for the current bootup.
4379 // Logged from bootstat.
4380 FACTORY_RESET_CURRENT_TIME = 2;
4381 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4382 // Logged from bootstat.
4383 FACTORY_RESET_RECORD_VALUE = 3;
4384 }
4385
4386 // Type of the event.
4387 optional UtcTimeEvent event = 1;
4388 // UTC time for the event.
4389 optional int64 utc_time_secs = 2;
4390}
4391
4392/**
4393 * Boot time events representing specific error code during bootup.
4394 * Meaning of error code can be different per each event type.
4395 *
4396 * Logged from: bootstat and various system server components. Check each enums for details.
4397 */
4398message BootTimeEventErrorCode {
4399 enum ErrorCodeEvent {
4400 UNKNOWN = 0;
4401 // Linux error code for time() call to get the current UTC time.
4402 // Logged from bootstat.
4403 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4404 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4405 // as UMOUNT_STAT_* from init/reboot.cpp.
4406 // Logged from f/b/services/.../BootReceiver.java.
4407 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004408 // Reprepsents fie system mounting error code of /data partition for the current boot.
4409 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004410 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004411 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004412 }
4413
4414 // Type of the event.
4415 optional ErrorCodeEvent event = 1;
4416 // error code defined per each event type.
4417 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4418 // FS_MGR_FS_STAT.
4419 optional int32 error_code = 2;
4420}
4421
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004422/**
4423 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4424 * after an OTA.
4425 *
4426 * Logged from:
4427 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4428 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4429 */
4430message SnapshotMergeReported {
4431 // Keep in sync with
4432 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4433 enum UpdateState {
4434 // No update or merge is in progress.
4435 NONE = 0;
4436 // An update is applying; snapshots may already exist.
4437 INITIATED = 1;
4438 // An update is pending, but has not been successfully booted yet.
4439 UNVERIFIED = 2;
4440 // The kernel is merging in the background.
4441 MERGING = 3;
4442 // Post-merge cleanup steps could not be completed due to a transient
4443 // error, but the next reboot will finish any pending operations.
4444 MERGE_NEEDS_REBOOT = 4;
4445 // Merging is complete, and needs to be acknowledged.
4446 MERGE_COMPLETED = 5;
4447 // Merging failed due to an unrecoverable error.
4448 MERGE_FAILED = 6;
4449 // The update was implicitly cancelled, either by a rollback or a flash
4450 // operation via fastboot. This state can only be returned by WaitForMerge.
4451 CANCELLED = 7;
4452 };
4453
4454 // Status of the update after the merge attempts.
4455 optional UpdateState final_state = 1;
4456
4457 // Time to complete a merge operation in milliseconds.
4458 // A negative value corresponds to the case in which the merge operation
4459 // was interrupted and resumed (e.g. in case of a system reboot during the
4460 // merge).
4461 optional int64 duration_millis = 2;
4462
4463 // Number of reboots that occurred after issuing and before completing the
4464 // merge of all the snapshot devices.
4465 optional int32 intermediate_reboots = 3;
4466}
4467
Chenjie Yubbcbc602018-02-05 16:51:52 -08004468//////////////////////////////////////////////////////////////////////
4469// Pulled atoms below this line //
4470//////////////////////////////////////////////////////////////////////
4471
4472/**
David Chenc8a43242017-10-17 16:23:28 -07004473 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4474 *
4475 * Pulled from:
4476 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4477 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004478message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004479 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004480
4481 optional int64 rx_bytes = 2;
4482
4483 optional int64 rx_packets = 3;
4484
4485 optional int64 tx_bytes = 4;
4486
4487 optional int64 tx_packets = 5;
4488}
4489
4490/**
4491 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4492 *
4493 * Pulled from:
4494 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4495 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004496message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004497 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004498
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004499 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4500 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004501
4502 optional int64 rx_bytes = 3;
4503
4504 optional int64 rx_packets = 4;
4505
4506 optional int64 tx_bytes = 5;
4507
4508 optional int64 tx_packets = 6;
4509}
4510
4511/**
4512 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4513 *
4514 * Pulled from:
4515 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4516 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004517message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004518 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004519
4520 optional int64 rx_bytes = 2;
4521
4522 optional int64 rx_packets = 3;
4523
4524 optional int64 tx_bytes = 4;
4525
4526 optional int64 tx_packets = 5;
4527}
4528
4529/**
4530 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4531 *
4532 * Pulled from:
4533 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4534 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004535message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004536 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004537
Yao Chenc40a19d2018-03-15 16:48:25 -07004538 // 1 denotes foreground and 0 denotes background. This is called Set in
4539 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004540 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004541
4542 optional int64 rx_bytes = 3;
4543
4544 optional int64 rx_packets = 4;
4545
4546 optional int64 tx_bytes = 5;
4547
4548 optional int64 tx_packets = 6;
4549}
4550
4551/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004552 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4553 *
4554 * Pulled from:
4555 * StatsCompanionService
4556 */
4557message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004558 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004559
4560 optional int64 rx_bytes = 2;
4561
4562 optional int64 tx_bytes = 3;
4563}
4564
4565/**
David Chenc8a43242017-10-17 16:23:28 -07004566 * Pulls the kernel wakelock durations. This atom is adapted from
4567 * android/internal/os/KernelWakelockStats.java
4568 *
4569 * Pulled from:
4570 * StatsCompanionService using KernelWakelockReader.
4571 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004572message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004573 optional string name = 1;
4574
4575 optional int32 count = 2;
4576
4577 optional int32 version = 3;
4578
Yangster-maca8a30442018-10-13 23:46:34 -07004579 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004580}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004581
Chenjie Yu05013b32017-11-21 10:21:41 -08004582/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004583 * Pulls low power state information. If power.stats HAL is not available, this
4584 * includes platform and subsystem sleep state information,
4585 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4586 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004587 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004588 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004589 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4590 * as defined in:
4591 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004592 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004593message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004594 // Subsystem name
4595 optional string subsystem_name = 1;
4596 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4597 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004598 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4599 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004600 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004601 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004602 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004603 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004604 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004605}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004606
Chenjie Yu05013b32017-11-21 10:21:41 -08004607/**
Bookatz92da2832018-11-01 18:10:03 -07004608 * Pulls on-device power measurement information.
4609 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4610 * Pulled from:
4611 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4612 */
4613message OnDevicePowerMeasurement {
4614 // Name of the subsystem (to which the rail belongs).
4615 optional string subsystem_name = 1;
4616
4617 // Rail name. The rail lies within the subsystem.
4618 optional string rail_name = 2;
4619
4620 // Time (in ms since boot) at which the rail energy value was measured.
4621 // This may differ slightly from the time that statsd logs this information.
4622 optional uint64 measurement_timestamp_millis = 3;
4623
4624 // Accumulated energy used via the rail since device boot in uWs.
4625 optional uint64 energy_microwatt_secs = 4;
4626}
4627
4628/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004629 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004630 * Pulls the time the cpu spend on the frequency index. Frequency index
4631 * starts from highest to lowest. The value should be monotonically
4632 * increasing since boot. However, if there is a cpu
4633 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004634 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004635message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004636 optional uint32 cluster = 1;
4637 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004638 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004639}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004640
Chenjie Yu05013b32017-11-21 10:21:41 -08004641/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004642 * Pulls Cpu Time Per Uid.
4643 * Note that isolated process uid time should be attributed to host uids.
4644 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004645message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004646 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004647 optional uint64 user_time_micros = 2;
4648 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004649}
4650
4651/**
4652 * Pulls Cpu Time Per Uid per frequency.
4653 * Note that isolated process uid time should be attributed to host uids.
4654 * For each uid, we order the time by descending frequencies.
4655 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004656message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004657 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004658 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004659 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004660}
Hugo Benichi884970e2017-11-14 22:42:46 +09004661
Chenjie Yu05013b32017-11-21 10:21:41 -08004662/**
4663 * Pulls Wifi Controller Activity Energy Info
4664 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004665message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004666 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004667 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004668 // stack reported state
4669 // TODO: replace this with proto enum
4670 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004671 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004672 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004673 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004674 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004675 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004676 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004677 // product of current(mA), voltage(V) and time(ms)
4678 optional uint64 controller_energy_used = 6;
4679}
4680
4681/**
4682 * Pulls Modem Activity Energy Info
4683 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004684message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004685 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004686 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004687 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004688 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004689 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004690 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004691 /**
4692 * Tx power index
4693 * index 0 = tx_power < 0dBm
4694 * index 1 = 0dBm < tx_power < 5dBm
4695 * index 2 = 5dBm < tx_power < 15dBm
4696 * index 3 = 15dBm < tx_power < 20dBm
4697 * index 4 = tx_power > 20dBm
4698 */
4699 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004700 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004701 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004702 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004703 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004704 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004705 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004706 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004707 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004708 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004709 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004710 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004711 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004712 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004713}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004714
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004715/**
4716 * Pulls Bluetooth Activity Energy Info
4717 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4718 */
4719message BluetoothActivityInfo {
4720 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004721 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004722 // bluetooth stack state
4723 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004724 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004725 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004726 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004727 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004728 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004729 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004730 // product of current(mA), voltage(V) and time(ms)
4731 optional uint64 energy_used = 6;
4732}
4733
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004734/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004735 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004736 *
4737 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004738 */
4739message ProcessMemoryState {
4740 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004741 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004742
4743 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004744 // Usually package name, "system" for system server.
4745 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004746 optional string process_name = 2;
4747
Rafal Slawikda51b932018-12-13 16:31:33 +00004748 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004749 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004750
4751 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004752 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004753
4754 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004755 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004756
Rajeev Kumar90235992018-01-29 11:06:48 -08004757 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004758 // Value is read from memory.stat, field total_rss if per-app memory
4759 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004760 optional int64 rss_in_bytes = 6;
4761
4762 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004763 // Value is read from memory.stat, field total_cache if per-app memory
4764 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004765 optional int64 cache_in_bytes = 7;
4766
4767 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004768 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004769 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004770 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004771
Rafal Slawik203c3db2019-09-25 19:53:01 +01004772 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004773 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004774
Rafal Slawik203c3db2019-09-25 19:53:01 +01004775 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4776 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004777
Rafal Slawik203c3db2019-09-25 19:53:01 +01004778 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4779 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004780}
4781
4782/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004783 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004784 *
4785 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4786 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004787 *
4788 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004789 */
4790message ProcessMemoryHighWaterMark {
4791 // The uid if available. -1 means not available.
4792 optional int32 uid = 1 [(is_uid) = true];
4793
Rafal Slawikda51b932018-12-13 16:31:33 +00004794 // The process name.
4795 // Usually package name or process cmdline.
4796 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004797 optional string process_name = 2;
4798
Rafal Slawik239b6802019-09-09 18:46:01 +01004799 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4800 // computed by converting kilobytes to bytes.
4801 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4802
Rafal Slawik3bea8952018-11-15 12:39:33 +00004803 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4804 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004805 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004806}
4807
4808/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004809 * Logs the memory stats for a process.
4810 *
4811 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4812 * and for selected native processes.
4813 */
4814message ProcessMemorySnapshot {
4815 // The uid if available. -1 means not available.
4816 optional int32 uid = 1 [(is_uid) = true];
4817
4818 // The process name.
4819 // Usually package name or process cmdline.
4820 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4821 optional string process_name = 2;
4822
4823 // The pid of the process.
4824 // Allows to disambiguate instances of the process.
4825 optional int32 pid = 3;
4826
4827 // The current OOM score adjustment value.
4828 // Read from ProcessRecord for managed processes.
4829 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4830 optional int32 oom_score_adj = 4;
4831
4832 // The current RSS of the process.
4833 // VmRSS from /proc/pid/status.
4834 optional int32 rss_in_kilobytes = 5;
4835
4836 // The current anon RSS of the process.
4837 // RssAnon from /proc/pid/status.
4838 optional int32 anon_rss_in_kilobytes = 6;
4839
4840 // The current swap size of the process.
4841 // VmSwap from /proc/pid/status.
4842 optional int32 swap_in_kilobytes = 7;
4843
4844 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4845 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4846}
4847
4848/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004849 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004850 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004851message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004852 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004853}
4854
4855/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004856 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004857 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004858message SystemUptime {
4859 // Milliseconds since the system was booted.
4860 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4861 // for external input).
4862 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004863 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004864}
4865
4866/*
4867 * Reads from /proc/uid_concurrent_active_time which has the format:
4868 * active: X (X is # cores)
4869 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4870 * [uid1]: [time-0] [time-1] [time-2] ... ...
4871 * ...
4872 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4873 * The file contains a monotonically increasing count of time for a single boot.
4874 */
4875message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004876 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004877 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004878}
4879
4880/**
4881 * Reads from /proc/uid_concurrent_policy_time which has the format:
4882 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4883 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4884 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4885 * ...
4886 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4887 * The file contains a monotonically increasing count of time for a single boot.
4888 */
4889message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004890 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004891 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004892 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004893}
4894
4895/*
4896 * Pulls free disk space, for data, system partition and temporary directory.
4897 */
4898message DiskSpace {
4899 // available bytes in data partition
4900 optional uint64 data_available_bytes = 1;
4901 // available bytes in system partition
4902 optional uint64 system_available_bytes = 2;
4903 // available bytes in download cache or temp directories
4904 optional uint64 temp_available_bytes = 3;
4905}
Tej Singhbf972d92018-01-10 20:51:13 -08004906
4907/**
4908 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004909 *
4910 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004911 */
4912message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004913 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004914}
4915
4916/**
4917 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004918 * Pulled from:
4919 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004920 */
4921message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004922 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004923}
4924
4925/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004926 * Pulls battery voltage.
4927 * Pulled from:
4928 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4929 */
4930message BatteryVoltage {
4931 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004932 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004933}
4934
4935/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004936 * Pulls battery level (percent full, from 0 to 100).
4937 *
4938 * Pulled from:
4939 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4940 */
4941message BatteryLevel {
4942 // Battery level. Should be in [0, 100].
4943 optional int32 battery_level = 1;
4944}
4945
4946/**
Tej Singhd89137e2018-03-26 14:51:40 -07004947 * Pulls the temperature of various parts of the device.
4948 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004949 *
Maggie White442b6312019-04-05 16:26:44 -07004950 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004951 */
4952message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004953 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004954 optional android.os.TemperatureTypeEnum sensor_location = 1;
4955
4956 // The name of the temperature source. Eg. CPU0
4957 optional string sensor_name = 2;
4958
Tej Singhd89137e2018-03-26 14:51:40 -07004959 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004960 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004961 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004962
4963 // Relative severity of the throttling, see enum definition.
4964 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004965}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004966
4967/**
4968 * Pulls the statistics of calls to Binder.
4969 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004970 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4971 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004972 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004973 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004974 */
4975message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004976 // UID of the process responsible for the binder transaction. It will be set if the process
4977 // executing the binder transaction attribute the transaction to another uid using
4978 // Binder.setThreadWorkSource().
4979 //
4980 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004981 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004982 // UID of the process executing the binder transaction.
4983 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004984 // Fully qualified class name of the API call.
4985 //
4986 // This is a system server class name.
4987 //
4988 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4989 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4990 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4991 // commonly used APIs.
4992 optional string service_class_name = 2;
4993 // Method name of the API call. It can also be a transaction code if we cannot
4994 // resolve it to a name. See Binder#getTransactionName.
4995 //
4996 // This is a system server method name.
4997 optional string service_method_name = 3;
4998 // Total number of API calls.
4999 optional int64 call_count = 4;
5000 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5001 optional bool screen_interactive = 13;
5002 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5003 // call_count will be equal to recorded_call_count.
5004 //
5005 // If recorded_call_count is different than call_count, it means data collection has been
5006 // sampled. All the fields below will be sampled in this case.
5007 optional int64 recorded_call_count = 12;
5008 // Number of exceptions thrown by the API.
5009 optional int64 recorded_exception_count = 5;
5010 // Total latency of all API calls.
5011 // Average can be computed using total_latency_micros / recorded_call_count.
5012 optional int64 recorded_total_latency_micros = 6;
5013 // Maximum latency of one API call.
5014 optional int64 recorded_max_latency_micros = 7;
5015 // Total CPU usage of all API calls.
5016 // Average can be computed using total_cpu_micros / recorded_call_count.
5017 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5018 optional int64 recorded_total_cpu_micros = 8;
5019 // Maximum CPU usage of one API call.
5020 optional int64 recorded_max_cpu_micros = 9;
5021 // Maximum parcel reply size of one API call.
5022 optional int64 recorded_max_reply_size_bytes = 10;
5023 // Maximum parcel request size of one API call.
5024 optional int64 recorded_max_request_size_bytes = 11;
5025}
5026
5027/**
5028 * Pulls the statistics of exceptions during calls to Binder.
5029 *
5030 * Binder stats are cumulative from boot unless somebody reset the data using
5031 * > adb shell dumpsys binder_calls_stats --reset
5032 */
5033message BinderCallsExceptions {
5034 // Exception class name, e.g. java.lang.IllegalArgumentException.
5035 //
5036 // This is an exception class name thrown by the system server.
5037 optional string exception_class_name = 1;
5038 // Total number of exceptions.
5039 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005040}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005041
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005042/**
5043 * Pulls the statistics of message dispatching on HandlerThreads.
5044 *
5045 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5046 * config on the device.
5047 *
5048 * Next tag: 11
5049 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005050message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005051 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005052 optional int32 uid = 1 [(is_uid) = true];
5053
5054 // Fully qualified class name of the handler target class.
5055 //
5056 // This field does not contain PII. This is a system server class name.
5057 optional string handler_class_name = 2;
5058
5059 // The name of the thread that runs the Looper.
5060 //
5061 // This field does not contain PII. This is a system server thread name.
5062 optional string looper_thread_name = 3;
5063
5064 // The name of the dispatched message.
5065 //
5066 // This field does not contain PII. This is a system server constant or class
5067 // name.
5068 optional string message_name = 4;
5069
5070 // Total number of successfully dispatched messages.
5071 optional int64 message_count = 5;
5072
5073 // Total number of messages that failed dispatching.
5074 optional int64 exception_count = 6;
5075
5076 // Total number of processed messages we have data recorded for. If we
5077 // collected data for all the messages, message_count will be equal to
5078 // recorded_message_count.
5079 //
5080 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005081 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005082 optional int64 recorded_message_count = 7;
5083
5084 // Total latency of all processed messages.
5085 // Average can be computed using recorded_total_latency_micros /
5086 // recorded_message_count.
5087 optional int64 recorded_total_latency_micros = 8;
5088
5089 // Total CPU usage of all processed message.
5090 // Average can be computed using recorded_total_cpu_micros /
5091 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005092 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005093 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005094
5095 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5096 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005097
5098 // Max recorded CPU usage of all processed messages.
5099 optional int64 recorded_max_cpu_micros = 11;
5100
5101 // Max recorded latency of all processed messages.
5102 optional int64 recorded_max_latency_micros = 12;
5103
5104 // Total number of messages we tracked the dispatching delay for. If we
5105 // collected data for all the messages, message_count will be equal to
5106 // recorded_delay_message_count.
5107 //
5108 // If recorded_delay_message_count is different than message_count, it means data
5109 // collection has been sampled or/and not all messages specified the target dispatch time.
5110 // The fields below will be sampled in this case.
5111 optional int64 recorded_delay_message_count = 13;
5112
5113 // Total dispatching delay of all processed messages.
5114 // Calculated as a difference between the target dispatching time (Message.when)
5115 // and the actual dispatching time.
5116 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5117 optional int64 recorded_total_delay_millis = 14;
5118
5119 // Max dispatching delay of all processed messages.
5120 // Calculated as a difference between the target dispatching time (Message.when)
5121 // and the actual dispatching time.
5122 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005123}
Tej Singh86dc9db2018-09-06 00:39:57 +00005124
5125/**
5126 * Pulls disk information, such as write speed and latency.
5127 */
5128message DiskStats {
5129 // Time taken to open, write 512B to, and close a file.
5130 // -1 if error performing the check.
5131 optional int64 data_write_latency_millis = 1;
5132
5133 optional bool file_based_encryption = 2;
5134
5135 // Recent disk write speed in kB/s.
5136 // -1 if error querying storageed.
5137 // 0 if data is unavailable.
5138 optional int32 recent_disk_write_speed = 3;
5139}
5140
5141
5142/**
5143 * Free and total bytes of the Data, Cache, and System partition.
5144 */
5145message DirectoryUsage {
5146 enum Directory {
5147 UNKNOWN = 0;
5148 DATA = 1;
5149 CACHE = 2;
5150 SYSTEM = 3;
5151 }
5152 optional Directory directory = 1;
5153 optional int64 free_bytes = 2;
5154 optional int64 total_bytes = 3;
5155}
5156
5157
5158/**
5159 * Size of an application: apk size, data size, and cache size.
5160 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5161 * Information is only reported for apps with the primary user (user 0).
5162 * Sizes are aggregated by package name.
5163 */
5164message AppSize {
5165 // Including uids will involve modifying diskstats logic.
5166 optional string package_name = 1;
5167 // App size in bytes. -1 if unavailable.
5168 optional int64 app_size_bytes = 2;
5169 // App data size in bytes. -1 if unavailable.
5170 optional int64 app_data_size_bytes = 3;
5171 // App cache size in bytes. -1 if unavailable.
5172 optional int64 app_cache_size_bytes = 4;
5173 // Time that the cache file was produced.
5174 // Uses System.currentTimeMillis(), which is wall clock time.
5175 optional int64 cache_time_millis = 5;
5176}
5177
5178
5179/**
5180 * Size of a particular category. Eg: photos, videos.
5181 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5182 */
5183message CategorySize {
5184 enum Category {
5185 UNKNOWN = 0;
5186 APP_SIZE = 1;
5187 APP_DATA_SIZE = 2;
5188 APP_CACHE_SIZE = 3;
5189 PHOTOS = 4;
5190 VIDEOS = 5;
5191 AUDIO = 6;
5192 DOWNLOADS = 7;
5193 SYSTEM = 8;
5194 OTHER = 9;
5195 }
5196 optional Category category = 1;
5197 // Category size in bytes.
5198 optional int64 size_bytes = 2;
5199 // Time that the cache file was produced.
5200 // Uses System.currentTimeMillis(), which is wall clock time.
5201 optional int64 cache_time_millis = 3;
5202}
Tej Singhd6d6d772018-09-05 17:41:25 -07005203
5204/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005205 * Pulls per uid I/O stats. The stats are cumulative since boot.
5206 *
5207 * Read/write bytes are I/O events from a storage device
5208 * Read/write chars are data requested by read/write syscalls, and can be
5209 * satisfied by caching.
5210 *
5211 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5212 */
5213message DiskIo {
5214 optional int32 uid = 1 [(is_uid) = true];
5215 optional int64 fg_chars_read = 2;
5216 optional int64 fg_chars_write = 3;
5217 optional int64 fg_bytes_read = 4;
5218 optional int64 fg_bytes_write = 5;
5219 optional int64 bg_chars_read = 6;
5220 optional int64 bg_chars_write = 7;
5221 optional int64 bg_bytes_read = 8;
5222 optional int64 bg_bytes_write = 9;
5223 optional int64 fg_fsync = 10;
5224 optional int64 bg_fsync= 11;
5225}
5226
5227
5228/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005229 * Pulls the number of fingerprints for each user.
5230 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005231 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005232 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005233message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005234 // The associated user. Eg: 0 for owners, 10+ for others.
5235 // Defined in android/os/UserHandle.java
5236 optional int32 user = 1;
5237 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005238 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005239}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005240
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005241/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005242 * Pulls the number of faces for each user.
5243 *
5244 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5245 */
5246message NumFacesEnrolled {
5247 // The associated user. Eg: 0 for owners, 10+ for others.
5248 // Defined in android/os/UserHandle.java
5249 optional int32 user = 1;
5250 // Number of faces registered to that user.
5251 optional int32 num_faces_enrolled = 2;
5252}
5253/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005254 * A mapping of role holder -> role
5255 */
5256message RoleHolder {
5257 // uid of the role holder
5258 optional int32 uid = 1 [(is_uid) = true];
5259
5260 // package name of the role holder
5261 optional string package_name = 2;
5262
5263 // the role held
5264 optional string role = 3;
5265}
5266
Yangsteraf9aee72018-10-12 09:26:16 -07005267message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005268 // These are all in byte resolution.
5269 optional int64 min = 1 [deprecated = true];
5270 optional int64 average = 2 [deprecated = true];
5271 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005272
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005273 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5274 // int64 fields.
5275 optional int32 mean_kb = 4;
5276 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005277}
5278
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005279// A reduced subset of process states; reducing the number of possible states allows more
5280// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5281enum ProcessStateAggregated {
5282 PROCESS_STATE_UNKNOWN = 0;
5283 // Persistent system process.
5284 PROCESS_STATE_PERSISTENT = 1;
5285 // Top activity; actually any visible activity.
5286 PROCESS_STATE_TOP = 2;
5287 // Process binding to top or a foreground service.
5288 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5289 // Processing running a foreground service.
5290 PROCESS_STATE_FGS = 4;
5291 // Important foreground process (ime, wallpaper, etc).
5292 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5293 // Important background process.
5294 PROCESS_STATE_BACKGROUND = 6;
5295 // Process running a receiver.
5296 PROCESS_STATE_RECEIVER = 7;
5297 // All kinds of cached processes.
5298 PROCESS_STATE_CACHED = 8;
5299}
5300
5301// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005302message ProcessStatsStateProto {
5303 optional android.service.procstats.ScreenState screen_state = 1;
5304
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005305 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005306
5307 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5308 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005309 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5310
5311 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005312
5313 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005314 optional int64 duration_millis = 4 [deprecated = true];
5315 // Same as above, but with minute resolution so it fits into an int32.
5316 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005317
5318 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005319 optional int64 realtime_duration_millis = 9 [deprecated = true];
5320 // Same as above, but with minute resolution so it fits into an int32.
5321 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005322
5323 // # of samples taken
5324 optional int32 sample_size = 5;
5325
5326 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005327 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005328
5329 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005330 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005331
5332 // RSS is memory resident for this process
5333 optional AggStats rss = 8;
5334}
5335
5336// Next Tag: 7
5337message ProcessStatsProto {
5338 // Name of process.
5339 optional string process = 1;
5340
5341 // Uid of the process.
5342 optional int32 uid = 2;
5343
5344 // Information about how often kills occurred
5345 message Kill {
5346 // Count of excessive CPU kills
5347 optional int32 cpu = 1;
5348
5349 // Count of kills when cached
5350 optional int32 cached = 2;
5351
5352 // PSS stats during cached kill
5353 optional AggStats cached_pss = 3;
5354 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005355 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005356
5357 // Time and memory spent in various states.
5358 repeated ProcessStatsStateProto states = 5;
5359
5360 // Total time process has been running... screen_state, memory_state, and process_state
5361 // will not be set.
5362 optional ProcessStatsStateProto total_running_state = 6;
5363}
5364
5365message PackageServiceOperationStatsProto {
5366 // Operate enum: Started, Foreground, Bound, Executing
5367 optional android.service.procstats.ServiceOperationState operation = 1;
5368
5369 // Number of times the service was in this operation.
5370 optional int32 count = 2;
5371
5372 // Information about a state the service can be in.
5373 message StateStats {
5374 // Screen state enum.
5375 optional android.service.procstats.ScreenState screen_state = 1;
5376 // Memory state enum.
5377 optional android.service.procstats.MemoryState memory_state = 2;
5378
5379 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005380 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005381 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005382 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005383 }
5384 repeated StateStats state_stats = 3;
5385}
5386
5387message PackageServiceStatsProto {
5388 // Name of service component.
5389 optional string service_name = 1;
5390
5391 // The operation stats.
5392 // The package_name, package_uid, package_version, service_name will not be set to save space.
5393 repeated PackageServiceOperationStatsProto operation_stats = 2;
5394}
5395
5396message PackageAssociationSourceProcessStatsProto {
5397 // Uid of the process.
5398 optional int32 process_uid = 1;
5399 // Process name.
5400 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005401 // Package name.
5402 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005403 // Total count of the times this association appeared.
5404 optional int32 total_count = 3;
5405
5406 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005407 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005408
5409 // Total count of the times this association became actively impacting its target process.
5410 optional int32 active_count = 5;
5411
5412 // Information on one source in this association.
5413 message StateStats {
5414 // Process state enum.
5415 optional android.service.procstats.ProcessState process_state = 1;
5416 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005417 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005418 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005419 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005420 }
5421 repeated StateStats active_state_stats = 6;
5422}
5423
5424message PackageAssociationProcessStatsProto {
5425 // Name of the target component.
5426 optional string component_name = 1;
5427 // Information on one source in this association.
5428 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5429}
5430
5431
5432message ProcessStatsPackageProto {
5433 // Name of package.
5434 optional string package = 1;
5435
5436 // Uid of the package.
5437 optional int32 uid = 2;
5438
5439 // Version of the package.
5440 optional int64 version = 3;
5441
5442 // Stats for each process running with the package loaded in to it.
5443 repeated ProcessStatsProto process_stats = 4;
5444
5445 // Stats for each of the package's services.
5446 repeated PackageServiceStatsProto service_stats = 5;
5447
5448 // Stats for each association with the package.
5449 repeated PackageAssociationProcessStatsProto association_stats = 6;
5450}
5451
5452message ProcessStatsSectionProto {
5453 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005454 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005455
5456 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005457 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005458
5459 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005460 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005461
5462 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005463 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005464
5465 // System runtime library. e.g. "libdvm.so", "libart.so".
5466 optional string runtime = 5;
5467
5468 // whether kernel reports swapped pss.
5469 optional bool has_swapped_pss = 6;
5470
5471 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5472 enum Status {
5473 STATUS_UNKNOWN = 0;
5474 STATUS_COMPLETE = 1;
5475 STATUS_PARTIAL = 2;
5476 STATUS_SHUTDOWN = 3;
5477 STATUS_SYSPROPS = 4;
5478 }
5479 repeated Status status = 7;
5480
Chenjie Yub2ecc792019-01-17 10:27:26 -08005481 // Number of pages available of various types and sizes, representation fragmentation.
5482 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5483
Yangsteraf9aee72018-10-12 09:26:16 -07005484 // Stats for each process.
5485 repeated ProcessStatsProto process_stats = 8;
5486
5487 // Stats for each package.
5488 repeated ProcessStatsPackageProto package_stats = 9;
5489}
5490
Chenjie Yub2ecc792019-01-17 10:27:26 -08005491message ProcessStatsAvailablePagesProto {
5492 // Node these pages are in (as per /proc/pagetypeinfo)
5493 optional int32 node = 1;
5494
5495 // Zone these pages are in (as per /proc/pagetypeinfo)
5496 optional string zone = 2;
5497
5498 // Label for the type of these pages (as per /proc/pagetypeinfo)
5499 optional string label = 3;
5500
5501 // Distribution of number of pages available by order size. First entry in array is
5502 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5503 repeated int32 pages_per_order = 4;
5504}
5505
Chenjie Yu12e5e672018-09-14 15:54:59 -07005506/**
5507 * Pulled from ProcessStatsService.java
5508 */
5509message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005510 optional ProcessStatsSectionProto proc_stats_section = 1;
5511}
5512
Chenjie Yuf910b7802019-01-11 16:08:20 -08005513/**
5514 * Pulled from ProcessStatsService.java
5515 */
5516message ProcStatsPkgProc {
5517 optional ProcessStatsSectionProto proc_stats_section = 1;
5518}
5519
Chris Wrencdea3b72019-11-22 16:58:17 -05005520// Next Tag: 2
5521message PackageRemoteViewInfoProto {
5522 optional string package_name = 1;
5523 // add per-package additional info here (like channels)
5524}
5525
5526// Next Tag: 2
5527message NotificationRemoteViewsProto {
5528 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5529}
5530
5531/**
5532 * Pulled from NotificationManagerService.java
5533 */
5534message NotificationRemoteViews {
5535 optional NotificationRemoteViewsProto notification_remote_views = 1;
5536}
5537
Yotam Aron74299972020-01-16 16:20:58 +02005538/**
5539 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5540 */
5541message PackageNotificationPreferences {
5542 // Uid under which the package is installed.
5543 optional int32 uid = 1;
5544 // Notification importance, which specifies when and how a notification is displayed.
5545 // Specified under core/java/android/app/NotificationManager.java.
5546 optional int32 importance = 2;
5547 // Lockscreen visibility as set by the user.
5548 optional int32 visibility = 3;
5549 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5550 // PreferencesHelper.java)
5551 optional int32 user_locked_fields = 4;
5552}
5553
5554/**
5555 * Atom that contains a list of a package's channel preferences, pulled from
5556 * NotificationManagerService.java.
5557 */
5558message PackageNotificationChannelPreferences {
5559 // Uid under which the package is installed.
5560 optional int32 uid = 1;
5561 // Channel's ID. Should always be available.
5562 optional string channel_id = 2;
5563 // Channel's name. Should always be available.
5564 optional string channel_name = 3;
5565 // Channel's description. Optionally set by the channel creator.
5566 optional string description = 4;
5567 // Notification importance, which specifies when and how a notification is displayed. Specified
5568 // under core/java/android/app/NotificationManager.java.
5569 optional int32 importance = 5;
5570 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5571 // at core/java/android/app/NotificationChannel.java
5572 optional int32 user_locked_fields = 6;
5573 // Indicates if the channel was deleted by the app.
5574 optional bool is_deleted = 7;
5575}
5576
5577/**
5578 * Atom that contains a list of a package's channel group preferences, pulled from
5579 * NotificationManagerService.java.
5580 */
5581message PackageNotificationChannelGroupPreferences {
5582 // Uid under which the package is installed.
5583 optional int32 uid = 1;
5584 // Channel Group's ID. Should always be available.
5585 optional string group_id = 2;
5586 // Channel Group's name. Should always be available.
5587 optional string group_name = 3;
5588 // Channel Group's description. Optionally set by group creator.
5589 optional string description = 4;
5590 // Indicates if notifications from this channel group are blocked.
5591 optional bool is_blocked = 5;
5592 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5593 // at core/java/android/app/NotificationChannelGroup.java
5594 optional int32 user_locked_fields = 6;
5595}
5596
Yangsteraf9aee72018-10-12 09:26:16 -07005597message PowerProfileProto {
5598 optional double cpu_suspend = 1;
5599
5600 optional double cpu_idle = 2;
5601
5602 optional double cpu_active = 3;
5603
5604 message CpuCluster {
5605 optional int32 id = 1;
5606 optional double cluster_power = 2;
5607 optional int32 cores = 3;
5608 repeated int64 speed = 4;
5609 repeated double core_power = 5;
5610 }
5611
5612 repeated CpuCluster cpu_cluster = 40;
5613
5614 optional double wifi_scan = 4;
5615
5616 optional double wifi_on = 5;
5617
5618 optional double wifi_active = 6;
5619
5620 optional double wifi_controller_idle = 7;
5621
5622 optional double wifi_controller_rx = 8;
5623
5624 optional double wifi_controller_tx = 9;
5625
5626 repeated double wifi_controller_tx_levels = 10;
5627
5628 optional double wifi_controller_operating_voltage = 11;
5629
5630 optional double bluetooth_controller_idle = 12;
5631
5632 optional double bluetooth_controller_rx = 13;
5633
5634 optional double bluetooth_controller_tx = 14;
5635
5636 optional double bluetooth_controller_operating_voltage = 15;
5637
5638 optional double modem_controller_sleep = 16;
5639
5640 optional double modem_controller_idle = 17;
5641
5642 optional double modem_controller_rx = 18;
5643
5644 repeated double modem_controller_tx = 19;
5645
5646 optional double modem_controller_operating_voltage = 20;
5647
5648 optional double gps_on = 21;
5649
5650 repeated double gps_signal_quality_based = 22;
5651
5652 optional double gps_operating_voltage = 23;
5653
5654 optional double bluetooth_on = 24;
5655
5656 optional double bluetooth_active = 25;
5657
5658 optional double bluetooth_at_cmd = 26;
5659
5660 optional double ambient_display = 27;
5661
5662 optional double screen_on = 28;
5663
5664 optional double radio_on = 29;
5665
5666 optional double radio_scanning = 30;
5667
5668 optional double radio_active = 31;
5669
5670 optional double screen_full = 32;
5671
5672 optional double audio = 33;
5673
5674 optional double video = 34;
5675
5676 optional double flashlight = 35;
5677
5678 optional double memory = 36;
5679
5680 optional double camera = 37;
5681
5682 optional double wifi_batched_scan = 38;
5683
5684 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005685}
Chenjie Yuab530202018-09-26 12:39:20 -07005686
5687/**
5688 * power_profile.xml and other constants for power model calculations.
5689 * Pulled from PowerProfile.java
5690 */
5691message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005692 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005693}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005694
5695/**
arangelovd5db50e2018-10-12 20:24:39 +01005696 * Logs when a user restriction was added or removed.
5697 *
5698 * Logged from:
5699 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5700 */
5701message UserRestrictionChanged {
5702 // The raw string of the user restriction as defined in UserManager.
5703 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5704 optional string restriction = 1;
5705 // Whether the restriction is enabled or disabled.
5706 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005707}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005708
5709/**
5710 * Pulls process user time and system time. Puller takes a snapshot of all pids
5711 * in the system and returns cpu stats for those that are working at the time.
5712 * Dead pids will be dropped. Kernel processes are excluded.
5713 * Min cool-down is 5 sec.
5714 */
5715message ProcessCpuTime {
5716 optional int32 uid = 1 [(is_uid) = true];
5717
5718 optional string process_name = 2;
5719 // Process cpu time in user space, cumulative from boot/process start
5720 optional int64 user_time_millis = 3;
5721 // Process cpu time in system space, cumulative from boot/process start
5722 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005723}
Misha Wagner5a51e002018-10-03 15:04:09 +01005724
5725/**
5726 * Pulls the CPU usage for each thread.
5727 *
5728 * Read from /proc/$PID/task/$TID/time_in_state files.
5729 *
5730 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5731 * time_in_state files not being present on some phones, have not been addressed. These should be
5732 * considered before a public release.
5733 */
5734message CpuTimePerThreadFreq {
5735 // UID that owns the process.
5736 optional int32 uid = 1 [(is_uid) = true];
5737 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005738 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005739 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005740 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005741 // Name of the process taken from `/proc/$PID/cmdline`.
5742 optional string process_name = 4;
5743 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5744 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005745
5746 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5747 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5748 // frequencies are given here as the alternative is sending eight separate atoms. This method
5749 // significantly reduces the amount of data created
5750 optional int32 frequency1_khz = 6;
5751 optional int32 time1_millis = 7;
5752 optional int32 frequency2_khz = 8;
5753 optional int32 time2_millis = 9;
5754 optional int32 frequency3_khz = 10;
5755 optional int32 time3_millis = 11;
5756 optional int32 frequency4_khz = 12;
5757 optional int32 time4_millis = 13;
5758 optional int32 frequency5_khz = 14;
5759 optional int32 time5_millis = 15;
5760 optional int32 frequency6_khz = 16;
5761 optional int32 time6_millis = 17;
5762 optional int32 frequency7_khz = 18;
5763 optional int32 time7_millis = 19;
5764 optional int32 frequency8_khz = 20;
5765 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005766}
Bookatz75ee6042018-11-09 12:27:37 -08005767
5768/**
Bookatz366a4432018-11-20 09:42:33 -08005769 * Pulls information about the device's build.
5770 */
5771message BuildInformation {
5772 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5773 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5774 optional string fingerprint = 1;
5775
5776 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5777 optional string brand = 2;
5778
5779 // Build.PRODUCT. The name of the overall product.
5780 optional string product = 3;
5781
5782 // Build.DEVICE. The name of the industrial design.
5783 optional string device = 4;
5784
5785 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5786 optional string version_release = 5;
5787
5788 // Build.ID. E.g. a label like "M4-rc20".
5789 optional string id = 6;
5790
5791 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5792 // represent this build.
5793 optional string version_incremental = 7;
5794
5795 // Build.TYPE. The type of build, like "user" or "eng".
5796 optional string type = 8;
5797
5798 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5799 optional string tags = 9;
5800}
5801
5802/**
Adam He420947c2019-01-23 15:59:09 -08005803 * Logs information about mismatched caller for content capture.
5804 *
5805 * Logged from:
5806 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5807 */
5808message ContentCaptureCallerMismatchReported {
5809 optional string intended_package = 1;
5810 optional string calling_package = 2;
5811}
5812
5813/**
5814 * Logs information about content capture service events.
5815 *
5816 * Logged from:
5817 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5818 */
5819message ContentCaptureServiceEvents {
5820 // The type of event.
5821 enum Event {
5822 UNKNOWN = 0;
5823 ON_CONNECTED = 1;
5824 ON_DISCONNECTED = 2;
5825 SET_WHITELIST = 3;
5826 SET_DISABLED = 4;
5827 ON_USER_DATA_REMOVED = 5;
5828 }
5829 optional Event event = 1;
5830 // component/package of content capture service.
5831 optional string service_info = 2;
5832 // component/package of target.
5833 // it's a concatenated list of component/package for SET_WHITELIST event
5834 // separated by " ".
5835 optional string target_info = 3;
5836}
5837
5838/**
5839 * Logs information about content capture session events.
5840 *
5841 * Logged from:
5842 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5843 */
5844message ContentCaptureSessionEvents {
5845 // The type of event.
5846 enum Event {
5847 UNKNOWN = 0;
5848 ON_SESSION_STARTED = 1;
5849 ON_SESSION_FINISHED = 2;
5850 SESSION_NOT_CREATED = 3;
5851 }
5852 optional int32 session_id = 1;
5853 optional Event event = 2;
5854 // (n/a on session finished)
5855 optional int32 state_flags = 3;
5856 // component/package of content capture service.
5857 optional string service_info = 4;
5858 // component/package of app.
5859 // (n/a on session finished)
5860 optional string app_info = 5;
5861 optional bool is_child_session = 6;
5862}
5863
5864/**
5865 * Logs information about session being flushed.
5866 *
5867 * Logged from:
5868 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5869 */
5870message ContentCaptureFlushed {
5871 optional int32 session_id = 1;
5872 // component/package of content capture service.
5873 optional string service_info = 2;
5874 // component/package of app.
5875 optional string app_info = 3;
5876 // session start/finish events
5877 optional int32 child_session_started = 4;
5878 optional int32 child_session_finished = 5;
5879 // count of view events.
5880 optional int32 view_appeared_count = 6;
5881 optional int32 view_disappeared_count = 7;
5882 optional int32 view_text_changed_count = 8;
5883
5884 // Flush stats.
5885 optional int32 max_events = 9;
5886 optional int32 idle_flush_freq = 10;
5887 optional int32 text_flush_freq = 11;
5888 optional int32 flush_reason = 12;
5889}
5890
5891/**
Bookatz75ee6042018-11-09 12:27:37 -08005892 * Pulls on-device BatteryStats power use calculations for the overall device.
5893 */
5894message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005895 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5896 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5897 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5898 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005899}
5900
5901/**
5902 * Pulls on-device BatteryStats power use calculations broken down by uid.
5903 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5904 * that is attributed to non-uid items. They must all be included to get the total power use.
5905 */
5906message DeviceCalculatedPowerBlameUid {
5907 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5908 optional int32 uid = 1 [(is_uid) = true];
5909
Bookatz3dbc13a2018-12-21 12:16:51 -08005910 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5911 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5912 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005913}
5914
5915/**
5916 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5917 * drain type.
5918 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5919 * is attributed uids. They must all be included to get the total power use.
5920 */
5921message DeviceCalculatedPowerBlameOther {
5922 // The type of item whose power use is being reported.
5923 enum DrainType {
5924 AMBIENT_DISPLAY = 0;
5925 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5926 BLUETOOTH = 2;
5927 CAMERA = 3;
5928 // Cell-standby
5929 CELL = 4;
5930 FLASHLIGHT = 5;
5931 IDLE = 6;
5932 MEMORY = 7;
5933 // Amount that total computed drain exceeded the drain estimated using the
5934 // battery level changes and capacity.
5935 OVERCOUNTED = 8;
5936 PHONE = 9;
5937 SCREEN = 10;
5938 // Amount that total computed drain was below the drain estimated using the
5939 // battery level changes and capacity.
5940 UNACCOUNTED = 11;
5941 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5942 WIFI = 13;
5943 }
5944 optional DrainType drain_type = 1;
5945
Bookatz3dbc13a2018-12-21 12:16:51 -08005946 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5947 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5948 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005949}
arangelov4e994062018-11-13 16:12:38 +00005950
5951/**
5952 * Logs device policy features.
5953 *
5954 * Logged from:
5955 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5956 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5957 */
5958message DevicePolicyEvent {
5959 // The event id - unique for each event.
5960 optional android.stats.devicepolicy.EventId event_id = 1;
5961 // The admin package name.
5962 optional string admin_package_name = 2;
5963 // A generic integer parameter.
5964 optional int32 integer_value = 3;
5965 // A generic boolean parameter.
5966 optional bool boolean_value = 4;
5967 // A parameter specifying a time period in milliseconds.
5968 optional uint64 time_period_millis = 5;
5969 // A parameter specifying a list of package names, bundle extras or string parameters.
5970 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5971}
shawnlinea5b66b2018-11-13 15:05:29 +08005972
5973/**
5974 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5975 *
5976 * Logged from:
5977 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5978 */
5979message DocsUILaunchReported {
5980 optional android.stats.docsui.LaunchAction launch_action = 1;
5981 optional bool has_initial_uri = 2;
5982 optional android.stats.docsui.MimeType mime_type = 3;
5983 optional android.stats.docsui.Root initial_root = 4;
5984}
5985
5986/**
5987 * Logs root/app visited event in file managers/picker. Call this when the user
5988 * taps on root/app in hamburger menu.
5989 *
5990 * Logged from:
5991 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5992 */
5993message DocsUIRootVisitedReported {
5994 optional android.stats.docsui.ContextScope scope = 1;
5995 optional android.stats.docsui.Root root = 2;
5996}
5997
5998/**
5999 * Logs file operation stats. Call this when a file operation has completed.
6000 *
6001 * Logged from:
6002 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6003 */
6004message DocsUIFileOperationReported {
6005 optional android.stats.docsui.Provider provider = 1;
6006 optional android.stats.docsui.FileOperation file_op = 2;
6007}
6008
6009/**
6010 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6011 * mode.
6012 *
6013 * Logged from:
6014 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6015 */
6016message DocsUIFileOperationCopyMoveModeReported {
6017 optional android.stats.docsui.FileOperation file_op = 1;
6018 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6019}
6020
6021
6022/**
6023 * Logs file sub operation stats. Call this when a file operation has failed.
6024 *
6025 * Logged from:
6026 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6027 */
6028message DocsUIFileOperationFailureReported {
6029 optional android.stats.docsui.Authority authority = 1;
6030 optional android.stats.docsui.SubFileOperation sub_op = 2;
6031}
6032
6033/**
6034* Logs the cancellation of a file operation. Call this when a job is canceled
6035*
6036* Logged from:
6037* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6038*/
6039message DocsUIFileOperationCanceledReported {
6040 optional android.stats.docsui.FileOperation file_op = 1;
6041}
6042
6043/**
6044 * Logs startup time in milliseconds.
6045 *
6046 * Logged from:
6047 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6048 */
6049message DocsUIStartupMsReported {
6050 optional int32 startup_millis = 1;
6051}
6052
6053/**
6054 * Logs the action that was started by user.
6055 *
6056 * Logged from:
6057 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6058 */
6059message DocsUIUserActionReported {
6060 optional android.stats.docsui.UserAction action = 1;
6061}
6062
6063/**
6064 * Logs the invalid type when invalid scoped access is requested.
6065 *
6066 * Logged from:
6067 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6068 */
6069message DocsUIInvalidScopedAccessRequestReported {
6070 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006071}
Ben Murdochbab399f2018-12-06 11:01:38 +00006072
6073/**
shawnlina75e82d2019-01-07 10:31:12 +08006074 * Logs the package name that launches docsui picker mode.
6075 *
6076 * Logged from:
6077 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6078 */
6079message DocsUIPickerLaunchedFromReported {
6080 optional string package_name = 1;
6081}
6082
6083/**
6084 * Logs the search type.
6085 *
6086 * Logged from:
6087 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6088 */
6089message DocsUISearchTypeReported {
6090 optional android.stats.docsui.SearchType search_type = 1;
6091}
6092
6093/**
6094 * Logs the search mode.
6095 *
6096 * Logged from:
6097 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6098 */
6099message DocsUISearchModeReported {
6100 optional android.stats.docsui.SearchMode search_mode = 1;
6101}
6102
6103/**
6104 * Logs the pick result information.
6105 *
6106 * Logged from:
6107 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6108 */
6109message DocsUIPickResultReported {
6110 optional int32 total_action_count = 1;
6111 optional int64 duration_millis = 2;
6112 optional int32 file_count= 3;
6113 optional bool is_searching = 4;
6114 optional android.stats.docsui.Root picked_from = 5;
6115 optional android.stats.docsui.MimeType mime_type = 6;
6116 optional int32 repeatedly_pick_times = 7;
6117}
6118
6119/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006120 * Logs when an app's memory is compacted.
6121 *
6122 * Logged from:
6123 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6124 */
6125message AppCompacted {
6126 // The pid of the process being compacted.
6127 optional int32 pid = 1;
6128
6129 // The name of the process being compacted.
6130 optional string process_name = 2;
6131
6132 // The type of compaction.
6133 enum Action {
6134 UNKNOWN = 0;
6135 SOME = 1;
6136 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006137 PERSISTENT = 3;
6138 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006139 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006140 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006141
6142 // Total RSS in kilobytes consumed by the process prior to compaction.
6143 optional int64 before_rss_total_kilobytes = 4;
6144
6145 // File RSS in kilobytes consumed by the process prior to compaction.
6146 optional int64 before_rss_file_kilobytes = 5;
6147
6148 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6149 optional int64 before_rss_anon_kilobytes = 6;
6150
6151 // Swap in kilobytes consumed by the process prior to compaction.
6152 optional int64 before_swap_kilobytes = 7;
6153
6154 // Total RSS in kilobytes consumed by the process after compaction.
6155 optional int64 after_rss_total_kilobytes = 8;
6156
6157 // File RSS in kilobytes consumed by the process after compaction.
6158 optional int64 after_rss_file_kilobytes = 9;
6159
6160 // Anonymous RSS in kilobytes consumed by the process after compaction.
6161 optional int64 after_rss_anon_kilobytes = 10;
6162
6163 // Swap in kilobytes consumed by the process after compaction.
6164 optional int64 after_swap_kilobytes = 11;
6165
6166 // The time taken to perform compaction in milliseconds.
6167 optional int64 time_to_compact_millis = 12;
6168
6169 // The last compaction action performed for this app.
6170 optional Action last_action = 13;
6171
Ben Murdoch01720b82018-12-19 18:03:44 +00006172 // The last time that compaction was attempted on this process in milliseconds
6173 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6174 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006175
Ben Murdoch885c21b2019-03-15 18:02:04 +00006176 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006177 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006178
6179 // The process state at the time of compaction.
6180 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006181
6182 // Free ZRAM in kilobytes before compaction.
6183 optional int64 before_zram_free_kilobytes = 17;
6184
6185 // Free ZRAM in kilobytes after compaction.
6186 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006187}
lifr157fc552018-12-12 16:38:04 +08006188
6189/**
lifrb6b90b62019-03-29 00:40:17 +08006190 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6191 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6192 *
lifr1f74b052019-04-16 22:16:30 +08006193 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6194 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6195 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6196 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006197 */
6198message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006199 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006200
lifr1f74b052019-04-16 22:16:30 +08006201 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006202
6203 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006204 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006205
lifr1f74b052019-04-16 22:16:30 +08006206 // Only valid for event_type = EVENT_GETADDRINFO.
6207 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006208
lifr1f74b052019-04-16 22:16:30 +08006209 // Flags passed to android_res_nsend() defined in multinetwork.h
6210 // Only valid for event_type = EVENT_RESNSEND.
6211 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006212
lifrad9becc2019-05-20 11:04:41 +08006213 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006214
6215 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006216 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006217
6218 // Additional pass-through fields opaque to statsd.
6219 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006220 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006221
6222 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6223 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006224}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006225
6226/**
6227 * Logs when a data stall event occurs.
6228 *
6229 * Log from:
6230 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6231 */
6232message DataStallEvent {
6233 // Data stall evaluation type.
6234 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6235 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6236 optional int32 evaluation_type = 1;
6237 // See definition in data_stall_event.proto.
6238 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6239 // See definition in data_stall_event.proto.
6240 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6241 // See definition in data_stall_event.proto.
6242 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6243 // See definition in data_stall_event.proto.
6244 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6245 // See definition in data_stall_event.proto.
6246 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6247}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006248
6249/*
6250 * Logs when RescueParty resets some set of experiment flags.
6251 *
6252 * Logged from:
6253 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6254 */
6255message RescuePartyResetReported {
6256 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6257 optional int32 rescue_level = 1;
6258}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006259
6260/**
6261 * Logs when signed config is received from an APK, and if that config was applied successfully.
6262 * Logged from:
6263 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6264 */
6265message SignedConfigReported {
6266 enum Type {
6267 UNKNOWN_TYPE = 0;
6268 GLOBAL_SETTINGS = 1;
6269 }
6270 optional Type type = 1;
6271
6272 // The final status of the signed config received.
6273 enum Status {
6274 UNKNOWN_STATUS = 0;
6275 APPLIED = 1;
6276 BASE64_FAILURE_CONFIG = 2;
6277 BASE64_FAILURE_SIGNATURE = 3;
6278 SECURITY_EXCEPTION = 4;
6279 INVALID_CONFIG = 5;
6280 OLD_CONFIG = 6;
6281 SIGNATURE_CHECK_FAILED = 7;
6282 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006283 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006284 }
6285 optional Status status = 2;
6286
6287 // The version of the signed config processed.
6288 optional int32 version = 3;
6289
6290 // The package name that the config was extracted from.
6291 optional string from_package = 4;
6292
6293 enum Key {
6294 NO_KEY = 0;
6295 DEBUG = 1;
6296 PRODUCTION = 2;
6297 }
6298 // Which key was used to verify the config.
6299 optional Key verified_with = 5;
6300}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006301
6302/*
6303 * Logs GNSS Network-Initiated (NI) location events.
6304 *
6305 * Logged from:
6306 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6307 */
6308message GnssNiEventReported {
6309 // The type of GnssNiEvent.
6310 enum EventType {
6311 UNKNOWN = 0;
6312 NI_REQUEST = 1;
6313 NI_RESPONSE = 2;
6314 }
6315 optional EventType event_type = 1;
6316
6317 // An ID generated by HAL to associate NI notifications and UI responses.
6318 optional int32 notification_id = 2;
6319
6320 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006321 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006322
6323 // NI requires notification.
6324 optional bool need_notify = 4;
6325
6326 // NI requires verification.
6327 optional bool need_verify = 5;
6328
6329 // NI requires privacy override, no notification/minimal trace.
6330 optional bool privacy_override = 6;
6331
6332 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6333 // seconds.
6334 optional int32 timeout = 7;
6335
6336 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006337 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006338
6339 // String representing the requester of the network inititated location request.
6340 optional string requestor_id = 9;
6341
6342 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6343 // network initiated location request.
6344 optional string text = 10;
6345
6346 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006347 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006348
6349 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006350 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006351
6352 // True if SUPL ES is enabled.
6353 optional bool is_supl_es_enabled = 13;
6354
6355 // True if GNSS location is enabled.
6356 optional bool is_location_enabled = 14;
6357
6358 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006359 optional android.server.location.GnssUserResponseType user_response = 15;
6360}
6361
6362/**
6363 * Logs GNSS non-framework (NFW) location notification.
6364 *
6365 * Logged from:
6366 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6367 */
6368message GnssNfwNotificationReported {
6369 // Package name of the Android proxy application representing the non-framework entity that
6370 // requested location. Set to empty string if unknown.
6371 optional string proxy_app_package_name = 1;
6372
6373 // Protocol stack that initiated the non-framework location request.
6374 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6375
6376 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6377 // set to empty string. This field is opaque to the framework and used for logging purposes.
6378 optional string other_protocol_stack_name = 3;
6379
6380 // Source initiating/receiving the location information.
6381 optional android.server.location.NfwRequestor requestor = 4;
6382
6383 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6384 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6385 // and used for logging purposes.
6386 optional string requestor_id = 5;
6387
6388 // Indicates whether location information was provided for this request.
6389 optional android.server.location.NfwResponseType response_type = 6;
6390
6391 // True if the device is in user initiated emergency session.
6392 optional bool in_emergency_mode = 7;
6393
6394 // True if cached location is provided.
6395 optional bool is_cached_location = 8;
6396
6397 // True if proxy app permission mismatch between framework and GNSS HAL.
6398 optional bool is_permission_mismatched = 9;
6399}
6400
6401/**
6402 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6403 *
6404 * Logged from:
6405 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6406 */
6407message GnssConfigurationReported {
6408 // SUPL host name.
6409 optional string supl_host = 1;
6410
6411 // SUPL port number.
6412 optional int32 supl_port = 2;
6413
6414 // C2K host name.
6415 optional string c2k_host = 3;
6416
6417 // C2K port number.
6418 optional int32 c2k_port = 4;
6419
6420 // The SUPL version requested by Carrier.
6421 optional int32 supl_ver = 5;
6422
6423 // The SUPL mode.
6424 optional android.server.location.SuplMode supl_mode = 6;
6425
6426 // True if NI emergency SUPL restrictions is enabled.
6427 optional bool supl_es = 7;
6428
6429 // LTE Positioning Profile settings
6430 optional android.server.location.LppProfile lpp_profile = 8;
6431
6432 // Positioning protocol on A-Glonass system.
6433 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6434
6435 // True if emergency PDN is used. Otherwise, regular PDN is used.
6436 optional bool use_emergency_pdn_for_emergency_supl= 10;
6437
6438 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6439 optional android.server.location.GpsLock gps_lock = 11;
6440
6441 // Number of seconds to extend the emergency session duration post emergency call.
6442 optional int32 es_extension_sec = 12;
6443
6444 // The full list of package names of proxy Android applications representing the non-framework
6445 // location access entities (on/off the device) for which the framework user has granted
6446 // non-framework location access permission. The package names are concatenated in one string
6447 // with spaces as separators.
6448 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006449}
Jack Yu95b64f32018-12-13 18:26:11 +08006450
6451/**
6452 * Logs when a NFC device's error occurred.
6453 * Logged from:
6454 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6455 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6456 */
6457message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006458 enum Type {
6459 UNKNOWN = 0;
6460 CMD_TIMEOUT = 1;
6461 ERROR_NOTIFICATION = 2;
6462 AID_OVERFLOW = 3;
6463 }
6464 optional Type type = 1;
6465 // If it's nci cmd timeout, log the timeout command.
6466 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006467
Alex Salod7c3eef2019-01-25 14:43:27 -08006468 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006469}
6470
6471/**
6472 * Logs when a NFC device's state changed event
6473 * Logged from:
6474 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6475 */
6476message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006477 enum State {
6478 UNKNOWN = 0;
6479 OFF = 1;
6480 ON = 2;
6481 ON_LOCKED = 3; // Secure Nfc enabled.
6482 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6483 }
6484 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006485}
6486
6487/**
6488 * Logs when a NFC Beam Transaction occurred.
6489 * Logged from:
6490 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6491 */
6492message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006493 enum Operation {
6494 UNKNOWN = 0;
6495 SEND = 1;
6496 RECEIVE = 2;
6497 }
6498 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006499}
6500
6501/**
6502 * Logs when a NFC Card Emulation Transaction occurred.
6503 * Logged from:
6504 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6505 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6506 */
6507message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006508 enum Category {
6509 UNKNOWN = 0;
6510 HCE_PAYMENT = 1;
6511 HCE_OTHER = 2;
6512 OFFHOST = 3;
6513 }
6514 // Transaction belongs to HCE payment or HCE other category, or offhost.
6515 optional Category category = 1;
6516 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6517 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006518}
6519
6520/**
6521 * Logs when a NFC Tag event occurred.
6522 * Logged from:
6523 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6524 */
6525message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006526 enum Type {
6527 UNKNOWN = 0;
6528 URL = 1;
6529 BT_PAIRING = 2;
6530 PROVISION = 3;
6531 WIFI_CONNECT = 4;
6532 APP_LAUNCH = 5;
6533 OTHERS = 6;
6534 }
6535 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006536}
6537
6538/**
6539 * Logs when Hce transaction triggered
6540 * Logged from:
6541 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6542 */
6543message NfcHceTransactionOccurred {
6544 // The latency period(in microseconds) it took for the first HCE data
6545 // exchange.
6546 optional uint32 latency_micros = 1;
6547}
6548
6549/**
6550 * Logs when SecureElement state event changed
6551 * Logged from:
6552 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6553 */
6554message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006555 enum State {
6556 UNKNOWN = 0;
6557 INITIALIZED = 1;
6558 DISCONNECTED = 2;
6559 CONNECTED = 3;
6560 HALCRASH = 4;
6561 }
6562 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006563
Alex Salod7c3eef2019-01-25 14:43:27 -08006564 optional string state_change_reason = 2;
6565 // SIMx or eSEx.
6566 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006567}
6568
6569/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006570 * Information about a permission grant request
6571 */
6572message PermissionGrantRequestResultReported {
6573 // unique value identifying an API call. A API call might result in multiple of these atoms
6574 optional int64 request_id = 1;
6575
6576 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006577 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006578
6579 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006580 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006581
6582 // The permission to be granted
6583 optional string permission_name = 4;
6584
6585 // If the permission was explicitly requested via the API or added by the system
6586 optional bool is_implicit = 5;
6587
6588 enum Result {
6589 UNDEFINED = 0;
6590 // permission request was ignored
6591 IGNORED = 1;
6592 // permission request was ignored because it was user fixed
6593 IGNORED_USER_FIXED = 2;
6594 // permission request was ignored because it was policy fixed
6595 IGNORED_POLICY_FIXED = 3;
6596 // permission was granted by user action
6597 USER_GRANTED = 4;
6598 // permission was automatically granted
6599 AUTO_GRANTED = 5;
6600 // permission was denied by user action
6601 USER_DENIED = 6;
6602 // permission was denied with prejudice by the user
6603 USER_DENIED_WITH_PREJUDICE = 7;
6604 // permission was automatically denied
6605 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006606 // permission request was ignored because permission is restricted
6607 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006608 // one time permission was granted by user action
6609 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006610 // user ignored request by leaving the request screen without choosing any option
6611 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006612 // user granted the permission after being linked to settings
6613 USER_GRANTED_IN_SETTINGS = 12;
6614 // user denied the permission after being linked to settings
6615 USER_DENIED_IN_SETTINGS = 13;
6616 // user denied the permission with prejudice after being linked to settings
6617 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6618 // permission was automatically revoked after one-time permission expired
6619 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006620 // permission was automatically revoked for unused app
6621 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006622 }
6623 // The result of the permission grant
6624 optional Result result = 6;
6625}
6626
6627/**
Jack Yu95b64f32018-12-13 18:26:11 +08006628 * Logs when Omapi API used
6629 * Logged from:
6630 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6631 */
6632message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006633 enum Operation {
6634 UNKNOWN = 0;
6635 OPEN_CHANNEL = 1;
6636 }
6637 optional Operation operation = 1;
6638 // SIMx or eSEx.
6639 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006640
Alex Salod7c3eef2019-01-25 14:43:27 -08006641 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006642}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006643
6644/**
Alex Saloa060aee2019-01-21 14:36:41 -08006645 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6646 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006647 * Logged from:
6648 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6649 */
6650message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006651 optional int64 dispatch_latency_millis = 1;
6652}
6653
6654/**
6655 * Logs AttentionManagerService attention check result.
6656 *
6657 * Logged from:
6658 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6659 */
6660message AttentionManagerServiceResultReported {
6661 // See core/java/android/service/attention/AttentionService.java
6662 enum AttentionCheckResult {
6663 UNKNOWN = 20;
6664 ATTENTION_SUCCESS_ABSENT = 0;
6665 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006666 ATTENTION_FAILURE_UNKNOWN = 2;
6667 ATTENTION_FAILURE_CANCELLED = 3;
6668 ATTENTION_FAILURE_PREEMPTED = 4;
6669 ATTENTION_FAILURE_TIMED_OUT = 5;
6670 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006671 }
6672 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006673}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006674
6675/**
6676 * Logs when an adb connection changes state.
6677 *
6678 * Logged from:
6679 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6680 */
6681message AdbConnectionChanged {
6682 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6683 // previously selected for this system.
6684 optional int64 last_connection_time_millis = 1;
6685
6686 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6687 // to reconnect via adb without user interaction.
6688 optional int64 auth_window_millis = 2;
6689
6690 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6691 optional android.debug.AdbConnectionStateEnum state = 3;
6692
6693 // True if the 'always allow' option was selected for this system.
6694 optional bool always_allow = 4;
6695}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006696
6697/*
6698 * Logs the reported speech DSP status.
6699 *
6700 * Logged from:
6701 * Vendor audio implementation.
6702 */
6703message SpeechDspStatReported {
6704 // The total Speech DSP uptime in milliseconds.
6705 optional int32 total_uptime_millis = 1;
6706 // The total Speech DSP downtime in milliseconds.
6707 optional int32 total_downtime_millis = 2;
6708 optional int32 total_crash_count = 3;
6709 optional int32 total_recover_count = 4;
6710}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006711
6712/**
6713 * Logs USB connector contaminant status.
6714 *
6715 * Logged from: USB Service.
6716 */
6717message UsbContaminantReported {
6718 optional string id = 1;
6719 optional android.service.usb.ContaminantPresenceStatus status = 2;
6720}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006721
6722/**
6723 * This atom is for debugging purpose.
6724 */
6725message DebugElapsedClock {
6726 // Monotically increasing value for each pull.
6727 optional int64 pull_count = 1;
6728 // Time from System.elapsedRealtime.
6729 optional int64 elapsed_clock_millis = 2;
6730 // Time from System.elapsedRealtime.
6731 optional int64 same_elapsed_clock_millis = 3;
6732 // Diff between current elapsed time and elapsed time from previous pull.
6733 optional int64 elapsed_clock_diff_millis = 4;
6734
6735 enum Type {
6736 TYPE_UNKNOWN = 0;
6737 ALWAYS_PRESENT = 1;
6738 PRESENT_ON_ODD_PULLS = 2;
6739 }
6740 // Type of behavior for the pulled data.
6741 optional Type type = 5;
6742}
6743
6744/**
6745 * This atom is for debugging purpose.
6746 */
6747message DebugFailingElapsedClock {
6748 // Monotically increasing value for each pull.
6749 optional int64 pull_count = 1;
6750 // Time from System.elapsedRealtime.
6751 optional int64 elapsed_clock_millis = 2;
6752 // Time from System.elapsedRealtime.
6753 optional int64 same_elapsed_clock_millis = 3;
6754 // Diff between current elapsed time and elapsed time from previous pull.
6755 optional int64 elapsed_clock_diff_millis = 4;
6756}
Steven Wuacef6bb2019-01-23 14:21:17 -05006757
6758/** Logs System UI bubbles event changed.
6759 *
6760 * Logged from:
6761 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6762 */
6763message BubbleUIChanged {
6764
6765 // The app package that is posting the bubble.
6766 optional string package_name = 1;
6767
6768 // The notification channel that is posting the bubble.
6769 optional string notification_channel = 2;
6770
6771 // The notification id associated with the posted bubble.
6772 optional int32 notification_id = 3;
6773
6774 // The position of the bubble within the bubble stack.
6775 optional int32 position = 4;
6776
6777 // The total number of bubbles within the bubble stack.
6778 optional int32 total_number = 5;
6779
6780 // User interactions with the bubble.
6781 enum Action {
6782 UNKNOWN = 0;
6783 POSTED = 1;
6784 UPDATED = 2;
6785 EXPANDED = 3;
6786 COLLAPSED = 4;
6787 DISMISSED = 5;
6788 STACK_DISMISSED = 6;
6789 STACK_MOVED = 7;
6790 HEADER_GO_TO_APP = 8;
6791 HEADER_GO_TO_SETTINGS = 9;
6792 PERMISSION_OPT_IN = 10;
6793 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006794 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006795 SWIPE_LEFT = 13;
6796 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006797 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006798 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006799 }
6800 optional Action action = 6;
6801
6802 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6803 optional float normalized_x_position = 7;
6804 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006805
6806 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6807 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006808
6809 // Whether the bubble is an on-going one.
6810 optional bool is_ongoing = 10;
6811
6812 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006813 // This is deprecated and the value should be ignored.
6814 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006815}
Kweku Adams8845d012018-12-11 20:06:45 -08006816
6817/**
Steven Wu552f63f2019-02-05 13:41:36 -05006818 * Logs System UI bubbles developer errors.
6819 *
6820 * Logged from:
6821 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6822 */
6823message BubbleDeveloperErrorReported {
6824
6825 // The app package that is posting the bubble.
6826 optional string package_name = 1;
6827
6828 // Bubble developer error type enums.
6829 enum Error {
6830 UNKNOWN = 0;
6831 ACTIVITY_INFO_MISSING = 1;
6832 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6833 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6834 }
6835 optional Error error = 2 [default = UNKNOWN];
6836}
6837
6838/**
Kweku Adams8845d012018-12-11 20:06:45 -08006839 * Logs that a constraint for a scheduled job has changed.
6840 *
6841 * Logged from:
6842 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6843 */
6844message ScheduledJobConstraintChanged {
6845 repeated AttributionNode attribution_node = 1;
6846
6847 // Name of the job.
6848 optional string job_name = 2;
6849
6850 optional com.android.server.job.ConstraintEnum constraint = 3;
6851
6852 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006853 UNKNOWN = 0;
6854 UNSATISFIED = 1;
6855 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006856 }
6857 optional State state = 4;
6858}
Alex Salod7c3eef2019-01-25 14:43:27 -08006859
6860/**
6861 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6862 * returns true.
6863 *
6864 * Logged from:
6865 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6866 */
6867message ScreenTimeoutExtensionReported {
6868 // Describes how many times in a row did the power manager reset the screen off timeout.
6869 optional uint32 consecutive_timeout_extended_count = 1;
6870}
Hui Yu885aca12019-01-10 17:11:34 -08006871
6872/*
6873* Logs number of milliseconds it takes to start a process.
6874* The definition of app process start time is from the app launch time to
6875* the time that Zygote finished forking the app process and loaded the
6876* application package's java classes.
6877
6878* This metric is different from AppStartOccurred which is for foreground
6879* activity only.
6880
6881* ProcessStartTime can report all processes (both foreground and background)
6882* start time.
6883*
6884* Logged from:
6885* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6886*/
6887message ProcessStartTime {
6888 // The uid of the ProcessRecord.
6889 optional int32 uid = 1 [(is_uid) = true];
6890
6891 // The process pid.
6892 optional int32 pid = 2;
6893
6894 // The process name.
6895 // Usually package name, "system" for system server.
6896 // Provided by ActivityManagerService.
6897 optional string process_name = 3;
6898
6899 enum StartType {
6900 UNKNOWN = 0;
6901 WARM = 1;
6902 HOT = 2;
6903 COLD = 3;
6904 }
6905
6906 // The start type.
6907 optional StartType type = 4;
6908
6909 // The elapsed realtime at the start of the process.
6910 optional int64 process_start_time_millis = 5;
6911
6912 // Number of milliseconds it takes to reach bind application.
6913 optional int32 bind_application_delay_millis = 6;
6914
6915 // Number of milliseconds it takes to finish start of the process.
6916 optional int32 process_start_delay_millis = 7;
6917
6918 // hostingType field in ProcessRecord, the component type such as "activity",
6919 // "service", "content provider", "broadcast" or other strings.
6920 optional string hosting_type = 8;
6921
6922 // hostingNameStr field in ProcessRecord. The component class name that runs
6923 // in this process.
6924 optional string hosting_name = 9;
6925}
6926
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006927/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006928 * Track Media Codec usage
6929 * Logged from:
6930 * frameworks/av/media/libstagefright/MediaCodec.cpp
6931 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6932 */
6933message MediametricsCodecReported {
6934 optional int64 timestamp_nanos = 1;
6935 optional string package_name = 2;
6936 optional int64 package_version_code = 3;
6937 optional int64 media_apex_version = 4;
6938
6939 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6940}
6941
6942/**
6943 * Track Media Extractor (pulling video/audio streams out of containers) usage
6944 * Logged from:
6945 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6946 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6947 */
6948message MediametricsExtractorReported {
6949 optional int64 timestamp_nanos = 1;
6950 optional string package_name = 2;
6951 optional int64 package_version_code = 3;
6952 optional int64 media_apex_version = 4;
6953
6954 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6955}
6956
6957/**
6958 * Track how we arbitrate between microphone/input requests.
6959 * Logged from
6960 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6961 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6962 */
6963message MediametricsAudiopolicyReported {
6964 optional int64 timestamp_nanos = 1;
6965 optional string package_name = 2;
6966 optional int64 package_version_code = 3;
6967 optional int64 media_apex_version = 4;
6968
6969 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6970}
6971
6972/**
6973 * Track how we arbitrate between microphone requests.
6974 * Logged from
6975 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6976 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6977 */
6978message MediametricsAudiorecordReported {
6979 optional int64 timestamp_nanos = 1;
6980 optional string package_name = 2;
6981 optional int64 package_version_code = 3;
6982 optional int64 media_apex_version = 4;
6983
6984 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6985}
6986
6987/**
6988 * Track how we arbitrate between microphone/input requests.
6989 * Logged from
6990 * frameworks/av/media/libnblog/ReportPerformance.cpp
6991 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6992 */
6993message MediametricsAudiothreadReported {
6994 optional int64 timestamp_nanos = 1;
6995 optional string package_name = 2;
6996 optional int64 package_version_code = 3;
6997 optional int64 media_apex_version = 4;
6998
6999 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7000}
7001
7002/**
7003 * Track how we arbitrate between microphone/input requests.
7004 * Logged from
7005 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7006 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7007 */
7008message MediametricsAudiotrackReported {
7009 optional int64 timestamp_nanos = 1;
7010 optional string package_name = 2;
7011 optional int64 package_version_code = 3;
7012 optional int64 media_apex_version = 4;
7013
7014 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7015}
7016
7017/**
7018 * Track information about DRM framework performance
7019 * Logged from
7020 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7021 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7022 */
7023message MediametricsMediadrmReported {
7024 optional int64 timestamp_nanos = 1;
7025 optional string package_name = 2;
7026 optional int64 package_version_code = 3;
7027 optional int64 media_apex_version = 4;
7028
7029 // vendor+description tell about which DRM plugin is in use on this device
7030 optional string vendor = 5;
7031 optional string description = 6;
7032 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7033 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7034}
7035
7036/**
7037 * Track information about the widevine DRM plugin performance
7038 * Logged from
7039 * vendor/widevine/libwvdrmengine/cdm/metrics
7040 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7041 */
7042message MediametricsDrmWidevineReported {
7043 optional int64 timestamp_nanos = 1;
7044 optional string package_name = 2;
7045 optional int64 package_version_code = 3;
7046 optional int64 media_apex_version = 4;
7047
7048 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7049}
7050
7051/**
7052 * Track information about recordings (e.g. camcorder)
7053 * Logged from
7054 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7055 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7056 */
7057message MediametricsRecorderReported {
7058 optional int64 timestamp_nanos = 1;
7059 optional string package_name = 2;
7060 optional int64 package_version_code = 3;
7061 optional int64 media_apex_version = 4;
7062
7063 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7064}
7065
7066/**
7067 * Track Media Player usage
7068 * Logged from:
7069 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7070 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7071 */
7072message MediametricsNuPlayerReported {
7073 optional int64 timestamp_nanos = 1;
7074 optional string package_name = 2;
7075 optional int64 package_version_code = 3;
7076 optional int64 media_apex_version = 4;
7077
7078 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7079}
7080
7081/**
Robert Shiha4beed32019-08-19 14:15:23 -07007082 * Track Legacy DRM usage
7083 * Logged from
7084 * frameworks/av/drm/drmserver/DrmManager.cpp
7085 */
7086message MediametricsDrmManagerReported {
7087 optional int64 timestamp_nanos = 1;
7088 optional string package_name = 2;
7089 optional int64 package_version_code = 3;
7090 optional int64 media_apex_version = 4;
7091
7092 enum Method {
7093 METHOD_NOT_FOUND = -1;
7094 GET_CONSTRAINTS = 0;
7095 GET_METADATA = 1;
7096 CAN_HANDLE = 2;
7097 PROCESS_DRM_INFO = 3;
7098 ACQUIRE_DRM_INFO = 4;
7099 SAVE_RIGHTS = 5;
7100 GET_ORIGINAL_MIME_TYPE = 6;
7101 GET_DRM_OBJECT_TYPE = 7;
7102 CHECK_RIGHTS_STATUS = 8;
7103 REMOVE_RIGHTS = 9;
7104 REMOVE_ALL_RIGHTS = 10;
7105 OPEN_CONVERT_SESSION = 11;
7106 OPEN_DECRYPT_SESSION = 12;
7107 }
7108
7109 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7110 optional string plugin_id = 5;
7111 optional string description = 6;
7112 optional Method method = 7;
7113 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007114
7115 optional int64 get_constraints_count = 9;
7116 optional int64 get_metadata_count = 10;
7117 optional int64 can_handle_count = 11;
7118 optional int64 process_drm_info_count = 12;
7119 optional int64 acquire_drm_info_count = 13;
7120 optional int64 save_rights_count = 14;
7121 optional int64 get_original_mime_type_count = 15;
7122 optional int64 get_drm_object_type_count = 16;
7123 optional int64 check_rights_status_count = 17;
7124 optional int64 remove_rights_count = 18;
7125 optional int64 remove_all_rights_count = 19;
7126 optional int64 open_convert_session_count = 20;
7127 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007128}
7129
7130/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007131 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007132 * Pulled from: StatsCompanionService
7133*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007134message DangerousPermissionState {
7135 // Name of the permission
7136 optional string permission_name = 1;
7137
7138 // Uid of the package
7139 optional int32 uid = 2 [(is_uid) = true];
7140
7141 // Package requesting the permission
7142 optional string package_name = 3;
7143
7144 // If the permission is granted to the uid
7145 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007146
7147 // Permission flags as per android.content.pm.PermissionFlags
7148 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007149}
7150
Michael Groover4a0ca942019-01-24 17:41:25 -08007151/**
7152 * Logs when a package is denied access to a device identifier based on the new access requirements.
7153 *
7154 * Logged from:
7155 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7156 */
7157message DeviceIdentifierAccessDenied {
7158 // The name of the package denied access to the requested device identifier.
7159 optional string package_name = 1;
7160
7161 // The name of the device identifier method the package attempted to invoke.
7162 optional string method_name = 2;
7163
7164 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007165 // Starting from Android 11, this boolean is not set and will always be false.
7166 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007167
7168 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007169 // Starting from Android 11, this boolean is not set and will always be false.
7170 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007171}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007172
7173/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007174 * Pulls the ongoing mainline install train version code.
7175 * Pulled from StatsCompanionService
7176 */
7177message TrainInfo {
7178 optional int64 train_version_code = 1;
7179
7180 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007181
7182 optional string train_name = 3;
7183
7184 enum Status {
7185 UNKNOWN = 0;
7186 INSTALL_REQUESTED = 1;
7187 INSTALL_STARTED = 2;
7188 INSTALL_STAGED_NOT_READY = 3;
7189 INSTALL_STAGED_READY = 4;
7190 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007191 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7192 // and INSTALL_FAILURE_COMMIT.
7193 INSTALL_FAILURE = 6 [deprecated = true];
7194 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007195 INSTALL_CANCELLED = 7;
7196 INSTALLER_ROLLBACK_REQUESTED = 8;
7197 INSTALLER_ROLLBACK_INITIATED = 9;
7198 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7199 INSTALLER_ROLLBACK_STAGED = 11;
7200 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7201 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7202 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7203 INSTALLER_ROLLBACK_SUCCESS = 15;
7204 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007205 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7206 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7207 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7208 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7209 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7210 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007211 INSTALL_FAILURE_DOWNLOAD = 23;
7212 INSTALL_FAILURE_STATE_MISMATCH = 24;
7213 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007214 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007215 }
7216 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007217}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007218
7219/**
7220 * Logs the gesture stage changed event.
7221 *
7222 * Logged from:
7223 * frameworks/base/packages/SystemUI/
7224 */
7225message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007226 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007227}
7228
7229/**
7230 * Logs the feedback type.
7231 *
7232 * Logged from:
7233 * frameworks/base/packages/SystemUI/
7234 */
7235message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007236 // Whether or not the gesture was used.
7237 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007238}
7239
7240/**
7241 * Logs the progress.
7242 *
7243 * Logged from:
7244 * frameworks/base/packages/SystemUI/
7245 */
7246message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007247 // [0,100] progress for the assist gesture.
7248 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007249}
Neil Fullerdb14b482019-02-05 19:44:44 +00007250
7251/*
7252 * Information about the time zone data on a device.
7253 */
7254message TimeZoneDataInfo {
7255 // A version identifier for the data set on device. e.g. "2018i"
7256 optional string tzdb_version = 1;
7257}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007258
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007259/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007260 * Logs the GPU stats global health information.
7261 *
7262 * Logged from:
7263 * frameworks/native/services/gpuservice/gpustats/
7264 */
7265message GpuStatsGlobalInfo {
7266 // Package name of the gpu driver.
7267 optional string driver_package_name = 1;
7268
7269 // Version name of the gpu driver.
7270 optional string driver_version_name = 2;
7271
7272 // Version code of the gpu driver.
7273 optional int64 driver_version_code = 3;
7274
7275 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7276 optional int64 driver_build_time = 4;
7277
7278 // Total count of the gl driver gets loaded.
7279 optional int64 gl_loading_count = 5;
7280
7281 // Total count of the gl driver fails to be loaded.
7282 optional int64 gl_loading_failure_count = 6;
7283
7284 // Total count of the Vulkan driver gets loaded.
7285 optional int64 vk_loading_count = 7;
7286
7287 // Total count of the Vulkan driver fails to be loaded.
7288 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007289
7290 // Api version of the system Vulkan driver.
7291 optional int32 vulkan_version = 9;
7292
7293 // Api version of the system CPU Vulkan driver.
7294 optional int32 cpu_vulkan_version = 10;
7295
7296 // Api version of the system GLES driver.
7297 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007298
7299 // Total count of the angle driver gets loaded.
7300 optional int64 angle_loading_count = 12;
7301
7302 // Total count of the angle driver fails to be loaded.
7303 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007304}
7305
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007306/**
7307 * GPU driver loading time info.
7308 */
7309message GpuDriverLoadingTime {
7310 // List of all the driver loading times for this app. The list size is
7311 // capped at 50.
7312 repeated int64 driver_loading_time = 1;
7313}
7314
7315/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007316 * Logs the GPU stats per app health information.
7317 *
7318 * Logged from:
7319 * frameworks/native/services/gpuservice/gpustats/
7320 */
7321message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007322 // Package name of the application that loads the gpu driver. Total number
7323 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007324 optional string app_package_name = 1;
7325
7326 // Version code of the gpu driver this app loads.
7327 optional int64 driver_version_code = 2;
7328
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007329 // gl driver loading time info.
7330 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7331 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007332
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007333 // Vulkan driver loading time info.
7334 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7335 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007336
7337 // Angle driver loading time info.
7338 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7339 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007340
7341 // CPU Vulkan implementation is in use.
7342 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007343
7344 // App is not doing pre-rotation correctly.
7345 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007346
7347 // App creates GLESv1 context.
7348 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007349}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007350
7351/*
7352 * Logs the size of the system ion heap.
7353 *
7354 * Pulled from StatsCompanionService.
7355 */
7356message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007357 // Deprecated due to limited support of ion stats in debugfs.
7358 // Use `IonHeapSize` instead.
7359 option deprecated = true;
7360
Rafal Slawikd4e87572019-03-12 13:08:38 +00007361 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007362 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007363 optional int64 size_in_bytes = 1;
7364}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007365
Rafal Slawik77987ed2019-06-17 12:28:23 +01007366/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007367 * Logs the total size of the ion heap.
7368 *
7369 * Pulled from StatsCompanionService.
7370 */
7371message IonHeapSize {
7372 // Total size of all ion heaps in kilobytes.
7373 // Read from: /sys/kernel/ion/total_heaps_kb.
7374 optional int32 total_size_kb = 1;
7375}
7376
7377/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007378 * Logs the per-process size of the system ion heap.
7379 *
7380 * Pulled from StatsCompanionService.
7381 */
7382message ProcessSystemIonHeapSize {
7383 // The uid if available. -1 means not available.
7384 optional int32 uid = 1 [(is_uid) = true];
7385
7386 // The process name (from /proc/PID/cmdline).
7387 optional string process_name = 2;
7388
7389 // Sum of sizes of all allocations.
7390 optional int32 total_size_in_kilobytes = 3;
7391
7392 // Number of allocations.
7393 optional int32 allocation_count = 4;
7394
7395 // Size of the largest allocation.
7396 optional int32 max_size_in_kilobytes = 5;
7397}
7398
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007399/**
7400 * Push network stack events.
7401 *
7402 * Log from:
7403 * frameworks/base/packages/NetworkStack/
7404 */
7405message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007406 // The id that indicates the event reported from NetworkStack.
7407 optional int32 event_id = 1;
7408 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007409 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7410}
Carmen Agimofa769c152019-03-04 14:39:14 +00007411
7412/**
7413 * Logs the apps that are installed on the external storage.
7414 * Pulled from:
7415 * StatsCompanionService
7416 */
7417message AppsOnExternalStorageInfo {
7418 // The type of the external storage.
7419 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7420 // The name of the package that is installed on the external storage.
7421 optional string package_name = 2;
7422}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007423
7424/**
7425 * Logs the settings related to Face.
7426 * Logged from:
7427 * frameworks/base/services/core/java/com/android/server/stats
7428 */
7429message FaceSettings {
7430 // Whether or not face unlock is allowed on Keyguard.
7431 optional bool unlock_keyguard_enabled = 1;
7432 // Whether or not face unlock dismisses the Keyguard.
7433 optional bool unlock_dismisses_keyguard = 2;
7434 // Whether or not face unlock requires attention.
7435 optional bool unlock_attention_required = 3;
7436 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7437 optional bool unlock_app_enabled = 4;
7438 // Whether or not face unlock always requires user confirmation.
7439 optional bool unlock_always_require_confirmation = 5;
7440 // Whether or not a diverse set of poses are required during enrollment.
7441 optional bool unlock_diversity_required = 6;
7442}
Maggie White442b6312019-04-05 16:26:44 -07007443
7444/**
7445 * Logs cooling devices maintained by the kernel.
7446 *
7447 * Pulled from StatsCompanionService.java
7448 */
7449message CoolingDevice {
7450 // The type of cooling device being reported. Eg. CPU, GPU...
7451 optional android.os.CoolingTypeEnum device_location = 1;
7452 // The name of the cooling device source. Eg. CPU0
7453 optional string device_name = 2;
7454 // Current throttle state of the cooling device. The value can any unsigned
7455 // integer between 0 and max_state defined in its driver. 0 means device is
7456 // not in throttling, higher value means deeper throttling.
7457 optional int32 state = 3;
7458}
Ben Blount763a5d52019-04-10 11:48:58 -07007459
7460/**
7461 * Intelligence has several counter-type events that don't warrant a
7462 * full separate atom. These are primarily API call counters but also include
7463 * counters for feature usage and specific failure modes.
7464 *
7465 * Logged from the Intelligence mainline module.
7466 */
7467message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007468 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007469 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007470 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007471 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007472 // How many times the event occured (to report a batch of high frequency events).
7473 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007474 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007475 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007476}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007477
7478/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007479 * Logs when Car Power state changed.
7480 *
7481 * Logged from:
7482 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7483 */
7484message CarPowerStateChanged {
7485 // States come from CpmsState in CarPowerManagementService.java.
7486 enum State {
7487 WAIT_FOR_VHAL = 0;
7488 ON = 1;
7489 SHUTDOWN_PREPARE = 2;
7490 WAIT_FOR_FINISH = 3;
7491 SUSPEND = 4;
7492 SIMULATE_SLEEP = 5;
7493 }
7494 optional State state = 1;
7495}
7496
7497/**
7498 * Logs whether GarageMode is entered.
7499 *
7500 * Logged from:
7501 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7502 */
7503message GarageModeInfo {
7504 // Whether GarageMode is entered.
7505 optional bool is_garage_mode = 1;
7506}
Martijn Coenencd95d462019-04-25 17:09:45 +02007507
7508/**
7509 * Historical app ops data per package.
7510 */
7511message AppOps {
7512 // Uid of the package requesting the op
7513 optional int32 uid = 1 [(is_uid) = true];
7514
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007515 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007516 optional string package_name = 2;
7517
7518 // operation id; maps to the OP_* constants in AppOpsManager.java
7519 optional int32 op_id = 3;
7520
7521 // The number of times the op was granted while the app was in the
7522 // foreground (only for trusted requests)
7523 optional int64 trusted_foreground_granted_count = 4;
7524
7525 // The number of times the op was granted while the app was in the
7526 // background (only for trusted requests)
7527 optional int64 trusted_background_granted_count = 5;
7528
7529 // The number of times the op was rejected while the app was in the
7530 // foreground (only for trusted requests)
7531 optional int64 trusted_foreground_rejected_count = 6;
7532
7533 // The number of times the op was rejected while the app was in the
7534 // background (only for trusted requests)
7535 optional int64 trusted_background_rejected_count = 7;
7536
7537 // For long-running operations, total duration of the operation
7538 // while the app was in the foreground (only for trusted requests)
7539 optional int64 trusted_foreground_duration_millis = 8;
7540
7541 // For long-running operations, total duration of the operation
7542 // while the app was in the background (only for trusted requests)
7543 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007544
7545 // Whether AppOps is guarded by Runtime permission
7546 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007547}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007548
7549/**
7550 * Location Manager API Usage information(e.g. API under usage,
7551 * API call's parameters).
7552 * Logged from:
7553 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7554 */
7555message LocationManagerApiUsageReported {
7556
7557 // Indicating if usage starts or usage ends.
7558 optional android.stats.location.UsageState state = 1;
7559
7560 // LocationManagerService's API in use.
7561 // We can identify which API from LocationManager is
7562 // invoking current LMS API by the combination of
7563 // API parameter(e.g. is_listener_null, is_intent_null,
7564 // is_location_request_null)
7565 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7566
7567 // Name of the package calling the API.
7568 optional string calling_package_name = 3;
7569
7570 // Type of the location provider.
7571 optional android.stats.location.ProviderType provider = 4;
7572
7573 // Quality of the location request
7574 optional android.stats.location.LocationRequestQuality quality = 5;
7575
7576 // The desired interval for active location updates, in milliseconds.
7577 // Bucketized to reduce cardinality.
7578 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7579
7580 // Minimum distance between location updates, in meters.
7581 // Bucketized to reduce cardinality.
7582 optional android.stats.location.SmallestDisplacementBucket
7583 bucketized_smallest_displacement = 7;
7584
7585 // The number of location updates.
7586 optional int64 num_updates = 8;
7587
7588 // The request expiration time, in millisecond since boot.
7589 // Bucketized to reduce cardinality.
7590 optional android.stats.location.ExpirationBucket
7591 bucketized_expire_in = 9;
7592
7593 // Type of Callback passed in for this API.
7594 optional android.stats.location.CallbackType callback_type = 10;
7595
7596 // The radius of the central point of the alert
7597 // region, in meters. Only for API REQUEST_GEOFENCE.
7598 // Bucketized to reduce cardinality.
7599 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7600
7601 // Activity Importance of API caller.
7602 // Categorized to 3 types that are interesting from location's perspective.
7603 optional android.stats.location.ActivityImportance activiy_importance = 12;
7604}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007605
7606/**
7607 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7608 */
7609message ReviewPermissionsFragmentResultReported {
7610 // unique value identifying a permission group change. A permission group change might result
7611 // in multiple of these atoms
7612 optional int64 change_id = 1;
7613
7614 // UID of package the permission belongs to
7615 optional int32 uid = 2 [(is_uid) = true];
7616
7617 // Name of package the permission belongs to
7618 optional string package_name = 3;
7619
7620 // The permission to be granted
7621 optional string permission_name = 4;
7622
7623 // The result of the permission grant
7624 optional bool permission_granted = 5;
7625}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007626
7627/**
7628* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7629* Logged from: RuntimePermissionUpdgradeController
7630*/
7631message RuntimePermissionsUpgradeResult {
7632 // Permission granted as result of upgrade
7633 optional string permission_name = 1;
7634
7635 // UID of package granted permission
7636 optional int32 uid = 2 [(is_uid) = true];
7637
7638 // Name of package granted permission
7639 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007640}
7641
7642/**
7643* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7644*/
7645message GrantPermissionsActivityButtonActions {
7646 // Permission granted as result of upgrade
7647 optional string permission_group_name = 1;
7648
7649 // UID of package granted permission
7650 optional int32 uid = 2 [(is_uid) = true];
7651
7652 // Name of package requesting permission
7653 optional string package_name = 3;
7654
7655 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7656 // LABEL_ constants in GrantPermissionActivity.java
7657 optional int32 buttons_presented = 4;
7658
7659 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7660 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007661
7662 // id which identifies single session of user interacting with permission controller
7663 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007664}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007665
7666/**
7667 * Information about LocationAccessCheck notification presented to user
7668 */
7669message LocationAccessCheckNotificationAction {
7670
7671 // id which identifies single session of user interacting with permission controller
7672 optional int64 session_id = 1;
7673
7674 // Uid of package for which location access check is presented
7675 optional int32 package_uid = 2;
7676
7677 // Name of package for which location access check is presented
7678 optional string package_name = 3;
7679
7680 enum Result {
7681 UNDEFINED = 0;
7682 // notification was presented to the user
7683 NOTIFICATION_PRESENTED = 1;
7684 // notification was declined by the user
7685 NOTIFICATION_DECLINED = 2;
7686 // notification was clicked by the user
7687 NOTIFICATION_CLICKED = 3;
7688 }
7689
7690 // View / interaction recorded
7691 optional Result result = 4;
7692}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007693
7694/**
7695 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7696 */
7697message AppPermissionFragmentActionReported {
7698 // id which identifies single session of user interacting with permission controller
7699 optional int64 session_id = 1;
7700
7701 // unique value identifying a permission group change. A permission group change might result
7702 // in multiple of these atoms
7703 optional int64 change_id = 2;
7704
7705 // UID of package the permission belongs to
7706 optional int32 uid = 3 [(is_uid) = true];
7707
7708 // Name of package the permission belongs to
7709 optional string package_name = 4;
7710
7711 // The permission to be granted
7712 optional string permission_name = 5;
7713
7714 // The result of the permission grant
7715 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007716
7717 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7718 optional int32 permission_flags = 7;
7719
7720 enum Button {
7721 UNDEFINED = 0;
7722 // Allow button
7723 ALLOW = 1;
7724 // Deny button
7725 DENY = 2;
7726 // Ask every time button
7727 ASK_EVERY_TIME = 3;
7728 // Allow all the time button
7729 ALLOW_ALWAYS = 4;
7730 // Allow only while using the app button
7731 ALLOW_FOREGROUND = 5;
7732 // Same is Deny button but shown in while in use dialog
7733 DENY_FOREGROUND = 6;
7734 }
7735
7736 // Button pressed in the dialog
7737 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007738}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007739
7740/**
7741* Information about a AppPermissionFragment viewed by user
7742*/
7743message AppPermissionFragmentViewed {
7744 // id which identifies single session of user interacting with permission controller
7745 optional int64 session_id = 1;
7746
7747 // UID of package for which permissions are viewed
7748 optional int32 uid = 2 [(is_uid) = true];
7749
7750 // Name of package for which permissions are viewed
7751 optional string package_name = 3;
7752
7753 // Permission group viewed
7754 optional string permission_group_name = 4;
7755}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007756
7757/**
7758* Information about a AppPermissionsFragment viewed by user
7759*/
7760message AppPermissionsFragmentViewed {
7761 // id which identifies single session of user interacting with permission controller
7762 optional int64 session_id = 1;
7763
7764 // id which identifies single view as every view might have several logging records
7765 // with different package information attached
7766 optional int64 view_id = 2;
7767
7768 // Permission group viewed
7769 optional string permission_group_name = 3;
7770
7771 // UID of package for which permissions are viewed
7772 optional int32 uid = 4 [(is_uid) = true];
7773
7774 // Name of package for which permissions are viewed
7775 optional string package_name = 5;
7776
7777 // Category in which permission is included
7778 enum Category {
7779 UNDEFINED = 0;
7780 ALLOWED = 1;
7781 ALLOWED_FOREGROUND = 2;
7782 DENIED = 3;
7783 }
7784 optional Category category = 6;
7785}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007786
7787/**
7788* Information about a PermissionAppsFragment viewed by user.
7789* Logged from ui/handheld/PermissionAppsFragment.java
7790*/
7791message PermissionAppsFragmentViewed {
7792 // id which identifies single session of user interacting with permission controller
7793 optional int64 session_id = 1;
7794
7795 // id which identifies single view as every view might have several logging records
7796 // with different package information attached
7797 optional int64 view_id = 2;
7798
7799 // Permission group viewed
7800 optional string permission_group_name = 3;
7801
7802 // UID of package for which permissions are viewed
7803 optional int32 uid = 4 [(is_uid) = true];
7804
7805 // Name of package for which permissions are viewed
7806 optional string package_name = 5;
7807
7808 // Category in which app is included
7809 enum Category {
7810 UNDEFINED = 0;
7811 ALLOWED = 1;
7812 ALLOWED_FOREGROUND = 2;
7813 DENIED = 3;
7814 }
7815 optional Category category = 6;
7816}
Tony Make2b1b672019-07-29 16:59:47 +01007817
7818/**
7819 * Logs when there is a smart selection related event.
7820 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7821 * Logged from: TextClassifierEventLogger.java
7822 */
7823message TextSelectionEvent {
7824 // A session ID.
7825 optional string session_id = 1;
7826
7827 // Event type of this event.
7828 optional android.stats.textclassifier.EventType event_type = 2;
7829
Tony Mak9c84bd22019-12-09 07:27:25 +00007830 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007831 optional string model_name = 3;
7832
7833 // Type of widget that was involved in triggering this event.
7834 optional android.stats.textclassifier.WidgetType widget_type = 4;
7835
7836 // Index of this event in a session.
7837 optional int32 event_index = 5;
7838
7839 // Entity type that is involved.
7840 optional string entity_type = 6;
7841
7842 // Relative word index of the start of the selection.
7843 optional int32 relative_word_start_index = 7;
7844
7845 // Relative word (exclusive) index of the end of the selection.
7846 optional int32 relative_word_end_index = 8;
7847
7848 // Relative word index of the start of the smart selection.
7849 optional int32 relative_suggested_word_start_index = 9;
7850
7851 // Relative word (exclusive) index of the end of the smart selection.
7852 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007853
7854 // Name of source package.
7855 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007856}
7857
7858/**
7859 * Logs when there is a smart linkify related event.
7860 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7861 * Logged from: TextClassifierEventLogger.java
7862 */
7863message TextLinkifyEvent {
7864 // A session ID.
7865 optional string session_id = 1;
7866
7867 // Event type of this event.
7868 optional android.stats.textclassifier.EventType event_type = 2;
7869
Tony Mak9c84bd22019-12-09 07:27:25 +00007870 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007871 optional string model_name = 3;
7872
7873 // Type of widget that was involved in triggering this event.
7874 optional android.stats.textclassifier.WidgetType widget_type = 4;
7875
7876 // Index of this event in a session.
7877 optional int32 event_index = 5;
7878
7879 // Entity type that is involved.
7880 optional string entity_type = 6;
7881
7882 // Number of links detected.
7883 optional int32 num_links = 7;
7884
7885 // The total length of all links.
7886 optional int32 linked_text_length = 8;
7887
7888 // Length of input text.
7889 optional int32 text_length = 9;
7890
7891 // Time spent on generating links in ms.
7892 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007893
7894 // Name of source package.
7895 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007896}
7897
7898/**
7899 * Logs when there is a conversation actions related event.
7900 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7901 * Logged from: TextClassifierEventLogger.java
7902 */
7903message ConversationActionsEvent {
7904 // A session ID.
7905 optional string session_id = 1;
7906
7907 // Event type of this event.
7908 optional android.stats.textclassifier.EventType event_type = 2;
7909
Tony Mak9c84bd22019-12-09 07:27:25 +00007910 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007911 optional string model_name = 3;
7912
7913 // Type of widget that was involved in triggering this event.
7914 optional android.stats.textclassifier.WidgetType widget_type = 4;
7915
7916 // The first entity type that is involved.
7917 optional string first_entity_type = 5;
7918
7919 // The second entity type that is involved.
7920 optional string second_entity_type = 6;
7921
7922 // The third entity type that is involved.
7923 optional string third_entity_type = 7;
7924
7925 // The score of the first entity type.
7926 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007927
7928 // Name of source package.
7929 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007930
7931 // Name of the annotator model that is involved in this event.
7932 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007933}
7934
7935/**
7936 * Logs when there is a language detection related event.
7937 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7938 * Logged from: TextClassifierEventLogger.java
7939 */
7940message LanguageDetectionEvent {
7941 // A session ID.
7942 optional string session_id = 1;
7943
7944 // Event type of this event.
7945 optional android.stats.textclassifier.EventType event_type = 2;
7946
Tony Mak9c84bd22019-12-09 07:27:25 +00007947 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007948 optional string model_name = 3;
7949
7950 // Type of widget that was involved in triggering this event.
7951 optional android.stats.textclassifier.WidgetType widget_type = 4;
7952
7953 // Detected language.
7954 optional string language_tag = 5;
7955
7956 // Score of the detected language.
7957 optional float score = 6;
7958
7959 // Position of this action.
7960 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007961
7962 // Name of source package.
7963 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007964}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007965
7966/**
7967 * Information about an OTA update attempt by update_engine.
7968 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7969 */
7970message UpdateEngineUpdateAttemptReported {
7971 // The number of attempts for the update engine to apply a given payload.
7972 optional int32 attempt_number = 1;
7973
7974 optional android.stats.otaupdate.PayloadType payload_type = 2;
7975
7976 // The total time in minutes for the update engine to apply a given payload.
7977 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7978 // it's increased when the system is sleeping.
7979 optional int32 duration_boottime_in_minutes = 3;
7980
7981 // The total time in minutes for the update engine to apply a given payload.
7982 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7983 // and it's not increased when the system is sleeping.
7984 optional int32 duration_monotonic_in_minutes = 4;
7985
7986 // The size of the payload in MiBs.
7987 optional int32 payload_size_mib = 5;
7988
7989 // The attempt result reported by the update engine for an OTA update.
7990 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7991
7992 // The error code reported by the update engine after an OTA update attempt
7993 // on A/B devices.
7994 optional android.stats.otaupdate.ErrorCode error_code = 7;
7995
7996 // The build fingerprint of the source system. The value is read from a
7997 // system property when the device takes the update. e.g.
7998 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7999 optional string source_fingerprint = 8;
8000}
8001
8002/**
8003 * Information about all the attempts the device make before finishing the
8004 * successful update.
8005 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8006 */
8007message UpdateEngineSuccessfulUpdateReported {
8008 // The number of attempts for the update engine to apply the payload for a
8009 // successful update.
8010 optional int32 attempt_count = 1;
8011
8012 optional android.stats.otaupdate.PayloadType payload_type = 2;
8013
8014 optional int32 payload_size_mib = 3;
8015
8016 // The total number of bytes downloaded by update_engine since the last
8017 // successful update.
8018 optional int32 total_bytes_downloaded_mib = 4;
8019
8020 // The ratio in percentage of the over-downloaded bytes compared to the
8021 // total bytes needed to successfully install the update. e.g. 200 if we
8022 // download 200MiB in total for a 100MiB package.
8023 optional int32 download_overhead_percentage = 5;
8024
8025 // The total time in minutes for the update engine to apply the payload for a
8026 // successful update.
8027 optional int32 total_duration_minutes = 6;
8028
8029 // The number of reboot of the device during a successful update.
8030 optional int32 reboot_count = 7;
8031}
Alec Mourie088e762019-07-02 13:10:55 -07008032
8033/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008034 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8035 * key to indicate whether it was successful or not.
8036 *
8037 * Logged from:
8038 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8039 */
8040message RebootEscrowRecoveryReported {
8041 optional bool successful = 1;
8042}
8043
8044/**
Alec Mourie088e762019-07-02 13:10:55 -07008045 * Global display pipeline metrics reported by SurfaceFlinger.
8046 * Pulled from:
8047 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8048 */
8049message SurfaceflingerStatsGlobalInfo {
8050 // Total number of frames presented during the tracing period
8051 optional int64 total_frames = 1;
8052 // Total number of frames missed
8053 optional int64 missed_frames = 2;
8054 // Total number of frames that fell back to client composition
8055 optional int64 client_composition_frames = 3;
8056 // Total time the display was turned on
8057 optional int64 display_on_millis = 4;
8058 // Total time that was spent performing animations.
8059 // This is derived from the present-to-present layer histogram
8060 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008061 // Total number of event connections tracked by SurfaceFlinger at the time
8062 // of this pull. If this number grows prohibitively large, then this can
8063 // cause jank due to resource contention.
8064 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008065 // Set of timings measured from when SurfaceFlinger began compositing a
8066 // frame, until the frame was requested to be presented to the display. This
8067 // measures SurfaceFlinger's total CPU walltime on the critical path per
8068 // frame.
8069 optional FrameTimingHistogram frame_duration = 7
8070 [(android.os.statsd.log_mode) = MODE_BYTES];
8071 // Set of timings measured from when SurfaceFlinger first began using the
8072 // GPU to composite a frame, until the GPU has finished compositing that
8073 // frame. This measures the total additional time SurfaceFlinger needed to
8074 // perform due to falling back into GPU composition.
8075 optional FrameTimingHistogram render_engine_timing = 8
8076 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008077}
8078
8079/**
8080 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8081 * The number of layers uploaded will be restricted due to size limitations.
8082 * Pulled from:
8083 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8084 */
8085message SurfaceflingerStatsLayerInfo {
8086 // The layer for this set of metrics
8087 // For now we can infer that the package name is included in the layer
8088 // name.
8089 optional string layer_name = 1;
8090 // Total number of frames presented
8091 optional int64 total_frames = 2;
8092 // Total number of dropped frames while latching a buffer for this layer.
8093 optional int64 dropped_frames = 3;
8094 // Set of timings measured between successive presentation timestamps.
8095 optional FrameTimingHistogram present_to_present = 4
8096 [(android.os.statsd.log_mode) = MODE_BYTES];
8097 // Set of timings measured from when an app queued a buffer for
8098 // presentation, until the buffer was actually presented to the
8099 // display.
8100 optional FrameTimingHistogram post_to_present = 5
8101 [(android.os.statsd.log_mode) = MODE_BYTES];
8102 // Set of timings measured from when a buffer is ready to be presented,
8103 // until the buffer was actually presented to the display.
8104 optional FrameTimingHistogram acquire_to_present = 6
8105 [(android.os.statsd.log_mode) = MODE_BYTES];
8106 // Set of timings measured from when a buffer was latched by
8107 // SurfaceFlinger, until the buffer was presented to the display
8108 optional FrameTimingHistogram latch_to_present = 7
8109 [(android.os.statsd.log_mode) = MODE_BYTES];
8110 // Set of timings measured from the desired presentation to the actual
8111 // presentation time
8112 optional FrameTimingHistogram desired_to_present = 8
8113 [(android.os.statsd.log_mode) = MODE_BYTES];
8114 // Set of timings measured from when an app queued a buffer for
8115 // presentation, until the buffer was ready to be presented.
8116 optional FrameTimingHistogram post_to_acquire = 9
8117 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008118 // Frames missed latch because the acquire fence didn't fire
8119 optional int64 late_acquire_frames = 10;
8120 // Frames latched early because the desired present time was bad
8121 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008122}
8123
8124/**
8125 * Histogram of frame counts bucketed by time in milliseconds.
8126 * Because of size limitations, we hard-cap the number of buckets, with
8127 * buckets for corresponding to larger milliseconds being less precise.
8128 */
8129message FrameTimingHistogram {
8130 // Timings in milliseconds that describes a set of histogram buckets
8131 repeated int32 time_millis_buckets = 1;
8132 // Number of frames that match to each time_millis, i.e. the bucket
8133 // contents
8134 // It's required that len(time_millis) == len(frame_count)
8135 repeated int64 frame_counts = 2;
8136}
Emilian Peev6729f372019-08-29 09:14:09 -07008137
Emilian Peev6729f372019-08-29 09:14:09 -07008138/**
8139 * Information about camera facing and API level usage.
8140 * Logged from:
8141 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8142 */
8143message CameraActionEvent {
8144 // Camera session duration
8145 optional int64 duration = 1;
8146
8147 // Camera API level used
8148 optional int32 api_level = 2;
8149
8150 // Name of client package
8151 optional string package_name = 3;
8152
8153 // Camera facing
8154 enum Facing {
8155 UNKNOWN = 0;
8156 BACK = 1;
8157 FRONT = 2;
8158 EXTERNAL = 3;
8159 }
8160 optional Facing facing = 4;
8161}
atrost01a20932019-08-28 15:40:37 +01008162
8163/**
8164 * Logs when a compatibility change is affecting an app.
8165 *
8166 * Logged from:
8167 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8168 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8169 */
8170message AppCompatibilityChangeReported {
8171 // The UID of the app being affected by the compatibilty change.
8172 optional int32 uid = 1 [(is_uid) = true];
8173
8174 // The ID of the change affecting the app.
8175 optional int64 change_id = 2;
8176
8177 enum State {
8178 UNKNOWN_STATE = 0;
8179 ENABLED = 1;
8180 DISABLED = 2;
8181 LOGGED = 3;
8182 }
8183
8184 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8185 // logged otherwise.
8186 optional State state = 3;
8187
8188 enum Source {
8189 UNKNOWN_SOURCE = 0;
8190 APP_PROCESS = 1;
8191 SYSTEM_SERVER = 2;
8192 }
8193
8194 // Where it was logged from.
8195 optional Source source = 4;
8196
8197}
Hector Dearman40579f62019-11-01 13:19:30 +00008198
8199/**
8200 * Logged from
8201 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8202 */
8203message PerfettoUploaded {
8204 enum Event {
8205 PERFETTO_UNDEFINED = 0;
8206 PERFETTO_TRACE_BEGIN = 1;
8207 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8208 PERFETTO_ON_CONNECT = 3;
8209 PERFETTO_ON_TRACING_DISABLED = 4;
8210 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8211 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8212 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8213 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8214 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8215 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8216 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8217 PERFETTO_TRIGGER_BEGIN = 12;
8218 PERFETTO_TRIGGER_SUCCESS = 13;
8219 PERFETTO_TRIGGER_FAILURE = 14;
8220 PERFETTO_HIT_GUARDRAILS = 15;
8221 PERFETTO_ON_TIMEOUT = 16;
8222 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8223 }
8224
8225 // Which stage of the pipeline we are reporting from.
8226 optional Event event = 1;
8227
8228 // UUID matching the one set inside the SystemInfo trace packet.
8229 optional int64 trace_uuid_lsb = 2;
8230 optional int64 trace_uuid_msb = 3;
8231}
Mark Tabrya824a642019-11-05 12:26:12 -08008232
8233/**
8234 * Pulls client metrics on data transferred via Vehicle Maps Service.
8235 * Metrics are keyed by uid + layer.
8236 *
8237 * Pulled from:
8238 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8239 */
8240message VmsClientStats {
8241 // UID of the VMS client app
8242 optional int32 uid = 1 [(is_uid) = true];
8243
8244 // VMS layer definition
8245 optional int32 layer_type = 2;
8246 optional int32 layer_channel = 3;
8247 optional int32 layer_version = 4;
8248
8249 // Bytes and packets sent by the client for the layer
8250 optional int64 tx_bytes = 5;
8251 optional int64 tx_packets = 6;
8252
8253 // Bytes and packets received by the client for the layer
8254 optional int64 rx_bytes = 7;
8255 optional int64 rx_packets = 8;
8256
8257 // Bytes and packets dropped due to client error
8258 optional int64 dropped_bytes = 9;
8259 optional int64 dropped_packets = 10;
8260}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008261
8262/**
8263 * State of a dangerous permission requested by a package - sampled
8264 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8265*/
8266message DangerousPermissionStateSampled {
8267 // Name of the permission
8268 optional string permission_name = 1;
8269
8270 // Uid of the package
8271 optional int32 uid = 2 [(is_uid) = true];
8272
8273 // If the permission is granted to the uid
8274 optional bool is_granted = 3;
8275
8276 // Permission flags as per android.content.pm.PermissionFlags
8277 optional int32 permission_flags = 4;
8278}
8279
Stan Iliev637ba5e2019-08-16 13:43:08 -04008280/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008281 * HWUI stats for a given app.
8282 */
8283message GraphicsStats {
8284 // The package name of the app
8285 optional string package_name = 1;
8286
8287 // The version code of the app
8288 optional int64 version_code = 2;
8289
8290 // The start & end timestamps in UTC as
8291 // milliseconds since January 1, 1970
8292 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008293 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008294
Stan Ilievb6517192020-02-18 10:12:42 -05008295 optional int64 end_millis = 4;
8296
8297 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8298 enum PipelineType {
8299 UNKNOWN = 0;
8300 GL = 1;
8301 VULKAN = 2;
8302 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008303
8304 // HWUI renders pipeline type: GL or Vulkan.
8305 optional PipelineType pipeline = 5;
8306
8307 // Distinct frame count.
8308 optional int32 total_frames = 6;
8309
8310 // Number of "missed vsync" events.
8311 optional int32 missed_vsync_count = 7;
8312
8313 // Number of frames in triple-buffering scenario (high input latency)
8314 optional int32 high_input_latency_count = 8;
8315
8316 // Number of "slow UI thread" events.
8317 optional int32 slow_ui_thread_count = 9;
8318
8319 // Number of "slow bitmap upload" events.
8320 optional int32 slow_bitmap_upload_count = 10;
8321
8322 // Number of "slow draw" events.
8323 optional int32 slow_draw_count = 11;
8324
8325 // Number of frames that missed their deadline (aka, visibly janked)
8326 optional int32 missed_deadline_count = 12;
8327
8328 // The frame time histogram for the package
8329 optional FrameTimingHistogram cpu_histogram = 13
8330 [(android.os.statsd.log_mode) = MODE_BYTES];
8331
8332 // The gpu frame time histogram for the package
8333 optional FrameTimingHistogram gpu_histogram = 14
8334 [(android.os.statsd.log_mode) = MODE_BYTES];
8335
8336 // UI mainline module version.
8337 optional int64 version_ui_module = 15;
8338
8339 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8340 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8341 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8342 // more apps are running / rendering.
8343 optional bool is_today = 16;
8344}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008345
8346/**
8347 * Message related to dangerous (runtime) app ops access
8348 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008349message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008350 // Uid of the package accessing app op
8351 optional int32 uid = 1 [(is_uid) = true];
8352
8353 // Name of the package accessing app op
8354 optional string package_name = 2;
8355
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008356 // operation string id per OPSTR_ constants in AppOpsManager.java
8357 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008358
8359 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8360 // Features must be provided through manifest using <feature> tag available in R and above.
8361 optional string feature_id = 4;
8362
8363 // message related to app op access, limited to 600 chars by API
8364 optional string message = 5;
8365
8366 enum SamplingStrategy {
8367 DEFAULT = 0;
8368 UNIFORM = 1;
8369 RARELY_USED = 2;
8370 }
8371
8372 // sampling strategy used to collect this message
8373 optional SamplingStrategy sampling_strategy = 6;
8374}
8375
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008376/*
8377 * Logs userspace reboot outcome and duration.
8378 *
8379 * Logged from:
8380 * frameworks/base/core/java/com/android/server/BootReceiver.java
8381 */
8382message UserspaceRebootReported {
8383 // Possible outcomes of userspace reboot.
8384 enum Outcome {
8385 // Default value in case platform failed to determine the outcome.
8386 OUTCOME_UNKNOWN = 0;
8387 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8388 SUCCESS = 1;
8389 // Userspace reboot shutdown sequence was aborted.
8390 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8391 // Remounting userdata into checkpointing mode failed.
8392 FAILED_USERDATA_REMOUNT = 3;
8393 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8394 // reboot.
8395 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8396 }
8397 // Outcome of userspace reboot. Always set.
8398 optional Outcome outcome = 1;
8399 // Duration of userspace reboot in case it has a successful outcome.
8400 // Duration is measured as time between userspace reboot was initiated and until boot completed
8401 // (e.g. sys.boot_completed=1).
8402 optional int64 duration_millis = 2;
8403 // State of primary user's (user0) credential encryption storage.
8404 enum UserEncryptionState {
8405 // Default value.
8406 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8407 // Credential encrypted storage is unlocked.
8408 UNLOCKED = 1;
8409 // Credential encrypted storage is locked.
8410 LOCKED = 2;
8411 }
8412 // State of primary user's encryption storage at the moment boot completed. Always set.
8413 optional UserEncryptionState user_encryption_state = 3;
8414}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008415
8416/*
8417 * Logs integrity check information during each install.
8418 *
8419 * Logged from:
8420 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8421 */
8422message IntegrityCheckResultReported {
8423 optional string package_name = 1;
8424 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008425 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008426 optional string installer_package_name = 4;
8427 enum Response {
8428 UNKNOWN = 0;
8429 ALLOWED = 1;
8430 REJECTED = 2;
8431 FORCE_ALLOWED = 3;
8432 }
8433 optional Response response = 5;
8434 // An estimate on the cause of the response. This will only be populated for
8435 // REJECTED and FORCE_ALLOWED
8436 optional bool caused_by_app_cert_rule = 6;
8437 optional bool caused_by_installer_rule = 7;
8438}
8439
8440/**
8441 * Logs the information about the rules and the provider whenever rules are
8442 * pushed into AppIntegrityManager.
8443 *
8444 * Logged from:
8445 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8446 */
8447message IntegrityRulesPushed {
8448 optional bool success = 1;
8449 // Package name of the app that pushed the rules.
8450 optional string rule_provider = 2;
8451 // Version string of arbitrary format provided by the rule provider to
8452 // identify the rules.
8453 optional string rule_version = 3;
8454}
Jordan Liubedfa702019-12-20 15:08:45 -08008455
8456/**
8457 * Logs when a cell broadcast message is received on the device.
8458 *
8459 * Logged from CellBroadcastService module:
8460 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8461 */
8462message CellBroadcastMessageReported {
8463 // The type of Cell Broadcast message
8464 enum CbType {
8465 UNKNOWN_TYPE = 0;
8466 GSM = 1;
8467 CDMA = 2;
8468 CDMA_SPC = 3;
8469 }
8470
8471 // GSM, CDMA, CDMA-SCP
8472 optional CbType type = 1;
8473}
8474
8475/**
8476 * Logs when an error occurs while handling a cell broadcast message;
8477 *
8478 * Logged from CellBroadcastService module:
8479 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8480 */
8481message CellBroadcastMessageError {
8482 // The type of error raised when trying to handle a cell broadcast message
8483 enum ErrorType {
8484 UNKNOWN_TYPE = 0;
8485 CDMA_DECODING_ERROR = 1;
8486 CDMA_SCP_EMPTY = 2;
8487 CDMA_SCP_HANDLING_ERROR = 3;
8488 GSM_INVALID_HEADER_LENGTH = 4;
8489 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8490 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8491 GSM_INVALID_PDU = 7;
8492 GSM_INVALID_GEO_FENCING_DATA = 8;
8493 GSM_UMTS_INVALID_WAC = 9;
8494 FAILED_TO_INSERT_TO_DB = 10;
8495 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8496 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8497 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8498 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8499 }
8500
8501 // What kind of error occurred
8502 optional ErrorType type = 1;
8503
8504 // Exception message (or log message) associated with the error (max 1000 chars)
8505 optional string exception_message = 2;
8506}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008507
8508/**
8509 * Logs when the SDK Extensions test app has polled the current version.
8510 * This is atom ID 354.
8511 *
8512 * Logged from:
8513 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8514 */
8515message SdkExtensionStatus {
8516 enum ApiCallStatus {
8517 CALL_NOT_ATTEMPTED = 0;
8518 CALL_SUCCESSFUL = 1;
8519 CALL_FAILED = 2;
8520 }
8521
8522 optional ApiCallStatus result = 1;
8523
8524 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8525 optional int32 r_extension_version = 2;
8526
8527 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8528 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8529 optional int32 failed_call_symbol = 3;
8530}
Marco Ballesio497aff42020-01-24 08:39:42 -08008531
8532/**
8533 * Logs when an app is frozen or unfrozen.
8534 *
8535 * Logged from:
8536 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8537 */
8538message AppFreezeChanged {
8539 // The type of event.
8540 enum Action {
8541 UNKNOWN = 0;
8542 FREEZE_APP = 1;
8543 UNFREEZE_APP = 2;
8544 }
8545 optional Action action = 1;
8546
8547 // Pid of the process being frozen.
8548 optional int32 pid = 2;
8549
8550 // Name of the process being frozen.
8551 optional string process_name = 3;
8552
8553 // Time since last unfrozen.
8554 optional int64 time_unfrozen_millis = 4;
8555}