blob: dadbb048f54909a77fb5fc1284f506636f9e7e07 [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;
384 NotificationChannelModified notification_panel_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"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000395 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 }
David Chenc8a43242017-10-17 16:23:28 -0700397
David Chen6e3e6cb2018-01-03 16:14:06 -0800398 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000399 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700400 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
402 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
403 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
404 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
405 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
406 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800407 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800408 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
409 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
410 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
411 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
412 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
413 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
414 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
415 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
416 SystemUptime system_uptime = 10015 [(module) = "framework"];
417 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
418 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000419 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800420 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
421 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800422 Temperature temperature = 10021 [(module) = "framework"];
423 BinderCalls binder_calls = 10022 [(module) = "framework"];
424 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
425 LooperStats looper_stats = 10024 [(module) = "framework"];
426 DiskStats disk_stats = 10025 [(module) = "framework"];
427 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
428 AppSize app_size = 10027 [(module) = "framework"];
429 CategorySize category_size = 10028 [(module) = "framework"];
430 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800431 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
433 DiskIo disk_io = 10032 [(module) = "framework"];
434 PowerProfile power_profile = 10033 [(module) = "framework"];
435 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
436 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
437 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700438 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
440 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
441 10040 [(module) = "framework"];
442 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
443 10041 [(module) = "framework"];
444 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800445 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
449 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
450 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
451 RoleHolder role_holder = 10049 [(module) = "framework"];
452 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800453 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
455 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800456 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
457 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
459 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
460 FaceSettings face_settings = 10058 [(module) = "framework"];
461 CoolingDevice cooling_device = 10059 [(module) = "framework"];
462 AppOps app_ops = 10060 [(module) = "framework"];
463 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700464 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
465 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800467 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
469 DangerousPermissionStateSampled dangerous_permission_state_sampled =
470 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400471 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000472 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000473 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700474 }
yroa1fe77c2018-02-26 14:22:54 -0800475
Bookatz76aafcf2018-09-17 16:17:10 -0700476 // DO NOT USE field numbers above 100,000 in AOSP.
477 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
478 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100479
480 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700481}
482
Yao Chend54f9dd2017-10-17 17:37:48 +0000483/**
Yangster-mac20877162017-12-22 17:19:39 -0800484 * This proto represents a node of an attribution chain.
485 * Note: All attribution chains are represented as a repeated field of type
486 * AttributionNode. It is understood that in such arrays, the order is that
487 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000488 */
Yangster-mac20877162017-12-22 17:19:39 -0800489message AttributionNode {
490 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800491 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800492
Yangster-mac20877162017-12-22 17:19:39 -0800493 // The (optional) string tag for an element in the attribution chain. If the
494 // element has no tag, it is encoded as an empty string.
495 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700496}
497
Yangster-mac48b3d622018-08-18 12:38:11 -0700498message KeyValuePair {
499 optional int32 key = 1;
500 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700501 int32 value_int = 2;
502 int64 value_long = 3;
503 string value_str = 4;
504 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700505 }
506}
507
508message KeyValuePairsAtom {
509 optional int32 uid = 1;
510 repeated KeyValuePair pairs = 2;
511}
512
Yao Chend54f9dd2017-10-17 17:37:48 +0000513/*
514 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800515 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000516 *
517 * RULES:
518 * - The field ids for each atom must start at 1, and count upwards by 1.
519 * Skipping field ids is not allowed.
520 * - These form an API, so renaming, renumbering or removing fields is
521 * not allowed between android releases. (This is not currently enforced,
522 * but there will be a tool to enforce this restriction).
523 * - The types must be built-in protocol buffer types, namely, no sub-messages
524 * are allowed (yet). The bytes type is also not allowed.
525 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800526 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000527 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800528 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000529 * - A field that is a uid should be a string field, tagged with the [xxx]
530 * annotation. The generated code on android will be represented by UIDs,
531 * and those UIDs will be translated in xxx to those strings.
532 *
533 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700534 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 * - If there is a UID, it goes first. Think in an object-oriented fashion.
536 * *****************************************************************************
537 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700538
Yao Chend54f9dd2017-10-17 17:37:48 +0000539/**
Tej Singha72344992019-04-17 18:55:08 -0700540 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700541 * Logs when the Thermal service HAL notifies the throttling start/stop events.
542 *
543 * Logged from:
544 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
545 */
546message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700547 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700548 optional android.os.TemperatureTypeEnum sensor_type = 1;
549
Maggie White442b6312019-04-05 16:26:44 -0700550 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700551 enum State {
552 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700553 START = 1; // START indicated that throttling was triggered.
554 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700555 }
Yangster-mace16189a2018-08-26 12:20:16 -0700556 optional State state = 2;
557
558 optional float temperature = 3;
559}
560
561/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000562 * Logs when the screen state changes.
563 *
564 * Logged from:
565 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
566 */
567message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800568 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800569 optional android.view.DisplayStateEnum state = 1
570 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700571}
Yao Chend54f9dd2017-10-17 17:37:48 +0000572
573/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700574 * Logs that the process state of the uid, as determined by ActivityManager
575 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000576 *
577 * Logged from:
578 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
579 */
Bookatzc1a050a2017-10-10 15:49:28 -0700580message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800581 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000582
Bookatzdb026a22018-01-10 19:01:56 -0800583 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800584 optional android.app.ProcessStateEnum state = 2
585 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000586}
587
588/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700589 * Logs process state change of a process, as per the activity manager.
590 *
591 * Logged from:
592 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
593 */
594message ProcessStateChanged {
595 optional int32 uid = 1;
596 optional string process_name = 2;
597 optional string package_name = 3;
598 // TODO: remove this when validation is done
599 optional int64 version = 5;
600 // The state, from frameworks/base/core/proto/android/app/enums.proto.
601 optional android.app.ProcessStateEnum state = 4;
602}
603
604/**
605 * Logs when ActivityManagerService sleep state is changed.
606 *
607 * Logged from:
608 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
609 */
610message ActivityManagerSleepStateChanged {
611 // TODO: import frameworks proto
612 enum State {
613 UNKNOWN = 0;
614 ASLEEP = 1;
615 AWAKE = 2;
616 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800617 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700618}
619
620/**
621 * Logs when system memory state changes.
622 *
623 * Logged from:
624 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
625 */
626message MemoryFactorStateChanged {
627 // TODO: import frameworks proto
628 enum State {
629 MEMORY_UNKNOWN = 0;
630 NORMAL = 1; // normal.
631 MODERATE = 2; // moderate memory pressure.
632 LOW = 3; // low memory.
633 CRITICAL = 4; // critical memory.
634
635 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800636 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700637}
638
639/**
640 * Logs when app is using too much cpu, according to ActivityManagerService.
641 *
642 * Logged from:
643 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
644 */
645message ExcessiveCpuUsageReported {
646 optional int32 uid = 1;
647 optional string process_name = 2;
648 optional string package_name = 3;
649 // package version. TODO: remove this when validation is done
650 optional int64 version = 4;
651}
652
653/**
654 * Logs when a cached process is killed, along with its pss.
655 *
656 * Logged from:
657 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
658 */
659message CachedKillReported {
660 optional int32 uid = 1;
661 optional string process_name = 2;
662 optional string package_name = 3;
663 // TODO: remove this when validation is done
664 optional int64 version = 5;
665 optional int64 pss = 4;
666}
667
668/**
xshu2c3d9e42019-09-26 17:54:02 -0700669 * Logs the change in wifi health.
670 *
671 * Logged from:
672 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
673 */
674message WifiHealthStatReported {
675 // duration this stat is obtained over in milliseconds
676 optional int32 duration_millis = 1;
677 // whether wifi is classified as sufficient for the user's data traffic, determined
678 // by whether the calculated throughput exceeds the average demand within |duration_millis|
679 optional bool is_sufficient = 2;
680 // whether the calculated throughput is exceeds the minimum required for typical usage
681 optional bool is_throughput_good = 3;
682 // whether cellular data is available
683 optional bool is_cell_data_available = 4;
684 // the WLAN channel the connected network is on (ie. 2412)
685 optional int32 frequency = 5;
686}
687
688/**
689 * Logged when wifi detects a significant change in connection failure rate.
690 *
691 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
692 *
693 */
694message WifiFailureStatReported {
695 enum AbnormalityType {
696 UNKNOWN = 0;
697 SIGNIFICANT_INCREASE = 1;
698 SIGNIFICANT_DECREASE = 2;
699 SIMPLY_HIGH = 3;
700 }
701 enum FailureType {
702 FAILURE_UNKNOWN = 0;
703 FAILURE_CONNECTION = 1;
704 FAILURE_ASSOCIATION_REJECTION = 2;
705 FAILURE_ASSOCIATION_TIMEOUT = 3;
706 FAILURE_AUTHENTICATION = 4;
707 FAILURE_NON_LOCAL_DISCONNECTION = 5;
708 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
709 }
710 // Reason for uploading this stat
711 optional AbnormalityType abnormality_type = 1;
712 // The particular type of failure
713 optional FailureType failure_type = 2;
714 // How many times we have encountered this combination of AbnormalityType and FailureType
715 optional int32 failure_count = 3;
716}
717
718/**
719 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
720 *
721 * Logged from:
722 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
723 */
724message WifiConnectionResultReported {
725 enum FailureCode {
726 FAILURE_UNKNOWN = 0;
727 FAILURE_ASSOCIATION_TIMEOUT = 1;
728 FAILURE_ASSOCIATION_REJECTION = 2;
729 FAILURE_AUTHENTICATION_GENERAL = 3;
730 FAILURE_AUTHENTICATION_EAP = 4;
731 FAILURE_DHCP = 5;
732 FAILURE_NETWORK_DISCONNECTION = 6;
733 FAILURE_ROAM_TIMEOUT = 7;
734 }
735 // true represents a successful connection
736 optional bool connection_result = 1;
737 // reason for the connection failure
738 optional FailureCode failure_code = 2;
739 // scan rssi before the connection attempt
740 optional int32 rssi = 3;
741}
742
743/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700744 * Logs when memory stats of a process is reported.
745 *
746 * Logged from:
747 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
748 */
749message ProcessMemoryStatReported {
750 optional int32 uid = 1;
751 optional string process_name = 2;
752 optional string package_name = 3;
753 //TODO: remove this when validation is done
754 optional int64 version = 9;
755 optional int64 pss = 4;
756 optional int64 uss = 5;
757 optional int64 rss = 6;
758 enum Type {
759 ADD_PSS_INTERNAL_SINGLE = 0;
760 ADD_PSS_INTERNAL_ALL_MEM = 1;
761 ADD_PSS_INTERNAL_ALL_POLL = 2;
762 ADD_PSS_EXTERNAL = 3;
763 ADD_PSS_EXTERNAL_SLOW = 4;
764 }
765 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800766 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700767}
768
769/**
Bookatzc1a050a2017-10-10 15:49:28 -0700770 * Logs that a process started, finished, crashed, or ANRed.
771 *
772 * Logged from:
773 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
774 */
775message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700776 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700777
David Chen0b5c90c2018-01-25 16:51:49 -0800778 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800779 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700780
Bookatzddccf0a2017-11-28 16:48:14 -0800781 // What lifecycle state the process changed to.
782 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800783 enum State {
784 FINISHED = 0;
785 STARTED = 1;
786 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800787 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800788 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700789}
790
Bookatzc1a050a2017-10-10 15:49:28 -0700791/**
792 * Logs when the ble scan state changes.
793 *
794 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700795 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700796 */
797message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800798 repeated AttributionNode attribution_node = 1
799 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700800
801 enum State {
802 OFF = 0;
803 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700804 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
805 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700806 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800807 optional State state = 2 [
808 (state_field_option).option = EXCLUSIVE_STATE,
809 (state_field_option).default_state_value = 0 /* State.OFF */,
810 (state_field_option).reset_state_value = 2 /* State.RESET */,
811 (state_field_option).nested = true
812 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700813
Bookatze5ec0b42018-03-26 13:34:56 -0700814 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800815 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700816 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800817 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700818 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800819 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700820}
821
822/**
823 * Logs reporting of a ble scan finding results.
824 *
825 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700826 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700827 */
Bookatzae6738e2018-09-13 11:38:56 -0700828// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700829message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800830 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700831
832 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800833 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700834}
835
836/**
837 * Logs when a sensor state changes.
838 *
839 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700840 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700841 */
842message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800843 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700844
Bookatzc1a050a2017-10-10 15:49:28 -0700845 // The id (int) of the sensor.
846 optional int32 sensor_id = 2;
847
848 enum State {
849 OFF = 0;
850 ON = 1;
851 }
852 optional State state = 3;
853}
854
Bookatzc1a050a2017-10-10 15:49:28 -0700855/**
856 * Logs when GPS state changes.
857 *
858 * Logged from:
859 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
860 */
861message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800862 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700863
864 enum State {
865 OFF = 0;
866 ON = 1;
867 }
868 optional State state = 2;
869}
870
Bookatz48d362e2018-11-06 15:49:08 -0800871/**
872 * Logs when GPS signal quality.
873 *
874 * Logged from:
875 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
876 */
877message GpsSignalQualityChanged {
878 optional android.server.location.GpsSignalQualityEnum level = 1;
879}
880
Bookatzc1a050a2017-10-10 15:49:28 -0700881
882/**
883 * Logs when a sync manager sync state changes.
884 *
885 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700886 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700887 */
888message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800889 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700890
David Chen0b5c90c2018-01-25 16:51:49 -0800891 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800892 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700893
894 enum State {
895 OFF = 0;
896 ON = 1;
897 }
898 optional State state = 3;
899}
900
Yangster-mac96353002018-09-05 11:18:55 -0700901/*
902 * Deferred job stats.
903 *
904 * Logged from:
905 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
906*/
907message DeferredJobStatsReported {
908 repeated AttributionNode attribution_node = 1;
909
910 // Number of jobs deferred.
911 optional int32 num_jobs_deferred = 2;
912
913 // Time since the last job runs.
914 optional int64 time_since_last_job_millis = 3;
915}
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917/**
918 * Logs when a job scheduler job state changes.
919 *
920 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700921 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700922 */
923message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800924 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700925
926 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800927 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700928
929 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800930 FINISHED = 0;
931 STARTED = 1;
932 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700933 }
934 optional State state = 3;
935
Tej Singh33a412b2018-03-16 18:43:59 -0700936 // The reason a job has stopped.
937 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700938 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700939 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100940
941 // The standby bucket of the app that scheduled the job. These match the framework constants
942 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
943 // already assigned 0.
944 enum Bucket {
945 UNKNOWN = -1;
946 ACTIVE = 0;
947 WORKING_SET = 1;
948 FREQUENT = 2;
949 RARE = 3;
950 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800951 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100952 }
953 optional Bucket standby_bucket = 5 [default = UNKNOWN];
954
955 // The job id (as assigned by the app).
956 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700957}
958
959/**
960 * Logs when the audio state changes.
961 *
962 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700963 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700964 */
965message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800966 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700967
968 enum State {
969 OFF = 0;
970 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700971 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
972 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700973 }
974 optional State state = 2;
975}
976
977/**
978 * Logs when the video codec state changes.
979 *
980 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700981 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700982 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800983message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800984 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700985
986 enum State {
987 OFF = 0;
988 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700989 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
990 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700991 }
992 optional State state = 2;
993}
994
995/**
996 * Logs when the flashlight state changes.
997 *
998 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700999 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001000 */
1001message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001002 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001003
1004 enum State {
1005 OFF = 0;
1006 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001007 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1008 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001009 }
1010 optional State state = 2;
1011}
1012
1013/**
1014 * Logs when the camera state changes.
1015 *
1016 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001017 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001018 */
1019message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001020 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001021
1022 enum State {
1023 OFF = 0;
1024 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001025 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1026 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001027 }
1028 optional State state = 2;
1029}
1030
1031/**
1032 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001033 *
1034 * Logged from:
1035 * TODO
1036 */
Bookatzd6746242017-10-24 18:39:35 -07001037message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001038 repeated AttributionNode attribution_node = 1
1039 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001040
Bookatz1a1b0462018-01-12 11:47:03 -08001041 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1042 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001043 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001044 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001045
1046 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001047 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001048
1049 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001050 RELEASE = 0;
1051 ACQUIRE = 1;
1052 CHANGE_RELEASE = 2;
1053 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001054 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001055 optional State state = 4 [
1056 (state_field_option).option = EXCLUSIVE_STATE,
1057 (state_field_option).default_state_value = 0,
1058 (state_field_option).nested = true
1059 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001060}
1061
1062/**
Bookatzc1a050a2017-10-10 15:49:28 -07001063 * Logs when a partial wakelock is considered 'long' (over 1 min).
1064 *
1065 * Logged from:
1066 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1067 */
1068message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001069 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001070
Yao Chend54f9dd2017-10-17 17:37:48 +00001071 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1072 optional string tag = 2;
1073
Bookatzc1a050a2017-10-10 15:49:28 -07001074 // TODO: I have no idea what this is.
1075 optional string history_tag = 3;
1076
1077 enum State {
1078 OFF = 0;
1079 ON = 1;
1080 }
1081 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001082}
1083
Bookatzc1a050a2017-10-10 15:49:28 -07001084/**
Bookatza66083f2018-09-20 17:24:00 -07001085 * Logs when the device is interactive, according to the PowerManager Notifier.
1086 *
1087 * Logged from:
1088 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1089 */
1090message InteractiveStateChanged {
1091 enum State {
1092 OFF = 0;
1093 ON = 1;
1094 }
1095 optional State state = 1;
1096}
1097
1098/**
Bookatzc1a050a2017-10-10 15:49:28 -07001099 * Logs Battery Saver state change.
1100 *
1101 * Logged from:
1102 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1103 */
1104message BatterySaverModeStateChanged {
1105 enum State {
1106 OFF = 0;
1107 ON = 1;
1108 }
1109 optional State state = 1;
1110}
1111
1112/**
1113 * Logs Doze mode state change.
1114 *
1115 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001116 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001117 */
1118message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001119 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001120}
1121
1122
1123/**
1124 * Logs state change of Doze mode including maintenance windows.
1125 *
1126 * Logged from:
1127 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1128 */
1129message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001130 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001131}
1132
1133/**
1134 * Logs screen brightness level.
1135 *
1136 * Logged from:
1137 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1138 */
1139message ScreenBrightnessChanged {
1140 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1141 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001142}
1143
1144/**
1145 * Logs battery level (percent full, from 0 to 100).
1146 *
1147 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001148 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001149 */
1150message BatteryLevelChanged {
1151 // Battery level. Should be in [0, 100].
1152 optional int32 battery_level = 1;
1153}
1154
1155/**
1156 * Logs change in charging status of the device.
1157 *
1158 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001159 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001160 */
1161message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001162 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1163 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001164}
1165
1166/**
1167 * Logs whether the device is plugged in, and what power source it is using.
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 PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001173 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1174 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001175}
1176
Bookatz8c6571b2017-10-24 15:04:41 -07001177/**
1178 * Logs when an app's wakeup alarm fires.
1179 *
1180 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001181 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001182 */
1183message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001184 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001185
1186 // Name of the wakeup alarm.
1187 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001188
1189 // Name of source package (for historical reasons, since BatteryStats tracked it).
1190 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001191
1192 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1193 enum Bucket {
1194 UNKNOWN = 0;
1195 EXEMPTED = 5;
1196 ACTIVE = 10;
1197 WORKING_SET = 20;
1198 FREQUENT = 30;
1199 RARE = 40;
1200 NEVER = 50;
1201 }
1202 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1203 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001204}
1205
1206/**
1207 * Logs when an an app causes the mobile radio to change state.
1208 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1209 *
1210 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001211 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001212 */
1213message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001214 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001215
Bookatz1a1b0462018-01-12 11:47:03 -08001216 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1217 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001218}
1219
1220/**
1221 * Logs when an an app causes the wifi radio to change state.
1222 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1223 *
1224 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001225 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001226 */
1227message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001228 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001229
Bookatz1a1b0462018-01-12 11:47:03 -08001230 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1231 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001232}
1233
1234/**
1235 * Logs kernel wakeup reasons and aborts.
1236 *
1237 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001238 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001239 */
1240message KernelWakeupReported {
1241 // Name of the kernel wakeup reason (or abort).
1242 optional string wakeup_reason_name = 1;
1243
1244 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001245 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001246}
1247
1248/**
Bookatzda1798c2018-12-13 14:16:00 -08001249 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001250 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001251 *
1252 * Logged from:
1253 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1254 */
1255message WifiEnabledStateChanged {
1256 enum State {
1257 OFF = 0;
1258 ON = 1;
1259 }
1260 optional State state = 1;
1261}
1262
1263/**
tsaichristinececebdc2020-02-04 14:05:56 -08001264 * This atom is deprecated starting in R.
1265 *
Bookatzda1798c2018-12-13 14:16:00 -08001266 * 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 -08001267 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1268 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001269 *
1270 * Logged from:
1271 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1272 */
1273message WifiRunningStateChanged {
1274 repeated AttributionNode attribution_node = 1;
1275
1276 enum State {
1277 OFF = 0;
1278 ON = 1;
1279 }
1280 optional State state = 2;
1281}
1282
1283/**
Bookatze5885242017-10-24 20:10:31 -07001284 * Logs wifi locks held by an app.
1285 *
1286 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001287 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001288 */
1289message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001290 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001291
1292 enum State {
1293 OFF = 0;
1294 ON = 1;
1295 }
1296 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001297
1298 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1299 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001300}
1301
1302/**
1303 * Logs wifi signal strength changes.
1304 *
1305 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001306 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001307 */
1308message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001309 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1310 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001311}
1312
1313/**
1314 * Logs wifi scans performed by an app.
1315 *
1316 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001317 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001318 */
1319message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001320 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001321
1322 enum State {
1323 OFF = 0;
1324 ON = 1;
1325 }
1326 optional State state = 2;
1327}
1328
1329/**
Tej Singh4503e102018-01-04 14:35:01 -08001330 * Logs wifi multicast locks held by an app
1331 *
1332 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001333 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001334 */
1335message WifiMulticastLockStateChanged {
1336 repeated AttributionNode attribution_node = 1;
1337
1338 enum State {
1339 OFF = 0;
1340 ON = 1;
1341 }
1342 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001343
1344 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001345}
1346
1347/**
Tej Singh1ea42892018-01-19 09:27:00 -08001348 * Logs shutdown reason and duration on next boot.
1349 *
1350 * Logged from:
1351 * frameworks/base/core/java/com/android/server/BootReceiver.java
1352 */
1353message ShutdownSequenceReported {
1354 // True if shutdown is for a reboot. Default: false if we do not know.
1355 optional bool reboot = 1;
1356
1357 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1358 optional string reason = 2;
1359
1360 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1361 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001362 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001363
1364 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001365 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001366}
1367
Tej Singh6483ea42018-01-25 17:45:49 -08001368
1369/**
1370 * Logs boot reason and duration.
1371 *
1372 * Logged from:
1373 * system/core/bootstat/bootstat.cpp
1374 */
1375message BootSequenceReported {
1376 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1377 // Default: "<EMPTY>" if not available.
1378 optional string bootloader_reason = 1;
1379
1380 // Reason for system boot. Eg. bootloader, reboot,userrequested
1381 // Default: "<EMPTY>" if not available.
1382 optional string system_reason = 2;
1383
1384 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001385 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001386
1387 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001388 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001389
1390 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001392
1393 // Time since last boot in ms. Default: 0 if not available.
1394 optional int64 time_since_last_boot = 6;
1395}
1396
Tej Singhc477d9c2018-02-05 18:31:39 -08001397
1398/**
1399 * Logs call state and disconnect cause (if applicable).
1400 *
1401 * Logged from:
1402 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1403 */
1404message CallStateChanged {
1405 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1406 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1407 optional android.telecom.CallStateEnum call_state = 1;
1408
1409 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1410 // This value is only applicable when the call_state is DISCONNECTED, and
1411 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1412 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1413 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1414
1415 // True if the call is self-managed, which are apps that use the
1416 // telecom infrastructure to make their own calls.
1417 optional bool self_managed = 3;
1418
1419 // True if call is external. External calls are calls on connected Wear
1420 // devices but show up in Telecom so the user can pull them onto the device.
1421 optional bool external_call = 4;
1422}
1423
Tej Singh1ea42892018-01-19 09:27:00 -08001424/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001425 * Logs keyguard state. The keyguard is the lock screen.
1426 *
1427 * Logged from:
1428 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1429 */
1430message KeyguardStateChanged {
1431 enum State {
1432 UNKNOWN = 0;
1433 // The keyguard is hidden when the phone is unlocked.
1434 HIDDEN = 1;
1435 // The keyguard is shown when the phone is locked (screen turns off).
1436 SHOWN= 2;
1437 // The keyguard is occluded when something is overlaying the keyguard.
1438 // Eg. Opening the camera while on the lock screen.
1439 OCCLUDED = 3;
1440 }
1441 optional State state = 1;
1442}
1443
1444/**
1445 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1446 * prompts the user to enter a password (pattern, pin, etc).
1447 *
1448 * Logged from:
1449 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1450 */
1451
1452message KeyguardBouncerStateChanged {
1453 enum State {
1454 UNKNOWN = 0;
1455 // Bouncer is hidden, either as a result of successfully entering the
1456 // password, screen timing out, or user going back to lock screen.
1457 HIDDEN = 1;
1458 // This is when the user is being prompted to enter the password.
1459 SHOWN = 2;
1460 }
1461 optional State state = 1;
1462}
1463
1464/**
1465 * Logs the result of entering a password into the keyguard bouncer.
1466 *
1467 * Logged from:
1468 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1469 */
1470message KeyguardBouncerPasswordEntered {
1471 enum BouncerResult {
1472 UNKNOWN = 0;
1473 // The password entered was incorrect.
1474 FAILURE = 1;
1475 // The password entered was correct.
1476 SUCCESS = 2;
1477 }
1478 optional BouncerResult result = 1;
1479}
1480
Tej Singha883b372018-02-15 11:30:01 -08001481/*
1482 * Logs changes to the configuration of the device. The configuration is defined
1483 * in frameworks/base/core/java/android/content/res/Configuration.java
1484 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1485 * Please go there to interpret the possible values each field can be.
1486 *
1487 * Logged from:
1488 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1489 */
1490message ResourceConfigurationChanged {
1491 // Bit mask of color capabilities of the screen.
1492 // Contains information about the color gamut and hdr mode of the screen.
1493 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001494 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001495
1496 // The target screen density being rendered to.
1497 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001498 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001499
1500 // Current user preference for the scaling factor for fonts,
1501 // relative to the base density scaling.
1502 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001503 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001504
1505 // Flag indicating whether the hard keyboard is hidden.
1506 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001507 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001508
1509 // The type of keyboard attached to the device.
1510 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1511 optional int32 keyboard = 5;
1512
1513 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1514 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001515 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001516
1517 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1518 // 0 if undefined.
1519 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1520 optional int32 mcc = 7;
1521
1522 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1523 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1524 // MNC_ZERO symbol defined in Configuration.java.
1525 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1526 optional int32 mnc = 8;
1527
1528 // The kind of navigation available on the device.
1529 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1530 optional int32 navigation = 9;
1531
1532 // Flag indicating whether the navigation is available.
1533 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001534 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001535
1536 // Overall orientation of the screen.
1537 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1538 optional int32 orientation = 11;
1539
1540 // The current height of the available screen space, in dp units.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // Bit mask of overall layout of the screen.
1545 // Contains information about screen size, whether the screen is wider/taller
1546 // than normal, whether the screen layout is right-tl-left or left-to-right,
1547 // and whether the screen has a rounded shape.
1548 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001549 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001550
1551 // Current width of the available screen space, in dp units.
1552 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001553 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001554
1555 // The smallest screen size an application will see in normal operation.
1556 // This is the smallest value of both screenWidthDp and screenHeightDp
1557 // in portrait and landscape.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // The type of touch screen attached to the device.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1563 optional int32 touchscreen = 16;
1564
1565 // Bit mask of the ui mode.
1566 // Contains information about the overall ui mode of the device.
1567 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1568 // Also contains information about whether the device is in night mode.
1569 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001570 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001571}
1572
Tej Singheee317b2018-03-07 19:28:05 -08001573
1574/**
1575 * Logs changes in the connection state of the mobile radio.
1576 *
1577 * Logged from:
1578 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1579 */
1580message MobileConnectionStateChanged {
1581 // States are from the state machine DataConnection.java.
1582 enum State {
1583 UNKNOWN = 0;
1584 // The connection is inactive, or disconnected.
1585 INACTIVE = 1;
1586 // The connection is being activated, or connecting.
1587 ACTIVATING = 2;
1588 // The connection is active, or connected.
1589 ACTIVE = 3;
1590 // The connection is disconnecting.
1591 DISCONNECTING = 4;
1592 // The connection is disconnecting after creating a connection.
1593 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1594 }
1595 optional State state = 1;
1596 // For multi-sim phones, this distinguishes between the sim cards.
1597 optional int32 sim_slot_index = 2;
1598 // Used to identify the connection. Starts at 0 and increments by 1 for
1599 // every new network created. Resets whenever the device reboots.
1600 optional int32 data_connection_id = 3;
1601 // A bitmask for the capabilities of this connection.
1602 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1603 // Default value (if we have no information): 0
1604 optional int64 capabilities = 4;
1605 // If this connection has internet.
1606 // This just checks if the DEFAULT bit of capabilities is set.
1607 optional bool has_internet = 5;
1608}
1609
1610/**
1611 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1612 *
1613 * Logged from:
1614 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1615 */
1616message MobileRadioTechnologyChanged {
1617 optional android.telephony.NetworkTypeEnum state = 1;
1618 // For multi-sim phones, this distinguishes between the sim cards.
1619 optional int32 sim_slot_index = 2;
1620}
1621
Andrew Chantb56388b2018-03-22 21:07:33 -07001622/**
1623 * Logs the VID and PID of any connected USB devices.
1624 *
1625 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1626 *
1627 * Logged by Vendor.
1628 */
1629message UsbDeviceAttached {
1630 optional int32 vid = 1;
1631 optional int32 pid = 2;
1632 optional bool has_audio = 3;
1633 optional bool has_hid = 4;
1634 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001635 enum State {
1636 STATE_DISCONNECTED = 0;
1637 STATE_CONNECTED = 1;
1638 }
1639 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001640 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001641}
1642
Tej Singheee317b2018-03-07 19:28:05 -08001643
Tej Singhdd7bd352018-02-09 19:33:15 -08001644/**
Tej Singh5d991e12018-03-09 19:48:11 -08001645 * Logs when Bluetooth is enabled and disabled.
1646 *
1647 * Logged from:
1648 * services/core/java/com/android/server/BluetoothManagerService.java
1649 */
1650message BluetoothEnabledStateChanged {
1651 repeated AttributionNode attribution_node = 1;
1652 // Whether or not bluetooth is enabled on the device.
1653 enum State {
1654 UNKNOWN = 0;
1655 ENABLED = 1;
1656 DISABLED = 2;
1657 }
1658 optional State state = 2;
1659 // The reason for being enabled/disabled.
1660 // Eg. Airplane mode, crash, application request.
1661 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1662 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001663 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001664}
1665
1666/**
Jack Hed9837c82019-01-09 01:19:13 -08001667 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001668 *
1669 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001670 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1671 *
1672 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001673 */
1674message BluetoothConnectionStateChanged {
1675 // The state of the connection.
1676 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1677 optional android.bluetooth.ConnectionStateEnum state = 1;
1678 // An identifier that can be used to match connect and disconnect events.
1679 // Currently is last two bytes of a hash of a device level ID and
1680 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001681 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001682 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001683 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1684 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001685 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001686 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001687 // An identifier that can be used to match events for this device.
1688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1689 // Salt: Randomly generated 256 bit value
1690 // Hash algorithm: HMAC-SHA256
1691 // Size: 32 byte
1692 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001693 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001694}
1695
1696/**
1697 * Logs when a Bluetooth device connects and disconnects over ACL
1698 *
1699 * Logged from:
1700 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1701 *
1702 * Next Tag: 3
1703 */
1704message BluetoothAclConnectionStateChanged {
1705 // An identifier that can be used to match events for this device.
1706 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1707 // Salt: Randomly generated 256 bit value
1708 // Hash algorithm: HMAC-SHA256
1709 // Size: 32 byte
1710 // Default: null or empty if the device identifier is not known
1711 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1712 // The state of the connection.
1713 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1714 optional android.bluetooth.ConnectionStateEnum state = 2;
1715}
1716
1717/**
1718 * Logs when a Bluetooth device connects and disconnects over SCO
1719 *
1720 * Logged from:
1721 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1722 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1723 *
1724 * Next Tag: 4
1725 */
1726message BluetoothScoConnectionStateChanged {
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 // Codec used for this SCO connection
1738 // Default: UNKNOWN
1739 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001740}
1741
Jack Hec27040a2019-01-09 20:54:41 -08001742/**
1743 * Logged when active device of a profile changes
1744 *
1745 * Logged from:
1746 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1747 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1749 */
1750message BluetoothActiveDeviceChanged {
1751 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1752 // From android.bluetooth.BluetoothProfile
1753 optional int32 bt_profile = 1;
1754 // An identifier that can be used to match events for this new active device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if there is no active device for this profile
1760 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1761}
1762
Jack Heab86dbd22018-12-18 15:43:27 -08001763// Logs when there is an event affecting Bluetooth device's link layer connection.
1764// - This event is triggered when there is a related HCI command or event
1765// - Users of this metrics can deduce Bluetooth device's connection state from these events
1766// - HCI commands are logged before the command is sent, after receiving command status, and after
1767// receiving command complete
1768// - HCI events are logged when they arrive
1769//
1770// Low level log from system/bt
1771//
1772// Bluetooth classic commands:
1773// - CMD_CREATE_CONNECTION
1774// - CMD_DISCONNECT
1775// - CMD_CREATE_CONNECTION_CANCEL
1776// - CMD_ACCEPT_CONNECTION_REQUEST
1777// - CMD_REJECT_CONNECTION_REQUEST
1778// - CMD_SETUP_ESCO_CONNECTION
1779// - CMD_ACCEPT_ESCO_CONNECTION
1780// - CMD_REJECT_ESCO_CONNECTION
1781// - CMD_ENH_SETUP_ESCO_CONNECTION
1782// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1783//
1784// Bluetooth low energy commands:
1785// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1786// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1787// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1788// - CMD_BLE_CLEAR_WHITE_LIST
1789// - CMD_BLE_ADD_WHITE_LIST
1790// - CMD_BLE_REMOVE_WHITE_LIST
1791//
1792// Bluetooth classic events:
1793// - EVT_CONNECTION_COMP
1794// - EVT_CONNECTION_REQUEST
1795// - EVT_DISCONNECTION_COMP
1796// - EVT_ESCO_CONNECTION_COMP
1797// - EVT_ESCO_CONNECTION_CHANGED
1798//
1799// Bluetooth low energy meta events:
1800// - BLE_EVT_CONN_COMPLETE_EVT
1801// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1802//
1803// Next tag: 10
1804message BluetoothLinkLayerConnectionEvent {
1805 // An identifier that can be used to match events for this device.
1806 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1807 // Salt: Randomly generated 256 bit value
1808 // Hash algorithm: HMAC-SHA256
1809 // Size: 32 byte
1810 // Default: null or empty if the device identifier is not known
1811 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1812 // Connection handle of this connection if available
1813 // Range: 0x0000 - 0x0EFF (12 bits)
1814 // Default: 0xFFFF if the handle is unknown
1815 optional int32 connection_handle = 2;
1816 // Direction of the link
1817 // Default: DIRECTION_UNKNOWN
1818 optional android.bluetooth.DirectionEnum direction = 3;
1819 // Type of this link
1820 // Default: LINK_TYPE_UNKNOWN
1821 optional android.bluetooth.LinkTypeEnum type = 4;
1822
1823 // Reason metadata for this link layer connection event, rules for interpretation:
1824 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1825 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1826 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1827 // set and valid, ignore hci_ble_event
1828
1829 // HCI command associated with this event
1830 // Default: CMD_UNKNOWN
1831 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1832 // HCI event associated with this event
1833 // Default: EVT_UNKNOWN
1834 optional android.bluetooth.hci.EventEnum hci_event = 6;
1835 // HCI BLE meta event associated with this event
1836 // Default: BLE_EVT_UNKNOWN
1837 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1838 // HCI command status code if this is triggerred by hci_cmd
1839 // Default: STATUS_UNKNOWN
1840 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1841 // HCI reason code associated with this event
1842 // Default: STATUS_UNKNOWN
1843 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1844}
1845
Howard Roe103fe22019-01-17 16:52:16 -08001846/**
1847 * Logs when a module is rolled back by Watchdog.
1848 *
1849 * Logged from: Rollback Manager
1850 */
1851message WatchdogRollbackOccurred {
1852 enum RollbackType {
1853 UNKNOWN = 0;
1854 ROLLBACK_INITIATE = 1;
1855 ROLLBACK_SUCCESS = 2;
1856 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001857 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001858 }
1859 optional RollbackType rollback_type = 1;
1860
1861 optional string package_name = 2;
1862
1863 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001864
1865 enum RollbackReasonType {
1866 REASON_UNKNOWN = 0;
1867 REASON_NATIVE_CRASH = 1;
1868 REASON_EXPLICIT_HEALTH_CHECK = 2;
1869 REASON_APP_CRASH = 3;
1870 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001871 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001872 }
1873 optional RollbackReasonType rollback_reason = 4;
1874
1875 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1876 // is initiated. Empty if the package is unknown.
1877 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001878
1879 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001880}
1881
Jack Hec27040a2019-01-09 20:54:41 -08001882/**
1883 * Logs when there is a change in Bluetooth A2DP playback state
1884 *
1885 * Logged from:
1886 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1887 */
1888message BluetoothA2dpPlaybackStateChanged {
1889 // An identifier that can be used to match events for this device.
1890 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1891 // Salt: Randomly generated 256 bit value
1892 // Hash algorithm: HMAC-SHA256
1893 // Size: 32 byte
1894 // Default: null or empty if the device identifier is not known
1895 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1896 // Current playback state
1897 // Default: PLAYBACK_STATE_UNKNOWN
1898 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1899 // Current audio coding mode
1900 // Default: AUDIO_CODING_MODE_UNKNOWN
1901 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1902}
1903
1904/**
1905 * Logs when there is a change in A2DP codec config for a particular remote device
1906 *
1907 * Logged from:
1908 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1909 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1910 */
1911message BluetoothA2dpCodecConfigChanged {
1912 // An identifier that can be used to match events for this device.
1913 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1914 // Salt: Randomly generated 256 bit value
1915 // Hash algorithm: HMAC-SHA256
1916 // Size: 32 byte
1917 // Default: null or empty if the device identifier is not known
1918 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1919 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1920 // Default SOURCE_CODEC_TYPE_INVALID
1921 optional int32 codec_type = 2;
1922 // Codec priroity, the higher the more preferred, -1 for disabled
1923 // Default: CODEC_PRIORITY_DEFAULT
1924 optional int32 codec_priority = 3;
1925 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1926 // Default: SAMPLE_RATE_NONE
1927 optional int32 sample_rate = 4;
1928 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1929 // Default: BITS_PER_SAMPLE_NONE
1930 optional int32 bits_per_sample = 5;
1931 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1932 // Default: CHANNEL_MODE_NONE
1933 optional int32 channel_mode = 6;
1934 // Codec specific values
1935 // Default 0
1936 optional int64 codec_specific_1 = 7;
1937 optional int64 codec_specific_2 = 8;
1938 optional int64 codec_specific_3 = 9;
1939 optional int64 codec_specific_4 = 10;
1940}
1941
1942/**
1943 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1944 * Each codec's capability is logged separately due to statsd restriction
1945 *
1946 * Logged from:
1947 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1948 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1949 */
1950message BluetoothA2dpCodecCapabilityChanged {
1951 // An identifier that can be used to match events for this device.
1952 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1953 // Salt: Randomly generated 256 bit value
1954 // Hash algorithm: HMAC-SHA256
1955 // Size: 32 byte
1956 // Default: null or empty if the device identifier is not known
1957 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1958 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1959 // Default SOURCE_CODEC_TYPE_INVALID
1960 optional int32 codec_type = 2;
1961 // Codec priroity, the higher the more preferred, -1 for disabled
1962 // Default: CODEC_PRIORITY_DEFAULT
1963 optional int32 codec_priority = 3;
1964 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1965 // in BluetoothCodecConfig
1966 // Default: empty and SAMPLE_RATE_NONE for individual item
1967 optional int32 sample_rate = 4;
1968 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1969 // in BluetoothCodecConfig
1970 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1971 optional int32 bits_per_sample = 5;
1972 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1973 // BluetoothCodecConfig
1974 // Default: empty and CHANNEL_MODE_NONE for individual item
1975 optional int32 channel_mode = 6;
1976 // Codec specific values
1977 // Default 0
1978 optional int64 codec_specific_1 = 7;
1979 optional int64 codec_specific_2 = 8;
1980 optional int64 codec_specific_3 = 9;
1981 optional int64 codec_specific_4 = 10;
1982}
1983
1984/**
1985 * Logs when A2DP failed to read from PCM source.
1986 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1987 *
1988 * Logged from:
1989 * system/bt
1990 */
1991message BluetoothA2dpAudioUnderrunReported {
1992 // An identifier that can be used to match events for this device.
1993 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1994 // Salt: Randomly generated 256 bit value
1995 // Hash algorithm: HMAC-SHA256
1996 // Size: 32 byte
1997 // Default: null or empty if the device identifier is not known
1998 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1999 // Encoding interval in nanoseconds
2000 // Default: 0
2001 optional int64 encoding_interval_nanos = 2;
2002 // Number of bytes of PCM data that could not be read from the source
2003 // Default: 0
2004 optional int32 num_missing_pcm_bytes = 3;
2005}
2006
2007/**
2008 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2009 * buffer queue is full and we have to drop data
2010 *
2011 * Logged from:
2012 * system/bt
2013 */
2014message BluetoothA2dpAudioOverrunReported {
2015 // An identifier that can be used to match events for this device.
2016 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2017 // Salt: Randomly generated 256 bit value
2018 // Hash algorithm: HMAC-SHA256
2019 // Size: 32 byte
2020 // Default: null or empty if the device identifier is not known
2021 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2022 // Encoding interval in nanoseconds
2023 // Default: 0
2024 optional int64 encoding_interval_nanos = 2;
2025 // Number of buffers dropped in this event
2026 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2027 // Default: 0
2028 optional int32 num_dropped_buffers = 3;
2029 // Number of encoded buffers dropped in this event
2030 // Default 0
2031 optional int32 num_dropped_encoded_frames = 4;
2032 // Number of encoded bytes dropped in this event
2033 // Default: 0
2034 optional int32 num_dropped_encoded_bytes = 5;
2035}
2036
2037/**
2038 * Logs when we receive reports regarding a device's RSSI value
2039 *
2040 * Logged from:
2041 * system/bt
2042 */
2043message BluetoothDeviceRssiReported {
2044 // An identifier that can be used to match events for this device.
2045 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2046 // Salt: Randomly generated 256 bit value
2047 // Hash algorithm: HMAC-SHA256
2048 // Size: 32 byte
2049 // Default: null or empty if the device identifier is not known
2050 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2051 // Connection handle of this connection if available
2052 // Range: 0x0000 - 0x0EFF (12 bits)
2053 // Default: 0xFFFF if the handle is unknown
2054 optional int32 connection_handle = 2;
2055 // HCI command status code if this is triggerred by hci_cmd
2056 // Default: STATUS_UNKNOWN
2057 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2058 // BR/EDR
2059 // Range: -128 ≤ N ≤ 127 (signed integer)
2060 // Units: dB
2061 // LE:
2062 // Range: -127 to 20, 127 (signed integer)
2063 // Units: dBm
2064 // Invalid when an out of range value is reported
2065 optional int32 rssi = 4;
2066}
2067
2068/**
2069 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2070 *
2071 * Logged from:
2072 * system/bt
2073 */
2074message BluetoothDeviceFailedContactCounterReported {
2075 // An identifier that can be used to match events for this device.
2076 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2077 // Salt: Randomly generated 256 bit value
2078 // Hash algorithm: HMAC-SHA256
2079 // Size: 32 byte
2080 // Default: null or empty if the device identifier is not known
2081 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2082 // Connection handle of this connection if available
2083 // Range: 0x0000 - 0x0EFF (12 bits)
2084 // Default: 0xFFFF if the handle is unknown
2085 optional int32 connection_handle = 2;
2086 // HCI command status code if this is triggerred by hci_cmd
2087 // Default: STATUS_UNKNOWN
2088 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2089 // Number of consecutive failed contacts for a connection corresponding to the Handle
2090 // Range: uint16_t, 0-0xFFFF
2091 // Default: 0xFFFFF
2092 optional int32 failed_contact_counter = 4;
2093}
2094
2095/**
2096 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2097 *
2098 * Logged from:
2099 * system/bt
2100 */
2101message BluetoothDeviceTxPowerLevelReported {
2102 // An identifier that can be used to match events for this device.
2103 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2104 // Salt: Randomly generated 256 bit value
2105 // Hash algorithm: HMAC-SHA256
2106 // Size: 32 byte
2107 // Default: null or empty if the device identifier is not known
2108 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2109 // Connection handle of this connection if available
2110 // Range: 0x0000 - 0x0EFF (12 bits)
2111 // Default: 0xFFFF if the handle is unknown
2112 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002113 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002114 // Default: STATUS_UNKNOWN
2115 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2116 // Range: -30 ≤ N ≤ 20
2117 // Units: dBm
2118 // Invalid when an out of range value is reported
2119 optional int32 transmit_power_level = 4;
2120}
Jack Heab86dbd22018-12-18 15:43:27 -08002121
Tej Singh5d991e12018-03-09 19:48:11 -08002122/**
Jack He1021a612019-01-20 21:22:46 -08002123 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2124 * receiving an HCI command from the host
2125 *
2126 * Logged from: system/bt
2127 */
2128message BluetoothHciTimeoutReported {
2129 // HCI command associated with this event
2130 // Default: CMD_UNKNOWN
2131 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2132}
2133
2134/**
2135 * Logs when we receive Bluetooth Link Quality Report event from the controller
2136 * See Android Bluetooth HCI specification for more details
2137 *
2138 * Note: all count and bytes field are counted since last event
2139 *
2140 * Logged from: system/bt
2141 */
2142message BluetoothQualityReportReported {
2143 // Quality report ID
2144 // Original type: uint8_t
2145 // Default: BQR_ID_UNKNOWN
2146 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2147 // Packet type of the connection
2148 // Original type: uint8_t
2149 // Default: BQR_PACKET_TYPE_UNKNOWN
2150 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2151 // Connection handle of the connection
2152 // Original type: uint16_t
2153 optional int32 connection_handle = 3;
2154 // Performing Role for the connection
2155 // Original type: uint8_t
2156 optional int32 connection_role = 4;
2157 // Current Transmit Power Level for the connection. This value is the same as the controller's
2158 // response to the HCI_Read_Transmit_Power_Level HCI command
2159 // Original type: uint8_t
2160 optional int32 tx_power_level = 5;
2161 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2162 // absolute receiver signal strength value
2163 // Original type: int8_t
2164 optional int32 rssi = 6;
2165 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2166 // channels used by the link currently
2167 // Original type: uint8_t
2168 optional int32 snr = 7;
2169 // Indicates the number of unused channels in AFH_channel_map
2170 // Original type: uint8_t
2171 optional int32 unused_afh_channel_count = 8;
2172 // Indicates the number of the channels which are interfered and quality is bad but are still
2173 // selected for AFH
2174 // Original type: uint8_t
2175 optional int32 afh_select_unideal_channel_count = 9;
2176 // Current Link Supervision Timeout Setting
2177 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2178 // Original type: uint16_t
2179 optional int32 lsto = 10;
2180 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2181 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2182 // 0x01 (Piconet Clock)
2183 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2184 // Original type: uint32_t
2185 optional int64 connection_piconet_clock = 11;
2186 // The count of retransmission
2187 // Original type: uint32_t
2188 optional int64 retransmission_count = 12;
2189 // The count of no RX
2190 // Original type: uint32_t
2191 optional int64 no_rx_count = 13;
2192 // The count of NAK (Negative Acknowledge)
2193 // Original type: uint32_t
2194 optional int64 nak_count = 14;
2195 // Controller timestamp of last TX ACK
2196 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2197 // Original type: uint32_t
2198 optional int64 last_tx_ack_timestamp = 15;
2199 // The count of Flow-off (STOP)
2200 // Original type: uint32_t
2201 optional int64 flow_off_count = 16;
2202 // Controller timestamp of last Flow-on (GO)
2203 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2204 // Original type: uint32_t
2205 optional int64 last_flow_on_timestamp = 17;
2206 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2207 // Original type: uint32_t
2208 optional int64 buffer_overflow_bytes = 18;
2209 // Buffer underflow count (in byte) since last event
2210 // Original type: uint32_t
2211 optional int64 buffer_underflow_bytes = 19;
2212}
2213
2214/**
2215 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2216 *
2217 * Notes:
2218 * - Each event can be partially filled as we might learn different pieces of device
2219 * information at different time
2220 * - Multiple device info events can be combined to give more complete picture
2221 * - When multiple device info events tries to describe the same information, the
2222 * later one wins
2223 *
2224 * Logged from:
2225 * packages/apps/Bluetooth
2226 */
Jack Heaea26982019-04-04 11:19:48 -07002227message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002228 // An identifier that can be used to match events for this device.
2229 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2230 // Salt: Randomly generated 256 bit value
2231 // Hash algorithm: HMAC-SHA256
2232 // Size: 32 byte
2233 // Default: null or empty if the device identifier is not known
2234 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2235 // Where is this device info obtained from
2236 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2237 // Name of the data source
2238 // For EXTERNAL: package name of the data source
2239 // For INTERNAL: null for general case, component name otherwise
2240 optional string source_name = 3;
2241 // Name of the manufacturer of this device
2242 optional string manufacturer = 4;
2243 // Model of this device
2244 optional string model = 5;
2245 // Hardware version of this device
2246 optional string hardware_version = 6;
2247 // Software version of this device
2248 optional string software_version = 7;
2249}
2250
2251/**
2252 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2253 * device, as documented by the Bluetooth Core HCI specification
2254 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2255 * Vol 2, Part E, Page 1118
2256 *
2257 * Logged from:
2258 * system/bt
2259 */
2260message BluetoothRemoteVersionInfoReported {
2261 // Connection handle of the connection
2262 // Original type: uint16_t
2263 optional int32 connection_handle = 1;
2264 // HCI command status code
2265 // Default: STATUS_UNKNOWN
2266 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2267 // 1 byte Version of current LMP in the remote controller
2268 optional int32 lmp_version = 3;
2269 // 2 bytes LMP manufacturer code of the remote controller
2270 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2271 optional int32 lmp_manufacturer_code = 4;
2272 // 4 bytes subversion of the LMP in the remote controller
2273 optional int32 lmp_subversion = 5;
2274}
2275
2276/**
2277 * Logs when certain Bluetooth SDP attributes are discovered
2278 * Constant definitions are from:
2279 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2280 *
2281 * Current logged attributes:
2282 * - BluetoothProfileDescriptorList
2283 * - Supported Features Bitmask
2284 *
2285 * Logged from:
2286 * system/bt
2287 */
2288message BluetoothSdpAttributeReported {
2289 // An identifier that can be used to match events for this device.
2290 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2291 // Salt: Randomly generated 256 bit value
2292 // Hash algorithm: HMAC-SHA256
2293 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2294 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2295 // Original type: uint16_t
2296 optional int32 protocol_uuid = 2;
2297 // Short form UUIDs used to identify Bluetooth SDP attribute types
2298 // Original type: uint16_t
2299 optional int32 attribute_id = 3;
2300 // Attribute value for the particular attribute
2301 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2302}
2303
2304/**
2305 * Logs when bond state of a Bluetooth device changes
2306 *
2307 * Logged from:
2308 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2309 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2310 */
2311message BluetoothBondStateChanged {
2312 // An identifier that can be used to match events for this device.
2313 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2314 // Salt: Randomly generated 256 bit value
2315 // Hash algorithm: HMAC-SHA256
2316 // Size: 32 byte
2317 // Default: null or empty if the device identifier is not known
2318 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2319 // Preferred transport type to remote dual mode device
2320 // Default: TRANSPORT_AUTO means no preference
2321 optional android.bluetooth.TransportTypeEnum transport = 2;
2322 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2323 // Default: UNKNOWN
2324 optional android.bluetooth.DeviceTypeEnum type = 3;
2325 // Current bond state (NONE, BONDING, BONDED)
2326 // Default: BOND_STATE_UNKNOWN
2327 optional android.bluetooth.BondStateEnum bond_state = 4;
2328 // Bonding sub state
2329 // Default: BOND_SUB_STATE_UNKNOWN
2330 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2331 // Unbond Reason
2332 // Default: UNBOND_REASON_UNKNOWN
2333 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2334}
2335
2336/**
2337 * Logs there is an event related Bluetooth classic pairing
2338 *
2339 * Logged from:
2340 * system/bt
2341 */
2342message BluetoothClassicPairingEventReported {
2343 // An identifier that can be used to match events for this device.
2344 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2345 // Salt: Randomly generated 256 bit value
2346 // Hash algorithm: HMAC-SHA256
2347 // Size: 32 byte
2348 // Default: null or empty if the device identifier is not known
2349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2350 // Connection handle of this connection if available
2351 // Range: 0x0000 - 0x0EFF (12 bits)
2352 // Default: 0xFFFF if the handle is unknown
2353 optional int32 connection_handle = 2;
2354 // HCI command associated with this event
2355 // Default: CMD_UNKNOWN
2356 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2357 // HCI event associated with this event
2358 // Default: EVT_UNKNOWN
2359 optional android.bluetooth.hci.EventEnum hci_event = 4;
2360 // HCI command status code if this is triggerred by hci_cmd
2361 // Default: STATUS_UNKNOWN
2362 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2363 // HCI reason code associated with this event
2364 // Default: STATUS_UNKNOWN
2365 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002366 // A status value related to this specific event
2367 // Default: 0
2368 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002369}
2370
2371/**
2372 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2373 *
2374 * Logged from:
2375 * system/bt
2376 */
2377message BluetoothSmpPairingEventReported {
2378 // An identifier that can be used to match events for this device.
2379 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2380 // Salt: Randomly generated 256 bit value
2381 // Hash algorithm: HMAC-SHA256
2382 // Size: 32 byte
2383 // Default: null or empty if the device identifier is not known
2384 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2385 // SMP command sent or received over L2CAP
2386 // Default: CMD_UNKNOWN
2387 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2388 // Whether this command is sent or received
2389 // Default: DIRECTION_UNKNOWN
2390 optional android.bluetooth.DirectionEnum direction = 3;
2391 // SMP failure reason code
2392 // Default: PAIRING_FAIL_REASON_DEFAULT
2393 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2394}
2395
2396/**
Jack He815cdba2019-01-30 17:24:55 -08002397 * Logs when a Bluetooth socket’s connection state changed
2398 *
2399 * Logged from:
2400 * system/bt
2401 */
2402message BluetoothSocketConnectionStateChanged {
2403 // An identifier that can be used to match events for this device.
2404 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2405 // Salt: Randomly generated 256 bit value
2406 // Hash algorithm: HMAC-SHA256
2407 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002408 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002409 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002410 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002411 // Default 0 when unknown or don't care
2412 optional int32 port = 2;
2413 // Socket type as mentioned in
2414 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2415 // Default: SOCKET_TYPE_UNKNOWN
2416 optional android.bluetooth.SocketTypeEnum type = 3;
2417 // Socket connection state
2418 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2419 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2420 // Number of bytes sent to remote device during this connection
2421 optional int64 tx_bytes = 5;
2422 // Number of bytes received from remote device during this connection
2423 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002424 // Socket owner's UID
2425 optional int32 uid = 7 [(is_uid) = true];
2426 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2427 // |port| must be spawned by |server_port|
2428 // Default 0 when unknown or don't care
2429 optional int32 server_port = 8;
2430 // Whether this is a server listener socket
2431 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002432}
2433
2434/**
Jack He71426802019-04-02 13:32:52 -07002435 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2436 *
2437 * Logged from:
2438 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2439 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2440 *
2441 */
2442message BluetoothClassOfDeviceReported {
2443 // An identifier that can be used to match events for this device.
2444 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2445 // Salt: Randomly generated 256 bit value
2446 // Hash algorithm: HMAC-SHA256
2447 // Size: 32 byte
2448 // Default: null or empty if this is a server listener socket
2449 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2450 // Class of Device (CoD) value including both Major, Minor device class and service class
2451 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2452 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2453 // Default: 0
2454 optional int32 class_of_device = 2;
2455}
2456
2457/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002458 * Logs when something is plugged into or removed from the USB-C connector.
2459 *
2460 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002461 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002462 */
2463message UsbConnectorStateChanged {
2464 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002465 STATE_DISCONNECTED = 0;
2466 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002467 }
2468 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002469 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002470 // Last active session in ms.
2471 // 0 when the port is in connected state.
2472 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002473}
2474
2475/**
2476 * Logs the reported speaker impedance.
2477 *
2478 * Logged from:
2479 * Vendor audio implementation.
2480 */
2481message SpeakerImpedanceReported {
2482 optional int32 speaker_location = 1;
2483 optional int32 impedance = 2;
2484}
2485
2486/**
2487 * Logs the report of a failed hardware.
2488 *
2489 * Logged from:
2490 * Vendor HALs.
2491 *
2492 */
2493message HardwareFailed {
2494 enum HardwareType {
2495 HARDWARE_FAILED_UNKNOWN = 0;
2496 HARDWARE_FAILED_MICROPHONE = 1;
2497 HARDWARE_FAILED_CODEC = 2;
2498 HARDWARE_FAILED_SPEAKER = 3;
2499 HARDWARE_FAILED_FINGERPRINT = 4;
2500 }
2501 optional HardwareType hardware_type = 1;
2502
Maggie White6dcd8572019-01-31 14:11:50 -08002503 /**
2504 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002505 * the same hardware_type. The specific locations are vendor defined integers,
2506 * referring to board-specific numbering schemes.
2507 */
2508 optional int32 hardware_location = 2;
2509
Maggie White6dcd8572019-01-31 14:11:50 -08002510 /**
2511 * failure_code is specific to the HardwareType of the failed hardware.
2512 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002513 */
Maggie White6dcd8572019-01-31 14:11:50 -08002514 enum HardwareErrorCode {
2515 UNKNOWN = 0;
2516 COMPLETE = 1;
2517 SPEAKER_HIGH_Z = 2;
2518 SPEAKER_SHORT = 3;
2519 FINGERPRINT_SENSOR_BROKEN = 4;
2520 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002521 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002522 }
2523 optional int32 failure_code = 3;
2524}
2525
2526/**
2527 * Log an event when the device has been physically dropped.
2528 * Reported from the /vendor partition.
2529 */
2530message PhysicalDropDetected {
2531 // Confidence that the event was actually a drop, 0 -> 100
2532 optional int32 confidence_pctg = 1;
2533 // Peak acceleration of the drop, in 1/1000s of a g.
2534 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002535 // Duration of freefall in ms
2536 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002537}
2538
2539/**
2540 * Log bucketed battery charge cycles.
2541 *
2542 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002543 * a given charge point. For example, if 10 cycle buckets are
2544 * initialized, bucket 1 is the lowest 1/10th of the battery,
2545 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002546 *
2547 * Logged from:
2548 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2549 */
2550message ChargeCyclesReported {
2551 optional int32 cycle_bucket_1 = 1;
2552 optional int32 cycle_bucket_2 = 2;
2553 optional int32 cycle_bucket_3 = 3;
2554 optional int32 cycle_bucket_4 = 4;
2555 optional int32 cycle_bucket_5 = 5;
2556 optional int32 cycle_bucket_6 = 6;
2557 optional int32 cycle_bucket_7 = 7;
2558 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002559 optional int32 cycle_bucket_9 = 9;
2560 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002561}
2562
2563/**
Howard Roa46b6582018-09-18 16:45:02 -07002564 * Log battery health snapshot.
2565 *
2566 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2567 * are snapshotted periodically over 24hrs.
2568 */
2569message BatteryHealthSnapshot {
2570 enum BatterySnapshotType {
2571 UNKNOWN = 0;
2572 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2573 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2574 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2575 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2576 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2577 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2578 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2579 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2580 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2581 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2582 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2583 }
2584 optional BatterySnapshotType type = 1;
2585 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002586 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002587 // Voltage Battery Voltage, in microVolts.
2588 optional int32 voltage_micro_volt = 3;
2589 // Current Battery current, in microAmps.
2590 optional int32 current_micro_amps = 4;
2591 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2592 optional int32 open_circuit_micro_volt = 5;
2593 // Resistance Battery Resistance, in microOhms.
2594 optional int32 resistance_micro_ohm = 6;
2595 // Level Battery Level, as % of full.
2596 optional int32 level_percent = 7;
2597}
2598
2599/**
2600 * Log slow I/O operations on the primary storage.
2601 */
2602message SlowIo {
2603 // Classifications of IO Operations.
2604 enum IoOperation {
2605 UNKNOWN = 0;
2606 READ = 1;
2607 WRITE = 2;
2608 UNMAP = 3;
2609 SYNC = 4;
2610 }
2611 optional IoOperation operation = 1;
2612
2613 // The number of slow IO operations of this type over 24 hours.
2614 optional int32 count = 2;
2615}
2616
2617/**
2618 * Log battery caused shutdown with the last recorded voltage.
2619 */
2620message BatteryCausedShutdown {
2621 // The last recorded battery voltage prior to shutdown.
2622 optional int32 last_recorded_micro_volt = 1;
2623}
2624
2625/**
Tej Singha72344992019-04-17 18:55:08 -07002626 * Logs when ThermalService receives throttling events.
2627 *
2628 * Logged from:
2629 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2630 */
2631message ThermalThrottlingSeverityStateChanged {
2632 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2633 optional android.os.TemperatureTypeEnum sensor_type = 1;
2634
2635 // The name of the temperature source. Eg. CPU0
2636 optional string sensor_name = 2;
2637
2638 // Temperature in tenths of a degree C.
2639 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2640 optional int32 temperature_deci_celsius = 3;
2641
2642 // Relative severity of the throttling, see enum definition.
2643 optional android.os.ThrottlingSeverityEnum severity = 4;
2644}
2645
2646/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002647 * Logs the duration of a davey (jank of >=700ms) when it occurs
2648 *
2649 * Logged from:
2650 * frameworks/base/libs/hwui/JankTracker.cpp
2651 */
2652message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002653 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002654 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002655
Tej Singhbb8554a2018-01-26 11:59:14 -08002656 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002657 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002658}
2659
2660/**
Bookatze5885242017-10-24 20:10:31 -07002661 * Logs phone signal strength changes.
2662 *
2663 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002664 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002665 */
2666message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002667 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2668 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002669}
2670
Yangster4ccebea2018-10-09 17:09:02 -07002671
2672/**
2673 * Logs when the phone state, sim state or signal strength changes
2674 *
2675 * Logged from:
2676 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2677 */
2678message PhoneServiceStateChanged {
2679 optional android.telephony.ServiceStateEnum state = 1;
2680 optional android.telephony.SimStateEnum sim_state = 2;
2681 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2682}
2683
2684/**
2685 * Logs when the phone becomes on or off.
2686 *
2687 * Logged from:
2688 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2689 */
2690message PhoneStateChanged {
2691 enum State {
2692 OFF = 0;
2693 ON = 1;
2694 }
2695 optional State state = 1;
2696}
2697
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002698message BackGesture {
2699 enum BackType {
2700 DEFAULT_BACK_TYPE = 0;
2701 COMPLETED = 1;
2702 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2703 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2704 INCOMPLETE = 4;
2705 }
2706 optional BackType type = 1;
2707
2708 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2709 enum WindowHorizontalLocation {
2710 DEFAULT_LOCATION = 0;
2711 LEFT = 1;
2712 RIGHT = 2;
2713 }
2714 optional WindowHorizontalLocation x_location = 3;
2715}
2716
2717message ExclusionRectStateChanged {
2718 optional string component_name = 1; // if not available, simply packageName
2719 optional int32 requested_height = 2; // px
2720 optional int32 rejected_height = 3; // px
2721
2722 enum WindowHorizontalLocation {
2723 DEFAULT_LOCATION = 0;
2724 LEFT = 1;
2725 RIGHT = 2;
2726 }
2727 optional WindowHorizontalLocation x_location = 4;
2728 optional bool landscape = 5;
2729 optional bool splitscreen = 6;
2730 optional int32 duration_millis = 7;
2731}
2732
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002733message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002734 optional android.stats.launcher.LauncherAction action = 1;
2735 optional android.stats.launcher.LauncherState src_state = 2;
2736 optional android.stats.launcher.LauncherState dst_state = 3;
2737 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002738 optional bool is_swipe_up_enabled = 5;
2739}
2740
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002741message StyleUIChanged {
2742 optional android.stats.style.Action action = 1;
2743 optional int32 color_package_hash = 2;
2744 optional int32 font_package_hash = 3;
2745 optional int32 shape_package_hash = 4;
2746 optional int32 clock_package_hash = 5;
2747 optional int32 launcher_grid = 6;
2748 optional int32 wallpaper_category_hash = 7;
2749 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002750 optional int32 color_preference = 9;
2751 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002752}
2753
David Chenc28b2bb2017-10-24 12:52:52 -07002754/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002755 * Logs when Settings UI has changed.
2756 *
2757 * Logged from:
2758 * packages/apps/Settings
2759 */
2760message SettingsUIChanged {
2761 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002762 * Where this SettingsUIChange event comes from. For example, if
2763 * it's a PAGE_VISIBLE event, where the page is opened from.
2764 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002765 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002766
2767 /**
2768 * What the UI action is.
2769 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002770 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002771
2772 /**
2773 * Where the action is happening
2774 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002775 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002776
2777 /**
2778 * What preference changed in this event.
2779 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002780 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002781
2782 /**
2783 * The new value of the changed preference.
2784 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002785 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002786}
2787
2788/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002789 * Logs basic timing information about touch events.
2790 * Reported at most every 5 minutes while device is being interacted with.
2791 *
2792 * Logged from:
2793 * frameworks/native/services/inputflinger
2794 */
2795message TouchEventReported {
2796 /**
2797 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002798 * and the standard deviation of the time spent processing touchscreen events
2799 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002800 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002801 * On supported devices, the starting point is taken during the hard interrupt inside the
2802 * kernel touch driver. On all other devices, the starting point is taken inside
2803 * the kernel's input event subsystem upon receipt of the input event.
2804 * The ending point is taken inside InputDispatcher, just after the input event
2805 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002806 */
2807 // Minimum value
2808 optional float latency_min_micros = 1;
2809 // Maximum value
2810 optional float latency_max_micros = 2;
2811 // Average value
2812 optional float latency_mean_micros = 3;
2813 // Standard deviation
2814 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002815 // Number of touch events (input_event) in this report
2816 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002817}
2818
2819/**
Philip Quinn0eded622019-01-29 12:46:28 -08002820 * Logs gesture classification and timing information for touch events.
2821 *
2822 * Logged from:
2823 * frameworks/base/core/java/android/view/GestureDetector.java
2824 * frameworks/base/core/java/android/view/View.java
2825 */
2826message TouchGestureClassified {
2827 // The source of the classification (e.g. Java class name).
2828 optional string source = 1;
2829
2830 enum Classification {
2831 UNKNOWN_CLASSIFICATION = 0;
2832 SINGLE_TAP = 1;
2833 DOUBLE_TAP = 2;
2834 LONG_PRESS = 3;
2835 DEEP_PRESS = 4;
2836 SCROLL = 5;
2837 }
2838 // The classification of the gesture.
2839 optional Classification classification = 2;
2840
2841 // The interval from the start of a touch event stream until the
2842 // classification was made.
2843 optional int32 latency_millis = 3;
2844
2845 // The distance from the location of the first touch event to the
2846 // location of the touch event when the classification was made.
2847 optional float displacement_px = 4;
2848}
2849
2850/**
David Chenc28b2bb2017-10-24 12:52:52 -07002851 * Logs that a setting was updated.
2852 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002853 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002854 * The tag and is_default allow resetting of settings to default values based on the specified
2855 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2856 */
2857message SettingChanged {
2858 // The name of the setting.
2859 optional string setting = 1;
2860
2861 // The change being imposed on this setting. May represent a number, eg "3".
2862 optional string value = 2;
2863
2864 // The new value of this setting. For most settings, this is same as value. For some settings,
2865 // value is +X or -X where X represents an element in a set. For example, if the previous value
2866 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2867 // The +/- feature is currently only used for location_providers_allowed.
2868 optional string new_value = 3;
2869
2870 // The previous value of this setting.
2871 optional string prev_value = 4;
2872
2873 // The tag used with the is_default for resetting sets of settings. This is generally null.
2874 optional string tag = 5;
2875
Bookatz90867622018-01-31 15:05:57 -08002876 // True if this setting with tag should be resettable.
2877 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002878
David Chenbd789912018-03-16 17:19:55 -07002879 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002880 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002881
2882 enum ChangeReason {
2883 UPDATED = 1; // Updated can be an insertion or an update.
2884 DELETED = 2;
2885 }
2886 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002887}
Chenjie Yub3dda412017-10-24 13:41:59 -07002888
Chenjie Yu05013b32017-11-21 10:21:41 -08002889/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002890 * Logs activity going to foreground or background
2891 *
2892 * Logged from:
2893 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2894 */
2895message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002896 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002897 optional string pkg_name = 2;
2898 optional string class_name = 3;
2899
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002900 enum State {
2901 BACKGROUND = 0;
2902 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002903 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002904 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002905}
David Chenc8a43242017-10-17 16:23:28 -07002906
2907/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002908 * Logs when a volume entered low Storage state.
2909 * Logged from:
2910 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2911 */
2912message LowStorageStateChanged {
2913 // Volume that ran out of storage.
2914 optional string volume_description = 1;
2915
2916 enum State {
2917 UNKNOWN = 0;
2918 OFF = 1;
2919 ON = 2;
2920 }
2921 optional State state = 2;
2922}
2923
2924/**
2925 * Logs when an app is downgraded.
2926 * Logged from:
2927 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2928 */
2929message AppDowngraded {
2930 optional string package_name = 1;
2931 // Size of the package (all data) before being downgraded.
2932 optional int64 size_in_bytes_before = 2;
2933 // Size of the package (all data) after being downgraded.
2934 optional int64 size_in_bytes_after = 3;
2935
2936 optional bool aggressive = 4;
2937}
2938
2939/**
2940 * Logs when an app is optimized after being downgraded.
2941 * Logged from:
2942 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2943 */
2944message AppOptimizedAfterDowngraded {
2945 optional string package_name = 1;
2946}
2947
2948/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002949 * Logs whenever an app is installed on external storage.
2950 * Logged from:
2951 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2952 */
2953message AppInstallOnExternalStorageReported {
2954 // The type of external storage.
2955 optional android.stats.storage.ExternalStorageType storage_type = 1;
2956 // The name of the package that is installed on the sd card.
2957 optional string package_name = 2;
2958}
2959
2960/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002961 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002962 * Logged from:
2963 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2964 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002965message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002966 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002967
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002968 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002969
2970 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002971 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002972 optional string process_name = 3;
2973
2974 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002975 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002976
2977 optional string package_name = 5;
2978
2979 enum InstantApp {
2980 UNAVAILABLE = 0;
2981 FALSE = 1;
2982 TRUE = 2;
2983 }
2984 optional InstantApp is_instant_app = 6;
2985
2986 enum ForegroundState {
2987 UNKNOWN = 0;
2988 BACKGROUND = 1;
2989 FOREGROUND = 2;
2990 }
2991 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002992
2993 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002994}
David Chen9e3808c2017-11-20 17:25:34 -08002995
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996/**
2997 * Logs when a WTF (What a Terrible Failure) happened.
2998 * Logged from:
2999 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3000 */
3001message WTFOccurred {
3002 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003003
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003004 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003005
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003006 // The name of the process.
3007 // system_server if it is not by an app
3008 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003009
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003010 // The pid if available. -1 means not available.
3011 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003012
3013 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003014}
3015
3016/**
3017 * Logs when system server reports low memory.
3018 * Logged from:
3019 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3020 */
3021message LowMemReported {
3022}
3023
3024/**
3025 * Logs when an app ANR (App Not Responding) occurs.
3026 * Logged from:
3027 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3028 */
3029message ANROccurred {
3030 optional int32 uid = 1 [(is_uid) = true];
3031
3032 optional string process_name = 2;
3033
3034 optional string short_component_name = 3;
3035
3036 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003037
3038 enum InstantApp {
3039 UNAVAILABLE = 0;
3040 FALSE = 1;
3041 TRUE = 2;
3042 }
3043 optional InstantApp is_instant_app = 5;
3044
3045 enum ForegroundState {
3046 UNKNOWN = 0;
3047 BACKGROUND = 1;
3048 FOREGROUND = 2;
3049 }
3050 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003051
3052 optional android.server.ErrorSource error_source = 7;
3053
3054 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003055}
3056
Bookatza7020bd2018-08-28 16:29:35 -07003057/**
3058 * Logs when the vibrator state changes.
3059 * Logged from:
3060 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3061 */
3062message VibratorStateChanged {
3063 repeated AttributionNode attribution_node = 1;
3064
3065 enum State {
3066 OFF = 0;
3067 ON = 1;
3068 }
3069 optional State state = 2;
3070
3071 // Duration (in milliseconds) requested to keep the vibrator on.
3072 // Only applicable for State == ON.
3073 optional int64 duration_millis = 3;
3074}
3075
David Chen0a368b22017-12-06 16:28:16 -08003076/*
3077 * Allows other apps to push events into statsd.
3078 * Logged from:
3079 * frameworks/base/core/java/android/util/StatsLog.java
3080 */
David Chen0b5c90c2018-01-25 16:51:49 -08003081message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003082 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003083 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003084
3085 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3086 optional int32 label = 2;
3087
3088 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3089 // predicates for the metrics).
3090 enum State {
3091 UNKNOWN = 0;
3092 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3093 STOP = 2;
3094 START = 3;
3095 }
3096 optional State state = 3;
3097}
3098
David Chen9e3808c2017-11-20 17:25:34 -08003099/**
Bookatz7948c872018-09-04 12:58:33 -07003100 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3101 * For example, this could be due to the user manually changing the time.
3102 *
3103 * Logged from:
3104 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3105 */
3106message WallClockTimeShifted {
3107 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3108 optional int64 wall_clock_timestamp_millis = 1;
3109}
3110
3111/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003112 * Logs when statsd detects an anomaly.
3113 *
3114 * Logged from:
3115 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3116 */
3117message AnomalyDetected {
3118 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003119 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003120
Yangster-mac94e197c2018-01-02 16:03:03 -08003121 // Id of the config whose anomaly detection alert fired.
3122 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003123
Yangster-mac94e197c2018-01-02 16:03:03 -08003124 // Id of the alert (i.e. name of the anomaly that was detected).
3125 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003126}
3127
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003128message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003129 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003130 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003131
3132 // The app package name.
3133 optional string pkg_name = 2;
3134
3135 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003136 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003137 WARM = 1;
3138 HOT = 2;
3139 COLD = 3;
3140 }
3141 // The transition type.
3142 optional TransitionType type = 3;
3143
3144 // The activity name.
3145 optional string activity_name = 4;
3146
3147 // The name of the calling app. Empty if not set.
3148 optional string calling_pkg_name = 5;
3149
3150 // Whether the app is an instant app.
3151 optional bool is_instant_app = 6;
3152
3153 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003154 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003155
Bookatz80d11a02018-01-16 10:46:35 -08003156 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003157
David Chen0b5c90c2018-01-25 16:51:49 -08003158 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003159 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003160 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003161 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003162 optional int32 bind_application_delay_millis = 11;
3163 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003164
3165 // Empty if not set.
3166 optional string launch_token = 13;
3167
Calin Juravle759fbda2018-02-20 19:52:30 +00003168 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003169 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003170
3171 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003172 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003173}
3174
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003175message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003176 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003177 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003178
3179 // The app package name.
3180 optional string pkg_name = 2;
3181
3182 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003183 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003184 WARM = 1;
3185 HOT = 2;
3186 COLD = 3;
3187 }
3188 // The transition type.
3189 optional TransitionType type = 3;
3190
3191 // The activity name.
3192 optional string activity_name = 4;
3193}
3194
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003195message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003196 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003197 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198
3199 // The app package name.
3200 optional string pkg_name = 2;
3201
3202 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003203 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204 WITH_BUNDLE = 1;
3205 WITHOUT_BUNDLE = 2;
3206 }
3207 // The transition type.
3208 optional TransitionType type = 3;
3209
3210 // The activity name.
3211 optional string activity_name = 4;
3212
3213 optional bool transition_process_running = 5;
3214
3215 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003216 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003217}
3218
Bookatz8fcd09a2017-12-18 13:01:10 -08003219/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003220 * Logs a picture-in-picture action
3221 * Logged from:
3222 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3223 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3224 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3225 */
3226message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003227 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003228 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003229
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003230 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003231
Chenjie Yu52cacc62017-12-08 18:11:45 -08003232 enum State {
3233 ENTERED = 1;
3234 EXPANDED_TO_FULL_SCREEN = 2;
3235 MINIMIZED = 3;
3236 DISMISSED = 4;
3237 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003238 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003239}
3240
3241/**
Chenjie Yue8904192017-12-08 19:12:57 -08003242 * Logs overlay action
3243 * Logged from:
3244 * services/core/java/com/android/server/wm/Session.java
3245 */
3246message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003247 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003248
tsaichristine5adc7e02020-01-14 17:07:39 -08003249 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003250
3251 optional bool using_alert_window = 3;
3252
3253 enum State {
3254 ENTERED = 1;
3255 EXITED = 2;
3256 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003257 optional State state = 4 [
3258 (state_field_option).option = EXCLUSIVE_STATE,
3259 (state_field_option).nested = false,
3260 (state_field_option).default_state_value = 2
3261 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003262}
3263
Chenjie Yuccfe6452018-01-30 11:33:21 -08003264/*
3265 * Logs foreground service starts and stops.
3266 * Note that this is not when a service starts or stops, but when it is
3267 * considered foreground.
3268 * Logged from
3269 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3270 */
3271message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003272 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003273 // package_name + "/" + class_name
3274 optional string short_name = 2;
3275
3276 enum State {
3277 ENTER = 1;
3278 EXIT = 2;
3279 }
3280 optional State state = 3;
3281}
3282
Chenjie Yue8904192017-12-08 19:12:57 -08003283/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003284 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3285 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3286 * attributed back to the parent (host) uid. One example is Chrome.
3287 *
3288 * Logged from:
3289 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3290 */
3291message IsolatedUidChanged {
3292 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003293 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003294 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003295 optional int32 parent_uid = 1;
3296
3297 optional int32 isolated_uid = 2;
3298
3299 // We expect an isolated uid to be removed before if it's used for another parent uid.
3300 enum Event {
3301 REMOVED = 0;
3302 CREATED = 1;
3303 }
3304 optional Event event = 3;
3305}
3306
3307/*
3308 * Logs the reception of an incoming network packet causing the main system to wake up for
3309 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3310 * and processed by WakeupController.cpp.
3311 */
3312message PacketWakeupOccurred {
3313 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3314 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003315 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003316 // The interface name on which the packet was received.
3317 optional string iface = 2;
3318 // The ethertype value of the packet.
3319 optional int32 ethertype = 3;
3320 // String representation of the destination MAC address of the packet.
3321 optional string destination_hardware_address = 4;
3322 // String representation of the source address of the packet if this was an IP packet.
3323 optional string source_ip = 5;
3324 // String representation of the destination address of the packet if this was an IP packet.
3325 optional string destination_ip = 6;
3326 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3327 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3328 // families.
3329 optional int32 ip_next_header = 7;
3330 // The source port if this was a TCP or UDP packet.
3331 optional int32 source_port = 8;
3332 // The destination port if this was a TCP or UDP packet.
3333 optional int32 destination_port = 9;
3334}
3335
3336/*
3337 * Logs the memory stats for an app on startup.
3338 * Logged from:
3339 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3340 */
3341message AppStartMemoryStateCaptured {
3342 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003343 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003344
3345 // The process name.
3346 optional string process_name = 2;
3347
3348 // The activity name.
3349 optional string activity_name = 3;
3350
3351 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003352 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003353
3354 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003355 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003356
3357 // RSS
3358 optional int64 rss_in_bytes = 6;
3359
3360 // CACHE
3361 optional int64 cache_in_bytes = 7;
3362
3363 // SWAP
3364 optional int64 swap_in_bytes = 8;
3365}
3366
3367/*
3368 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3369 * for LMK event.
3370 * Logged from:
3371 * system/core/lmkd/lmkd.c
3372 */
3373message LmkStateChanged {
3374 enum State {
3375 UNKNOWN = 0;
3376 START = 1;
3377 STOP = 2;
3378 }
3379 optional State state = 1;
3380}
3381
3382/*
3383 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3384 * Logged from:
3385 * system/core/lmkd/lmkd.c
3386 */
3387message LmkKillOccurred {
3388 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003389 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003390
3391 // The process name.
3392 optional string process_name = 2;
3393
3394 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003395 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003396
3397 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003398 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003399
3400 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003401 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003402
3403 // RSS
3404 optional int64 rss_in_bytes = 6;
3405
3406 // CACHE
3407 optional int64 cache_in_bytes = 7;
3408
3409 // SWAP
3410 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003411
3412 // The elapsed real time of start of the process.
3413 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003414
3415 // Min oom adj score considered by lmkd.
3416 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003417}
3418
Rajeev Kumar51b54602018-03-01 12:18:26 -08003419/*
3420 * Logs when the ActivityManagerService detects that an app died.
3421 *
3422 * Logged from:
3423 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3424 */
3425message AppDied {
3426 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003427 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003428}
3429
Howard Ro21a039c2018-08-06 14:55:47 -07003430/**
3431 * An atom for generic metrics logging. Available from Android Q.
3432 */
3433message GenericAtom {
3434 // The uid of the application that sent this custom atom.
3435 optional int32 uid = 1 [(is_uid) = true];
3436
3437 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003438 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003439}
3440
Tej Singhd6d6d772018-09-05 17:41:25 -07003441/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003442 * Atom for simple logging of user interaction and impression events, such as "the user touched
3443 * this button" or "this dialog was displayed".
3444 * Keep the UI event stream clean: don't use for system or background events.
3445 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003446 *
3447 * Logged from:
3448 * frameworks/base/services/core/java/com/android/server/
3449 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003450 */
3451message UiEventReported {
3452 // The event_id.
3453 optional int32 event_id = 1;
3454 // The event's source or target uid and package, if applicable.
3455 // For example, the package posting a notification, or the destination package of a share.
3456 optional int32 uid = 2 [(is_uid) = true];
3457 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003458 // An identifier used to disambiguate which logs refer to a particular instance of some
3459 // UI element. Useful when there might be multiple instances simultaneously active.
3460 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003461}
3462
3463/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003464 * Reports a notification was created or updated.
3465 *
3466 * Logged from:
3467 * frameworks/base/services/core/java/com/android/server/notification/
3468 */
3469message NotificationReported {
3470 // The event_id (as for UiEventReported).
3471 optional int32 event_id = 1;
3472 // The notifying app's uid and package.
3473 optional int32 uid = 2 [(is_uid) = true];
3474 optional string package_name = 3;
3475 // A small system-assigned identifier for the notification.
3476 // Locally probably-unique, but expect collisions across users and/or days.
3477 optional int32 instance_id = 4;
3478 // The app-assigned notification ID and tag
3479 optional int32 notification_id = 5;
3480 optional string notification_tag = 6;
3481 optional string channel_id = 7; // App-assigned channel ID
3482
3483 // Grouping information
3484 optional string group_id = 8; // Group the notification currently belongs to
3485 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3486 optional bool is_group_summary = 10; // Tags the group-summary notification
3487
3488 // Attributes
3489 optional string category = 11; // App-assigned notification category (API-defined strings)
3490 optional int32 style = 12; // App-assigned notification style
3491 optional int32 num_people = 13; // Number of Person records attached to the notification
3492
3493 // Ordering, importance and interruptiveness
3494
3495 optional int32 position = 14; // Position in NotificationManager's list
3496
3497 optional android.stats.sysui.NotificationImportance importance = 15;
3498 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3499
3500 enum NotificationImportanceExplanation {
3501 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3502 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3503 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3504 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3505 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3506 // Like _APP, but based on pre-channels priority signal.
3507 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3508 }
3509
3510 optional NotificationImportanceExplanation importance_source = 17;
3511 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3512 optional NotificationImportanceExplanation importance_initial_source = 19;
3513 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3514 optional int32 assistant_hash = 21;
3515 optional float assistant_ranking_score = 22;
3516}
3517
3518message Notification {
3519 // The notifying app's uid and package.
3520 optional int32 uid = 1 [(is_uid) = true];
3521 optional string package_name = 2;
3522 // A small system-assigned identifier for the notification.
3523 optional int32 instance_id = 3;
3524
3525 // Grouping information.
3526 optional int32 group_instance_id = 4;
3527 optional bool is_group_summary = 5;
3528
3529 // The section of the shade that the notification is in.
3530 // See NotificationSectionsManager.PriorityBucket.
3531 enum NotificationSection {
3532 SECTION_UNKNOWN = 0;
3533 SECTION_PEOPLE = 1;
3534 SECTION_ALERTING = 2;
3535 SECTION_SILENT = 3;
3536 }
3537 optional NotificationSection section = 6;
3538}
3539
3540message NotificationList {
3541 repeated Notification notifications = 1; // An ordered sequence of notifications.
3542}
3543
3544/**
3545 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3546 *
3547 * Logged from:
3548 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3549 */
3550message NotificationPanelReported {
3551 // The event_id (as for UiEventReported).
3552 optional int32 event_id = 1;
3553 optional int32 num_notifications = 2;
3554 // The notifications in the panel, in the order that they appear there.
3555 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3556}
3557
3558/**
3559 * Reports a notification channel, or channel group, was created, updated, or deleted.
3560 *
3561 * Logged from:
3562 * frameworks/base/services/core/java/com/android/server/notification/
3563 */
3564message NotificationChannelModified {
3565 // The event_id (as for UiEventReported).
3566 optional int32 event_id = 1;
3567 // The notifying app's uid and package.
3568 optional int32 uid = 2 [(is_uid) = true];
3569 optional string package_name = 3;
3570 // App-assigned notification channel ID or channel-group ID
3571 optional string channel_id = 4;
3572 // Previous importance setting, if applicable
3573 optional android.stats.sysui.NotificationImportance old_importance = 5;
3574 // New importance setting
3575 optional android.stats.sysui.NotificationImportance importance = 6;
3576}
3577
3578
3579/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003580 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003581 *
3582 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003583 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003584 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003585message BiometricAcquired {
3586 // Biometric modality that was acquired.
3587 optional android.hardware.biometrics.ModalityEnum modality = 1;
3588 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3589 optional int32 user = 2;
3590 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3591 optional bool is_crypto = 3;
3592 // Action that the device is performing. Acquired messages are only expected for enroll and
3593 // authenticate. Other actions may indicate an error.
3594 optional android.hardware.biometrics.ActionEnum action = 4;
3595 // The client that this acquisition was received for.
3596 optional android.hardware.biometrics.ClientEnum client = 5;
3597 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3598 optional int32 acquire_info = 6;
3599 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3600 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003601 // Dictates if this message should trigger additional debugging.
3602 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003603}
3604
3605/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003606 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003607 *
3608 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003609 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003610 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003611message BiometricAuthenticated {
3612 // Biometric modality that was used.
3613 optional android.hardware.biometrics.ModalityEnum modality = 1;
3614 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3615 optional int32 user = 2;
3616 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3617 // storage.
3618 optional bool is_crypto = 3;
3619 // The client that this acquisition was received for.
3620 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003621 // If authentication requires user confirmation. See BiometricPrompt's
3622 // setRequireConfirmation(bool) method.
3623 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003624
Kevin Chyn1741a072019-01-17 11:54:40 -08003625 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003626 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003627 REJECTED = 1;
3628 PENDING_CONFIRMATION = 2;
3629 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003630 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003631
3632 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003633 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003634 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3635 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3636 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3637 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003638 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003639 // Dictates if this message should trigger additional debugging.
3640 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003641}
3642
3643/**
3644 * Logs when a biometric error occurs.
3645 *
3646 * Logged from:
3647 * frameworks/base/services/core/java/com/android/server/biometrics
3648 */
3649message BiometricErrorOccurred {
3650 // Biometric modality that was used.
3651 optional android.hardware.biometrics.ModalityEnum modality = 1;
3652 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3653 optional int32 user = 2;
3654 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3655 optional bool is_crypto = 3;
3656 // Action that the device is performing.
3657 optional android.hardware.biometrics.ActionEnum action = 4;
3658 // The client that this acquisition was received for.
3659 optional android.hardware.biometrics.ClientEnum client = 5;
3660 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3661 // are unique to modality.
3662 optional int32 error_info = 6;
3663 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3664 // by the vendor and not specified by the HIDL interface.
3665 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003666 // Dictates if this message should trigger additional debugging.
3667 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003668 // Time spent during the authentication attempt.
3669 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003670}
3671
3672/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003673 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003674 * Logged from:
3675 * frameworks/base/services/core/java/com/android/server/biometrics
3676 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003677message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003678 // Biometric modality.
3679 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003680 // Type of issue detected.
3681 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003682 // Dictates if this message should trigger additional debugging.
3683 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003684}
Howard Ro688ae182018-09-25 00:09:36 -07003685
joshmccloskey6f952b22019-03-25 20:59:35 -07003686/**
3687 * Logs when a biometric enrollment occurs.
3688 *
3689 * Logged from:
3690 * frameworks/base/services/core/java/com/android/server/biometrics
3691 */
3692message BiometricEnrolled {
3693 // Biometric modality that was used.
3694 optional android.hardware.biometrics.ModalityEnum modality = 1;
3695 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3696 optional int32 user = 2;
3697 // The amount of time the enrollment took in milliseconds.
3698 optional int64 latency_millis = 3;
3699 // Whether or not the enrollment was successful.
3700 optional bool success = 4;
3701}
3702
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003703/*
Tej Singh0d176952019-01-16 19:10:54 -08003704 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003705 */
Tej Singh0d176952019-01-16 19:10:54 -08003706message FlagFlipUpdateOccurred {
3707 // If the event is from a flag config package, specify the package name.
3708 optional string flag_flip_package_name = 1;
3709
3710 // The order id of the package
3711 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003712}
3713
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003714/**
3715 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003716 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003717 */
3718message TrainExperimentIds {
3719 repeated int64 experiment_id = 1;
3720}
3721
Yangster-macb89807e2018-11-15 21:10:57 -08003722/*
3723 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003724 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003725 */
3726message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003727 // Name of the train.
3728 optional string train_name = 1;
3729 // Version code for a "train" of packages that need to be installed atomically
3730 optional int64 train_version_code = 2;
3731 // After installation of this package, device requires a restart.
3732 optional bool requires_staging = 3;
3733 // Rollback should be enabled for this install.
3734 optional bool rollback_enabled = 4;
3735 // Requires low latency monitoring if possible.
3736 optional bool requires_low_latency_monitor = 5;
3737
Yangster-macb89807e2018-11-15 21:10:57 -08003738 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003739 UNKNOWN = 0;
3740 INSTALL_REQUESTED = 1;
3741 INSTALL_STARTED = 2;
3742 INSTALL_STAGED_NOT_READY = 3;
3743 INSTALL_STAGED_READY = 4;
3744 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003745 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3746 // and INSTALL_FAILURE_COMMIT.
3747 INSTALL_FAILURE = 6 [deprecated = true];
3748 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003749 INSTALL_CANCELLED = 7;
3750 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003751 INSTALLER_ROLLBACK_INITIATED = 9;
3752 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3753 INSTALLER_ROLLBACK_STAGED = 11;
3754 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3755 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3756 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3757 INSTALLER_ROLLBACK_SUCCESS = 15;
3758 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003759 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3760 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3761 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3762 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3763 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3764 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003765 INSTALL_FAILURE_DOWNLOAD = 23;
3766 INSTALL_FAILURE_STATE_MISMATCH = 24;
3767 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003768 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003769 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003770 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003771 // Possible experiment ids for monitoring this push.
3772 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3773 // user id
3774 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003775 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003776 // Whether or not this is a rollback event
3777 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003778}
3779
Tej Singhc9203082019-05-03 13:42:23 -07003780/* Test atom, is not logged anywhere */
3781message TestAtomReported {
3782 repeated AttributionNode attribution_node = 1;
3783 optional int32 int_field = 2;
3784 optional int64 long_field = 3;
3785 optional float float_field = 4;
3786 optional string string_field = 5;
3787 optional bool boolean_field = 6;
3788 enum State {
3789 UNKNOWN = 0;
3790 OFF = 1;
3791 ON = 2;
3792 }
3793 optional State state = 7;
3794 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3795}
3796
Maggie Whitefc1aa592018-11-28 21:55:23 -08003797/** Represents USB port overheat event. */
3798message UsbPortOverheatEvent {
3799 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3800 optional int32 plug_temperature_deci_c = 1;
3801
3802 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3803 optional int32 max_temperature_deci_c = 2;
3804
3805 /* Time between USB plug event and overheat threshold trip, in seconds. */
3806 optional int32 time_to_overheat_secs = 3;
3807
3808 /* Time between overheat threshold trip and hysteresis, in seconds. */
3809 optional int32 time_to_hysteresis_secs = 4;
3810
3811 /* Time between hysteresis and active mitigation ending, in seconds. */
3812 optional int32 time_to_inactive_secs = 5;
3813};
3814
Maggie White8735b852019-01-18 11:40:49 -08003815/**
3816 * Logs total effective full charge and discharge cycles on a battery.
3817 * Here are some examples of one effective cycle:
3818 * 1) the battery charges from 0% to 100% and drains back to 0%,
3819 * 2) charging from 50% to 100% and draining back to 50% twice.
3820 * Pulled from:
3821 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3822 */
3823message BatteryCycleCount {
3824 /* Number of total charge and discharge cycles on the system battery. */
3825 optional int32 cycle_count = 1;
3826}
3827
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003828/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003829 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3830 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003831 * Pulled from:
3832 * StatsCompanionService
3833 */
3834
Carmen Agimof12dec122019-03-06 16:14:38 +00003835message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003836
Carmen Agimof12dec122019-03-06 16:14:38 +00003837 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003838 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003839 PUBLIC = 1;
3840 PRIVATE = 2;
3841 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003842 }
3843
Carmen Agimof12dec122019-03-06 16:14:38 +00003844 // The type of external storage.
3845 optional android.stats.storage.ExternalStorageType storage_type = 1;
3846 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3847 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003848 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003849 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003850}
3851
Yangster-macb89807e2018-11-15 21:10:57 -08003852/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003853 * Logs when a connection becomes available and lost.
3854 * Logged in StatsCompanionService.java
3855 */
3856message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003857 // Id of the network.
3858 optional int32 net_id = 1;
3859
3860 enum State {
3861 UNKNOWN = 0;
3862 CONNECTED = 1;
3863 DISCONNECTED = 2;
3864 }
3865 // Connected state of a network.
3866 optional State state = 2;
3867}
3868
3869/**
3870 * Logs when a service starts and stops.
3871 * Logged from:
3872 * services/core/java/com/android/server/am/ActiveServices.java
3873 */
3874message ServiceStateChanged {
3875
3876 optional int32 uid = 1 [(is_uid) = true];
3877
3878 optional string package_name = 2;
3879
3880 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003881
3882 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003883 START = 1;
3884 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003885 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003886
3887 optional State state = 4;
3888}
3889
3890/**
3891 * Logs when a service is launched.
3892 * Logged from:
3893 * services/core/java/com/android/server/am/ActiveServices.java
3894 */
3895message ServiceLaunchReported {
3896
3897 optional int32 uid = 1 [(is_uid) = true];
3898
3899 optional string package_name = 2;
3900
3901 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003902}
Howard Ro688ae182018-09-25 00:09:36 -07003903
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003904/**
3905 * Logs when a hidden API is used.
3906 *
3907 * Logged from:
3908 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3909 */
3910message HiddenApiUsed {
3911 // The uid of the app making the hidden access.
3912 optional int32 uid = 1 [(is_uid) = true];
3913
3914 // Signature of the method or field accessed.
3915 optional string signature = 2;
3916
3917 enum AccessMethod {
3918 NONE = 0;
3919 REFLECTION = 1;
3920 JNI = 2;
3921 LINKING = 3;
3922 }
3923
3924 // Type of access.
3925 optional AccessMethod access_method = 3;
3926
3927 // Whether the access was prevented or not.
3928 optional bool access_denied = 4;
3929}
3930
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003931/**
3932 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3933 * - When user sees privacy chip
3934 * - When user clicks privacy chip
3935 * - How does the user exit the Privacy Dialog
3936 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003937 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3938 */
3939message PrivacyIndicatorsInteracted {
3940
3941 enum Type {
3942 UNKNOWN = 0;
3943 CHIP_VIEWED = 1;
3944 CHIP_CLICKED = 2;
3945 DIALOG_PRIVACY_SETTINGS = 3;
3946 DIALOG_DISMISS = 4;
3947 DIALOG_LINE_ITEM = 5;
3948 }
3949
tsaichristine5adc7e02020-01-14 17:07:39 -08003950 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003951
3952 // Used if the type is LINE_ITEM
3953 optional string package_name = 2;
3954}
3955
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003956/**
3957 * Logs information about a package that is moved from the internal to external storage and vice
3958 * versa.
3959 * It logs the package name, the type of the external storage where the package is installed
3960 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3961 * and the move type: if it's from internal to external or the other way around.
3962 *
3963 * Logged from:
3964 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3965 */
3966message AppMovedStorageReported {
3967 enum MoveType {
3968 UNKNOWN = 0;
3969 TO_EXTERNAL = 1;
3970 TO_INTERNAL = 2;
3971 }
3972 // The type of the external storage.
3973 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3974 // The type of move.
3975 optional MoveType move_type = 2;
3976 // The name of the package that was moved.
3977 optional string package_name = 3;
3978}
3979
jianjin8f2dee02019-03-29 14:03:08 -07003980/**
3981 * Logs when system server watchdog occurs.
3982 * Logged from:
3983 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3984 */
3985message SystemServerWatchdogOccurred {
3986 optional string subject = 1;
3987}
3988
3989/**
3990 * Logs when new file added to tombstones.
3991 * Logged from:
3992 * frameworks/base/core/java/com/android/server/BootReceiver.java
3993 */
3994message TombStoneOccurred {
3995}
3996
Hai Zhang5d3328d2019-04-13 21:25:06 +08003997/*
3998 * Information about a role request
3999 *
4000 * Logged from:
4001 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4002 */
4003message RoleRequestResultReported {
4004 // UID of application requesting the role
4005 optional int32 requesting_uid = 1;
4006
4007 // Package name of application requesting the role
4008 optional string requesting_package_name = 2;
4009
4010 // The role to be granted
4011 optional string role_name = 3;
4012
4013 // The count of applications qualifying for the role
4014 optional int32 qualifying_count = 4;
4015
4016 // UID of application current granted the role
4017 optional int32 current_uid = 5;
4018
4019 // Package name of application current granted the role
4020 optional string current_package_name = 6;
4021
4022 // UID of another application that user chose to grant the role to, instead of the requesting
4023 // application
4024 optional int32 granted_another_uid = 7;
4025
4026 // Package name of another application that user chose to grant the role to, instead of the
4027 // requesting application
4028 optional string granted_another_package_name = 8;
4029
4030 enum Result {
4031 UNDEFINED = 0;
4032 // role request was ignored
4033 IGNORED = 1;
4034 // role request was ignored because it's already granted
4035 IGNORED_ALREADY_GRANTED = 2;
4036 // role request was ignored because the application isn't qualified
4037 IGNORED_NOT_QUALIFIED = 3;
4038 // role request was ignored because user said it should be always denied
4039 IGNORED_USER_ALWAYS_DENIED = 4;
4040 // role was granted by user action
4041 USER_GRANTED = 5;
4042 // role was denied by user action
4043 USER_DENIED = 6;
4044 // role was denied by user granting another application the role
4045 USER_DENIED_GRANTED_ANOTHER = 7;
4046 // role was denied and set to be always denied by the user
4047 USER_DENIED_WITH_ALWAYS = 8;
4048 }
4049 // The result of the role request
4050 optional Result result = 9;
4051}
4052
Mark Tabrya824a642019-11-05 12:26:12 -08004053/**
4054 * Logs when a Vehicle Maps Service client's connection state has changed
4055 *
4056 * Logged from:
4057 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4058 */
4059message VmsClientConnectionStateChanged {
4060 // The UID of the VMS client app
4061 optional int32 uid = 1 [(is_uid) = true];
4062
4063 enum State {
4064 UNKNOWN = 0;
4065 // Attempting to connect to the client
4066 CONNECTING = 1;
4067 // Client connection established
4068 CONNECTED = 2;
4069 // Client connection closed unexpectedly
4070 DISCONNECTED = 3;
4071 // Client connection closed by VMS
4072 TERMINATED = 4;
4073 // Error establishing the client connection
4074 CONNECTION_ERROR = 5;
4075 }
4076
4077 optional State state = 2;
4078}
4079
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004080/**
4081 * Logs when MediaProvider has successfully finished scanning a storage volume.
4082 *
4083 * Logged from:
4084 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4085 */
4086message MediaProviderScanEvent {
4087 enum Reason {
4088 // Scan triggered due to unknown reason
4089 UNKNOWN = 0;
4090 // Scan triggered due to storage volume being mounted
4091 MOUNTED = 1;
4092 // Scan triggered due to explicit user action or app request
4093 DEMAND = 2;
4094 // Scan triggered due to idle maintenance
4095 IDLE = 3;
4096 }
4097
4098 // Volume type that this event pertains to
4099 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4100 // Reason why this scan was triggered
4101 optional Reason reason = 2;
4102 // Total number of files scanned
4103 optional int64 item_count = 3;
4104 // Duration of scan, normalized per file
4105 optional float normalized_duration_millis = 4;
4106 // Number of database inserts, normalized per file
4107 optional float normalized_insert_count = 5;
4108 // Number of database updates, normalized per file
4109 optional float normalized_update_count = 6;
4110 // Number of database deletes, normalized per file
4111 optional float normalized_delete_count = 7;
4112}
4113
4114/**
4115 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4116 *
4117 * Logged from:
4118 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4119 */
4120message MediaProviderDeletionEvent {
4121 // Volume type that this event pertains to
4122 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4123 // Device timestamp when this deletion event occurred
4124 optional int64 timestamp_millis = 2;
4125 // App that requested deletion
4126 optional string package_name = 3;
4127 // Number of items that were deleted
4128 optional int32 item_count = 4;
4129}
4130
4131/**
4132 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4133 *
4134 * Logged from:
4135 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4136 */
4137message MediaProviderPermissionEvent {
4138 enum Result {
4139 UNKNOWN = 0;
4140 USER_GRANTED = 1;
4141 AUTO_GRANTED = 2;
4142 USER_DENIED = 3;
4143 USER_DENIED_WITH_PREJUDICE = 4;
4144 AUTO_DENIED = 5;
4145 }
4146
4147 // Volume type that this event pertains to
4148 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4149 // Device timestamp when this permission event occurred
4150 optional int64 timestamp_millis = 2;
4151 // App that requested permission
4152 optional string package_name = 3;
4153 // Number of items that were requested
4154 optional int32 item_count = 4;
4155 // Result of this request
4156 optional Result result = 5;
4157}
4158
4159/**
4160 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4161 *
4162 * Logged from:
4163 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4164 */
4165message MediaProviderSchemaChange {
4166 // Volume type that this event pertains to
4167 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4168 // Old database version code
4169 optional int32 version_from = 2;
4170 // New database version code
4171 optional int32 version_to = 3;
4172 // Total number of files in database
4173 optional int64 item_count = 4;
4174 // Duration of schema change, normalized per file
4175 optional float normalized_duration_millis = 5;
4176}
4177
4178/**
4179 * Logs when MediaProvider has finished an idle maintenance job.
4180 *
4181 * Logged from:
4182 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4183 */
4184message MediaProviderIdleMaintenance {
4185 // Volume type that this event pertains to
4186 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4187
4188 // Total number of files in database
4189 optional int64 item_count = 2;
4190 // Duration of idle maintenance, normalized per file
4191 optional float normalized_duration_millis = 3;
4192 // Number of thumbnails found to be stale, normalized per file
4193 optional float normalized_stale_thumbnails = 4;
4194 // Number of items found to be expired, normalized per file
4195 optional float normalized_expired_media = 5;
4196}
4197
Keun young Park3e033cb2019-12-18 11:27:35 -08004198/**
4199 * Represents boot time event with duration in ms.
4200 *
4201 * Logged from: bootstat and various system server components. Check each enums for details.
4202 */
4203message BootTimeEventDuration {
4204 enum DurationEvent {
4205 UNKNOWN = 0;
4206 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4207 ABSOLUTE_BOOT_TIME = 1;
4208 // Bootloader's 1st stage execution time.
4209 // Logged from bootstat.
4210 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4211 // Bootloader's 1st stage loading time.
4212 // Logged from bootstat.
4213 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4214 // Bootloader's kernel loading time.
4215 // Logged from bootstat.
4216 BOOTLOADER_KERNEL_LOAD = 4;
4217 // Bootloader's 2nd stage execution time.
4218 // Logged from bootstat.
4219 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4220 // Bootloader's 2nd stage loading time.
4221 // Logged from bootstat.
4222 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4223 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4224 // for locked device.
4225 // Logged from bootstat.
4226 BOOTLOADER_UI_WAIT = 7;
4227 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4228 // Logged from bootstat.
4229 BOOTLOADER_TOTAL = 8;
4230 // Shutdown duration inside init for the reboot before the current boot up.
4231 // Logged from f/b/services/.../BootReceiver.java.
4232 SHUTDOWN_DURATION = 9;
4233 // Total time for mounting of disk devices during bootup.
4234 // Logged from f/b/services/.../BootReceiver.java.
4235 MOUNT_DEFAULT_DURATION = 10;
4236 // Total time for early stage mounting of disk devices during bootup.
4237 // Logged from f/b/services/.../BootReceiver.java.
4238 MOUNT_EARLY_DURATION = 11;
4239 // Total time for late stage mounting of disk devices during bootup.
4240 // Logged from f/b/services/.../BootReceiver.java.
4241 MOUNT_LATE_DURATION = 12;
4242 // Average time to scan non-system app after OTA
4243 // Logged from f/b/services/.../PackageManagerService.java
4244 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4245 // Time to initialize Package manager after OTA
4246 // Logged from f/b/services/.../PackageManagerService.java
4247 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4248 // Time to scan all system app from Package manager after OTA
4249 // Logged from f/b/services/.../PackageManagerService.java
4250 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4251 // Init's total time for cold boot stage.
4252 // Logged from bootstat.
4253 COLDBOOT_WAIT = 16;
4254 // Init's total time for initializing selinux.
4255 // Logged from bootstat.
4256 SELINUX_INIT = 17;
4257 // Time since last factory reset.
4258 // Logged from bootstat.
4259 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004260 // Init's total time spent for completing the 1st stage.
4261 // Logged from bootstat.
4262 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004263 }
4264
4265 // Type of the event.
4266 optional DurationEvent event = 1;
4267 // Duration of the event in ms.
4268 optional int64 duration_millis = 2;
4269}
4270
4271/**
4272 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4273 * since boot-up.
4274 *
4275 * Logged from: bootstat and various system server components. Check each enums for details.
4276 */
4277message BootTimeEventElapsedTime {
4278 enum ElapsedTimeEvent {
4279 UNKNOWN = 0;
4280 // Time when init starts 1st stage. Logged from bootstat.
4281 ANDROID_INIT_STAGE_1 = 1;
4282 // Time when sys.boot_completed prop is set.
4283 // Logged from bootstat.
4284 BOOT_COMPLETE = 2;
4285 // BOOT_COMPLETE for encrypted device.
4286 BOOT_COMPLETE_ENCRYPTION = 3;
4287 // BOOT_COMPLETE for device with no encryption.
4288 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4289 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004290 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004291 // BOOT_COMPLETE after factory reset.
4292 FACTORY_RESET_BOOT_COMPLETE = 6;
4293 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4294 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004295 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4296 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004297 // BOOT_COMPLETE after OTA.
4298 OTA_BOOT_COMPLETE = 9;
4299 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4300 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004301 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4302 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004303 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4304 // Logged from f/b/services/.../UserController.java
4305 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4306 // Time when the system starts sending BOOT_COMPLETED broadcast.
4307 // Logged from f/b/services/.../UserController.java
4308 FRAMEWORK_BOOT_COMPLETED = 13;
4309 // Time when the package manager starts init.
4310 // Logged from f/b/services/.../SystemServer.java
4311 PACKAGE_MANAGER_INIT_START = 14;
4312 // Time when package manager is ready
4313 // Logged from f/b/services/.../SystemServer.java
4314 PACKAGE_MANAGER_INIT_READY = 15;
4315 // Represents the time when user has entered unlock credential for system with user pin.
4316 // Logged from bootstat.
4317 POST_DECRYPT = 16;
4318 // Represents the start of zygote's init.
4319 // Logged from zygote itself.
4320 ZYGOTE_INIT_START = 17;
4321 // Represents the start of secondary zygote's init.
4322 // TODO: add logging to zygote
4323 SECONDARY_ZYGOTE_INIT_START = 18;
4324 // Represents the start of system server's init.
4325 // Logged from f/b/services/.../SystemServer.java
4326 SYSTEM_SERVER_INIT_START = 19;
4327 // Represents the completion of system server's init.
4328 // Logged from f/b/services/.../SystemServer.java
4329 SYSTEM_SERVER_READY = 20;
4330 // Represents the start of launcher during boot-up.
4331 // TODO: add logging
4332 LAUNCHER_START = 21;
4333 // Represents the completion of launcher's initial rendering. User can use other apps from
4334 // launcher from this point.
4335 // TODO: add logging
4336 LAUNCHER_SHOWN = 22;
4337 }
4338
4339 // Type of the event.
4340 optional ElapsedTimeEvent event = 1;
4341 // Time since bootup for the event.
4342 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4343 optional int64 time_millis = 2;
4344}
4345
4346/**
4347 * Boot time events with UTC time.
4348 *
4349 * Logged from: bootstat and various system server components. Check each enums for details.
4350 */
4351message BootTimeEventUtcTime {
4352 enum UtcTimeEvent {
4353 UNKNOWN = 0;
4354 // Time of the bootstat's marking of 1st boot after the last factory reset.
4355 // Logged from bootstat.
4356 FACTORY_RESET_RESET_TIME = 1;
4357 // The time when bootstat records FACTORY_RESET_* events. This is close to
4358 // BOOT_COMPLETE time for the current bootup.
4359 // Logged from bootstat.
4360 FACTORY_RESET_CURRENT_TIME = 2;
4361 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4362 // Logged from bootstat.
4363 FACTORY_RESET_RECORD_VALUE = 3;
4364 }
4365
4366 // Type of the event.
4367 optional UtcTimeEvent event = 1;
4368 // UTC time for the event.
4369 optional int64 utc_time_secs = 2;
4370}
4371
4372/**
4373 * Boot time events representing specific error code during bootup.
4374 * Meaning of error code can be different per each event type.
4375 *
4376 * Logged from: bootstat and various system server components. Check each enums for details.
4377 */
4378message BootTimeEventErrorCode {
4379 enum ErrorCodeEvent {
4380 UNKNOWN = 0;
4381 // Linux error code for time() call to get the current UTC time.
4382 // Logged from bootstat.
4383 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4384 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4385 // as UMOUNT_STAT_* from init/reboot.cpp.
4386 // Logged from f/b/services/.../BootReceiver.java.
4387 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004388 // Reprepsents fie system mounting error code of /data partition for the current boot.
4389 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004390 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004391 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004392 }
4393
4394 // Type of the event.
4395 optional ErrorCodeEvent event = 1;
4396 // error code defined per each event type.
4397 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4398 // FS_MGR_FS_STAT.
4399 optional int32 error_code = 2;
4400}
4401
Chenjie Yubbcbc602018-02-05 16:51:52 -08004402//////////////////////////////////////////////////////////////////////
4403// Pulled atoms below this line //
4404//////////////////////////////////////////////////////////////////////
4405
4406/**
David Chenc8a43242017-10-17 16:23:28 -07004407 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4408 *
4409 * Pulled from:
4410 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4411 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004412message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004413 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004414
4415 optional int64 rx_bytes = 2;
4416
4417 optional int64 rx_packets = 3;
4418
4419 optional int64 tx_bytes = 4;
4420
4421 optional int64 tx_packets = 5;
4422}
4423
4424/**
4425 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4426 *
4427 * Pulled from:
4428 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4429 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004430message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004431 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004432
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004433 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4434 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004435
4436 optional int64 rx_bytes = 3;
4437
4438 optional int64 rx_packets = 4;
4439
4440 optional int64 tx_bytes = 5;
4441
4442 optional int64 tx_packets = 6;
4443}
4444
4445/**
4446 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4447 *
4448 * Pulled from:
4449 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4450 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004451message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004452 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004453
4454 optional int64 rx_bytes = 2;
4455
4456 optional int64 rx_packets = 3;
4457
4458 optional int64 tx_bytes = 4;
4459
4460 optional int64 tx_packets = 5;
4461}
4462
4463/**
4464 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4465 *
4466 * Pulled from:
4467 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4468 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004469message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004470 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004471
Yao Chenc40a19d2018-03-15 16:48:25 -07004472 // 1 denotes foreground and 0 denotes background. This is called Set in
4473 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004474 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004475
4476 optional int64 rx_bytes = 3;
4477
4478 optional int64 rx_packets = 4;
4479
4480 optional int64 tx_bytes = 5;
4481
4482 optional int64 tx_packets = 6;
4483}
4484
4485/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004486 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4487 *
4488 * Pulled from:
4489 * StatsCompanionService
4490 */
4491message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004492 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004493
4494 optional int64 rx_bytes = 2;
4495
4496 optional int64 tx_bytes = 3;
4497}
4498
4499/**
David Chenc8a43242017-10-17 16:23:28 -07004500 * Pulls the kernel wakelock durations. This atom is adapted from
4501 * android/internal/os/KernelWakelockStats.java
4502 *
4503 * Pulled from:
4504 * StatsCompanionService using KernelWakelockReader.
4505 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004506message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004507 optional string name = 1;
4508
4509 optional int32 count = 2;
4510
4511 optional int32 version = 3;
4512
Yangster-maca8a30442018-10-13 23:46:34 -07004513 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004514}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004515
Chenjie Yu05013b32017-11-21 10:21:41 -08004516/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004517 * Pulls low power state information. If power.stats HAL is not available, this
4518 * includes platform and subsystem sleep state information,
4519 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4520 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004521 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004522 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004523 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4524 * as defined in:
4525 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004526 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004527message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004528 // Subsystem name
4529 optional string subsystem_name = 1;
4530 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4531 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004532 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4533 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004534 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004535 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004536 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004537 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004538 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004539}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004540
Chenjie Yu05013b32017-11-21 10:21:41 -08004541/**
Bookatz92da2832018-11-01 18:10:03 -07004542 * Pulls on-device power measurement information.
4543 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4544 * Pulled from:
4545 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4546 */
4547message OnDevicePowerMeasurement {
4548 // Name of the subsystem (to which the rail belongs).
4549 optional string subsystem_name = 1;
4550
4551 // Rail name. The rail lies within the subsystem.
4552 optional string rail_name = 2;
4553
4554 // Time (in ms since boot) at which the rail energy value was measured.
4555 // This may differ slightly from the time that statsd logs this information.
4556 optional uint64 measurement_timestamp_millis = 3;
4557
4558 // Accumulated energy used via the rail since device boot in uWs.
4559 optional uint64 energy_microwatt_secs = 4;
4560}
4561
4562/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004563 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004564 * Pulls the time the cpu spend on the frequency index. Frequency index
4565 * starts from highest to lowest. The value should be monotonically
4566 * increasing since boot. However, if there is a cpu
4567 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004568 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004569message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004570 optional uint32 cluster = 1;
4571 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004572 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004573}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004574
Chenjie Yu05013b32017-11-21 10:21:41 -08004575/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004576 * Pulls Cpu Time Per Uid.
4577 * Note that isolated process uid time should be attributed to host uids.
4578 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004579message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004580 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004581 optional uint64 user_time_micros = 2;
4582 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004583}
4584
4585/**
4586 * Pulls Cpu Time Per Uid per frequency.
4587 * Note that isolated process uid time should be attributed to host uids.
4588 * For each uid, we order the time by descending frequencies.
4589 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004590message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004591 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004592 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004593 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004594}
Hugo Benichi884970e2017-11-14 22:42:46 +09004595
Chenjie Yu05013b32017-11-21 10:21:41 -08004596/**
4597 * Pulls Wifi Controller Activity Energy Info
4598 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004599message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004600 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004601 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004602 // stack reported state
4603 // TODO: replace this with proto enum
4604 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004605 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004606 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004607 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004608 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004609 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004610 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004611 // product of current(mA), voltage(V) and time(ms)
4612 optional uint64 controller_energy_used = 6;
4613}
4614
4615/**
4616 * Pulls Modem Activity Energy Info
4617 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004618message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004619 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004620 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004621 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004622 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004623 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004624 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004625 /**
4626 * Tx power index
4627 * index 0 = tx_power < 0dBm
4628 * index 1 = 0dBm < tx_power < 5dBm
4629 * index 2 = 5dBm < tx_power < 15dBm
4630 * index 3 = 15dBm < tx_power < 20dBm
4631 * index 4 = tx_power > 20dBm
4632 */
4633 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004634 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004635 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004636 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004637 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004638 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004639 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004640 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004641 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004642 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004643 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004644 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004645 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004646 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004647}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004648
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004649/**
4650 * Pulls Bluetooth Activity Energy Info
4651 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4652 */
4653message BluetoothActivityInfo {
4654 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004655 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004656 // bluetooth stack state
4657 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004658 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004659 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004660 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004661 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004662 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004663 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004664 // product of current(mA), voltage(V) and time(ms)
4665 optional uint64 energy_used = 6;
4666}
4667
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004668/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004669 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004670 *
4671 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004672 */
4673message ProcessMemoryState {
4674 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004675 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004676
4677 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004678 // Usually package name, "system" for system server.
4679 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004680 optional string process_name = 2;
4681
Rafal Slawikda51b932018-12-13 16:31:33 +00004682 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004683 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004684
4685 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004686 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004687
4688 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004689 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004690
Rajeev Kumar90235992018-01-29 11:06:48 -08004691 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004692 // Value is read from memory.stat, field total_rss if per-app memory
4693 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004694 optional int64 rss_in_bytes = 6;
4695
4696 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004697 // Value is read from memory.stat, field total_cache if per-app memory
4698 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004699 optional int64 cache_in_bytes = 7;
4700
4701 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004702 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004703 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004704 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004705
Rafal Slawik203c3db2019-09-25 19:53:01 +01004706 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004707 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004708
Rafal Slawik203c3db2019-09-25 19:53:01 +01004709 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4710 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004711
Rafal Slawik203c3db2019-09-25 19:53:01 +01004712 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4713 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004714}
4715
4716/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004717 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004718 *
4719 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4720 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004721 *
4722 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004723 */
4724message ProcessMemoryHighWaterMark {
4725 // The uid if available. -1 means not available.
4726 optional int32 uid = 1 [(is_uid) = true];
4727
Rafal Slawikda51b932018-12-13 16:31:33 +00004728 // The process name.
4729 // Usually package name or process cmdline.
4730 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004731 optional string process_name = 2;
4732
Rafal Slawik239b6802019-09-09 18:46:01 +01004733 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4734 // computed by converting kilobytes to bytes.
4735 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4736
Rafal Slawik3bea8952018-11-15 12:39:33 +00004737 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4738 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004739 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004740}
4741
4742/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004743 * Logs the memory stats for a process.
4744 *
4745 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4746 * and for selected native processes.
4747 */
4748message ProcessMemorySnapshot {
4749 // The uid if available. -1 means not available.
4750 optional int32 uid = 1 [(is_uid) = true];
4751
4752 // The process name.
4753 // Usually package name or process cmdline.
4754 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4755 optional string process_name = 2;
4756
4757 // The pid of the process.
4758 // Allows to disambiguate instances of the process.
4759 optional int32 pid = 3;
4760
4761 // The current OOM score adjustment value.
4762 // Read from ProcessRecord for managed processes.
4763 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4764 optional int32 oom_score_adj = 4;
4765
4766 // The current RSS of the process.
4767 // VmRSS from /proc/pid/status.
4768 optional int32 rss_in_kilobytes = 5;
4769
4770 // The current anon RSS of the process.
4771 // RssAnon from /proc/pid/status.
4772 optional int32 anon_rss_in_kilobytes = 6;
4773
4774 // The current swap size of the process.
4775 // VmSwap from /proc/pid/status.
4776 optional int32 swap_in_kilobytes = 7;
4777
4778 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4779 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4780}
4781
4782/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004783 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004784 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004785message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004786 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004787}
4788
4789/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004790 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004791 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004792message SystemUptime {
4793 // Milliseconds since the system was booted.
4794 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4795 // for external input).
4796 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004797 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004798}
4799
4800/*
4801 * Reads from /proc/uid_concurrent_active_time which has the format:
4802 * active: X (X is # cores)
4803 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4804 * [uid1]: [time-0] [time-1] [time-2] ... ...
4805 * ...
4806 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4807 * The file contains a monotonically increasing count of time for a single boot.
4808 */
4809message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004810 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004811 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004812}
4813
4814/**
4815 * Reads from /proc/uid_concurrent_policy_time which has the format:
4816 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4817 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4818 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4819 * ...
4820 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4821 * The file contains a monotonically increasing count of time for a single boot.
4822 */
4823message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004824 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004825 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004826 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004827}
4828
4829/*
4830 * Pulls free disk space, for data, system partition and temporary directory.
4831 */
4832message DiskSpace {
4833 // available bytes in data partition
4834 optional uint64 data_available_bytes = 1;
4835 // available bytes in system partition
4836 optional uint64 system_available_bytes = 2;
4837 // available bytes in download cache or temp directories
4838 optional uint64 temp_available_bytes = 3;
4839}
Tej Singhbf972d92018-01-10 20:51:13 -08004840
4841/**
4842 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004843 *
4844 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004845 */
4846message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004847 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004848}
4849
4850/**
4851 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004852 * Pulled from:
4853 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004854 */
4855message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004856 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004857}
4858
4859/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004860 * Pulls battery voltage.
4861 * Pulled from:
4862 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4863 */
4864message BatteryVoltage {
4865 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004866 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004867}
4868
4869/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004870 * Pulls battery level (percent full, from 0 to 100).
4871 *
4872 * Pulled from:
4873 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4874 */
4875message BatteryLevel {
4876 // Battery level. Should be in [0, 100].
4877 optional int32 battery_level = 1;
4878}
4879
4880/**
Tej Singhd89137e2018-03-26 14:51:40 -07004881 * Pulls the temperature of various parts of the device.
4882 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004883 *
Maggie White442b6312019-04-05 16:26:44 -07004884 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004885 */
4886message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004887 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004888 optional android.os.TemperatureTypeEnum sensor_location = 1;
4889
4890 // The name of the temperature source. Eg. CPU0
4891 optional string sensor_name = 2;
4892
Tej Singhd89137e2018-03-26 14:51:40 -07004893 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004894 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004895 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004896
4897 // Relative severity of the throttling, see enum definition.
4898 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004899}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004900
4901/**
4902 * Pulls the statistics of calls to Binder.
4903 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004904 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4905 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004906 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004907 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004908 */
4909message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004910 // UID of the process responsible for the binder transaction. It will be set if the process
4911 // executing the binder transaction attribute the transaction to another uid using
4912 // Binder.setThreadWorkSource().
4913 //
4914 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004915 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004916 // UID of the process executing the binder transaction.
4917 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004918 // Fully qualified class name of the API call.
4919 //
4920 // This is a system server class name.
4921 //
4922 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4923 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4924 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4925 // commonly used APIs.
4926 optional string service_class_name = 2;
4927 // Method name of the API call. It can also be a transaction code if we cannot
4928 // resolve it to a name. See Binder#getTransactionName.
4929 //
4930 // This is a system server method name.
4931 optional string service_method_name = 3;
4932 // Total number of API calls.
4933 optional int64 call_count = 4;
4934 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4935 optional bool screen_interactive = 13;
4936 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4937 // call_count will be equal to recorded_call_count.
4938 //
4939 // If recorded_call_count is different than call_count, it means data collection has been
4940 // sampled. All the fields below will be sampled in this case.
4941 optional int64 recorded_call_count = 12;
4942 // Number of exceptions thrown by the API.
4943 optional int64 recorded_exception_count = 5;
4944 // Total latency of all API calls.
4945 // Average can be computed using total_latency_micros / recorded_call_count.
4946 optional int64 recorded_total_latency_micros = 6;
4947 // Maximum latency of one API call.
4948 optional int64 recorded_max_latency_micros = 7;
4949 // Total CPU usage of all API calls.
4950 // Average can be computed using total_cpu_micros / recorded_call_count.
4951 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4952 optional int64 recorded_total_cpu_micros = 8;
4953 // Maximum CPU usage of one API call.
4954 optional int64 recorded_max_cpu_micros = 9;
4955 // Maximum parcel reply size of one API call.
4956 optional int64 recorded_max_reply_size_bytes = 10;
4957 // Maximum parcel request size of one API call.
4958 optional int64 recorded_max_request_size_bytes = 11;
4959}
4960
4961/**
4962 * Pulls the statistics of exceptions during calls to Binder.
4963 *
4964 * Binder stats are cumulative from boot unless somebody reset the data using
4965 * > adb shell dumpsys binder_calls_stats --reset
4966 */
4967message BinderCallsExceptions {
4968 // Exception class name, e.g. java.lang.IllegalArgumentException.
4969 //
4970 // This is an exception class name thrown by the system server.
4971 optional string exception_class_name = 1;
4972 // Total number of exceptions.
4973 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004974}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004975
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004976/**
4977 * Pulls the statistics of message dispatching on HandlerThreads.
4978 *
4979 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4980 * config on the device.
4981 *
4982 * Next tag: 11
4983 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004984message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004985 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004986 optional int32 uid = 1 [(is_uid) = true];
4987
4988 // Fully qualified class name of the handler target class.
4989 //
4990 // This field does not contain PII. This is a system server class name.
4991 optional string handler_class_name = 2;
4992
4993 // The name of the thread that runs the Looper.
4994 //
4995 // This field does not contain PII. This is a system server thread name.
4996 optional string looper_thread_name = 3;
4997
4998 // The name of the dispatched message.
4999 //
5000 // This field does not contain PII. This is a system server constant or class
5001 // name.
5002 optional string message_name = 4;
5003
5004 // Total number of successfully dispatched messages.
5005 optional int64 message_count = 5;
5006
5007 // Total number of messages that failed dispatching.
5008 optional int64 exception_count = 6;
5009
5010 // Total number of processed messages we have data recorded for. If we
5011 // collected data for all the messages, message_count will be equal to
5012 // recorded_message_count.
5013 //
5014 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005015 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005016 optional int64 recorded_message_count = 7;
5017
5018 // Total latency of all processed messages.
5019 // Average can be computed using recorded_total_latency_micros /
5020 // recorded_message_count.
5021 optional int64 recorded_total_latency_micros = 8;
5022
5023 // Total CPU usage of all processed message.
5024 // Average can be computed using recorded_total_cpu_micros /
5025 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005026 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005027 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005028
5029 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5030 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005031
5032 // Max recorded CPU usage of all processed messages.
5033 optional int64 recorded_max_cpu_micros = 11;
5034
5035 // Max recorded latency of all processed messages.
5036 optional int64 recorded_max_latency_micros = 12;
5037
5038 // Total number of messages we tracked the dispatching delay for. If we
5039 // collected data for all the messages, message_count will be equal to
5040 // recorded_delay_message_count.
5041 //
5042 // If recorded_delay_message_count is different than message_count, it means data
5043 // collection has been sampled or/and not all messages specified the target dispatch time.
5044 // The fields below will be sampled in this case.
5045 optional int64 recorded_delay_message_count = 13;
5046
5047 // Total dispatching delay of all processed messages.
5048 // Calculated as a difference between the target dispatching time (Message.when)
5049 // and the actual dispatching time.
5050 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5051 optional int64 recorded_total_delay_millis = 14;
5052
5053 // Max dispatching delay of all processed messages.
5054 // Calculated as a difference between the target dispatching time (Message.when)
5055 // and the actual dispatching time.
5056 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005057}
Tej Singh86dc9db2018-09-06 00:39:57 +00005058
5059/**
5060 * Pulls disk information, such as write speed and latency.
5061 */
5062message DiskStats {
5063 // Time taken to open, write 512B to, and close a file.
5064 // -1 if error performing the check.
5065 optional int64 data_write_latency_millis = 1;
5066
5067 optional bool file_based_encryption = 2;
5068
5069 // Recent disk write speed in kB/s.
5070 // -1 if error querying storageed.
5071 // 0 if data is unavailable.
5072 optional int32 recent_disk_write_speed = 3;
5073}
5074
5075
5076/**
5077 * Free and total bytes of the Data, Cache, and System partition.
5078 */
5079message DirectoryUsage {
5080 enum Directory {
5081 UNKNOWN = 0;
5082 DATA = 1;
5083 CACHE = 2;
5084 SYSTEM = 3;
5085 }
5086 optional Directory directory = 1;
5087 optional int64 free_bytes = 2;
5088 optional int64 total_bytes = 3;
5089}
5090
5091
5092/**
5093 * Size of an application: apk size, data size, and cache size.
5094 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5095 * Information is only reported for apps with the primary user (user 0).
5096 * Sizes are aggregated by package name.
5097 */
5098message AppSize {
5099 // Including uids will involve modifying diskstats logic.
5100 optional string package_name = 1;
5101 // App size in bytes. -1 if unavailable.
5102 optional int64 app_size_bytes = 2;
5103 // App data size in bytes. -1 if unavailable.
5104 optional int64 app_data_size_bytes = 3;
5105 // App cache size in bytes. -1 if unavailable.
5106 optional int64 app_cache_size_bytes = 4;
5107 // Time that the cache file was produced.
5108 // Uses System.currentTimeMillis(), which is wall clock time.
5109 optional int64 cache_time_millis = 5;
5110}
5111
5112
5113/**
5114 * Size of a particular category. Eg: photos, videos.
5115 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5116 */
5117message CategorySize {
5118 enum Category {
5119 UNKNOWN = 0;
5120 APP_SIZE = 1;
5121 APP_DATA_SIZE = 2;
5122 APP_CACHE_SIZE = 3;
5123 PHOTOS = 4;
5124 VIDEOS = 5;
5125 AUDIO = 6;
5126 DOWNLOADS = 7;
5127 SYSTEM = 8;
5128 OTHER = 9;
5129 }
5130 optional Category category = 1;
5131 // Category size in bytes.
5132 optional int64 size_bytes = 2;
5133 // Time that the cache file was produced.
5134 // Uses System.currentTimeMillis(), which is wall clock time.
5135 optional int64 cache_time_millis = 3;
5136}
Tej Singhd6d6d772018-09-05 17:41:25 -07005137
5138/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005139 * Pulls per uid I/O stats. The stats are cumulative since boot.
5140 *
5141 * Read/write bytes are I/O events from a storage device
5142 * Read/write chars are data requested by read/write syscalls, and can be
5143 * satisfied by caching.
5144 *
5145 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5146 */
5147message DiskIo {
5148 optional int32 uid = 1 [(is_uid) = true];
5149 optional int64 fg_chars_read = 2;
5150 optional int64 fg_chars_write = 3;
5151 optional int64 fg_bytes_read = 4;
5152 optional int64 fg_bytes_write = 5;
5153 optional int64 bg_chars_read = 6;
5154 optional int64 bg_chars_write = 7;
5155 optional int64 bg_bytes_read = 8;
5156 optional int64 bg_bytes_write = 9;
5157 optional int64 fg_fsync = 10;
5158 optional int64 bg_fsync= 11;
5159}
5160
5161
5162/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005163 * Pulls the number of fingerprints for each user.
5164 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005165 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005166 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005167message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005168 // The associated user. Eg: 0 for owners, 10+ for others.
5169 // Defined in android/os/UserHandle.java
5170 optional int32 user = 1;
5171 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005172 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005173}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005174
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005175/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005176 * Pulls the number of faces for each user.
5177 *
5178 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5179 */
5180message NumFacesEnrolled {
5181 // The associated user. Eg: 0 for owners, 10+ for others.
5182 // Defined in android/os/UserHandle.java
5183 optional int32 user = 1;
5184 // Number of faces registered to that user.
5185 optional int32 num_faces_enrolled = 2;
5186}
5187/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005188 * A mapping of role holder -> role
5189 */
5190message RoleHolder {
5191 // uid of the role holder
5192 optional int32 uid = 1 [(is_uid) = true];
5193
5194 // package name of the role holder
5195 optional string package_name = 2;
5196
5197 // the role held
5198 optional string role = 3;
5199}
5200
Yangsteraf9aee72018-10-12 09:26:16 -07005201message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005202 // These are all in byte resolution.
5203 optional int64 min = 1 [deprecated = true];
5204 optional int64 average = 2 [deprecated = true];
5205 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005206
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005207 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5208 // int64 fields.
5209 optional int32 mean_kb = 4;
5210 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005211}
5212
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005213// A reduced subset of process states; reducing the number of possible states allows more
5214// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5215enum ProcessStateAggregated {
5216 PROCESS_STATE_UNKNOWN = 0;
5217 // Persistent system process.
5218 PROCESS_STATE_PERSISTENT = 1;
5219 // Top activity; actually any visible activity.
5220 PROCESS_STATE_TOP = 2;
5221 // Process binding to top or a foreground service.
5222 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5223 // Processing running a foreground service.
5224 PROCESS_STATE_FGS = 4;
5225 // Important foreground process (ime, wallpaper, etc).
5226 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5227 // Important background process.
5228 PROCESS_STATE_BACKGROUND = 6;
5229 // Process running a receiver.
5230 PROCESS_STATE_RECEIVER = 7;
5231 // All kinds of cached processes.
5232 PROCESS_STATE_CACHED = 8;
5233}
5234
5235// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005236message ProcessStatsStateProto {
5237 optional android.service.procstats.ScreenState screen_state = 1;
5238
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005239 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005240
5241 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5242 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005243 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5244
5245 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005246
5247 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005248 optional int64 duration_millis = 4 [deprecated = true];
5249 // Same as above, but with minute resolution so it fits into an int32.
5250 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005251
5252 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005253 optional int64 realtime_duration_millis = 9 [deprecated = true];
5254 // Same as above, but with minute resolution so it fits into an int32.
5255 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005256
5257 // # of samples taken
5258 optional int32 sample_size = 5;
5259
5260 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005261 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005262
5263 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005264 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005265
5266 // RSS is memory resident for this process
5267 optional AggStats rss = 8;
5268}
5269
5270// Next Tag: 7
5271message ProcessStatsProto {
5272 // Name of process.
5273 optional string process = 1;
5274
5275 // Uid of the process.
5276 optional int32 uid = 2;
5277
5278 // Information about how often kills occurred
5279 message Kill {
5280 // Count of excessive CPU kills
5281 optional int32 cpu = 1;
5282
5283 // Count of kills when cached
5284 optional int32 cached = 2;
5285
5286 // PSS stats during cached kill
5287 optional AggStats cached_pss = 3;
5288 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005289 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005290
5291 // Time and memory spent in various states.
5292 repeated ProcessStatsStateProto states = 5;
5293
5294 // Total time process has been running... screen_state, memory_state, and process_state
5295 // will not be set.
5296 optional ProcessStatsStateProto total_running_state = 6;
5297}
5298
5299message PackageServiceOperationStatsProto {
5300 // Operate enum: Started, Foreground, Bound, Executing
5301 optional android.service.procstats.ServiceOperationState operation = 1;
5302
5303 // Number of times the service was in this operation.
5304 optional int32 count = 2;
5305
5306 // Information about a state the service can be in.
5307 message StateStats {
5308 // Screen state enum.
5309 optional android.service.procstats.ScreenState screen_state = 1;
5310 // Memory state enum.
5311 optional android.service.procstats.MemoryState memory_state = 2;
5312
5313 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005314 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005315 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005316 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005317 }
5318 repeated StateStats state_stats = 3;
5319}
5320
5321message PackageServiceStatsProto {
5322 // Name of service component.
5323 optional string service_name = 1;
5324
5325 // The operation stats.
5326 // The package_name, package_uid, package_version, service_name will not be set to save space.
5327 repeated PackageServiceOperationStatsProto operation_stats = 2;
5328}
5329
5330message PackageAssociationSourceProcessStatsProto {
5331 // Uid of the process.
5332 optional int32 process_uid = 1;
5333 // Process name.
5334 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005335 // Package name.
5336 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005337 // Total count of the times this association appeared.
5338 optional int32 total_count = 3;
5339
5340 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005341 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005342
5343 // Total count of the times this association became actively impacting its target process.
5344 optional int32 active_count = 5;
5345
5346 // Information on one source in this association.
5347 message StateStats {
5348 // Process state enum.
5349 optional android.service.procstats.ProcessState process_state = 1;
5350 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005351 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005352 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005353 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005354 }
5355 repeated StateStats active_state_stats = 6;
5356}
5357
5358message PackageAssociationProcessStatsProto {
5359 // Name of the target component.
5360 optional string component_name = 1;
5361 // Information on one source in this association.
5362 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5363}
5364
5365
5366message ProcessStatsPackageProto {
5367 // Name of package.
5368 optional string package = 1;
5369
5370 // Uid of the package.
5371 optional int32 uid = 2;
5372
5373 // Version of the package.
5374 optional int64 version = 3;
5375
5376 // Stats for each process running with the package loaded in to it.
5377 repeated ProcessStatsProto process_stats = 4;
5378
5379 // Stats for each of the package's services.
5380 repeated PackageServiceStatsProto service_stats = 5;
5381
5382 // Stats for each association with the package.
5383 repeated PackageAssociationProcessStatsProto association_stats = 6;
5384}
5385
5386message ProcessStatsSectionProto {
5387 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005388 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005389
5390 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005391 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005392
5393 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005394 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005395
5396 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005397 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005398
5399 // System runtime library. e.g. "libdvm.so", "libart.so".
5400 optional string runtime = 5;
5401
5402 // whether kernel reports swapped pss.
5403 optional bool has_swapped_pss = 6;
5404
5405 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5406 enum Status {
5407 STATUS_UNKNOWN = 0;
5408 STATUS_COMPLETE = 1;
5409 STATUS_PARTIAL = 2;
5410 STATUS_SHUTDOWN = 3;
5411 STATUS_SYSPROPS = 4;
5412 }
5413 repeated Status status = 7;
5414
Chenjie Yub2ecc792019-01-17 10:27:26 -08005415 // Number of pages available of various types and sizes, representation fragmentation.
5416 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5417
Yangsteraf9aee72018-10-12 09:26:16 -07005418 // Stats for each process.
5419 repeated ProcessStatsProto process_stats = 8;
5420
5421 // Stats for each package.
5422 repeated ProcessStatsPackageProto package_stats = 9;
5423}
5424
Chenjie Yub2ecc792019-01-17 10:27:26 -08005425message ProcessStatsAvailablePagesProto {
5426 // Node these pages are in (as per /proc/pagetypeinfo)
5427 optional int32 node = 1;
5428
5429 // Zone these pages are in (as per /proc/pagetypeinfo)
5430 optional string zone = 2;
5431
5432 // Label for the type of these pages (as per /proc/pagetypeinfo)
5433 optional string label = 3;
5434
5435 // Distribution of number of pages available by order size. First entry in array is
5436 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5437 repeated int32 pages_per_order = 4;
5438}
5439
Chenjie Yu12e5e672018-09-14 15:54:59 -07005440/**
5441 * Pulled from ProcessStatsService.java
5442 */
5443message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005444 optional ProcessStatsSectionProto proc_stats_section = 1;
5445}
5446
Chenjie Yuf910b7802019-01-11 16:08:20 -08005447/**
5448 * Pulled from ProcessStatsService.java
5449 */
5450message ProcStatsPkgProc {
5451 optional ProcessStatsSectionProto proc_stats_section = 1;
5452}
5453
Chris Wrencdea3b72019-11-22 16:58:17 -05005454// Next Tag: 2
5455message PackageRemoteViewInfoProto {
5456 optional string package_name = 1;
5457 // add per-package additional info here (like channels)
5458}
5459
5460// Next Tag: 2
5461message NotificationRemoteViewsProto {
5462 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5463}
5464
5465/**
5466 * Pulled from NotificationManagerService.java
5467 */
5468message NotificationRemoteViews {
5469 optional NotificationRemoteViewsProto notification_remote_views = 1;
5470}
5471
Yangsteraf9aee72018-10-12 09:26:16 -07005472message PowerProfileProto {
5473 optional double cpu_suspend = 1;
5474
5475 optional double cpu_idle = 2;
5476
5477 optional double cpu_active = 3;
5478
5479 message CpuCluster {
5480 optional int32 id = 1;
5481 optional double cluster_power = 2;
5482 optional int32 cores = 3;
5483 repeated int64 speed = 4;
5484 repeated double core_power = 5;
5485 }
5486
5487 repeated CpuCluster cpu_cluster = 40;
5488
5489 optional double wifi_scan = 4;
5490
5491 optional double wifi_on = 5;
5492
5493 optional double wifi_active = 6;
5494
5495 optional double wifi_controller_idle = 7;
5496
5497 optional double wifi_controller_rx = 8;
5498
5499 optional double wifi_controller_tx = 9;
5500
5501 repeated double wifi_controller_tx_levels = 10;
5502
5503 optional double wifi_controller_operating_voltage = 11;
5504
5505 optional double bluetooth_controller_idle = 12;
5506
5507 optional double bluetooth_controller_rx = 13;
5508
5509 optional double bluetooth_controller_tx = 14;
5510
5511 optional double bluetooth_controller_operating_voltage = 15;
5512
5513 optional double modem_controller_sleep = 16;
5514
5515 optional double modem_controller_idle = 17;
5516
5517 optional double modem_controller_rx = 18;
5518
5519 repeated double modem_controller_tx = 19;
5520
5521 optional double modem_controller_operating_voltage = 20;
5522
5523 optional double gps_on = 21;
5524
5525 repeated double gps_signal_quality_based = 22;
5526
5527 optional double gps_operating_voltage = 23;
5528
5529 optional double bluetooth_on = 24;
5530
5531 optional double bluetooth_active = 25;
5532
5533 optional double bluetooth_at_cmd = 26;
5534
5535 optional double ambient_display = 27;
5536
5537 optional double screen_on = 28;
5538
5539 optional double radio_on = 29;
5540
5541 optional double radio_scanning = 30;
5542
5543 optional double radio_active = 31;
5544
5545 optional double screen_full = 32;
5546
5547 optional double audio = 33;
5548
5549 optional double video = 34;
5550
5551 optional double flashlight = 35;
5552
5553 optional double memory = 36;
5554
5555 optional double camera = 37;
5556
5557 optional double wifi_batched_scan = 38;
5558
5559 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005560}
Chenjie Yuab530202018-09-26 12:39:20 -07005561
5562/**
5563 * power_profile.xml and other constants for power model calculations.
5564 * Pulled from PowerProfile.java
5565 */
5566message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005567 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005568}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005569
5570/**
arangelovd5db50e2018-10-12 20:24:39 +01005571 * Logs when a user restriction was added or removed.
5572 *
5573 * Logged from:
5574 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5575 */
5576message UserRestrictionChanged {
5577 // The raw string of the user restriction as defined in UserManager.
5578 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5579 optional string restriction = 1;
5580 // Whether the restriction is enabled or disabled.
5581 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005582}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005583
5584/**
5585 * Pulls process user time and system time. Puller takes a snapshot of all pids
5586 * in the system and returns cpu stats for those that are working at the time.
5587 * Dead pids will be dropped. Kernel processes are excluded.
5588 * Min cool-down is 5 sec.
5589 */
5590message ProcessCpuTime {
5591 optional int32 uid = 1 [(is_uid) = true];
5592
5593 optional string process_name = 2;
5594 // Process cpu time in user space, cumulative from boot/process start
5595 optional int64 user_time_millis = 3;
5596 // Process cpu time in system space, cumulative from boot/process start
5597 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005598}
Misha Wagner5a51e002018-10-03 15:04:09 +01005599
5600/**
5601 * Pulls the CPU usage for each thread.
5602 *
5603 * Read from /proc/$PID/task/$TID/time_in_state files.
5604 *
5605 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5606 * time_in_state files not being present on some phones, have not been addressed. These should be
5607 * considered before a public release.
5608 */
5609message CpuTimePerThreadFreq {
5610 // UID that owns the process.
5611 optional int32 uid = 1 [(is_uid) = true];
5612 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005613 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005614 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005615 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005616 // Name of the process taken from `/proc/$PID/cmdline`.
5617 optional string process_name = 4;
5618 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5619 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005620
5621 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5622 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5623 // frequencies are given here as the alternative is sending eight separate atoms. This method
5624 // significantly reduces the amount of data created
5625 optional int32 frequency1_khz = 6;
5626 optional int32 time1_millis = 7;
5627 optional int32 frequency2_khz = 8;
5628 optional int32 time2_millis = 9;
5629 optional int32 frequency3_khz = 10;
5630 optional int32 time3_millis = 11;
5631 optional int32 frequency4_khz = 12;
5632 optional int32 time4_millis = 13;
5633 optional int32 frequency5_khz = 14;
5634 optional int32 time5_millis = 15;
5635 optional int32 frequency6_khz = 16;
5636 optional int32 time6_millis = 17;
5637 optional int32 frequency7_khz = 18;
5638 optional int32 time7_millis = 19;
5639 optional int32 frequency8_khz = 20;
5640 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005641}
Bookatz75ee60422018-11-09 12:27:37 -08005642
5643/**
Bookatz366a4432018-11-20 09:42:33 -08005644 * Pulls information about the device's build.
5645 */
5646message BuildInformation {
5647 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5648 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5649 optional string fingerprint = 1;
5650
5651 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5652 optional string brand = 2;
5653
5654 // Build.PRODUCT. The name of the overall product.
5655 optional string product = 3;
5656
5657 // Build.DEVICE. The name of the industrial design.
5658 optional string device = 4;
5659
5660 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5661 optional string version_release = 5;
5662
5663 // Build.ID. E.g. a label like "M4-rc20".
5664 optional string id = 6;
5665
5666 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5667 // represent this build.
5668 optional string version_incremental = 7;
5669
5670 // Build.TYPE. The type of build, like "user" or "eng".
5671 optional string type = 8;
5672
5673 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5674 optional string tags = 9;
5675}
5676
5677/**
Adam He420947c2019-01-23 15:59:09 -08005678 * Logs information about mismatched caller for content capture.
5679 *
5680 * Logged from:
5681 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5682 */
5683message ContentCaptureCallerMismatchReported {
5684 optional string intended_package = 1;
5685 optional string calling_package = 2;
5686}
5687
5688/**
5689 * Logs information about content capture service events.
5690 *
5691 * Logged from:
5692 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5693 */
5694message ContentCaptureServiceEvents {
5695 // The type of event.
5696 enum Event {
5697 UNKNOWN = 0;
5698 ON_CONNECTED = 1;
5699 ON_DISCONNECTED = 2;
5700 SET_WHITELIST = 3;
5701 SET_DISABLED = 4;
5702 ON_USER_DATA_REMOVED = 5;
5703 }
5704 optional Event event = 1;
5705 // component/package of content capture service.
5706 optional string service_info = 2;
5707 // component/package of target.
5708 // it's a concatenated list of component/package for SET_WHITELIST event
5709 // separated by " ".
5710 optional string target_info = 3;
5711}
5712
5713/**
5714 * Logs information about content capture session events.
5715 *
5716 * Logged from:
5717 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5718 */
5719message ContentCaptureSessionEvents {
5720 // The type of event.
5721 enum Event {
5722 UNKNOWN = 0;
5723 ON_SESSION_STARTED = 1;
5724 ON_SESSION_FINISHED = 2;
5725 SESSION_NOT_CREATED = 3;
5726 }
5727 optional int32 session_id = 1;
5728 optional Event event = 2;
5729 // (n/a on session finished)
5730 optional int32 state_flags = 3;
5731 // component/package of content capture service.
5732 optional string service_info = 4;
5733 // component/package of app.
5734 // (n/a on session finished)
5735 optional string app_info = 5;
5736 optional bool is_child_session = 6;
5737}
5738
5739/**
5740 * Logs information about session being flushed.
5741 *
5742 * Logged from:
5743 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5744 */
5745message ContentCaptureFlushed {
5746 optional int32 session_id = 1;
5747 // component/package of content capture service.
5748 optional string service_info = 2;
5749 // component/package of app.
5750 optional string app_info = 3;
5751 // session start/finish events
5752 optional int32 child_session_started = 4;
5753 optional int32 child_session_finished = 5;
5754 // count of view events.
5755 optional int32 view_appeared_count = 6;
5756 optional int32 view_disappeared_count = 7;
5757 optional int32 view_text_changed_count = 8;
5758
5759 // Flush stats.
5760 optional int32 max_events = 9;
5761 optional int32 idle_flush_freq = 10;
5762 optional int32 text_flush_freq = 11;
5763 optional int32 flush_reason = 12;
5764}
5765
5766/**
Bookatz75ee60422018-11-09 12:27:37 -08005767 * Pulls on-device BatteryStats power use calculations for the overall device.
5768 */
5769message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005770 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5771 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5772 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5773 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005774}
5775
5776/**
5777 * Pulls on-device BatteryStats power use calculations broken down by uid.
5778 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5779 * that is attributed to non-uid items. They must all be included to get the total power use.
5780 */
5781message DeviceCalculatedPowerBlameUid {
5782 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5783 optional int32 uid = 1 [(is_uid) = true];
5784
Bookatz3dbc13a2018-12-21 12:16:51 -08005785 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5786 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5787 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005788}
5789
5790/**
5791 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5792 * drain type.
5793 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5794 * is attributed uids. They must all be included to get the total power use.
5795 */
5796message DeviceCalculatedPowerBlameOther {
5797 // The type of item whose power use is being reported.
5798 enum DrainType {
5799 AMBIENT_DISPLAY = 0;
5800 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5801 BLUETOOTH = 2;
5802 CAMERA = 3;
5803 // Cell-standby
5804 CELL = 4;
5805 FLASHLIGHT = 5;
5806 IDLE = 6;
5807 MEMORY = 7;
5808 // Amount that total computed drain exceeded the drain estimated using the
5809 // battery level changes and capacity.
5810 OVERCOUNTED = 8;
5811 PHONE = 9;
5812 SCREEN = 10;
5813 // Amount that total computed drain was below the drain estimated using the
5814 // battery level changes and capacity.
5815 UNACCOUNTED = 11;
5816 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5817 WIFI = 13;
5818 }
5819 optional DrainType drain_type = 1;
5820
Bookatz3dbc13a2018-12-21 12:16:51 -08005821 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5822 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5823 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005824}
arangelov4e994062018-11-13 16:12:38 +00005825
5826/**
5827 * Logs device policy features.
5828 *
5829 * Logged from:
5830 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5831 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5832 */
5833message DevicePolicyEvent {
5834 // The event id - unique for each event.
5835 optional android.stats.devicepolicy.EventId event_id = 1;
5836 // The admin package name.
5837 optional string admin_package_name = 2;
5838 // A generic integer parameter.
5839 optional int32 integer_value = 3;
5840 // A generic boolean parameter.
5841 optional bool boolean_value = 4;
5842 // A parameter specifying a time period in milliseconds.
5843 optional uint64 time_period_millis = 5;
5844 // A parameter specifying a list of package names, bundle extras or string parameters.
5845 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5846}
shawnlinea5b66b2018-11-13 15:05:29 +08005847
5848/**
5849 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5850 *
5851 * Logged from:
5852 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5853 */
5854message DocsUILaunchReported {
5855 optional android.stats.docsui.LaunchAction launch_action = 1;
5856 optional bool has_initial_uri = 2;
5857 optional android.stats.docsui.MimeType mime_type = 3;
5858 optional android.stats.docsui.Root initial_root = 4;
5859}
5860
5861/**
5862 * Logs root/app visited event in file managers/picker. Call this when the user
5863 * taps on root/app in hamburger menu.
5864 *
5865 * Logged from:
5866 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5867 */
5868message DocsUIRootVisitedReported {
5869 optional android.stats.docsui.ContextScope scope = 1;
5870 optional android.stats.docsui.Root root = 2;
5871}
5872
5873/**
5874 * Logs file operation stats. Call this when a file operation has completed.
5875 *
5876 * Logged from:
5877 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5878 */
5879message DocsUIFileOperationReported {
5880 optional android.stats.docsui.Provider provider = 1;
5881 optional android.stats.docsui.FileOperation file_op = 2;
5882}
5883
5884/**
5885 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5886 * mode.
5887 *
5888 * Logged from:
5889 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5890 */
5891message DocsUIFileOperationCopyMoveModeReported {
5892 optional android.stats.docsui.FileOperation file_op = 1;
5893 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5894}
5895
5896
5897/**
5898 * Logs file sub operation stats. Call this when a file operation has failed.
5899 *
5900 * Logged from:
5901 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5902 */
5903message DocsUIFileOperationFailureReported {
5904 optional android.stats.docsui.Authority authority = 1;
5905 optional android.stats.docsui.SubFileOperation sub_op = 2;
5906}
5907
5908/**
5909* Logs the cancellation of a file operation. Call this when a job is canceled
5910*
5911* Logged from:
5912* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5913*/
5914message DocsUIFileOperationCanceledReported {
5915 optional android.stats.docsui.FileOperation file_op = 1;
5916}
5917
5918/**
5919 * Logs startup time in milliseconds.
5920 *
5921 * Logged from:
5922 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5923 */
5924message DocsUIStartupMsReported {
5925 optional int32 startup_millis = 1;
5926}
5927
5928/**
5929 * Logs the action that was started by user.
5930 *
5931 * Logged from:
5932 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5933 */
5934message DocsUIUserActionReported {
5935 optional android.stats.docsui.UserAction action = 1;
5936}
5937
5938/**
5939 * Logs the invalid type when invalid scoped access is requested.
5940 *
5941 * Logged from:
5942 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5943 */
5944message DocsUIInvalidScopedAccessRequestReported {
5945 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005946}
Ben Murdochbab399f62018-12-06 11:01:38 +00005947
5948/**
shawnlina75e82d2019-01-07 10:31:12 +08005949 * Logs the package name that launches docsui picker mode.
5950 *
5951 * Logged from:
5952 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5953 */
5954message DocsUIPickerLaunchedFromReported {
5955 optional string package_name = 1;
5956}
5957
5958/**
5959 * Logs the search type.
5960 *
5961 * Logged from:
5962 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5963 */
5964message DocsUISearchTypeReported {
5965 optional android.stats.docsui.SearchType search_type = 1;
5966}
5967
5968/**
5969 * Logs the search mode.
5970 *
5971 * Logged from:
5972 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5973 */
5974message DocsUISearchModeReported {
5975 optional android.stats.docsui.SearchMode search_mode = 1;
5976}
5977
5978/**
5979 * Logs the pick result information.
5980 *
5981 * Logged from:
5982 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5983 */
5984message DocsUIPickResultReported {
5985 optional int32 total_action_count = 1;
5986 optional int64 duration_millis = 2;
5987 optional int32 file_count= 3;
5988 optional bool is_searching = 4;
5989 optional android.stats.docsui.Root picked_from = 5;
5990 optional android.stats.docsui.MimeType mime_type = 6;
5991 optional int32 repeatedly_pick_times = 7;
5992}
5993
5994/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005995 * Logs when an app's memory is compacted.
5996 *
5997 * Logged from:
5998 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5999 */
6000message AppCompacted {
6001 // The pid of the process being compacted.
6002 optional int32 pid = 1;
6003
6004 // The name of the process being compacted.
6005 optional string process_name = 2;
6006
6007 // The type of compaction.
6008 enum Action {
6009 UNKNOWN = 0;
6010 SOME = 1;
6011 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006012 PERSISTENT = 3;
6013 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006014 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006015 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006016
6017 // Total RSS in kilobytes consumed by the process prior to compaction.
6018 optional int64 before_rss_total_kilobytes = 4;
6019
6020 // File RSS in kilobytes consumed by the process prior to compaction.
6021 optional int64 before_rss_file_kilobytes = 5;
6022
6023 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6024 optional int64 before_rss_anon_kilobytes = 6;
6025
6026 // Swap in kilobytes consumed by the process prior to compaction.
6027 optional int64 before_swap_kilobytes = 7;
6028
6029 // Total RSS in kilobytes consumed by the process after compaction.
6030 optional int64 after_rss_total_kilobytes = 8;
6031
6032 // File RSS in kilobytes consumed by the process after compaction.
6033 optional int64 after_rss_file_kilobytes = 9;
6034
6035 // Anonymous RSS in kilobytes consumed by the process after compaction.
6036 optional int64 after_rss_anon_kilobytes = 10;
6037
6038 // Swap in kilobytes consumed by the process after compaction.
6039 optional int64 after_swap_kilobytes = 11;
6040
6041 // The time taken to perform compaction in milliseconds.
6042 optional int64 time_to_compact_millis = 12;
6043
6044 // The last compaction action performed for this app.
6045 optional Action last_action = 13;
6046
Ben Murdoch01720b82018-12-19 18:03:44 +00006047 // The last time that compaction was attempted on this process in milliseconds
6048 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6049 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006050
Ben Murdoch885c21b2019-03-15 18:02:04 +00006051 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006052 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006053
6054 // The process state at the time of compaction.
6055 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006056
6057 // Free ZRAM in kilobytes before compaction.
6058 optional int64 before_zram_free_kilobytes = 17;
6059
6060 // Free ZRAM in kilobytes after compaction.
6061 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006062}
lifr157fc552018-12-12 16:38:04 +08006063
6064/**
lifrb6b90b62019-03-29 00:40:17 +08006065 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6066 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6067 *
lifr1f74b052019-04-16 22:16:30 +08006068 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6069 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6070 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6071 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006072 */
6073message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006074 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006075
lifr1f74b052019-04-16 22:16:30 +08006076 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006077
6078 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006079 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006080
lifr1f74b052019-04-16 22:16:30 +08006081 // Only valid for event_type = EVENT_GETADDRINFO.
6082 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006083
lifr1f74b052019-04-16 22:16:30 +08006084 // Flags passed to android_res_nsend() defined in multinetwork.h
6085 // Only valid for event_type = EVENT_RESNSEND.
6086 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006087
lifrad9becc2019-05-20 11:04:41 +08006088 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006089
6090 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006091 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006092
6093 // Additional pass-through fields opaque to statsd.
6094 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006095 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006096
6097 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6098 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006099}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006100
6101/**
6102 * Logs when a data stall event occurs.
6103 *
6104 * Log from:
6105 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6106 */
6107message DataStallEvent {
6108 // Data stall evaluation type.
6109 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6110 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6111 optional int32 evaluation_type = 1;
6112 // See definition in data_stall_event.proto.
6113 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6114 // See definition in data_stall_event.proto.
6115 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6116 // See definition in data_stall_event.proto.
6117 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6118 // See definition in data_stall_event.proto.
6119 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6120 // See definition in data_stall_event.proto.
6121 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6122}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006123
6124/*
6125 * Logs when RescueParty resets some set of experiment flags.
6126 *
6127 * Logged from:
6128 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6129 */
6130message RescuePartyResetReported {
6131 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6132 optional int32 rescue_level = 1;
6133}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006134
6135/**
6136 * Logs when signed config is received from an APK, and if that config was applied successfully.
6137 * Logged from:
6138 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6139 */
6140message SignedConfigReported {
6141 enum Type {
6142 UNKNOWN_TYPE = 0;
6143 GLOBAL_SETTINGS = 1;
6144 }
6145 optional Type type = 1;
6146
6147 // The final status of the signed config received.
6148 enum Status {
6149 UNKNOWN_STATUS = 0;
6150 APPLIED = 1;
6151 BASE64_FAILURE_CONFIG = 2;
6152 BASE64_FAILURE_SIGNATURE = 3;
6153 SECURITY_EXCEPTION = 4;
6154 INVALID_CONFIG = 5;
6155 OLD_CONFIG = 6;
6156 SIGNATURE_CHECK_FAILED = 7;
6157 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006158 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006159 }
6160 optional Status status = 2;
6161
6162 // The version of the signed config processed.
6163 optional int32 version = 3;
6164
6165 // The package name that the config was extracted from.
6166 optional string from_package = 4;
6167
6168 enum Key {
6169 NO_KEY = 0;
6170 DEBUG = 1;
6171 PRODUCTION = 2;
6172 }
6173 // Which key was used to verify the config.
6174 optional Key verified_with = 5;
6175}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006176
6177/*
6178 * Logs GNSS Network-Initiated (NI) location events.
6179 *
6180 * Logged from:
6181 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6182 */
6183message GnssNiEventReported {
6184 // The type of GnssNiEvent.
6185 enum EventType {
6186 UNKNOWN = 0;
6187 NI_REQUEST = 1;
6188 NI_RESPONSE = 2;
6189 }
6190 optional EventType event_type = 1;
6191
6192 // An ID generated by HAL to associate NI notifications and UI responses.
6193 optional int32 notification_id = 2;
6194
6195 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006196 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006197
6198 // NI requires notification.
6199 optional bool need_notify = 4;
6200
6201 // NI requires verification.
6202 optional bool need_verify = 5;
6203
6204 // NI requires privacy override, no notification/minimal trace.
6205 optional bool privacy_override = 6;
6206
6207 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6208 // seconds.
6209 optional int32 timeout = 7;
6210
6211 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006212 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006213
6214 // String representing the requester of the network inititated location request.
6215 optional string requestor_id = 9;
6216
6217 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6218 // network initiated location request.
6219 optional string text = 10;
6220
6221 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006222 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006223
6224 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006225 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006226
6227 // True if SUPL ES is enabled.
6228 optional bool is_supl_es_enabled = 13;
6229
6230 // True if GNSS location is enabled.
6231 optional bool is_location_enabled = 14;
6232
6233 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006234 optional android.server.location.GnssUserResponseType user_response = 15;
6235}
6236
6237/**
6238 * Logs GNSS non-framework (NFW) location notification.
6239 *
6240 * Logged from:
6241 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6242 */
6243message GnssNfwNotificationReported {
6244 // Package name of the Android proxy application representing the non-framework entity that
6245 // requested location. Set to empty string if unknown.
6246 optional string proxy_app_package_name = 1;
6247
6248 // Protocol stack that initiated the non-framework location request.
6249 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6250
6251 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6252 // set to empty string. This field is opaque to the framework and used for logging purposes.
6253 optional string other_protocol_stack_name = 3;
6254
6255 // Source initiating/receiving the location information.
6256 optional android.server.location.NfwRequestor requestor = 4;
6257
6258 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6259 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6260 // and used for logging purposes.
6261 optional string requestor_id = 5;
6262
6263 // Indicates whether location information was provided for this request.
6264 optional android.server.location.NfwResponseType response_type = 6;
6265
6266 // True if the device is in user initiated emergency session.
6267 optional bool in_emergency_mode = 7;
6268
6269 // True if cached location is provided.
6270 optional bool is_cached_location = 8;
6271
6272 // True if proxy app permission mismatch between framework and GNSS HAL.
6273 optional bool is_permission_mismatched = 9;
6274}
6275
6276/**
6277 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6278 *
6279 * Logged from:
6280 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6281 */
6282message GnssConfigurationReported {
6283 // SUPL host name.
6284 optional string supl_host = 1;
6285
6286 // SUPL port number.
6287 optional int32 supl_port = 2;
6288
6289 // C2K host name.
6290 optional string c2k_host = 3;
6291
6292 // C2K port number.
6293 optional int32 c2k_port = 4;
6294
6295 // The SUPL version requested by Carrier.
6296 optional int32 supl_ver = 5;
6297
6298 // The SUPL mode.
6299 optional android.server.location.SuplMode supl_mode = 6;
6300
6301 // True if NI emergency SUPL restrictions is enabled.
6302 optional bool supl_es = 7;
6303
6304 // LTE Positioning Profile settings
6305 optional android.server.location.LppProfile lpp_profile = 8;
6306
6307 // Positioning protocol on A-Glonass system.
6308 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6309
6310 // True if emergency PDN is used. Otherwise, regular PDN is used.
6311 optional bool use_emergency_pdn_for_emergency_supl= 10;
6312
6313 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6314 optional android.server.location.GpsLock gps_lock = 11;
6315
6316 // Number of seconds to extend the emergency session duration post emergency call.
6317 optional int32 es_extension_sec = 12;
6318
6319 // The full list of package names of proxy Android applications representing the non-framework
6320 // location access entities (on/off the device) for which the framework user has granted
6321 // non-framework location access permission. The package names are concatenated in one string
6322 // with spaces as separators.
6323 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006324}
Jack Yu95b64f32018-12-13 18:26:11 +08006325
6326/**
6327 * Logs when a NFC device's error occurred.
6328 * Logged from:
6329 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6330 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6331 */
6332message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006333 enum Type {
6334 UNKNOWN = 0;
6335 CMD_TIMEOUT = 1;
6336 ERROR_NOTIFICATION = 2;
6337 AID_OVERFLOW = 3;
6338 }
6339 optional Type type = 1;
6340 // If it's nci cmd timeout, log the timeout command.
6341 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006342
Alex Salod7c3eef2019-01-25 14:43:27 -08006343 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006344}
6345
6346/**
6347 * Logs when a NFC device's state changed event
6348 * Logged from:
6349 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6350 */
6351message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006352 enum State {
6353 UNKNOWN = 0;
6354 OFF = 1;
6355 ON = 2;
6356 ON_LOCKED = 3; // Secure Nfc enabled.
6357 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6358 }
6359 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006360}
6361
6362/**
6363 * Logs when a NFC Beam Transaction occurred.
6364 * Logged from:
6365 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6366 */
6367message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006368 enum Operation {
6369 UNKNOWN = 0;
6370 SEND = 1;
6371 RECEIVE = 2;
6372 }
6373 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006374}
6375
6376/**
6377 * Logs when a NFC Card Emulation Transaction occurred.
6378 * Logged from:
6379 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6380 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6381 */
6382message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006383 enum Category {
6384 UNKNOWN = 0;
6385 HCE_PAYMENT = 1;
6386 HCE_OTHER = 2;
6387 OFFHOST = 3;
6388 }
6389 // Transaction belongs to HCE payment or HCE other category, or offhost.
6390 optional Category category = 1;
6391 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6392 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006393}
6394
6395/**
6396 * Logs when a NFC Tag event occurred.
6397 * Logged from:
6398 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6399 */
6400message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006401 enum Type {
6402 UNKNOWN = 0;
6403 URL = 1;
6404 BT_PAIRING = 2;
6405 PROVISION = 3;
6406 WIFI_CONNECT = 4;
6407 APP_LAUNCH = 5;
6408 OTHERS = 6;
6409 }
6410 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006411}
6412
6413/**
6414 * Logs when Hce transaction triggered
6415 * Logged from:
6416 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6417 */
6418message NfcHceTransactionOccurred {
6419 // The latency period(in microseconds) it took for the first HCE data
6420 // exchange.
6421 optional uint32 latency_micros = 1;
6422}
6423
6424/**
6425 * Logs when SecureElement state event changed
6426 * Logged from:
6427 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6428 */
6429message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006430 enum State {
6431 UNKNOWN = 0;
6432 INITIALIZED = 1;
6433 DISCONNECTED = 2;
6434 CONNECTED = 3;
6435 HALCRASH = 4;
6436 }
6437 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006438
Alex Salod7c3eef2019-01-25 14:43:27 -08006439 optional string state_change_reason = 2;
6440 // SIMx or eSEx.
6441 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006442}
6443
6444/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006445 * Information about a permission grant request
6446 */
6447message PermissionGrantRequestResultReported {
6448 // unique value identifying an API call. A API call might result in multiple of these atoms
6449 optional int64 request_id = 1;
6450
6451 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006452 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006453
6454 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006455 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006456
6457 // The permission to be granted
6458 optional string permission_name = 4;
6459
6460 // If the permission was explicitly requested via the API or added by the system
6461 optional bool is_implicit = 5;
6462
6463 enum Result {
6464 UNDEFINED = 0;
6465 // permission request was ignored
6466 IGNORED = 1;
6467 // permission request was ignored because it was user fixed
6468 IGNORED_USER_FIXED = 2;
6469 // permission request was ignored because it was policy fixed
6470 IGNORED_POLICY_FIXED = 3;
6471 // permission was granted by user action
6472 USER_GRANTED = 4;
6473 // permission was automatically granted
6474 AUTO_GRANTED = 5;
6475 // permission was denied by user action
6476 USER_DENIED = 6;
6477 // permission was denied with prejudice by the user
6478 USER_DENIED_WITH_PREJUDICE = 7;
6479 // permission was automatically denied
6480 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006481 // permission request was ignored because permission is restricted
6482 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006483 // one time permission was granted by user action
6484 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006485 // user ignored request by leaving the request screen without choosing any option
6486 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006487 // user granted the permission after being linked to settings
6488 USER_GRANTED_IN_SETTINGS = 12;
6489 // user denied the permission after being linked to settings
6490 USER_DENIED_IN_SETTINGS = 13;
6491 // user denied the permission with prejudice after being linked to settings
6492 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6493 // permission was automatically revoked after one-time permission expired
6494 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006495 // permission was automatically revoked for unused app
6496 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006497 }
6498 // The result of the permission grant
6499 optional Result result = 6;
6500}
6501
6502/**
Jack Yu95b64f32018-12-13 18:26:11 +08006503 * Logs when Omapi API used
6504 * Logged from:
6505 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6506 */
6507message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006508 enum Operation {
6509 UNKNOWN = 0;
6510 OPEN_CHANNEL = 1;
6511 }
6512 optional Operation operation = 1;
6513 // SIMx or eSEx.
6514 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006515
Alex Salod7c3eef2019-01-25 14:43:27 -08006516 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006517}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006518
6519/**
Alex Saloa060aee2019-01-21 14:36:41 -08006520 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6521 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006522 * Logged from:
6523 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6524 */
6525message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006526 optional int64 dispatch_latency_millis = 1;
6527}
6528
6529/**
6530 * Logs AttentionManagerService attention check result.
6531 *
6532 * Logged from:
6533 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6534 */
6535message AttentionManagerServiceResultReported {
6536 // See core/java/android/service/attention/AttentionService.java
6537 enum AttentionCheckResult {
6538 UNKNOWN = 20;
6539 ATTENTION_SUCCESS_ABSENT = 0;
6540 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006541 ATTENTION_FAILURE_UNKNOWN = 2;
6542 ATTENTION_FAILURE_CANCELLED = 3;
6543 ATTENTION_FAILURE_PREEMPTED = 4;
6544 ATTENTION_FAILURE_TIMED_OUT = 5;
6545 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006546 }
6547 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006548}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006549
6550/**
6551 * Logs when an adb connection changes state.
6552 *
6553 * Logged from:
6554 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6555 */
6556message AdbConnectionChanged {
6557 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6558 // previously selected for this system.
6559 optional int64 last_connection_time_millis = 1;
6560
6561 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6562 // to reconnect via adb without user interaction.
6563 optional int64 auth_window_millis = 2;
6564
6565 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6566 optional android.debug.AdbConnectionStateEnum state = 3;
6567
6568 // True if the 'always allow' option was selected for this system.
6569 optional bool always_allow = 4;
6570}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006571
6572/*
6573 * Logs the reported speech DSP status.
6574 *
6575 * Logged from:
6576 * Vendor audio implementation.
6577 */
6578message SpeechDspStatReported {
6579 // The total Speech DSP uptime in milliseconds.
6580 optional int32 total_uptime_millis = 1;
6581 // The total Speech DSP downtime in milliseconds.
6582 optional int32 total_downtime_millis = 2;
6583 optional int32 total_crash_count = 3;
6584 optional int32 total_recover_count = 4;
6585}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006586
6587/**
6588 * Logs USB connector contaminant status.
6589 *
6590 * Logged from: USB Service.
6591 */
6592message UsbContaminantReported {
6593 optional string id = 1;
6594 optional android.service.usb.ContaminantPresenceStatus status = 2;
6595}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006596
6597/**
6598 * This atom is for debugging purpose.
6599 */
6600message DebugElapsedClock {
6601 // Monotically increasing value for each pull.
6602 optional int64 pull_count = 1;
6603 // Time from System.elapsedRealtime.
6604 optional int64 elapsed_clock_millis = 2;
6605 // Time from System.elapsedRealtime.
6606 optional int64 same_elapsed_clock_millis = 3;
6607 // Diff between current elapsed time and elapsed time from previous pull.
6608 optional int64 elapsed_clock_diff_millis = 4;
6609
6610 enum Type {
6611 TYPE_UNKNOWN = 0;
6612 ALWAYS_PRESENT = 1;
6613 PRESENT_ON_ODD_PULLS = 2;
6614 }
6615 // Type of behavior for the pulled data.
6616 optional Type type = 5;
6617}
6618
6619/**
6620 * This atom is for debugging purpose.
6621 */
6622message DebugFailingElapsedClock {
6623 // Monotically increasing value for each pull.
6624 optional int64 pull_count = 1;
6625 // Time from System.elapsedRealtime.
6626 optional int64 elapsed_clock_millis = 2;
6627 // Time from System.elapsedRealtime.
6628 optional int64 same_elapsed_clock_millis = 3;
6629 // Diff between current elapsed time and elapsed time from previous pull.
6630 optional int64 elapsed_clock_diff_millis = 4;
6631}
Steven Wuacef6bb2019-01-23 14:21:17 -05006632
6633/** Logs System UI bubbles event changed.
6634 *
6635 * Logged from:
6636 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6637 */
6638message BubbleUIChanged {
6639
6640 // The app package that is posting the bubble.
6641 optional string package_name = 1;
6642
6643 // The notification channel that is posting the bubble.
6644 optional string notification_channel = 2;
6645
6646 // The notification id associated with the posted bubble.
6647 optional int32 notification_id = 3;
6648
6649 // The position of the bubble within the bubble stack.
6650 optional int32 position = 4;
6651
6652 // The total number of bubbles within the bubble stack.
6653 optional int32 total_number = 5;
6654
6655 // User interactions with the bubble.
6656 enum Action {
6657 UNKNOWN = 0;
6658 POSTED = 1;
6659 UPDATED = 2;
6660 EXPANDED = 3;
6661 COLLAPSED = 4;
6662 DISMISSED = 5;
6663 STACK_DISMISSED = 6;
6664 STACK_MOVED = 7;
6665 HEADER_GO_TO_APP = 8;
6666 HEADER_GO_TO_SETTINGS = 9;
6667 PERMISSION_OPT_IN = 10;
6668 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006669 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006670 SWIPE_LEFT = 13;
6671 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006672 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006673 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006674 }
6675 optional Action action = 6;
6676
6677 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6678 optional float normalized_x_position = 7;
6679 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006680
6681 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6682 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006683
6684 // Whether the bubble is an on-going one.
6685 optional bool is_ongoing = 10;
6686
6687 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006688 // This is deprecated and the value should be ignored.
6689 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006690}
Kweku Adams8845d012018-12-11 20:06:45 -08006691
6692/**
Steven Wu552f63f2019-02-05 13:41:36 -05006693 * Logs System UI bubbles developer errors.
6694 *
6695 * Logged from:
6696 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6697 */
6698message BubbleDeveloperErrorReported {
6699
6700 // The app package that is posting the bubble.
6701 optional string package_name = 1;
6702
6703 // Bubble developer error type enums.
6704 enum Error {
6705 UNKNOWN = 0;
6706 ACTIVITY_INFO_MISSING = 1;
6707 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6708 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6709 }
6710 optional Error error = 2 [default = UNKNOWN];
6711}
6712
6713/**
Kweku Adams8845d012018-12-11 20:06:45 -08006714 * Logs that a constraint for a scheduled job has changed.
6715 *
6716 * Logged from:
6717 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6718 */
6719message ScheduledJobConstraintChanged {
6720 repeated AttributionNode attribution_node = 1;
6721
6722 // Name of the job.
6723 optional string job_name = 2;
6724
6725 optional com.android.server.job.ConstraintEnum constraint = 3;
6726
6727 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006728 UNKNOWN = 0;
6729 UNSATISFIED = 1;
6730 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006731 }
6732 optional State state = 4;
6733}
Alex Salod7c3eef2019-01-25 14:43:27 -08006734
6735/**
6736 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6737 * returns true.
6738 *
6739 * Logged from:
6740 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6741 */
6742message ScreenTimeoutExtensionReported {
6743 // Describes how many times in a row did the power manager reset the screen off timeout.
6744 optional uint32 consecutive_timeout_extended_count = 1;
6745}
Hui Yu885aca12019-01-10 17:11:34 -08006746
6747/*
6748* Logs number of milliseconds it takes to start a process.
6749* The definition of app process start time is from the app launch time to
6750* the time that Zygote finished forking the app process and loaded the
6751* application package's java classes.
6752
6753* This metric is different from AppStartOccurred which is for foreground
6754* activity only.
6755
6756* ProcessStartTime can report all processes (both foreground and background)
6757* start time.
6758*
6759* Logged from:
6760* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6761*/
6762message ProcessStartTime {
6763 // The uid of the ProcessRecord.
6764 optional int32 uid = 1 [(is_uid) = true];
6765
6766 // The process pid.
6767 optional int32 pid = 2;
6768
6769 // The process name.
6770 // Usually package name, "system" for system server.
6771 // Provided by ActivityManagerService.
6772 optional string process_name = 3;
6773
6774 enum StartType {
6775 UNKNOWN = 0;
6776 WARM = 1;
6777 HOT = 2;
6778 COLD = 3;
6779 }
6780
6781 // The start type.
6782 optional StartType type = 4;
6783
6784 // The elapsed realtime at the start of the process.
6785 optional int64 process_start_time_millis = 5;
6786
6787 // Number of milliseconds it takes to reach bind application.
6788 optional int32 bind_application_delay_millis = 6;
6789
6790 // Number of milliseconds it takes to finish start of the process.
6791 optional int32 process_start_delay_millis = 7;
6792
6793 // hostingType field in ProcessRecord, the component type such as "activity",
6794 // "service", "content provider", "broadcast" or other strings.
6795 optional string hosting_type = 8;
6796
6797 // hostingNameStr field in ProcessRecord. The component class name that runs
6798 // in this process.
6799 optional string hosting_name = 9;
6800}
6801
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006802/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006803 * Track Media Codec usage
6804 * Logged from:
6805 * frameworks/av/media/libstagefright/MediaCodec.cpp
6806 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6807 */
6808message MediametricsCodecReported {
6809 optional int64 timestamp_nanos = 1;
6810 optional string package_name = 2;
6811 optional int64 package_version_code = 3;
6812 optional int64 media_apex_version = 4;
6813
6814 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6815}
6816
6817/**
6818 * Track Media Extractor (pulling video/audio streams out of containers) usage
6819 * Logged from:
6820 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6821 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6822 */
6823message MediametricsExtractorReported {
6824 optional int64 timestamp_nanos = 1;
6825 optional string package_name = 2;
6826 optional int64 package_version_code = 3;
6827 optional int64 media_apex_version = 4;
6828
6829 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6830}
6831
6832/**
6833 * Track how we arbitrate between microphone/input requests.
6834 * Logged from
6835 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6836 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6837 */
6838message MediametricsAudiopolicyReported {
6839 optional int64 timestamp_nanos = 1;
6840 optional string package_name = 2;
6841 optional int64 package_version_code = 3;
6842 optional int64 media_apex_version = 4;
6843
6844 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6845}
6846
6847/**
6848 * Track how we arbitrate between microphone requests.
6849 * Logged from
6850 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6851 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6852 */
6853message MediametricsAudiorecordReported {
6854 optional int64 timestamp_nanos = 1;
6855 optional string package_name = 2;
6856 optional int64 package_version_code = 3;
6857 optional int64 media_apex_version = 4;
6858
6859 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6860}
6861
6862/**
6863 * Track how we arbitrate between microphone/input requests.
6864 * Logged from
6865 * frameworks/av/media/libnblog/ReportPerformance.cpp
6866 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6867 */
6868message MediametricsAudiothreadReported {
6869 optional int64 timestamp_nanos = 1;
6870 optional string package_name = 2;
6871 optional int64 package_version_code = 3;
6872 optional int64 media_apex_version = 4;
6873
6874 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6875}
6876
6877/**
6878 * Track how we arbitrate between microphone/input requests.
6879 * Logged from
6880 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6881 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6882 */
6883message MediametricsAudiotrackReported {
6884 optional int64 timestamp_nanos = 1;
6885 optional string package_name = 2;
6886 optional int64 package_version_code = 3;
6887 optional int64 media_apex_version = 4;
6888
6889 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6890}
6891
6892/**
6893 * Track information about DRM framework performance
6894 * Logged from
6895 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6896 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6897 */
6898message MediametricsMediadrmReported {
6899 optional int64 timestamp_nanos = 1;
6900 optional string package_name = 2;
6901 optional int64 package_version_code = 3;
6902 optional int64 media_apex_version = 4;
6903
6904 // vendor+description tell about which DRM plugin is in use on this device
6905 optional string vendor = 5;
6906 optional string description = 6;
6907 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6908 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6909}
6910
6911/**
6912 * Track information about the widevine DRM plugin performance
6913 * Logged from
6914 * vendor/widevine/libwvdrmengine/cdm/metrics
6915 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6916 */
6917message MediametricsDrmWidevineReported {
6918 optional int64 timestamp_nanos = 1;
6919 optional string package_name = 2;
6920 optional int64 package_version_code = 3;
6921 optional int64 media_apex_version = 4;
6922
6923 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6924}
6925
6926/**
6927 * Track information about recordings (e.g. camcorder)
6928 * Logged from
6929 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6930 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6931 */
6932message MediametricsRecorderReported {
6933 optional int64 timestamp_nanos = 1;
6934 optional string package_name = 2;
6935 optional int64 package_version_code = 3;
6936 optional int64 media_apex_version = 4;
6937
6938 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6939}
6940
6941/**
6942 * Track Media Player usage
6943 * Logged from:
6944 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6945 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6946 */
6947message MediametricsNuPlayerReported {
6948 optional int64 timestamp_nanos = 1;
6949 optional string package_name = 2;
6950 optional int64 package_version_code = 3;
6951 optional int64 media_apex_version = 4;
6952
6953 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6954}
6955
6956/**
Robert Shiha4beed32019-08-19 14:15:23 -07006957 * Track Legacy DRM usage
6958 * Logged from
6959 * frameworks/av/drm/drmserver/DrmManager.cpp
6960 */
6961message MediametricsDrmManagerReported {
6962 optional int64 timestamp_nanos = 1;
6963 optional string package_name = 2;
6964 optional int64 package_version_code = 3;
6965 optional int64 media_apex_version = 4;
6966
6967 enum Method {
6968 METHOD_NOT_FOUND = -1;
6969 GET_CONSTRAINTS = 0;
6970 GET_METADATA = 1;
6971 CAN_HANDLE = 2;
6972 PROCESS_DRM_INFO = 3;
6973 ACQUIRE_DRM_INFO = 4;
6974 SAVE_RIGHTS = 5;
6975 GET_ORIGINAL_MIME_TYPE = 6;
6976 GET_DRM_OBJECT_TYPE = 7;
6977 CHECK_RIGHTS_STATUS = 8;
6978 REMOVE_RIGHTS = 9;
6979 REMOVE_ALL_RIGHTS = 10;
6980 OPEN_CONVERT_SESSION = 11;
6981 OPEN_DECRYPT_SESSION = 12;
6982 }
6983
6984 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6985 optional string plugin_id = 5;
6986 optional string description = 6;
6987 optional Method method = 7;
6988 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08006989
6990 optional int64 get_constraints_count = 9;
6991 optional int64 get_metadata_count = 10;
6992 optional int64 can_handle_count = 11;
6993 optional int64 process_drm_info_count = 12;
6994 optional int64 acquire_drm_info_count = 13;
6995 optional int64 save_rights_count = 14;
6996 optional int64 get_original_mime_type_count = 15;
6997 optional int64 get_drm_object_type_count = 16;
6998 optional int64 check_rights_status_count = 17;
6999 optional int64 remove_rights_count = 18;
7000 optional int64 remove_all_rights_count = 19;
7001 optional int64 open_convert_session_count = 20;
7002 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007003}
7004
7005/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007006 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007007 * Pulled from: StatsCompanionService
7008*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007009message DangerousPermissionState {
7010 // Name of the permission
7011 optional string permission_name = 1;
7012
7013 // Uid of the package
7014 optional int32 uid = 2 [(is_uid) = true];
7015
7016 // Package requesting the permission
7017 optional string package_name = 3;
7018
7019 // If the permission is granted to the uid
7020 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007021
7022 // Permission flags as per android.content.pm.PermissionFlags
7023 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007024}
7025
Michael Groover4a0ca942019-01-24 17:41:25 -08007026/**
7027 * Logs when a package is denied access to a device identifier based on the new access requirements.
7028 *
7029 * Logged from:
7030 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7031 */
7032message DeviceIdentifierAccessDenied {
7033 // The name of the package denied access to the requested device identifier.
7034 optional string package_name = 1;
7035
7036 // The name of the device identifier method the package attempted to invoke.
7037 optional string method_name = 2;
7038
7039 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007040 // Starting from Android 11, this boolean is not set and will always be false.
7041 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007042
7043 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007044 // Starting from Android 11, this boolean is not set and will always be false.
7045 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007046}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007047
7048/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007049 * Pulls the ongoing mainline install train version code.
7050 * Pulled from StatsCompanionService
7051 */
7052message TrainInfo {
7053 optional int64 train_version_code = 1;
7054
7055 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007056
7057 optional string train_name = 3;
7058
7059 enum Status {
7060 UNKNOWN = 0;
7061 INSTALL_REQUESTED = 1;
7062 INSTALL_STARTED = 2;
7063 INSTALL_STAGED_NOT_READY = 3;
7064 INSTALL_STAGED_READY = 4;
7065 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007066 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7067 // and INSTALL_FAILURE_COMMIT.
7068 INSTALL_FAILURE = 6 [deprecated = true];
7069 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007070 INSTALL_CANCELLED = 7;
7071 INSTALLER_ROLLBACK_REQUESTED = 8;
7072 INSTALLER_ROLLBACK_INITIATED = 9;
7073 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7074 INSTALLER_ROLLBACK_STAGED = 11;
7075 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7076 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7077 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7078 INSTALLER_ROLLBACK_SUCCESS = 15;
7079 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007080 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7081 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7082 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7083 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7084 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7085 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007086 INSTALL_FAILURE_DOWNLOAD = 23;
7087 INSTALL_FAILURE_STATE_MISMATCH = 24;
7088 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007089 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007090 }
7091 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007092}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007093
7094/**
7095 * Logs the gesture stage changed event.
7096 *
7097 * Logged from:
7098 * frameworks/base/packages/SystemUI/
7099 */
7100message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007101 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007102}
7103
7104/**
7105 * Logs the feedback type.
7106 *
7107 * Logged from:
7108 * frameworks/base/packages/SystemUI/
7109 */
7110message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007111 // Whether or not the gesture was used.
7112 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007113}
7114
7115/**
7116 * Logs the progress.
7117 *
7118 * Logged from:
7119 * frameworks/base/packages/SystemUI/
7120 */
7121message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007122 // [0,100] progress for the assist gesture.
7123 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007124}
Neil Fullerdb14b482019-02-05 19:44:44 +00007125
7126/*
7127 * Information about the time zone data on a device.
7128 */
7129message TimeZoneDataInfo {
7130 // A version identifier for the data set on device. e.g. "2018i"
7131 optional string tzdb_version = 1;
7132}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007133
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007134/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007135 * Logs the GPU stats global health information.
7136 *
7137 * Logged from:
7138 * frameworks/native/services/gpuservice/gpustats/
7139 */
7140message GpuStatsGlobalInfo {
7141 // Package name of the gpu driver.
7142 optional string driver_package_name = 1;
7143
7144 // Version name of the gpu driver.
7145 optional string driver_version_name = 2;
7146
7147 // Version code of the gpu driver.
7148 optional int64 driver_version_code = 3;
7149
7150 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7151 optional int64 driver_build_time = 4;
7152
7153 // Total count of the gl driver gets loaded.
7154 optional int64 gl_loading_count = 5;
7155
7156 // Total count of the gl driver fails to be loaded.
7157 optional int64 gl_loading_failure_count = 6;
7158
7159 // Total count of the Vulkan driver gets loaded.
7160 optional int64 vk_loading_count = 7;
7161
7162 // Total count of the Vulkan driver fails to be loaded.
7163 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007164
7165 // Api version of the system Vulkan driver.
7166 optional int32 vulkan_version = 9;
7167
7168 // Api version of the system CPU Vulkan driver.
7169 optional int32 cpu_vulkan_version = 10;
7170
7171 // Api version of the system GLES driver.
7172 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007173
7174 // Total count of the angle driver gets loaded.
7175 optional int64 angle_loading_count = 12;
7176
7177 // Total count of the angle driver fails to be loaded.
7178 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007179}
7180
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007181/**
7182 * GPU driver loading time info.
7183 */
7184message GpuDriverLoadingTime {
7185 // List of all the driver loading times for this app. The list size is
7186 // capped at 50.
7187 repeated int64 driver_loading_time = 1;
7188}
7189
7190/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007191 * Logs the GPU stats per app health information.
7192 *
7193 * Logged from:
7194 * frameworks/native/services/gpuservice/gpustats/
7195 */
7196message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007197 // Package name of the application that loads the gpu driver. Total number
7198 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007199 optional string app_package_name = 1;
7200
7201 // Version code of the gpu driver this app loads.
7202 optional int64 driver_version_code = 2;
7203
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007204 // gl driver loading time info.
7205 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7206 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007207
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007208 // Vulkan driver loading time info.
7209 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7210 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007211
7212 // Angle driver loading time info.
7213 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7214 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007215
7216 // CPU Vulkan implementation is in use.
7217 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007218
7219 // App is not doing pre-rotation correctly.
7220 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007221
7222 // App creates GLESv1 context.
7223 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007224}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007225
7226/*
7227 * Logs the size of the system ion heap.
7228 *
7229 * Pulled from StatsCompanionService.
7230 */
7231message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007232 // Deprecated due to limited support of ion stats in debugfs.
7233 // Use `IonHeapSize` instead.
7234 option deprecated = true;
7235
Rafal Slawikd4e87572019-03-12 13:08:38 +00007236 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007237 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007238 optional int64 size_in_bytes = 1;
7239}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007240
Rafal Slawik77987ed2019-06-17 12:28:23 +01007241/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007242 * Logs the total size of the ion heap.
7243 *
7244 * Pulled from StatsCompanionService.
7245 */
7246message IonHeapSize {
7247 // Total size of all ion heaps in kilobytes.
7248 // Read from: /sys/kernel/ion/total_heaps_kb.
7249 optional int32 total_size_kb = 1;
7250}
7251
7252/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007253 * Logs the per-process size of the system ion heap.
7254 *
7255 * Pulled from StatsCompanionService.
7256 */
7257message ProcessSystemIonHeapSize {
7258 // The uid if available. -1 means not available.
7259 optional int32 uid = 1 [(is_uid) = true];
7260
7261 // The process name (from /proc/PID/cmdline).
7262 optional string process_name = 2;
7263
7264 // Sum of sizes of all allocations.
7265 optional int32 total_size_in_kilobytes = 3;
7266
7267 // Number of allocations.
7268 optional int32 allocation_count = 4;
7269
7270 // Size of the largest allocation.
7271 optional int32 max_size_in_kilobytes = 5;
7272}
7273
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007274/**
7275 * Push network stack events.
7276 *
7277 * Log from:
7278 * frameworks/base/packages/NetworkStack/
7279 */
7280message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007281 // The id that indicates the event reported from NetworkStack.
7282 optional int32 event_id = 1;
7283 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007284 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7285}
Carmen Agimofa769c152019-03-04 14:39:14 +00007286
7287/**
7288 * Logs the apps that are installed on the external storage.
7289 * Pulled from:
7290 * StatsCompanionService
7291 */
7292message AppsOnExternalStorageInfo {
7293 // The type of the external storage.
7294 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7295 // The name of the package that is installed on the external storage.
7296 optional string package_name = 2;
7297}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007298
7299/**
7300 * Logs the settings related to Face.
7301 * Logged from:
7302 * frameworks/base/services/core/java/com/android/server/stats
7303 */
7304message FaceSettings {
7305 // Whether or not face unlock is allowed on Keyguard.
7306 optional bool unlock_keyguard_enabled = 1;
7307 // Whether or not face unlock dismisses the Keyguard.
7308 optional bool unlock_dismisses_keyguard = 2;
7309 // Whether or not face unlock requires attention.
7310 optional bool unlock_attention_required = 3;
7311 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7312 optional bool unlock_app_enabled = 4;
7313 // Whether or not face unlock always requires user confirmation.
7314 optional bool unlock_always_require_confirmation = 5;
7315 // Whether or not a diverse set of poses are required during enrollment.
7316 optional bool unlock_diversity_required = 6;
7317}
Maggie White442b6312019-04-05 16:26:44 -07007318
7319/**
7320 * Logs cooling devices maintained by the kernel.
7321 *
7322 * Pulled from StatsCompanionService.java
7323 */
7324message CoolingDevice {
7325 // The type of cooling device being reported. Eg. CPU, GPU...
7326 optional android.os.CoolingTypeEnum device_location = 1;
7327 // The name of the cooling device source. Eg. CPU0
7328 optional string device_name = 2;
7329 // Current throttle state of the cooling device. The value can any unsigned
7330 // integer between 0 and max_state defined in its driver. 0 means device is
7331 // not in throttling, higher value means deeper throttling.
7332 optional int32 state = 3;
7333}
Ben Blount763a5d52019-04-10 11:48:58 -07007334
7335/**
7336 * Intelligence has several counter-type events that don't warrant a
7337 * full separate atom. These are primarily API call counters but also include
7338 * counters for feature usage and specific failure modes.
7339 *
7340 * Logged from the Intelligence mainline module.
7341 */
7342message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007343 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007344 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007345 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007346 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007347 // How many times the event occured (to report a batch of high frequency events).
7348 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007349 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007350 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007351}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007352
7353/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007354 * Logs when Car Power state changed.
7355 *
7356 * Logged from:
7357 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7358 */
7359message CarPowerStateChanged {
7360 // States come from CpmsState in CarPowerManagementService.java.
7361 enum State {
7362 WAIT_FOR_VHAL = 0;
7363 ON = 1;
7364 SHUTDOWN_PREPARE = 2;
7365 WAIT_FOR_FINISH = 3;
7366 SUSPEND = 4;
7367 SIMULATE_SLEEP = 5;
7368 }
7369 optional State state = 1;
7370}
7371
7372/**
7373 * Logs whether GarageMode is entered.
7374 *
7375 * Logged from:
7376 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7377 */
7378message GarageModeInfo {
7379 // Whether GarageMode is entered.
7380 optional bool is_garage_mode = 1;
7381}
Martijn Coenencd95d462019-04-25 17:09:45 +02007382
7383/**
7384 * Historical app ops data per package.
7385 */
7386message AppOps {
7387 // Uid of the package requesting the op
7388 optional int32 uid = 1 [(is_uid) = true];
7389
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007390 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007391 optional string package_name = 2;
7392
7393 // operation id; maps to the OP_* constants in AppOpsManager.java
7394 optional int32 op_id = 3;
7395
7396 // The number of times the op was granted while the app was in the
7397 // foreground (only for trusted requests)
7398 optional int64 trusted_foreground_granted_count = 4;
7399
7400 // The number of times the op was granted while the app was in the
7401 // background (only for trusted requests)
7402 optional int64 trusted_background_granted_count = 5;
7403
7404 // The number of times the op was rejected while the app was in the
7405 // foreground (only for trusted requests)
7406 optional int64 trusted_foreground_rejected_count = 6;
7407
7408 // The number of times the op was rejected while the app was in the
7409 // background (only for trusted requests)
7410 optional int64 trusted_background_rejected_count = 7;
7411
7412 // For long-running operations, total duration of the operation
7413 // while the app was in the foreground (only for trusted requests)
7414 optional int64 trusted_foreground_duration_millis = 8;
7415
7416 // For long-running operations, total duration of the operation
7417 // while the app was in the background (only for trusted requests)
7418 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007419
7420 // Whether AppOps is guarded by Runtime permission
7421 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007422}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007423
7424/**
7425 * Location Manager API Usage information(e.g. API under usage,
7426 * API call's parameters).
7427 * Logged from:
7428 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7429 */
7430message LocationManagerApiUsageReported {
7431
7432 // Indicating if usage starts or usage ends.
7433 optional android.stats.location.UsageState state = 1;
7434
7435 // LocationManagerService's API in use.
7436 // We can identify which API from LocationManager is
7437 // invoking current LMS API by the combination of
7438 // API parameter(e.g. is_listener_null, is_intent_null,
7439 // is_location_request_null)
7440 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7441
7442 // Name of the package calling the API.
7443 optional string calling_package_name = 3;
7444
7445 // Type of the location provider.
7446 optional android.stats.location.ProviderType provider = 4;
7447
7448 // Quality of the location request
7449 optional android.stats.location.LocationRequestQuality quality = 5;
7450
7451 // The desired interval for active location updates, in milliseconds.
7452 // Bucketized to reduce cardinality.
7453 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7454
7455 // Minimum distance between location updates, in meters.
7456 // Bucketized to reduce cardinality.
7457 optional android.stats.location.SmallestDisplacementBucket
7458 bucketized_smallest_displacement = 7;
7459
7460 // The number of location updates.
7461 optional int64 num_updates = 8;
7462
7463 // The request expiration time, in millisecond since boot.
7464 // Bucketized to reduce cardinality.
7465 optional android.stats.location.ExpirationBucket
7466 bucketized_expire_in = 9;
7467
7468 // Type of Callback passed in for this API.
7469 optional android.stats.location.CallbackType callback_type = 10;
7470
7471 // The radius of the central point of the alert
7472 // region, in meters. Only for API REQUEST_GEOFENCE.
7473 // Bucketized to reduce cardinality.
7474 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7475
7476 // Activity Importance of API caller.
7477 // Categorized to 3 types that are interesting from location's perspective.
7478 optional android.stats.location.ActivityImportance activiy_importance = 12;
7479}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007480
7481/**
7482 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7483 */
7484message ReviewPermissionsFragmentResultReported {
7485 // unique value identifying a permission group change. A permission group change might result
7486 // in multiple of these atoms
7487 optional int64 change_id = 1;
7488
7489 // UID of package the permission belongs to
7490 optional int32 uid = 2 [(is_uid) = true];
7491
7492 // Name of package the permission belongs to
7493 optional string package_name = 3;
7494
7495 // The permission to be granted
7496 optional string permission_name = 4;
7497
7498 // The result of the permission grant
7499 optional bool permission_granted = 5;
7500}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007501
7502/**
7503* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7504* Logged from: RuntimePermissionUpdgradeController
7505*/
7506message RuntimePermissionsUpgradeResult {
7507 // Permission granted as result of upgrade
7508 optional string permission_name = 1;
7509
7510 // UID of package granted permission
7511 optional int32 uid = 2 [(is_uid) = true];
7512
7513 // Name of package granted permission
7514 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007515}
7516
7517/**
7518* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7519*/
7520message GrantPermissionsActivityButtonActions {
7521 // Permission granted as result of upgrade
7522 optional string permission_group_name = 1;
7523
7524 // UID of package granted permission
7525 optional int32 uid = 2 [(is_uid) = true];
7526
7527 // Name of package requesting permission
7528 optional string package_name = 3;
7529
7530 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7531 // LABEL_ constants in GrantPermissionActivity.java
7532 optional int32 buttons_presented = 4;
7533
7534 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7535 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007536
7537 // id which identifies single session of user interacting with permission controller
7538 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007539}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007540
7541/**
7542 * Information about LocationAccessCheck notification presented to user
7543 */
7544message LocationAccessCheckNotificationAction {
7545
7546 // id which identifies single session of user interacting with permission controller
7547 optional int64 session_id = 1;
7548
7549 // Uid of package for which location access check is presented
7550 optional int32 package_uid = 2;
7551
7552 // Name of package for which location access check is presented
7553 optional string package_name = 3;
7554
7555 enum Result {
7556 UNDEFINED = 0;
7557 // notification was presented to the user
7558 NOTIFICATION_PRESENTED = 1;
7559 // notification was declined by the user
7560 NOTIFICATION_DECLINED = 2;
7561 // notification was clicked by the user
7562 NOTIFICATION_CLICKED = 3;
7563 }
7564
7565 // View / interaction recorded
7566 optional Result result = 4;
7567}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007568
7569/**
7570 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7571 */
7572message AppPermissionFragmentActionReported {
7573 // id which identifies single session of user interacting with permission controller
7574 optional int64 session_id = 1;
7575
7576 // unique value identifying a permission group change. A permission group change might result
7577 // in multiple of these atoms
7578 optional int64 change_id = 2;
7579
7580 // UID of package the permission belongs to
7581 optional int32 uid = 3 [(is_uid) = true];
7582
7583 // Name of package the permission belongs to
7584 optional string package_name = 4;
7585
7586 // The permission to be granted
7587 optional string permission_name = 5;
7588
7589 // The result of the permission grant
7590 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007591
7592 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7593 optional int32 permission_flags = 7;
7594
7595 enum Button {
7596 UNDEFINED = 0;
7597 // Allow button
7598 ALLOW = 1;
7599 // Deny button
7600 DENY = 2;
7601 // Ask every time button
7602 ASK_EVERY_TIME = 3;
7603 // Allow all the time button
7604 ALLOW_ALWAYS = 4;
7605 // Allow only while using the app button
7606 ALLOW_FOREGROUND = 5;
7607 // Same is Deny button but shown in while in use dialog
7608 DENY_FOREGROUND = 6;
7609 }
7610
7611 // Button pressed in the dialog
7612 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007613}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007614
7615/**
7616* Information about a AppPermissionFragment viewed by user
7617*/
7618message AppPermissionFragmentViewed {
7619 // id which identifies single session of user interacting with permission controller
7620 optional int64 session_id = 1;
7621
7622 // UID of package for which permissions are viewed
7623 optional int32 uid = 2 [(is_uid) = true];
7624
7625 // Name of package for which permissions are viewed
7626 optional string package_name = 3;
7627
7628 // Permission group viewed
7629 optional string permission_group_name = 4;
7630}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007631
7632/**
7633* Information about a AppPermissionsFragment viewed by user
7634*/
7635message AppPermissionsFragmentViewed {
7636 // id which identifies single session of user interacting with permission controller
7637 optional int64 session_id = 1;
7638
7639 // id which identifies single view as every view might have several logging records
7640 // with different package information attached
7641 optional int64 view_id = 2;
7642
7643 // Permission group viewed
7644 optional string permission_group_name = 3;
7645
7646 // UID of package for which permissions are viewed
7647 optional int32 uid = 4 [(is_uid) = true];
7648
7649 // Name of package for which permissions are viewed
7650 optional string package_name = 5;
7651
7652 // Category in which permission is included
7653 enum Category {
7654 UNDEFINED = 0;
7655 ALLOWED = 1;
7656 ALLOWED_FOREGROUND = 2;
7657 DENIED = 3;
7658 }
7659 optional Category category = 6;
7660}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007661
7662/**
7663* Information about a PermissionAppsFragment viewed by user.
7664* Logged from ui/handheld/PermissionAppsFragment.java
7665*/
7666message PermissionAppsFragmentViewed {
7667 // id which identifies single session of user interacting with permission controller
7668 optional int64 session_id = 1;
7669
7670 // id which identifies single view as every view might have several logging records
7671 // with different package information attached
7672 optional int64 view_id = 2;
7673
7674 // Permission group viewed
7675 optional string permission_group_name = 3;
7676
7677 // UID of package for which permissions are viewed
7678 optional int32 uid = 4 [(is_uid) = true];
7679
7680 // Name of package for which permissions are viewed
7681 optional string package_name = 5;
7682
7683 // Category in which app is included
7684 enum Category {
7685 UNDEFINED = 0;
7686 ALLOWED = 1;
7687 ALLOWED_FOREGROUND = 2;
7688 DENIED = 3;
7689 }
7690 optional Category category = 6;
7691}
Tony Make2b1b672019-07-29 16:59:47 +01007692
7693/**
7694 * Logs when there is a smart selection related event.
7695 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7696 * Logged from: TextClassifierEventLogger.java
7697 */
7698message TextSelectionEvent {
7699 // A session ID.
7700 optional string session_id = 1;
7701
7702 // Event type of this event.
7703 optional android.stats.textclassifier.EventType event_type = 2;
7704
Tony Mak9c84bd22019-12-09 07:27:25 +00007705 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007706 optional string model_name = 3;
7707
7708 // Type of widget that was involved in triggering this event.
7709 optional android.stats.textclassifier.WidgetType widget_type = 4;
7710
7711 // Index of this event in a session.
7712 optional int32 event_index = 5;
7713
7714 // Entity type that is involved.
7715 optional string entity_type = 6;
7716
7717 // Relative word index of the start of the selection.
7718 optional int32 relative_word_start_index = 7;
7719
7720 // Relative word (exclusive) index of the end of the selection.
7721 optional int32 relative_word_end_index = 8;
7722
7723 // Relative word index of the start of the smart selection.
7724 optional int32 relative_suggested_word_start_index = 9;
7725
7726 // Relative word (exclusive) index of the end of the smart selection.
7727 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007728
7729 // Name of source package.
7730 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007731}
7732
7733/**
7734 * Logs when there is a smart linkify related event.
7735 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7736 * Logged from: TextClassifierEventLogger.java
7737 */
7738message TextLinkifyEvent {
7739 // A session ID.
7740 optional string session_id = 1;
7741
7742 // Event type of this event.
7743 optional android.stats.textclassifier.EventType event_type = 2;
7744
Tony Mak9c84bd22019-12-09 07:27:25 +00007745 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007746 optional string model_name = 3;
7747
7748 // Type of widget that was involved in triggering this event.
7749 optional android.stats.textclassifier.WidgetType widget_type = 4;
7750
7751 // Index of this event in a session.
7752 optional int32 event_index = 5;
7753
7754 // Entity type that is involved.
7755 optional string entity_type = 6;
7756
7757 // Number of links detected.
7758 optional int32 num_links = 7;
7759
7760 // The total length of all links.
7761 optional int32 linked_text_length = 8;
7762
7763 // Length of input text.
7764 optional int32 text_length = 9;
7765
7766 // Time spent on generating links in ms.
7767 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007768
7769 // Name of source package.
7770 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007771}
7772
7773/**
7774 * Logs when there is a conversation actions related event.
7775 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7776 * Logged from: TextClassifierEventLogger.java
7777 */
7778message ConversationActionsEvent {
7779 // A session ID.
7780 optional string session_id = 1;
7781
7782 // Event type of this event.
7783 optional android.stats.textclassifier.EventType event_type = 2;
7784
Tony Mak9c84bd22019-12-09 07:27:25 +00007785 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007786 optional string model_name = 3;
7787
7788 // Type of widget that was involved in triggering this event.
7789 optional android.stats.textclassifier.WidgetType widget_type = 4;
7790
7791 // The first entity type that is involved.
7792 optional string first_entity_type = 5;
7793
7794 // The second entity type that is involved.
7795 optional string second_entity_type = 6;
7796
7797 // The third entity type that is involved.
7798 optional string third_entity_type = 7;
7799
7800 // The score of the first entity type.
7801 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007802
7803 // Name of source package.
7804 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007805
7806 // Name of the annotator model that is involved in this event.
7807 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007808}
7809
7810/**
7811 * Logs when there is a language detection related event.
7812 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7813 * Logged from: TextClassifierEventLogger.java
7814 */
7815message LanguageDetectionEvent {
7816 // A session ID.
7817 optional string session_id = 1;
7818
7819 // Event type of this event.
7820 optional android.stats.textclassifier.EventType event_type = 2;
7821
Tony Mak9c84bd22019-12-09 07:27:25 +00007822 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007823 optional string model_name = 3;
7824
7825 // Type of widget that was involved in triggering this event.
7826 optional android.stats.textclassifier.WidgetType widget_type = 4;
7827
7828 // Detected language.
7829 optional string language_tag = 5;
7830
7831 // Score of the detected language.
7832 optional float score = 6;
7833
7834 // Position of this action.
7835 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007836
7837 // Name of source package.
7838 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007839}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007840
7841/**
7842 * Information about an OTA update attempt by update_engine.
7843 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7844 */
7845message UpdateEngineUpdateAttemptReported {
7846 // The number of attempts for the update engine to apply a given payload.
7847 optional int32 attempt_number = 1;
7848
7849 optional android.stats.otaupdate.PayloadType payload_type = 2;
7850
7851 // The total time in minutes for the update engine to apply a given payload.
7852 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7853 // it's increased when the system is sleeping.
7854 optional int32 duration_boottime_in_minutes = 3;
7855
7856 // The total time in minutes for the update engine to apply a given payload.
7857 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7858 // and it's not increased when the system is sleeping.
7859 optional int32 duration_monotonic_in_minutes = 4;
7860
7861 // The size of the payload in MiBs.
7862 optional int32 payload_size_mib = 5;
7863
7864 // The attempt result reported by the update engine for an OTA update.
7865 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7866
7867 // The error code reported by the update engine after an OTA update attempt
7868 // on A/B devices.
7869 optional android.stats.otaupdate.ErrorCode error_code = 7;
7870
7871 // The build fingerprint of the source system. The value is read from a
7872 // system property when the device takes the update. e.g.
7873 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7874 optional string source_fingerprint = 8;
7875}
7876
7877/**
7878 * Information about all the attempts the device make before finishing the
7879 * successful update.
7880 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7881 */
7882message UpdateEngineSuccessfulUpdateReported {
7883 // The number of attempts for the update engine to apply the payload for a
7884 // successful update.
7885 optional int32 attempt_count = 1;
7886
7887 optional android.stats.otaupdate.PayloadType payload_type = 2;
7888
7889 optional int32 payload_size_mib = 3;
7890
7891 // The total number of bytes downloaded by update_engine since the last
7892 // successful update.
7893 optional int32 total_bytes_downloaded_mib = 4;
7894
7895 // The ratio in percentage of the over-downloaded bytes compared to the
7896 // total bytes needed to successfully install the update. e.g. 200 if we
7897 // download 200MiB in total for a 100MiB package.
7898 optional int32 download_overhead_percentage = 5;
7899
7900 // The total time in minutes for the update engine to apply the payload for a
7901 // successful update.
7902 optional int32 total_duration_minutes = 6;
7903
7904 // The number of reboot of the device during a successful update.
7905 optional int32 reboot_count = 7;
7906}
Alec Mourie088e762019-07-02 13:10:55 -07007907
7908/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007909 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7910 * key to indicate whether it was successful or not.
7911 *
7912 * Logged from:
7913 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7914 */
7915message RebootEscrowRecoveryReported {
7916 optional bool successful = 1;
7917}
7918
7919/**
Alec Mourie088e762019-07-02 13:10:55 -07007920 * Global display pipeline metrics reported by SurfaceFlinger.
7921 * Pulled from:
7922 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7923 */
7924message SurfaceflingerStatsGlobalInfo {
7925 // Total number of frames presented during the tracing period
7926 optional int64 total_frames = 1;
7927 // Total number of frames missed
7928 optional int64 missed_frames = 2;
7929 // Total number of frames that fell back to client composition
7930 optional int64 client_composition_frames = 3;
7931 // Total time the display was turned on
7932 optional int64 display_on_millis = 4;
7933 // Total time that was spent performing animations.
7934 // This is derived from the present-to-present layer histogram
7935 optional int64 animation_millis = 5;
7936}
7937
7938/**
7939 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7940 * The number of layers uploaded will be restricted due to size limitations.
7941 * Pulled from:
7942 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7943 */
7944message SurfaceflingerStatsLayerInfo {
7945 // The layer for this set of metrics
7946 // For now we can infer that the package name is included in the layer
7947 // name.
7948 optional string layer_name = 1;
7949 // Total number of frames presented
7950 optional int64 total_frames = 2;
7951 // Total number of dropped frames while latching a buffer for this layer.
7952 optional int64 dropped_frames = 3;
7953 // Set of timings measured between successive presentation timestamps.
7954 optional FrameTimingHistogram present_to_present = 4
7955 [(android.os.statsd.log_mode) = MODE_BYTES];
7956 // Set of timings measured from when an app queued a buffer for
7957 // presentation, until the buffer was actually presented to the
7958 // display.
7959 optional FrameTimingHistogram post_to_present = 5
7960 [(android.os.statsd.log_mode) = MODE_BYTES];
7961 // Set of timings measured from when a buffer is ready to be presented,
7962 // until the buffer was actually presented to the display.
7963 optional FrameTimingHistogram acquire_to_present = 6
7964 [(android.os.statsd.log_mode) = MODE_BYTES];
7965 // Set of timings measured from when a buffer was latched by
7966 // SurfaceFlinger, until the buffer was presented to the display
7967 optional FrameTimingHistogram latch_to_present = 7
7968 [(android.os.statsd.log_mode) = MODE_BYTES];
7969 // Set of timings measured from the desired presentation to the actual
7970 // presentation time
7971 optional FrameTimingHistogram desired_to_present = 8
7972 [(android.os.statsd.log_mode) = MODE_BYTES];
7973 // Set of timings measured from when an app queued a buffer for
7974 // presentation, until the buffer was ready to be presented.
7975 optional FrameTimingHistogram post_to_acquire = 9
7976 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08007977 // Frames missed latch because the acquire fence didn't fire
7978 optional int64 late_acquire_frames = 10;
7979 // Frames latched early because the desired present time was bad
7980 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07007981}
7982
7983/**
7984 * Histogram of frame counts bucketed by time in milliseconds.
7985 * Because of size limitations, we hard-cap the number of buckets, with
7986 * buckets for corresponding to larger milliseconds being less precise.
7987 */
7988message FrameTimingHistogram {
7989 // Timings in milliseconds that describes a set of histogram buckets
7990 repeated int32 time_millis_buckets = 1;
7991 // Number of frames that match to each time_millis, i.e. the bucket
7992 // contents
7993 // It's required that len(time_millis) == len(frame_count)
7994 repeated int64 frame_counts = 2;
7995}
Emilian Peev6729f372019-08-29 09:14:09 -07007996
Emilian Peev6729f372019-08-29 09:14:09 -07007997/**
7998 * Information about camera facing and API level usage.
7999 * Logged from:
8000 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8001 */
8002message CameraActionEvent {
8003 // Camera session duration
8004 optional int64 duration = 1;
8005
8006 // Camera API level used
8007 optional int32 api_level = 2;
8008
8009 // Name of client package
8010 optional string package_name = 3;
8011
8012 // Camera facing
8013 enum Facing {
8014 UNKNOWN = 0;
8015 BACK = 1;
8016 FRONT = 2;
8017 EXTERNAL = 3;
8018 }
8019 optional Facing facing = 4;
8020}
atrost01a20932019-08-28 15:40:37 +01008021
8022/**
8023 * Logs when a compatibility change is affecting an app.
8024 *
8025 * Logged from:
8026 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8027 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8028 */
8029message AppCompatibilityChangeReported {
8030 // The UID of the app being affected by the compatibilty change.
8031 optional int32 uid = 1 [(is_uid) = true];
8032
8033 // The ID of the change affecting the app.
8034 optional int64 change_id = 2;
8035
8036 enum State {
8037 UNKNOWN_STATE = 0;
8038 ENABLED = 1;
8039 DISABLED = 2;
8040 LOGGED = 3;
8041 }
8042
8043 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8044 // logged otherwise.
8045 optional State state = 3;
8046
8047 enum Source {
8048 UNKNOWN_SOURCE = 0;
8049 APP_PROCESS = 1;
8050 SYSTEM_SERVER = 2;
8051 }
8052
8053 // Where it was logged from.
8054 optional Source source = 4;
8055
8056}
Hector Dearman40579f62019-11-01 13:19:30 +00008057
8058/**
8059 * Logged from
8060 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8061 */
8062message PerfettoUploaded {
8063 enum Event {
8064 PERFETTO_UNDEFINED = 0;
8065 PERFETTO_TRACE_BEGIN = 1;
8066 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8067 PERFETTO_ON_CONNECT = 3;
8068 PERFETTO_ON_TRACING_DISABLED = 4;
8069 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8070 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8071 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8072 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8073 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8074 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8075 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8076 PERFETTO_TRIGGER_BEGIN = 12;
8077 PERFETTO_TRIGGER_SUCCESS = 13;
8078 PERFETTO_TRIGGER_FAILURE = 14;
8079 PERFETTO_HIT_GUARDRAILS = 15;
8080 PERFETTO_ON_TIMEOUT = 16;
8081 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8082 }
8083
8084 // Which stage of the pipeline we are reporting from.
8085 optional Event event = 1;
8086
8087 // UUID matching the one set inside the SystemInfo trace packet.
8088 optional int64 trace_uuid_lsb = 2;
8089 optional int64 trace_uuid_msb = 3;
8090}
Mark Tabrya824a642019-11-05 12:26:12 -08008091
8092/**
8093 * Pulls client metrics on data transferred via Vehicle Maps Service.
8094 * Metrics are keyed by uid + layer.
8095 *
8096 * Pulled from:
8097 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8098 */
8099message VmsClientStats {
8100 // UID of the VMS client app
8101 optional int32 uid = 1 [(is_uid) = true];
8102
8103 // VMS layer definition
8104 optional int32 layer_type = 2;
8105 optional int32 layer_channel = 3;
8106 optional int32 layer_version = 4;
8107
8108 // Bytes and packets sent by the client for the layer
8109 optional int64 tx_bytes = 5;
8110 optional int64 tx_packets = 6;
8111
8112 // Bytes and packets received by the client for the layer
8113 optional int64 rx_bytes = 7;
8114 optional int64 rx_packets = 8;
8115
8116 // Bytes and packets dropped due to client error
8117 optional int64 dropped_bytes = 9;
8118 optional int64 dropped_packets = 10;
8119}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008120
8121/**
8122 * State of a dangerous permission requested by a package - sampled
8123 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8124*/
8125message DangerousPermissionStateSampled {
8126 // Name of the permission
8127 optional string permission_name = 1;
8128
8129 // Uid of the package
8130 optional int32 uid = 2 [(is_uid) = true];
8131
8132 // If the permission is granted to the uid
8133 optional bool is_granted = 3;
8134
8135 // Permission flags as per android.content.pm.PermissionFlags
8136 optional int32 permission_flags = 4;
8137}
8138
Stan Iliev637ba5e2019-08-16 13:43:08 -04008139/**
8140 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8141 */
8142enum PipelineType {
8143 GL = 0;
8144 VULKAN = 1;
8145}
8146
8147/**
8148 * HWUI stats for a given app.
8149 */
8150message GraphicsStats {
8151 // The package name of the app
8152 optional string package_name = 1;
8153
8154 // The version code of the app
8155 optional int64 version_code = 2;
8156
8157 // The start & end timestamps in UTC as
8158 // milliseconds since January 1, 1970
8159 // Compatible with java.util.Date#setTime()
8160 optional int64 stats_start = 3;
8161
8162 optional int64 stats_end = 4;
8163
8164 // HWUI renders pipeline type: GL or Vulkan.
8165 optional PipelineType pipeline = 5;
8166
8167 // Distinct frame count.
8168 optional int32 total_frames = 6;
8169
8170 // Number of "missed vsync" events.
8171 optional int32 missed_vsync_count = 7;
8172
8173 // Number of frames in triple-buffering scenario (high input latency)
8174 optional int32 high_input_latency_count = 8;
8175
8176 // Number of "slow UI thread" events.
8177 optional int32 slow_ui_thread_count = 9;
8178
8179 // Number of "slow bitmap upload" events.
8180 optional int32 slow_bitmap_upload_count = 10;
8181
8182 // Number of "slow draw" events.
8183 optional int32 slow_draw_count = 11;
8184
8185 // Number of frames that missed their deadline (aka, visibly janked)
8186 optional int32 missed_deadline_count = 12;
8187
8188 // The frame time histogram for the package
8189 optional FrameTimingHistogram cpu_histogram = 13
8190 [(android.os.statsd.log_mode) = MODE_BYTES];
8191
8192 // The gpu frame time histogram for the package
8193 optional FrameTimingHistogram gpu_histogram = 14
8194 [(android.os.statsd.log_mode) = MODE_BYTES];
8195
8196 // UI mainline module version.
8197 optional int64 version_ui_module = 15;
8198
8199 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8200 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8201 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8202 // more apps are running / rendering.
8203 optional bool is_today = 16;
8204}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008205
8206/**
8207 * Message related to dangerous (runtime) app ops access
8208 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008209message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008210 // Uid of the package accessing app op
8211 optional int32 uid = 1 [(is_uid) = true];
8212
8213 // Name of the package accessing app op
8214 optional string package_name = 2;
8215
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008216 // operation string id per OPSTR_ constants in AppOpsManager.java
8217 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008218
8219 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8220 // Features must be provided through manifest using <feature> tag available in R and above.
8221 optional string feature_id = 4;
8222
8223 // message related to app op access, limited to 600 chars by API
8224 optional string message = 5;
8225
8226 enum SamplingStrategy {
8227 DEFAULT = 0;
8228 UNIFORM = 1;
8229 RARELY_USED = 2;
8230 }
8231
8232 // sampling strategy used to collect this message
8233 optional SamplingStrategy sampling_strategy = 6;
8234}
8235
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008236/*
8237 * Logs userspace reboot outcome and duration.
8238 *
8239 * Logged from:
8240 * frameworks/base/core/java/com/android/server/BootReceiver.java
8241 */
8242message UserspaceRebootReported {
8243 // Possible outcomes of userspace reboot.
8244 enum Outcome {
8245 // Default value in case platform failed to determine the outcome.
8246 OUTCOME_UNKNOWN = 0;
8247 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8248 SUCCESS = 1;
8249 // Userspace reboot shutdown sequence was aborted.
8250 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8251 // Remounting userdata into checkpointing mode failed.
8252 FAILED_USERDATA_REMOUNT = 3;
8253 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8254 // reboot.
8255 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8256 }
8257 // Outcome of userspace reboot. Always set.
8258 optional Outcome outcome = 1;
8259 // Duration of userspace reboot in case it has a successful outcome.
8260 // Duration is measured as time between userspace reboot was initiated and until boot completed
8261 // (e.g. sys.boot_completed=1).
8262 optional int64 duration_millis = 2;
8263 // State of primary user's (user0) credential encryption storage.
8264 enum UserEncryptionState {
8265 // Default value.
8266 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8267 // Credential encrypted storage is unlocked.
8268 UNLOCKED = 1;
8269 // Credential encrypted storage is locked.
8270 LOCKED = 2;
8271 }
8272 // State of primary user's encryption storage at the moment boot completed. Always set.
8273 optional UserEncryptionState user_encryption_state = 3;
8274}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008275
8276/*
8277 * Logs integrity check information during each install.
8278 *
8279 * Logged from:
8280 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8281 */
8282message IntegrityCheckResultReported {
8283 optional string package_name = 1;
8284 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008285 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008286 optional string installer_package_name = 4;
8287 enum Response {
8288 UNKNOWN = 0;
8289 ALLOWED = 1;
8290 REJECTED = 2;
8291 FORCE_ALLOWED = 3;
8292 }
8293 optional Response response = 5;
8294 // An estimate on the cause of the response. This will only be populated for
8295 // REJECTED and FORCE_ALLOWED
8296 optional bool caused_by_app_cert_rule = 6;
8297 optional bool caused_by_installer_rule = 7;
8298}
8299
8300/**
8301 * Logs the information about the rules and the provider whenever rules are
8302 * pushed into AppIntegrityManager.
8303 *
8304 * Logged from:
8305 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8306 */
8307message IntegrityRulesPushed {
8308 optional bool success = 1;
8309 // Package name of the app that pushed the rules.
8310 optional string rule_provider = 2;
8311 // Version string of arbitrary format provided by the rule provider to
8312 // identify the rules.
8313 optional string rule_version = 3;
8314}
Jordan Liubedfa702019-12-20 15:08:45 -08008315
8316/**
8317 * Logs when a cell broadcast message is received on the device.
8318 *
8319 * Logged from CellBroadcastService module:
8320 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8321 */
8322message CellBroadcastMessageReported {
8323 // The type of Cell Broadcast message
8324 enum CbType {
8325 UNKNOWN_TYPE = 0;
8326 GSM = 1;
8327 CDMA = 2;
8328 CDMA_SPC = 3;
8329 }
8330
8331 // GSM, CDMA, CDMA-SCP
8332 optional CbType type = 1;
8333}
8334
8335/**
8336 * Logs when an error occurs while handling a cell broadcast message;
8337 *
8338 * Logged from CellBroadcastService module:
8339 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8340 */
8341message CellBroadcastMessageError {
8342 // The type of error raised when trying to handle a cell broadcast message
8343 enum ErrorType {
8344 UNKNOWN_TYPE = 0;
8345 CDMA_DECODING_ERROR = 1;
8346 CDMA_SCP_EMPTY = 2;
8347 CDMA_SCP_HANDLING_ERROR = 3;
8348 GSM_INVALID_HEADER_LENGTH = 4;
8349 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8350 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8351 GSM_INVALID_PDU = 7;
8352 GSM_INVALID_GEO_FENCING_DATA = 8;
8353 GSM_UMTS_INVALID_WAC = 9;
8354 FAILED_TO_INSERT_TO_DB = 10;
8355 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8356 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8357 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8358 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8359 }
8360
8361 // What kind of error occurred
8362 optional ErrorType type = 1;
8363
8364 // Exception message (or log message) associated with the error (max 1000 chars)
8365 optional string exception_message = 2;
8366}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008367
8368/**
8369 * Logs when the SDK Extensions test app has polled the current version.
8370 * This is atom ID 354.
8371 *
8372 * Logged from:
8373 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8374 */
8375message SdkExtensionStatus {
8376 enum ApiCallStatus {
8377 CALL_NOT_ATTEMPTED = 0;
8378 CALL_SUCCESSFUL = 1;
8379 CALL_FAILED = 2;
8380 }
8381
8382 optional ApiCallStatus result = 1;
8383
8384 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8385 optional int32 r_extension_version = 2;
8386
8387 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8388 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8389 optional int32 failed_call_symbol = 3;
8390}
Marco Ballesio497aff42020-01-24 08:39:42 -08008391
8392/**
8393 * Logs when an app is frozen or unfrozen.
8394 *
8395 * Logged from:
8396 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8397 */
8398message AppFreezeChanged {
8399 // The type of event.
8400 enum Action {
8401 UNKNOWN = 0;
8402 FREEZE_APP = 1;
8403 UNFREEZE_APP = 2;
8404 }
8405 optional Action action = 1;
8406
8407 // Pid of the process being frozen.
8408 optional int32 pid = 2;
8409
8410 // Name of the process being frozen.
8411 optional string process_name = 3;
8412
8413 // Time since last unfrozen.
8414 optional int64 time_unfrozen_millis = 4;
8415}