blob: 4aa0b4bb767d7161e0fd0b8c5009eb0f43b8dc04 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080082 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 SensorStateChanged sensor_state_changed = 5 [(module) = "framework"];
85 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
86 SyncStateChanged sync_state_changed = 7 [(module) = "framework"];
87 ScheduledJobStateChanged scheduled_job_state_changed = 8 [(module) = "framework"];
88 ScreenBrightnessChanged screen_brightness_changed = 9 [(module) = "framework"];
89 WakelockStateChanged wakelock_state_changed = 10 [(module) = "framework"];
90 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
91 11 [(module) = "framework"];
92 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
93 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
94 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
95 14 [(module) = "framework"];
96 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
97 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
98 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
99 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800100 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20 [(module) = "framework"];
102 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
103 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
104 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
105 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
106 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
107 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
108 UidProcessStateChanged uid_process_state_changed = 27 [(module) = "framework"];
109 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28 [(module) = "framework"];
110 ScreenStateChanged screen_state_changed = 29 [(module) = "framework"];
111 BatteryLevelChanged battery_level_changed = 30 [(module) = "framework"];
112 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
113 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
114 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800115 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
117 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800118 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
119 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
120 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
122 SettingChanged setting_changed = 41 [(module) = "framework"];
123 ActivityForegroundStateChanged activity_foreground_state_changed =
124 42 [(module) = "framework"];
125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework"];
126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Bookatz8fcd09a2017-12-18 13:01:10 -0800128 AnomalyDetected anomaly_detected = 46;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800130 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
132 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
133 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800134 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800136 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800137 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
139 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800140 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
143 ForegroundServiceStateChanged foreground_service_state_changed
144 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800145 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800146 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
147 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
148 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppDied app_died = 65 [(module) = "framework"];
150 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
151 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800152 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
153 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
155 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800156 SpeakerImpedanceReported speaker_impedance_reported = 71;
157 HardwareFailed hardware_failed = 72;
158 PhysicalDropDetected physical_drop_detected = 73;
159 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800160 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
161 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
163 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework"];
164 ANROccurred anr_occurred = 79 [(module) = "framework"];
165 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
166 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700167 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 KeyValuePairsAtom key_value_pairs_atom =
169 83 [(allow_from_any_uid) = true, (module) = "framework"];
170 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
171 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700172 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
174 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
175 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
176 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700177 BatteryHealthSnapshot battery_health_snapshot = 91;
178 SlowIo slow_io = 92;
179 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
181 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100182 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800183 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700185 // TODO: service state change is very noisy shortly after boot, as well
186 // as at other transitions - coming out of doze, device plugged in, etc.
187 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
189 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
190 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800193 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
194 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
195 105 [(module) = "docsui"];
196 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
197 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
198 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
199 108 [(module) = "docsui"];
200 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
201 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
202 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800205 WifiRunningStateChanged wifi_running_state_changed = 114
206 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800210 117 [(module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
214 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
216 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
217 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
219 125 [(module) = "bluetooth"];
220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
221 126 [(module) = "bluetooth"];
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
223 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
228 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800230 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
231 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
232 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
234 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800236 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
237 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
239 142 [(module) = "framework"];
240 AttentionManagerServiceResultReported attention_manager_service_result_reported =
241 143 [(module) = "framework"];
242 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"];
246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
247 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800248 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800249 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
250 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800251 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
252 151 [(module) = "bluetooth"];
253 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
254 152 [(module) = "bluetooth"];
255 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
256 153 [(module) = "bluetooth"];
257 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
258 154 [(module) = "bluetooth"];
259 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
260 155 [(module) = "bluetooth"];
261 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
262 156 [(module) = "bluetooth"];
263 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
264 157 [(module) = "bluetooth"];
265 BluetoothDeviceFailedContactCounterReported
266 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
267 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
268 159 [(module) = "bluetooth"];
269 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
270 160 [(module) = "bluetooth"];
271 BluetoothQualityReportReported bluetooth_quality_report_reported =
272 161 [(module) = "bluetooth"];
273 BluetoothDeviceInfoReported bluetooth_device_info_reported =
274 162 [(module) = "bluetooth"];
275 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
276 163 [(module) = "bluetooth"];
277 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
278 164 [(module) = "bluetooth"];
279 BluetoothBondStateChanged bluetooth_bond_state_changed =
280 165 [(module) = "bluetooth"];
281 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
282 166 [(module) = "bluetooth"];
283 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
284 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800285 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
286 168 [(module) = "framework"];
287 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700288 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800289 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800290 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800291 DeviceIdentifierAccessDenied device_identifier_access_denied =
292 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800293 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800294 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
295 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
296 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800297 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
298 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800299 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700300 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800301 180 [(module) = "permissioncontroller"];
302 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
303 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
306 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
307 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
308 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800309 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
310 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700311 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 188 [(module) = "intelligence"];
313 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
314 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800315 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800317 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
318 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
319 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
320 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
321 MediametricsCodecReported mediametrics_codec_reported = 195;
322 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
323 MediametricsExtractorReported mediametrics_extractor_reported = 197;
324 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
325 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
326 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700327 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800328 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
329 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800330 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
332 206 [(module) = "framework"];
333 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
334 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
335 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
336 LocationManagerApiUsageReported location_manager_api_usage_reported =
337 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100338 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800339 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100340 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800341 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100342 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800343 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100344 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800345 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100346 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800347 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100348 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800349 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100350 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100352 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800354 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
355 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
356 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
357 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800359 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700360 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
361 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100363 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800365 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800366 VmsClientConnectionStateChanged vms_client_connection_state_changed =
367 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800368 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
369 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700370 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 235 [(module) = "mediaprovider"];
372 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700373 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
376 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
377 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
378 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800379 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800380 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000381 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800382 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman079fdaa2020-01-12 16:45:03 -0500383 NotificationPanelReported notification_panel_reported = 245;
Will Brockman492be332020-02-12 16:46:04 -0500384 NotificationChannelModified notification_channel_modified = 246;
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800385 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
386 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800387 CellBroadcastMessageReported cb_message_reported =
388 249 [(module) = "cellbroadcast"];
389 CellBroadcastMessageError cb_message_error =
390 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700391 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
392 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
393 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800394 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000395 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800396 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
397 256 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000398 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000399 }
David Chenc8a43242017-10-17 16:23:28 -0700400
David Chen6e3e6cb2018-01-03 16:14:06 -0800401 // Pulled events will start at field 10000.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000402 // Next: 10076
David Chenc8a43242017-10-17 16:23:28 -0700403 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800404 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
405 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
406 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
407 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
408 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
409 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800410 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800411 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
412 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
413 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
414 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
415 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
416 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
417 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
418 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
419 SystemUptime system_uptime = 10015 [(module) = "framework"];
420 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
421 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000422 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800423 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
424 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800425 Temperature temperature = 10021 [(module) = "framework"];
426 BinderCalls binder_calls = 10022 [(module) = "framework"];
427 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
428 LooperStats looper_stats = 10024 [(module) = "framework"];
429 DiskStats disk_stats = 10025 [(module) = "framework"];
430 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
431 AppSize app_size = 10027 [(module) = "framework"];
432 CategorySize category_size = 10028 [(module) = "framework"];
433 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800434 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800435 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
436 DiskIo disk_io = 10032 [(module) = "framework"];
437 PowerProfile power_profile = 10033 [(module) = "framework"];
438 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
439 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
440 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700441 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800442 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
443 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
444 10040 [(module) = "framework"];
445 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
446 10041 [(module) = "framework"];
447 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800448 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800449 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800450 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
452 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
453 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
454 RoleHolder role_holder = 10049 [(module) = "framework"];
455 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800456 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
458 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800459 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
460 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800461 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
462 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
463 FaceSettings face_settings = 10058 [(module) = "framework"];
464 CoolingDevice cooling_device = 10059 [(module) = "framework"];
465 AppOps app_ops = 10060 [(module) = "framework"];
466 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700467 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
468 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800470 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800471 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
472 DangerousPermissionStateSampled dangerous_permission_state_sampled =
473 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400474 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000475 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000476 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200477 PackageNotificationPreferences package_notification_preferences =
478 10071 [(module) = "framework"];
479 PackageNotificationChannelPreferences package_notification_channel_preferences =
480 10072 [(module) = "framework"];
481 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
482 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800483 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000484 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700485 }
yroa1fe77c2018-02-26 14:22:54 -0800486
Bookatz76aafcf2018-09-17 16:17:10 -0700487 // DO NOT USE field numbers above 100,000 in AOSP.
488 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
489 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100490
491 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700492}
493
Yao Chend54f9dd2017-10-17 17:37:48 +0000494/**
Yangster-mac20877162017-12-22 17:19:39 -0800495 * This proto represents a node of an attribution chain.
496 * Note: All attribution chains are represented as a repeated field of type
497 * AttributionNode. It is understood that in such arrays, the order is that
498 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000499 */
Yangster-mac20877162017-12-22 17:19:39 -0800500message AttributionNode {
501 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800502 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800503
Yangster-mac20877162017-12-22 17:19:39 -0800504 // The (optional) string tag for an element in the attribution chain. If the
505 // element has no tag, it is encoded as an empty string.
506 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700507}
508
Yangster-mac48b3d622018-08-18 12:38:11 -0700509message KeyValuePair {
510 optional int32 key = 1;
511 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700512 int32 value_int = 2;
513 int64 value_long = 3;
514 string value_str = 4;
515 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700516 }
517}
518
519message KeyValuePairsAtom {
520 optional int32 uid = 1;
521 repeated KeyValuePair pairs = 2;
522}
523
Yao Chend54f9dd2017-10-17 17:37:48 +0000524/*
525 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800526 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000527 *
528 * RULES:
529 * - The field ids for each atom must start at 1, and count upwards by 1.
530 * Skipping field ids is not allowed.
531 * - These form an API, so renaming, renumbering or removing fields is
532 * not allowed between android releases. (This is not currently enforced,
533 * but there will be a tool to enforce this restriction).
534 * - The types must be built-in protocol buffer types, namely, no sub-messages
535 * are allowed (yet). The bytes type is also not allowed.
536 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800537 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000538 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800539 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000540 * - A field that is a uid should be a string field, tagged with the [xxx]
541 * annotation. The generated code on android will be represented by UIDs,
542 * and those UIDs will be translated in xxx to those strings.
543 *
544 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700545 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000546 * - If there is a UID, it goes first. Think in an object-oriented fashion.
547 * *****************************************************************************
548 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700549
Yao Chend54f9dd2017-10-17 17:37:48 +0000550/**
Tej Singha72344992019-04-17 18:55:08 -0700551 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700552 * Logs when the Thermal service HAL notifies the throttling start/stop events.
553 *
554 * Logged from:
555 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
556 */
557message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700558 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700559 optional android.os.TemperatureTypeEnum sensor_type = 1;
560
Maggie White442b6312019-04-05 16:26:44 -0700561 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700562 enum State {
563 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700564 START = 1; // START indicated that throttling was triggered.
565 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700566 }
Yangster-mace16189a2018-08-26 12:20:16 -0700567 optional State state = 2;
568
569 optional float temperature = 3;
570}
571
572/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000573 * Logs when the screen state changes.
574 *
575 * Logged from:
576 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
577 */
578message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800579 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800580 optional android.view.DisplayStateEnum state = 1
581 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700582}
Yao Chend54f9dd2017-10-17 17:37:48 +0000583
584/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700585 * Logs that the process state of the uid, as determined by ActivityManager
586 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000587 *
588 * Logged from:
589 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
590 */
Bookatzc1a050a2017-10-10 15:49:28 -0700591message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800592 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000593
Bookatzdb026a22018-01-10 19:01:56 -0800594 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800595 optional android.app.ProcessStateEnum state = 2
596 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000597}
598
599/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700600 * Logs process state change of a process, as per the activity manager.
601 *
602 * Logged from:
603 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
604 */
605message ProcessStateChanged {
606 optional int32 uid = 1;
607 optional string process_name = 2;
608 optional string package_name = 3;
609 // TODO: remove this when validation is done
610 optional int64 version = 5;
611 // The state, from frameworks/base/core/proto/android/app/enums.proto.
612 optional android.app.ProcessStateEnum state = 4;
613}
614
615/**
616 * Logs when ActivityManagerService sleep state is changed.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
620 */
621message ActivityManagerSleepStateChanged {
622 // TODO: import frameworks proto
623 enum State {
624 UNKNOWN = 0;
625 ASLEEP = 1;
626 AWAKE = 2;
627 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800628 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629}
630
631/**
632 * Logs when system memory state changes.
633 *
634 * Logged from:
635 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
636 */
637message MemoryFactorStateChanged {
638 // TODO: import frameworks proto
639 enum State {
640 MEMORY_UNKNOWN = 0;
641 NORMAL = 1; // normal.
642 MODERATE = 2; // moderate memory pressure.
643 LOW = 3; // low memory.
644 CRITICAL = 4; // critical memory.
645
646 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800647 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700648}
649
650/**
651 * Logs when app is using too much cpu, according to ActivityManagerService.
652 *
653 * Logged from:
654 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
655 */
656message ExcessiveCpuUsageReported {
657 optional int32 uid = 1;
658 optional string process_name = 2;
659 optional string package_name = 3;
660 // package version. TODO: remove this when validation is done
661 optional int64 version = 4;
662}
663
664/**
665 * Logs when a cached process is killed, along with its pss.
666 *
667 * Logged from:
668 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
669 */
670message CachedKillReported {
671 optional int32 uid = 1;
672 optional string process_name = 2;
673 optional string package_name = 3;
674 // TODO: remove this when validation is done
675 optional int64 version = 5;
676 optional int64 pss = 4;
677}
678
679/**
xshu2c3d9e42019-09-26 17:54:02 -0700680 * Logs the change in wifi health.
681 *
682 * Logged from:
683 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
684 */
685message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800686 enum Band {
687 UNKNOWN = 0;
688 // All of 2.4GHz band
689 BAND_2G = 1;
690 // Frequencies in the range of [5150, 5250) GHz
691 BAND_5G_LOW = 2;
692 // Frequencies in the range of [5250, 5725) GHz
693 BAND_5G_MIDDLE = 3;
694 // Frequencies in the range of [5725, 5850) GHz
695 BAND_5G_HIGH = 4;
696 // Frequencies in the range of [5925, 6425) GHz
697 BAND_6G_LOW = 5;
698 // Frequencies in the range of [6425, 6875) GHz
699 BAND_6G_MIDDLE = 6;
700 // Frequencies in the range of [6875, 7125) GHz
701 BAND_6G_HIGH = 7;
702 }
xshu2c3d9e42019-09-26 17:54:02 -0700703 // duration this stat is obtained over in milliseconds
704 optional int32 duration_millis = 1;
705 // whether wifi is classified as sufficient for the user's data traffic, determined
706 // by whether the calculated throughput exceeds the average demand within |duration_millis|
707 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700708 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800709 optional bool is_cell_data_available = 3;
710 // the Band bucket the connected network is on
711 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700712}
713
714/**
715 * Logged when wifi detects a significant change in connection failure rate.
716 *
717 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
718 *
719 */
720message WifiFailureStatReported {
721 enum AbnormalityType {
722 UNKNOWN = 0;
723 SIGNIFICANT_INCREASE = 1;
724 SIGNIFICANT_DECREASE = 2;
725 SIMPLY_HIGH = 3;
726 }
727 enum FailureType {
728 FAILURE_UNKNOWN = 0;
729 FAILURE_CONNECTION = 1;
730 FAILURE_ASSOCIATION_REJECTION = 2;
731 FAILURE_ASSOCIATION_TIMEOUT = 3;
732 FAILURE_AUTHENTICATION = 4;
733 FAILURE_NON_LOCAL_DISCONNECTION = 5;
734 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
735 }
736 // Reason for uploading this stat
737 optional AbnormalityType abnormality_type = 1;
738 // The particular type of failure
739 optional FailureType failure_type = 2;
740 // How many times we have encountered this combination of AbnormalityType and FailureType
741 optional int32 failure_count = 3;
742}
743
744/**
745 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
746 *
747 * Logged from:
748 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
749 */
750message WifiConnectionResultReported {
751 enum FailureCode {
752 FAILURE_UNKNOWN = 0;
753 FAILURE_ASSOCIATION_TIMEOUT = 1;
754 FAILURE_ASSOCIATION_REJECTION = 2;
755 FAILURE_AUTHENTICATION_GENERAL = 3;
756 FAILURE_AUTHENTICATION_EAP = 4;
757 FAILURE_DHCP = 5;
758 FAILURE_NETWORK_DISCONNECTION = 6;
759 FAILURE_ROAM_TIMEOUT = 7;
760 }
761 // true represents a successful connection
762 optional bool connection_result = 1;
763 // reason for the connection failure
764 optional FailureCode failure_code = 2;
765 // scan rssi before the connection attempt
766 optional int32 rssi = 3;
767}
768
769/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700770 * Logs when memory stats of a process is reported.
771 *
772 * Logged from:
773 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
774 */
775message ProcessMemoryStatReported {
776 optional int32 uid = 1;
777 optional string process_name = 2;
778 optional string package_name = 3;
779 //TODO: remove this when validation is done
780 optional int64 version = 9;
781 optional int64 pss = 4;
782 optional int64 uss = 5;
783 optional int64 rss = 6;
784 enum Type {
785 ADD_PSS_INTERNAL_SINGLE = 0;
786 ADD_PSS_INTERNAL_ALL_MEM = 1;
787 ADD_PSS_INTERNAL_ALL_POLL = 2;
788 ADD_PSS_EXTERNAL = 3;
789 ADD_PSS_EXTERNAL_SLOW = 4;
790 }
791 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800792 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700793}
794
795/**
Bookatzc1a050a2017-10-10 15:49:28 -0700796 * Logs that a process started, finished, crashed, or ANRed.
797 *
798 * Logged from:
799 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
800 */
801message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700802 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700803
David Chen0b5c90c2018-01-25 16:51:49 -0800804 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800805 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
Bookatzddccf0a2017-11-28 16:48:14 -0800807 // What lifecycle state the process changed to.
808 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800809 enum State {
810 FINISHED = 0;
811 STARTED = 1;
812 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800813 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800814 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700815}
816
Bookatzc1a050a2017-10-10 15:49:28 -0700817/**
818 * Logs when the ble scan state changes.
819 *
820 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700821 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700822 */
823message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800824 repeated AttributionNode attribution_node = 1
825 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700826
827 enum State {
828 OFF = 0;
829 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700830 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
831 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700832 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800833 optional State state = 2 [
834 (state_field_option).option = EXCLUSIVE_STATE,
835 (state_field_option).default_state_value = 0 /* State.OFF */,
836 (state_field_option).reset_state_value = 2 /* State.RESET */,
837 (state_field_option).nested = true
838 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700839
Bookatze5ec0b42018-03-26 13:34:56 -0700840 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800841 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700842 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800843 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700844 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800845 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700846}
847
848/**
849 * Logs reporting of a ble scan finding results.
850 *
851 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700852 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700853 */
Bookatzae6738e2018-09-13 11:38:56 -0700854// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700855message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800856 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700857
858 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800859 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700860}
861
862/**
863 * Logs when a sensor state changes.
864 *
865 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700866 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700867 */
868message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800869 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700870
Bookatzc1a050a2017-10-10 15:49:28 -0700871 // The id (int) of the sensor.
872 optional int32 sensor_id = 2;
873
874 enum State {
875 OFF = 0;
876 ON = 1;
877 }
878 optional State state = 3;
879}
880
Bookatzc1a050a2017-10-10 15:49:28 -0700881/**
882 * Logs when GPS state changes.
883 *
884 * Logged from:
885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
886 */
887message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800888 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700889
890 enum State {
891 OFF = 0;
892 ON = 1;
893 }
894 optional State state = 2;
895}
896
Bookatz48d362e2018-11-06 15:49:08 -0800897/**
898 * Logs when GPS signal quality.
899 *
900 * Logged from:
901 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
902 */
903message GpsSignalQualityChanged {
904 optional android.server.location.GpsSignalQualityEnum level = 1;
905}
906
Bookatzc1a050a2017-10-10 15:49:28 -0700907
908/**
909 * Logs when a sync manager sync state changes.
910 *
911 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700912 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700913 */
914message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800915 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700916
David Chen0b5c90c2018-01-25 16:51:49 -0800917 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800918 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700919
920 enum State {
921 OFF = 0;
922 ON = 1;
923 }
924 optional State state = 3;
925}
926
Yangster-mac96353002018-09-05 11:18:55 -0700927/*
928 * Deferred job stats.
929 *
930 * Logged from:
931 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
932*/
933message DeferredJobStatsReported {
934 repeated AttributionNode attribution_node = 1;
935
936 // Number of jobs deferred.
937 optional int32 num_jobs_deferred = 2;
938
939 // Time since the last job runs.
940 optional int64 time_since_last_job_millis = 3;
941}
942
Bookatzc1a050a2017-10-10 15:49:28 -0700943/**
944 * Logs when a job scheduler job state changes.
945 *
946 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700947 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700948 */
949message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800950 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700951
952 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800953 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700954
955 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800956 FINISHED = 0;
957 STARTED = 1;
958 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700959 }
960 optional State state = 3;
961
Tej Singh33a412b2018-03-16 18:43:59 -0700962 // The reason a job has stopped.
963 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700964 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700965 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100966
967 // The standby bucket of the app that scheduled the job. These match the framework constants
968 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
969 // already assigned 0.
970 enum Bucket {
971 UNKNOWN = -1;
972 ACTIVE = 0;
973 WORKING_SET = 1;
974 FREQUENT = 2;
975 RARE = 3;
976 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800977 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100978 }
979 optional Bucket standby_bucket = 5 [default = UNKNOWN];
980
981 // The job id (as assigned by the app).
982 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700983}
984
985/**
986 * Logs when the audio state changes.
987 *
988 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700989 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700990 */
991message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800992 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700993
994 enum State {
995 OFF = 0;
996 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700997 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
998 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700999 }
1000 optional State state = 2;
1001}
1002
1003/**
1004 * Logs when the video codec state changes.
1005 *
1006 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001007 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001008 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001009message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001010 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001011
1012 enum State {
1013 OFF = 0;
1014 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001015 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1016 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001017 }
1018 optional State state = 2;
1019}
1020
1021/**
1022 * Logs when the flashlight state changes.
1023 *
1024 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001025 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001026 */
1027message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001028 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001029
1030 enum State {
1031 OFF = 0;
1032 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001033 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1034 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001035 }
1036 optional State state = 2;
1037}
1038
1039/**
1040 * Logs when the camera state changes.
1041 *
1042 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001043 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001044 */
1045message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001046 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001047
1048 enum State {
1049 OFF = 0;
1050 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001051 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1052 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001053 }
1054 optional State state = 2;
1055}
1056
1057/**
1058 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001059 *
1060 * Logged from:
1061 * TODO
1062 */
Bookatzd6746242017-10-24 18:39:35 -07001063message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001064 repeated AttributionNode attribution_node = 1
1065 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001066
Bookatz1a1b0462018-01-12 11:47:03 -08001067 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1068 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001069 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001070 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001071
1072 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001073 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001074
1075 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001076 RELEASE = 0;
1077 ACQUIRE = 1;
1078 CHANGE_RELEASE = 2;
1079 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001080 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001081 optional State state = 4 [
1082 (state_field_option).option = EXCLUSIVE_STATE,
1083 (state_field_option).default_state_value = 0,
1084 (state_field_option).nested = true
1085 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001086}
1087
1088/**
Bookatzc1a050a2017-10-10 15:49:28 -07001089 * Logs when a partial wakelock is considered 'long' (over 1 min).
1090 *
1091 * Logged from:
1092 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1093 */
1094message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001095 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001096
Yao Chend54f9dd2017-10-17 17:37:48 +00001097 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1098 optional string tag = 2;
1099
Bookatzc1a050a2017-10-10 15:49:28 -07001100 // TODO: I have no idea what this is.
1101 optional string history_tag = 3;
1102
1103 enum State {
1104 OFF = 0;
1105 ON = 1;
1106 }
1107 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001108}
1109
Bookatzc1a050a2017-10-10 15:49:28 -07001110/**
Bookatza66083f2018-09-20 17:24:00 -07001111 * Logs when the device is interactive, according to the PowerManager Notifier.
1112 *
1113 * Logged from:
1114 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1115 */
1116message InteractiveStateChanged {
1117 enum State {
1118 OFF = 0;
1119 ON = 1;
1120 }
1121 optional State state = 1;
1122}
1123
1124/**
Bookatzc1a050a2017-10-10 15:49:28 -07001125 * Logs Battery Saver state change.
1126 *
1127 * Logged from:
1128 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1129 */
1130message BatterySaverModeStateChanged {
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
1134 }
1135 optional State state = 1;
1136}
1137
1138/**
1139 * Logs Doze mode state change.
1140 *
1141 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001142 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001143 */
1144message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001145 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001146}
1147
1148
1149/**
1150 * Logs state change of Doze mode including maintenance windows.
1151 *
1152 * Logged from:
1153 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1154 */
1155message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001156 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001157}
1158
1159/**
1160 * Logs screen brightness level.
1161 *
1162 * Logged from:
1163 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1164 */
1165message ScreenBrightnessChanged {
1166 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1167 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001168}
1169
1170/**
1171 * Logs battery level (percent full, from 0 to 100).
1172 *
1173 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001174 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001175 */
1176message BatteryLevelChanged {
1177 // Battery level. Should be in [0, 100].
1178 optional int32 battery_level = 1;
1179}
1180
1181/**
1182 * Logs change in charging status of the device.
1183 *
1184 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001185 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001186 */
1187message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001188 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1189 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001190}
1191
1192/**
1193 * Logs whether the device is plugged in, and what power source it is using.
1194 *
1195 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001196 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001197 */
1198message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001199 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1200 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001201}
1202
Bookatz8c6571b2017-10-24 15:04:41 -07001203/**
1204 * Logs when an app's wakeup alarm fires.
1205 *
1206 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001207 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001208 */
1209message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001210 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001211
1212 // Name of the wakeup alarm.
1213 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001214
1215 // Name of source package (for historical reasons, since BatteryStats tracked it).
1216 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001217
1218 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1219 enum Bucket {
1220 UNKNOWN = 0;
1221 EXEMPTED = 5;
1222 ACTIVE = 10;
1223 WORKING_SET = 20;
1224 FREQUENT = 30;
1225 RARE = 40;
1226 NEVER = 50;
1227 }
1228 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1229 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001230}
1231
1232/**
1233 * Logs when an an app causes the mobile radio to change state.
1234 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1235 *
1236 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001237 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001238 */
1239message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001240 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001241
Bookatz1a1b0462018-01-12 11:47:03 -08001242 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1243 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001244}
1245
1246/**
1247 * Logs when an an app causes the wifi radio to change state.
1248 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1249 *
1250 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001251 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001252 */
1253message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001254 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001255
Bookatz1a1b0462018-01-12 11:47:03 -08001256 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1257 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001258}
1259
1260/**
1261 * Logs kernel wakeup reasons and aborts.
1262 *
1263 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001264 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001265 */
1266message KernelWakeupReported {
1267 // Name of the kernel wakeup reason (or abort).
1268 optional string wakeup_reason_name = 1;
1269
1270 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001271 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001272}
1273
1274/**
Bookatzda1798c2018-12-13 14:16:00 -08001275 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001276 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001277 *
1278 * Logged from:
1279 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1280 */
1281message WifiEnabledStateChanged {
1282 enum State {
1283 OFF = 0;
1284 ON = 1;
1285 }
1286 optional State state = 1;
1287}
1288
1289/**
tsaichristinececebdc2020-02-04 14:05:56 -08001290 * This atom is deprecated starting in R.
1291 *
Bookatzda1798c2018-12-13 14:16:00 -08001292 * 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 -08001293 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1294 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001295 *
1296 * Logged from:
1297 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1298 */
1299message WifiRunningStateChanged {
1300 repeated AttributionNode attribution_node = 1;
1301
1302 enum State {
1303 OFF = 0;
1304 ON = 1;
1305 }
1306 optional State state = 2;
1307}
1308
1309/**
Bookatze5885242017-10-24 20:10:31 -07001310 * Logs wifi locks held by an app.
1311 *
1312 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001313 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001314 */
1315message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001316 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001317
1318 enum State {
1319 OFF = 0;
1320 ON = 1;
1321 }
1322 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001323
1324 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1325 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001326}
1327
1328/**
1329 * Logs wifi signal strength changes.
1330 *
1331 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001332 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001333 */
1334message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001335 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1336 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001337}
1338
1339/**
1340 * Logs wifi scans performed by an app.
1341 *
1342 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001343 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001344 */
1345message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001346 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001347
1348 enum State {
1349 OFF = 0;
1350 ON = 1;
1351 }
1352 optional State state = 2;
1353}
1354
1355/**
Tej Singh4503e102018-01-04 14:35:01 -08001356 * Logs wifi multicast locks held by an app
1357 *
1358 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001359 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001360 */
1361message WifiMulticastLockStateChanged {
1362 repeated AttributionNode attribution_node = 1;
1363
1364 enum State {
1365 OFF = 0;
1366 ON = 1;
1367 }
1368 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001369
1370 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001371}
1372
1373/**
Tej Singh1ea42892018-01-19 09:27:00 -08001374 * Logs shutdown reason and duration on next boot.
1375 *
1376 * Logged from:
1377 * frameworks/base/core/java/com/android/server/BootReceiver.java
1378 */
1379message ShutdownSequenceReported {
1380 // True if shutdown is for a reboot. Default: false if we do not know.
1381 optional bool reboot = 1;
1382
1383 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1384 optional string reason = 2;
1385
1386 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1387 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001388 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001389
1390 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001392}
1393
Tej Singh6483ea42018-01-25 17:45:49 -08001394
1395/**
1396 * Logs boot reason and duration.
1397 *
1398 * Logged from:
1399 * system/core/bootstat/bootstat.cpp
1400 */
1401message BootSequenceReported {
1402 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1403 // Default: "<EMPTY>" if not available.
1404 optional string bootloader_reason = 1;
1405
1406 // Reason for system boot. Eg. bootloader, reboot,userrequested
1407 // Default: "<EMPTY>" if not available.
1408 optional string system_reason = 2;
1409
1410 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001411 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001412
1413 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001414 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001415
1416 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001417 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001418
1419 // Time since last boot in ms. Default: 0 if not available.
1420 optional int64 time_since_last_boot = 6;
1421}
1422
Tej Singhc477d9c2018-02-05 18:31:39 -08001423
1424/**
1425 * Logs call state and disconnect cause (if applicable).
1426 *
1427 * Logged from:
1428 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1429 */
1430message CallStateChanged {
1431 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1432 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1433 optional android.telecom.CallStateEnum call_state = 1;
1434
1435 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1436 // This value is only applicable when the call_state is DISCONNECTED, and
1437 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1438 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1439 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1440
1441 // True if the call is self-managed, which are apps that use the
1442 // telecom infrastructure to make their own calls.
1443 optional bool self_managed = 3;
1444
1445 // True if call is external. External calls are calls on connected Wear
1446 // devices but show up in Telecom so the user can pull them onto the device.
1447 optional bool external_call = 4;
1448}
1449
Tej Singh1ea42892018-01-19 09:27:00 -08001450/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001451 * Logs keyguard state. The keyguard is the lock screen.
1452 *
1453 * Logged from:
1454 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1455 */
1456message KeyguardStateChanged {
1457 enum State {
1458 UNKNOWN = 0;
1459 // The keyguard is hidden when the phone is unlocked.
1460 HIDDEN = 1;
1461 // The keyguard is shown when the phone is locked (screen turns off).
1462 SHOWN= 2;
1463 // The keyguard is occluded when something is overlaying the keyguard.
1464 // Eg. Opening the camera while on the lock screen.
1465 OCCLUDED = 3;
1466 }
1467 optional State state = 1;
1468}
1469
1470/**
1471 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1472 * prompts the user to enter a password (pattern, pin, etc).
1473 *
1474 * Logged from:
1475 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1476 */
1477
1478message KeyguardBouncerStateChanged {
1479 enum State {
1480 UNKNOWN = 0;
1481 // Bouncer is hidden, either as a result of successfully entering the
1482 // password, screen timing out, or user going back to lock screen.
1483 HIDDEN = 1;
1484 // This is when the user is being prompted to enter the password.
1485 SHOWN = 2;
1486 }
1487 optional State state = 1;
1488}
1489
1490/**
1491 * Logs the result of entering a password into the keyguard bouncer.
1492 *
1493 * Logged from:
1494 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1495 */
1496message KeyguardBouncerPasswordEntered {
1497 enum BouncerResult {
1498 UNKNOWN = 0;
1499 // The password entered was incorrect.
1500 FAILURE = 1;
1501 // The password entered was correct.
1502 SUCCESS = 2;
1503 }
1504 optional BouncerResult result = 1;
1505}
1506
Tej Singha883b372018-02-15 11:30:01 -08001507/*
1508 * Logs changes to the configuration of the device. The configuration is defined
1509 * in frameworks/base/core/java/android/content/res/Configuration.java
1510 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1511 * Please go there to interpret the possible values each field can be.
1512 *
1513 * Logged from:
1514 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1515 */
1516message ResourceConfigurationChanged {
1517 // Bit mask of color capabilities of the screen.
1518 // Contains information about the color gamut and hdr mode of the screen.
1519 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001520 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001521
1522 // The target screen density being rendered to.
1523 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001524 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001525
1526 // Current user preference for the scaling factor for fonts,
1527 // relative to the base density scaling.
1528 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001529 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001530
1531 // Flag indicating whether the hard keyboard is hidden.
1532 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001533 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001534
1535 // The type of keyboard attached to the device.
1536 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1537 optional int32 keyboard = 5;
1538
1539 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1540 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001541 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001542
1543 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1544 // 0 if undefined.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1546 optional int32 mcc = 7;
1547
1548 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1549 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1550 // MNC_ZERO symbol defined in Configuration.java.
1551 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1552 optional int32 mnc = 8;
1553
1554 // The kind of navigation available on the device.
1555 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1556 optional int32 navigation = 9;
1557
1558 // Flag indicating whether the navigation is available.
1559 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001560 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001561
1562 // Overall orientation of the screen.
1563 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1564 optional int32 orientation = 11;
1565
1566 // The current height of the available screen space, in dp units.
1567 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001568 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001569
1570 // Bit mask of overall layout of the screen.
1571 // Contains information about screen size, whether the screen is wider/taller
1572 // than normal, whether the screen layout is right-tl-left or left-to-right,
1573 // and whether the screen has a rounded shape.
1574 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001575 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001576
1577 // Current width of the available screen space, in dp units.
1578 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001579 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001580
1581 // The smallest screen size an application will see in normal operation.
1582 // This is the smallest value of both screenWidthDp and screenHeightDp
1583 // in portrait and landscape.
1584 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001585 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001586
1587 // The type of touch screen attached to the device.
1588 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1589 optional int32 touchscreen = 16;
1590
1591 // Bit mask of the ui mode.
1592 // Contains information about the overall ui mode of the device.
1593 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1594 // Also contains information about whether the device is in night mode.
1595 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001596 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001597}
1598
Tej Singheee317b2018-03-07 19:28:05 -08001599
1600/**
1601 * Logs changes in the connection state of the mobile radio.
1602 *
1603 * Logged from:
1604 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1605 */
1606message MobileConnectionStateChanged {
1607 // States are from the state machine DataConnection.java.
1608 enum State {
1609 UNKNOWN = 0;
1610 // The connection is inactive, or disconnected.
1611 INACTIVE = 1;
1612 // The connection is being activated, or connecting.
1613 ACTIVATING = 2;
1614 // The connection is active, or connected.
1615 ACTIVE = 3;
1616 // The connection is disconnecting.
1617 DISCONNECTING = 4;
1618 // The connection is disconnecting after creating a connection.
1619 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1620 }
1621 optional State state = 1;
1622 // For multi-sim phones, this distinguishes between the sim cards.
1623 optional int32 sim_slot_index = 2;
1624 // Used to identify the connection. Starts at 0 and increments by 1 for
1625 // every new network created. Resets whenever the device reboots.
1626 optional int32 data_connection_id = 3;
1627 // A bitmask for the capabilities of this connection.
1628 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1629 // Default value (if we have no information): 0
1630 optional int64 capabilities = 4;
1631 // If this connection has internet.
1632 // This just checks if the DEFAULT bit of capabilities is set.
1633 optional bool has_internet = 5;
1634}
1635
1636/**
1637 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1638 *
1639 * Logged from:
1640 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1641 */
1642message MobileRadioTechnologyChanged {
1643 optional android.telephony.NetworkTypeEnum state = 1;
1644 // For multi-sim phones, this distinguishes between the sim cards.
1645 optional int32 sim_slot_index = 2;
1646}
1647
Andrew Chantb56388b2018-03-22 21:07:33 -07001648/**
1649 * Logs the VID and PID of any connected USB devices.
1650 *
1651 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1652 *
1653 * Logged by Vendor.
1654 */
1655message UsbDeviceAttached {
1656 optional int32 vid = 1;
1657 optional int32 pid = 2;
1658 optional bool has_audio = 3;
1659 optional bool has_hid = 4;
1660 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001661 enum State {
1662 STATE_DISCONNECTED = 0;
1663 STATE_CONNECTED = 1;
1664 }
1665 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001666 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001667}
1668
Tej Singheee317b2018-03-07 19:28:05 -08001669
Tej Singhdd7bd352018-02-09 19:33:15 -08001670/**
Tej Singh5d991e12018-03-09 19:48:11 -08001671 * Logs when Bluetooth is enabled and disabled.
1672 *
1673 * Logged from:
1674 * services/core/java/com/android/server/BluetoothManagerService.java
1675 */
1676message BluetoothEnabledStateChanged {
1677 repeated AttributionNode attribution_node = 1;
1678 // Whether or not bluetooth is enabled on the device.
1679 enum State {
1680 UNKNOWN = 0;
1681 ENABLED = 1;
1682 DISABLED = 2;
1683 }
1684 optional State state = 2;
1685 // The reason for being enabled/disabled.
1686 // Eg. Airplane mode, crash, application request.
1687 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1688 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001689 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001690}
1691
1692/**
Jack Hed9837c82019-01-09 01:19:13 -08001693 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001694 *
1695 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001696 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1697 *
1698 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001699 */
1700message BluetoothConnectionStateChanged {
1701 // The state of the connection.
1702 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1703 optional android.bluetooth.ConnectionStateEnum state = 1;
1704 // An identifier that can be used to match connect and disconnect events.
1705 // Currently is last two bytes of a hash of a device level ID and
1706 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001707 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001708 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001709 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1710 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001711 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001712 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001713 // An identifier that can be used to match events for this device.
1714 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1715 // Salt: Randomly generated 256 bit value
1716 // Hash algorithm: HMAC-SHA256
1717 // Size: 32 byte
1718 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001719 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001720}
1721
1722/**
1723 * Logs when a Bluetooth device connects and disconnects over ACL
1724 *
1725 * Logged from:
1726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1727 *
1728 * Next Tag: 3
1729 */
1730message BluetoothAclConnectionStateChanged {
1731 // An identifier that can be used to match events for this device.
1732 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1733 // Salt: Randomly generated 256 bit value
1734 // Hash algorithm: HMAC-SHA256
1735 // Size: 32 byte
1736 // Default: null or empty if the device identifier is not known
1737 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1738 // The state of the connection.
1739 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1740 optional android.bluetooth.ConnectionStateEnum state = 2;
1741}
1742
1743/**
1744 * Logs when a Bluetooth device connects and disconnects over SCO
1745 *
1746 * Logged from:
1747 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1749 *
1750 * Next Tag: 4
1751 */
1752message BluetoothScoConnectionStateChanged {
1753 // An identifier that can be used to match events for this device.
1754 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1755 // Salt: Randomly generated 256 bit value
1756 // Hash algorithm: HMAC-SHA256
1757 // Size: 32 byte
1758 // Default: null or empty if the device identifier is not known
1759 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1760 // The state of the connection.
1761 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1762 optional android.bluetooth.ConnectionStateEnum state = 2;
1763 // Codec used for this SCO connection
1764 // Default: UNKNOWN
1765 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001766}
1767
Jack Hec27040a2019-01-09 20:54:41 -08001768/**
1769 * Logged when active device of a profile changes
1770 *
1771 * Logged from:
1772 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1773 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1774 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1775 */
1776message BluetoothActiveDeviceChanged {
1777 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1778 // From android.bluetooth.BluetoothProfile
1779 optional int32 bt_profile = 1;
1780 // An identifier that can be used to match events for this new active device.
1781 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1782 // Salt: Randomly generated 256 bit value
1783 // Hash algorithm: HMAC-SHA256
1784 // Size: 32 byte
1785 // Default: null or empty if there is no active device for this profile
1786 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1787}
1788
Jack Heab86dbd22018-12-18 15:43:27 -08001789// Logs when there is an event affecting Bluetooth device's link layer connection.
1790// - This event is triggered when there is a related HCI command or event
1791// - Users of this metrics can deduce Bluetooth device's connection state from these events
1792// - HCI commands are logged before the command is sent, after receiving command status, and after
1793// receiving command complete
1794// - HCI events are logged when they arrive
1795//
1796// Low level log from system/bt
1797//
1798// Bluetooth classic commands:
1799// - CMD_CREATE_CONNECTION
1800// - CMD_DISCONNECT
1801// - CMD_CREATE_CONNECTION_CANCEL
1802// - CMD_ACCEPT_CONNECTION_REQUEST
1803// - CMD_REJECT_CONNECTION_REQUEST
1804// - CMD_SETUP_ESCO_CONNECTION
1805// - CMD_ACCEPT_ESCO_CONNECTION
1806// - CMD_REJECT_ESCO_CONNECTION
1807// - CMD_ENH_SETUP_ESCO_CONNECTION
1808// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1809//
1810// Bluetooth low energy commands:
1811// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1812// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1813// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1814// - CMD_BLE_CLEAR_WHITE_LIST
1815// - CMD_BLE_ADD_WHITE_LIST
1816// - CMD_BLE_REMOVE_WHITE_LIST
1817//
1818// Bluetooth classic events:
1819// - EVT_CONNECTION_COMP
1820// - EVT_CONNECTION_REQUEST
1821// - EVT_DISCONNECTION_COMP
1822// - EVT_ESCO_CONNECTION_COMP
1823// - EVT_ESCO_CONNECTION_CHANGED
1824//
1825// Bluetooth low energy meta events:
1826// - BLE_EVT_CONN_COMPLETE_EVT
1827// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1828//
1829// Next tag: 10
1830message BluetoothLinkLayerConnectionEvent {
1831 // An identifier that can be used to match events for this device.
1832 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1833 // Salt: Randomly generated 256 bit value
1834 // Hash algorithm: HMAC-SHA256
1835 // Size: 32 byte
1836 // Default: null or empty if the device identifier is not known
1837 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1838 // Connection handle of this connection if available
1839 // Range: 0x0000 - 0x0EFF (12 bits)
1840 // Default: 0xFFFF if the handle is unknown
1841 optional int32 connection_handle = 2;
1842 // Direction of the link
1843 // Default: DIRECTION_UNKNOWN
1844 optional android.bluetooth.DirectionEnum direction = 3;
1845 // Type of this link
1846 // Default: LINK_TYPE_UNKNOWN
1847 optional android.bluetooth.LinkTypeEnum type = 4;
1848
1849 // Reason metadata for this link layer connection event, rules for interpretation:
1850 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1851 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1852 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1853 // set and valid, ignore hci_ble_event
1854
1855 // HCI command associated with this event
1856 // Default: CMD_UNKNOWN
1857 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1858 // HCI event associated with this event
1859 // Default: EVT_UNKNOWN
1860 optional android.bluetooth.hci.EventEnum hci_event = 6;
1861 // HCI BLE meta event associated with this event
1862 // Default: BLE_EVT_UNKNOWN
1863 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1864 // HCI command status code if this is triggerred by hci_cmd
1865 // Default: STATUS_UNKNOWN
1866 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1867 // HCI reason code associated with this event
1868 // Default: STATUS_UNKNOWN
1869 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1870}
1871
Howard Roe103fe22019-01-17 16:52:16 -08001872/**
1873 * Logs when a module is rolled back by Watchdog.
1874 *
1875 * Logged from: Rollback Manager
1876 */
1877message WatchdogRollbackOccurred {
1878 enum RollbackType {
1879 UNKNOWN = 0;
1880 ROLLBACK_INITIATE = 1;
1881 ROLLBACK_SUCCESS = 2;
1882 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001883 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001884 }
1885 optional RollbackType rollback_type = 1;
1886
1887 optional string package_name = 2;
1888
1889 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001890
1891 enum RollbackReasonType {
1892 REASON_UNKNOWN = 0;
1893 REASON_NATIVE_CRASH = 1;
1894 REASON_EXPLICIT_HEALTH_CHECK = 2;
1895 REASON_APP_CRASH = 3;
1896 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001897 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001898 }
1899 optional RollbackReasonType rollback_reason = 4;
1900
1901 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1902 // is initiated. Empty if the package is unknown.
1903 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001904
1905 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001906}
1907
Jack Hec27040a2019-01-09 20:54:41 -08001908/**
1909 * Logs when there is a change in Bluetooth A2DP playback state
1910 *
1911 * Logged from:
1912 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1913 */
1914message BluetoothA2dpPlaybackStateChanged {
1915 // An identifier that can be used to match events for this device.
1916 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1917 // Salt: Randomly generated 256 bit value
1918 // Hash algorithm: HMAC-SHA256
1919 // Size: 32 byte
1920 // Default: null or empty if the device identifier is not known
1921 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1922 // Current playback state
1923 // Default: PLAYBACK_STATE_UNKNOWN
1924 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1925 // Current audio coding mode
1926 // Default: AUDIO_CODING_MODE_UNKNOWN
1927 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1928}
1929
1930/**
1931 * Logs when there is a change in A2DP codec config for a particular remote device
1932 *
1933 * Logged from:
1934 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1935 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1936 */
1937message BluetoothA2dpCodecConfigChanged {
1938 // An identifier that can be used to match events for this device.
1939 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1940 // Salt: Randomly generated 256 bit value
1941 // Hash algorithm: HMAC-SHA256
1942 // Size: 32 byte
1943 // Default: null or empty if the device identifier is not known
1944 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1945 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1946 // Default SOURCE_CODEC_TYPE_INVALID
1947 optional int32 codec_type = 2;
1948 // Codec priroity, the higher the more preferred, -1 for disabled
1949 // Default: CODEC_PRIORITY_DEFAULT
1950 optional int32 codec_priority = 3;
1951 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1952 // Default: SAMPLE_RATE_NONE
1953 optional int32 sample_rate = 4;
1954 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1955 // Default: BITS_PER_SAMPLE_NONE
1956 optional int32 bits_per_sample = 5;
1957 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1958 // Default: CHANNEL_MODE_NONE
1959 optional int32 channel_mode = 6;
1960 // Codec specific values
1961 // Default 0
1962 optional int64 codec_specific_1 = 7;
1963 optional int64 codec_specific_2 = 8;
1964 optional int64 codec_specific_3 = 9;
1965 optional int64 codec_specific_4 = 10;
1966}
1967
1968/**
1969 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1970 * Each codec's capability is logged separately due to statsd restriction
1971 *
1972 * Logged from:
1973 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1974 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1975 */
1976message BluetoothA2dpCodecCapabilityChanged {
1977 // An identifier that can be used to match events for this device.
1978 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1979 // Salt: Randomly generated 256 bit value
1980 // Hash algorithm: HMAC-SHA256
1981 // Size: 32 byte
1982 // Default: null or empty if the device identifier is not known
1983 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1984 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1985 // Default SOURCE_CODEC_TYPE_INVALID
1986 optional int32 codec_type = 2;
1987 // Codec priroity, the higher the more preferred, -1 for disabled
1988 // Default: CODEC_PRIORITY_DEFAULT
1989 optional int32 codec_priority = 3;
1990 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1991 // in BluetoothCodecConfig
1992 // Default: empty and SAMPLE_RATE_NONE for individual item
1993 optional int32 sample_rate = 4;
1994 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1995 // in BluetoothCodecConfig
1996 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1997 optional int32 bits_per_sample = 5;
1998 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1999 // BluetoothCodecConfig
2000 // Default: empty and CHANNEL_MODE_NONE for individual item
2001 optional int32 channel_mode = 6;
2002 // Codec specific values
2003 // Default 0
2004 optional int64 codec_specific_1 = 7;
2005 optional int64 codec_specific_2 = 8;
2006 optional int64 codec_specific_3 = 9;
2007 optional int64 codec_specific_4 = 10;
2008}
2009
2010/**
2011 * Logs when A2DP failed to read from PCM source.
2012 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2013 *
2014 * Logged from:
2015 * system/bt
2016 */
2017message BluetoothA2dpAudioUnderrunReported {
2018 // An identifier that can be used to match events for this device.
2019 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2020 // Salt: Randomly generated 256 bit value
2021 // Hash algorithm: HMAC-SHA256
2022 // Size: 32 byte
2023 // Default: null or empty if the device identifier is not known
2024 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2025 // Encoding interval in nanoseconds
2026 // Default: 0
2027 optional int64 encoding_interval_nanos = 2;
2028 // Number of bytes of PCM data that could not be read from the source
2029 // Default: 0
2030 optional int32 num_missing_pcm_bytes = 3;
2031}
2032
2033/**
2034 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2035 * buffer queue is full and we have to drop data
2036 *
2037 * Logged from:
2038 * system/bt
2039 */
2040message BluetoothA2dpAudioOverrunReported {
2041 // An identifier that can be used to match events for this device.
2042 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2043 // Salt: Randomly generated 256 bit value
2044 // Hash algorithm: HMAC-SHA256
2045 // Size: 32 byte
2046 // Default: null or empty if the device identifier is not known
2047 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2048 // Encoding interval in nanoseconds
2049 // Default: 0
2050 optional int64 encoding_interval_nanos = 2;
2051 // Number of buffers dropped in this event
2052 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2053 // Default: 0
2054 optional int32 num_dropped_buffers = 3;
2055 // Number of encoded buffers dropped in this event
2056 // Default 0
2057 optional int32 num_dropped_encoded_frames = 4;
2058 // Number of encoded bytes dropped in this event
2059 // Default: 0
2060 optional int32 num_dropped_encoded_bytes = 5;
2061}
2062
2063/**
2064 * Logs when we receive reports regarding a device's RSSI value
2065 *
2066 * Logged from:
2067 * system/bt
2068 */
2069message BluetoothDeviceRssiReported {
2070 // An identifier that can be used to match events for this device.
2071 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2072 // Salt: Randomly generated 256 bit value
2073 // Hash algorithm: HMAC-SHA256
2074 // Size: 32 byte
2075 // Default: null or empty if the device identifier is not known
2076 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2077 // Connection handle of this connection if available
2078 // Range: 0x0000 - 0x0EFF (12 bits)
2079 // Default: 0xFFFF if the handle is unknown
2080 optional int32 connection_handle = 2;
2081 // HCI command status code if this is triggerred by hci_cmd
2082 // Default: STATUS_UNKNOWN
2083 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2084 // BR/EDR
2085 // Range: -128 ≤ N ≤ 127 (signed integer)
2086 // Units: dB
2087 // LE:
2088 // Range: -127 to 20, 127 (signed integer)
2089 // Units: dBm
2090 // Invalid when an out of range value is reported
2091 optional int32 rssi = 4;
2092}
2093
2094/**
2095 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2096 *
2097 * Logged from:
2098 * system/bt
2099 */
2100message BluetoothDeviceFailedContactCounterReported {
2101 // An identifier that can be used to match events for this device.
2102 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2103 // Salt: Randomly generated 256 bit value
2104 // Hash algorithm: HMAC-SHA256
2105 // Size: 32 byte
2106 // Default: null or empty if the device identifier is not known
2107 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2108 // Connection handle of this connection if available
2109 // Range: 0x0000 - 0x0EFF (12 bits)
2110 // Default: 0xFFFF if the handle is unknown
2111 optional int32 connection_handle = 2;
2112 // HCI command status code if this is triggerred by hci_cmd
2113 // Default: STATUS_UNKNOWN
2114 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2115 // Number of consecutive failed contacts for a connection corresponding to the Handle
2116 // Range: uint16_t, 0-0xFFFF
2117 // Default: 0xFFFFF
2118 optional int32 failed_contact_counter = 4;
2119}
2120
2121/**
2122 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2123 *
2124 * Logged from:
2125 * system/bt
2126 */
2127message BluetoothDeviceTxPowerLevelReported {
2128 // An identifier that can be used to match events for this device.
2129 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2130 // Salt: Randomly generated 256 bit value
2131 // Hash algorithm: HMAC-SHA256
2132 // Size: 32 byte
2133 // Default: null or empty if the device identifier is not known
2134 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2135 // Connection handle of this connection if available
2136 // Range: 0x0000 - 0x0EFF (12 bits)
2137 // Default: 0xFFFF if the handle is unknown
2138 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002139 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002140 // Default: STATUS_UNKNOWN
2141 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2142 // Range: -30 ≤ N ≤ 20
2143 // Units: dBm
2144 // Invalid when an out of range value is reported
2145 optional int32 transmit_power_level = 4;
2146}
Jack Heab86dbd22018-12-18 15:43:27 -08002147
Tej Singh5d991e12018-03-09 19:48:11 -08002148/**
Jack He1021a612019-01-20 21:22:46 -08002149 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2150 * receiving an HCI command from the host
2151 *
2152 * Logged from: system/bt
2153 */
2154message BluetoothHciTimeoutReported {
2155 // HCI command associated with this event
2156 // Default: CMD_UNKNOWN
2157 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2158}
2159
2160/**
2161 * Logs when we receive Bluetooth Link Quality Report event from the controller
2162 * See Android Bluetooth HCI specification for more details
2163 *
2164 * Note: all count and bytes field are counted since last event
2165 *
2166 * Logged from: system/bt
2167 */
2168message BluetoothQualityReportReported {
2169 // Quality report ID
2170 // Original type: uint8_t
2171 // Default: BQR_ID_UNKNOWN
2172 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2173 // Packet type of the connection
2174 // Original type: uint8_t
2175 // Default: BQR_PACKET_TYPE_UNKNOWN
2176 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2177 // Connection handle of the connection
2178 // Original type: uint16_t
2179 optional int32 connection_handle = 3;
2180 // Performing Role for the connection
2181 // Original type: uint8_t
2182 optional int32 connection_role = 4;
2183 // Current Transmit Power Level for the connection. This value is the same as the controller's
2184 // response to the HCI_Read_Transmit_Power_Level HCI command
2185 // Original type: uint8_t
2186 optional int32 tx_power_level = 5;
2187 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2188 // absolute receiver signal strength value
2189 // Original type: int8_t
2190 optional int32 rssi = 6;
2191 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2192 // channels used by the link currently
2193 // Original type: uint8_t
2194 optional int32 snr = 7;
2195 // Indicates the number of unused channels in AFH_channel_map
2196 // Original type: uint8_t
2197 optional int32 unused_afh_channel_count = 8;
2198 // Indicates the number of the channels which are interfered and quality is bad but are still
2199 // selected for AFH
2200 // Original type: uint8_t
2201 optional int32 afh_select_unideal_channel_count = 9;
2202 // Current Link Supervision Timeout Setting
2203 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2204 // Original type: uint16_t
2205 optional int32 lsto = 10;
2206 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2207 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2208 // 0x01 (Piconet Clock)
2209 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2210 // Original type: uint32_t
2211 optional int64 connection_piconet_clock = 11;
2212 // The count of retransmission
2213 // Original type: uint32_t
2214 optional int64 retransmission_count = 12;
2215 // The count of no RX
2216 // Original type: uint32_t
2217 optional int64 no_rx_count = 13;
2218 // The count of NAK (Negative Acknowledge)
2219 // Original type: uint32_t
2220 optional int64 nak_count = 14;
2221 // Controller timestamp of last TX ACK
2222 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2223 // Original type: uint32_t
2224 optional int64 last_tx_ack_timestamp = 15;
2225 // The count of Flow-off (STOP)
2226 // Original type: uint32_t
2227 optional int64 flow_off_count = 16;
2228 // Controller timestamp of last Flow-on (GO)
2229 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2230 // Original type: uint32_t
2231 optional int64 last_flow_on_timestamp = 17;
2232 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2233 // Original type: uint32_t
2234 optional int64 buffer_overflow_bytes = 18;
2235 // Buffer underflow count (in byte) since last event
2236 // Original type: uint32_t
2237 optional int64 buffer_underflow_bytes = 19;
2238}
2239
2240/**
2241 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2242 *
2243 * Notes:
2244 * - Each event can be partially filled as we might learn different pieces of device
2245 * information at different time
2246 * - Multiple device info events can be combined to give more complete picture
2247 * - When multiple device info events tries to describe the same information, the
2248 * later one wins
2249 *
2250 * Logged from:
2251 * packages/apps/Bluetooth
2252 */
Jack Heaea26982019-04-04 11:19:48 -07002253message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002254 // An identifier that can be used to match events for this device.
2255 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2256 // Salt: Randomly generated 256 bit value
2257 // Hash algorithm: HMAC-SHA256
2258 // Size: 32 byte
2259 // Default: null or empty if the device identifier is not known
2260 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2261 // Where is this device info obtained from
2262 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2263 // Name of the data source
2264 // For EXTERNAL: package name of the data source
2265 // For INTERNAL: null for general case, component name otherwise
2266 optional string source_name = 3;
2267 // Name of the manufacturer of this device
2268 optional string manufacturer = 4;
2269 // Model of this device
2270 optional string model = 5;
2271 // Hardware version of this device
2272 optional string hardware_version = 6;
2273 // Software version of this device
2274 optional string software_version = 7;
2275}
2276
2277/**
2278 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2279 * device, as documented by the Bluetooth Core HCI specification
2280 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2281 * Vol 2, Part E, Page 1118
2282 *
2283 * Logged from:
2284 * system/bt
2285 */
2286message BluetoothRemoteVersionInfoReported {
2287 // Connection handle of the connection
2288 // Original type: uint16_t
2289 optional int32 connection_handle = 1;
2290 // HCI command status code
2291 // Default: STATUS_UNKNOWN
2292 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2293 // 1 byte Version of current LMP in the remote controller
2294 optional int32 lmp_version = 3;
2295 // 2 bytes LMP manufacturer code of the remote controller
2296 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2297 optional int32 lmp_manufacturer_code = 4;
2298 // 4 bytes subversion of the LMP in the remote controller
2299 optional int32 lmp_subversion = 5;
2300}
2301
2302/**
2303 * Logs when certain Bluetooth SDP attributes are discovered
2304 * Constant definitions are from:
2305 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2306 *
2307 * Current logged attributes:
2308 * - BluetoothProfileDescriptorList
2309 * - Supported Features Bitmask
2310 *
2311 * Logged from:
2312 * system/bt
2313 */
2314message BluetoothSdpAttributeReported {
2315 // An identifier that can be used to match events for this device.
2316 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2317 // Salt: Randomly generated 256 bit value
2318 // Hash algorithm: HMAC-SHA256
2319 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2320 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2321 // Original type: uint16_t
2322 optional int32 protocol_uuid = 2;
2323 // Short form UUIDs used to identify Bluetooth SDP attribute types
2324 // Original type: uint16_t
2325 optional int32 attribute_id = 3;
2326 // Attribute value for the particular attribute
2327 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2328}
2329
2330/**
2331 * Logs when bond state of a Bluetooth device changes
2332 *
2333 * Logged from:
2334 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2335 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2336 */
2337message BluetoothBondStateChanged {
2338 // An identifier that can be used to match events for this device.
2339 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2340 // Salt: Randomly generated 256 bit value
2341 // Hash algorithm: HMAC-SHA256
2342 // Size: 32 byte
2343 // Default: null or empty if the device identifier is not known
2344 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2345 // Preferred transport type to remote dual mode device
2346 // Default: TRANSPORT_AUTO means no preference
2347 optional android.bluetooth.TransportTypeEnum transport = 2;
2348 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2349 // Default: UNKNOWN
2350 optional android.bluetooth.DeviceTypeEnum type = 3;
2351 // Current bond state (NONE, BONDING, BONDED)
2352 // Default: BOND_STATE_UNKNOWN
2353 optional android.bluetooth.BondStateEnum bond_state = 4;
2354 // Bonding sub state
2355 // Default: BOND_SUB_STATE_UNKNOWN
2356 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2357 // Unbond Reason
2358 // Default: UNBOND_REASON_UNKNOWN
2359 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2360}
2361
2362/**
2363 * Logs there is an event related Bluetooth classic pairing
2364 *
2365 * Logged from:
2366 * system/bt
2367 */
2368message BluetoothClassicPairingEventReported {
2369 // An identifier that can be used to match events for this device.
2370 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2371 // Salt: Randomly generated 256 bit value
2372 // Hash algorithm: HMAC-SHA256
2373 // Size: 32 byte
2374 // Default: null or empty if the device identifier is not known
2375 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2376 // Connection handle of this connection if available
2377 // Range: 0x0000 - 0x0EFF (12 bits)
2378 // Default: 0xFFFF if the handle is unknown
2379 optional int32 connection_handle = 2;
2380 // HCI command associated with this event
2381 // Default: CMD_UNKNOWN
2382 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2383 // HCI event associated with this event
2384 // Default: EVT_UNKNOWN
2385 optional android.bluetooth.hci.EventEnum hci_event = 4;
2386 // HCI command status code if this is triggerred by hci_cmd
2387 // Default: STATUS_UNKNOWN
2388 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2389 // HCI reason code associated with this event
2390 // Default: STATUS_UNKNOWN
2391 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002392 // A status value related to this specific event
2393 // Default: 0
2394 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002395}
2396
2397/**
2398 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2399 *
2400 * Logged from:
2401 * system/bt
2402 */
2403message BluetoothSmpPairingEventReported {
2404 // An identifier that can be used to match events for this device.
2405 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2406 // Salt: Randomly generated 256 bit value
2407 // Hash algorithm: HMAC-SHA256
2408 // Size: 32 byte
2409 // Default: null or empty if the device identifier is not known
2410 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2411 // SMP command sent or received over L2CAP
2412 // Default: CMD_UNKNOWN
2413 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2414 // Whether this command is sent or received
2415 // Default: DIRECTION_UNKNOWN
2416 optional android.bluetooth.DirectionEnum direction = 3;
2417 // SMP failure reason code
2418 // Default: PAIRING_FAIL_REASON_DEFAULT
2419 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2420}
2421
2422/**
Jack He815cdba2019-01-30 17:24:55 -08002423 * Logs when a Bluetooth socket’s connection state changed
2424 *
2425 * Logged from:
2426 * system/bt
2427 */
2428message BluetoothSocketConnectionStateChanged {
2429 // An identifier that can be used to match events for this device.
2430 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2431 // Salt: Randomly generated 256 bit value
2432 // Hash algorithm: HMAC-SHA256
2433 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002434 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002435 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002436 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002437 // Default 0 when unknown or don't care
2438 optional int32 port = 2;
2439 // Socket type as mentioned in
2440 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2441 // Default: SOCKET_TYPE_UNKNOWN
2442 optional android.bluetooth.SocketTypeEnum type = 3;
2443 // Socket connection state
2444 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2445 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2446 // Number of bytes sent to remote device during this connection
2447 optional int64 tx_bytes = 5;
2448 // Number of bytes received from remote device during this connection
2449 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002450 // Socket owner's UID
2451 optional int32 uid = 7 [(is_uid) = true];
2452 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2453 // |port| must be spawned by |server_port|
2454 // Default 0 when unknown or don't care
2455 optional int32 server_port = 8;
2456 // Whether this is a server listener socket
2457 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002458}
2459
2460/**
Jack He71426802019-04-02 13:32:52 -07002461 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2462 *
2463 * Logged from:
2464 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2465 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2466 *
2467 */
2468message BluetoothClassOfDeviceReported {
2469 // An identifier that can be used to match events for this device.
2470 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2471 // Salt: Randomly generated 256 bit value
2472 // Hash algorithm: HMAC-SHA256
2473 // Size: 32 byte
2474 // Default: null or empty if this is a server listener socket
2475 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2476 // Class of Device (CoD) value including both Major, Minor device class and service class
2477 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2478 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2479 // Default: 0
2480 optional int32 class_of_device = 2;
2481}
2482
2483/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002484 * Logs when something is plugged into or removed from the USB-C connector.
2485 *
2486 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002487 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002488 */
2489message UsbConnectorStateChanged {
2490 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002491 STATE_DISCONNECTED = 0;
2492 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002493 }
2494 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002495 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002496 // Last active session in ms.
2497 // 0 when the port is in connected state.
2498 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002499}
2500
2501/**
2502 * Logs the reported speaker impedance.
2503 *
2504 * Logged from:
2505 * Vendor audio implementation.
2506 */
2507message SpeakerImpedanceReported {
2508 optional int32 speaker_location = 1;
2509 optional int32 impedance = 2;
2510}
2511
2512/**
2513 * Logs the report of a failed hardware.
2514 *
2515 * Logged from:
2516 * Vendor HALs.
2517 *
2518 */
2519message HardwareFailed {
2520 enum HardwareType {
2521 HARDWARE_FAILED_UNKNOWN = 0;
2522 HARDWARE_FAILED_MICROPHONE = 1;
2523 HARDWARE_FAILED_CODEC = 2;
2524 HARDWARE_FAILED_SPEAKER = 3;
2525 HARDWARE_FAILED_FINGERPRINT = 4;
2526 }
2527 optional HardwareType hardware_type = 1;
2528
Maggie White6dcd8572019-01-31 14:11:50 -08002529 /**
2530 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002531 * the same hardware_type. The specific locations are vendor defined integers,
2532 * referring to board-specific numbering schemes.
2533 */
2534 optional int32 hardware_location = 2;
2535
Maggie White6dcd8572019-01-31 14:11:50 -08002536 /**
2537 * failure_code is specific to the HardwareType of the failed hardware.
2538 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002539 */
Maggie White6dcd8572019-01-31 14:11:50 -08002540 enum HardwareErrorCode {
2541 UNKNOWN = 0;
2542 COMPLETE = 1;
2543 SPEAKER_HIGH_Z = 2;
2544 SPEAKER_SHORT = 3;
2545 FINGERPRINT_SENSOR_BROKEN = 4;
2546 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002547 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002548 }
2549 optional int32 failure_code = 3;
2550}
2551
2552/**
2553 * Log an event when the device has been physically dropped.
2554 * Reported from the /vendor partition.
2555 */
2556message PhysicalDropDetected {
2557 // Confidence that the event was actually a drop, 0 -> 100
2558 optional int32 confidence_pctg = 1;
2559 // Peak acceleration of the drop, in 1/1000s of a g.
2560 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002561 // Duration of freefall in ms
2562 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002563}
2564
2565/**
2566 * Log bucketed battery charge cycles.
2567 *
2568 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002569 * a given charge point. For example, if 10 cycle buckets are
2570 * initialized, bucket 1 is the lowest 1/10th of the battery,
2571 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002572 *
2573 * Logged from:
2574 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2575 */
2576message ChargeCyclesReported {
2577 optional int32 cycle_bucket_1 = 1;
2578 optional int32 cycle_bucket_2 = 2;
2579 optional int32 cycle_bucket_3 = 3;
2580 optional int32 cycle_bucket_4 = 4;
2581 optional int32 cycle_bucket_5 = 5;
2582 optional int32 cycle_bucket_6 = 6;
2583 optional int32 cycle_bucket_7 = 7;
2584 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002585 optional int32 cycle_bucket_9 = 9;
2586 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002587}
2588
2589/**
Howard Roa46b6582018-09-18 16:45:02 -07002590 * Log battery health snapshot.
2591 *
2592 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2593 * are snapshotted periodically over 24hrs.
2594 */
2595message BatteryHealthSnapshot {
2596 enum BatterySnapshotType {
2597 UNKNOWN = 0;
2598 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2599 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2600 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2601 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2602 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2603 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2604 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2605 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2606 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2607 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2608 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2609 }
2610 optional BatterySnapshotType type = 1;
2611 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002612 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002613 // Voltage Battery Voltage, in microVolts.
2614 optional int32 voltage_micro_volt = 3;
2615 // Current Battery current, in microAmps.
2616 optional int32 current_micro_amps = 4;
2617 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2618 optional int32 open_circuit_micro_volt = 5;
2619 // Resistance Battery Resistance, in microOhms.
2620 optional int32 resistance_micro_ohm = 6;
2621 // Level Battery Level, as % of full.
2622 optional int32 level_percent = 7;
2623}
2624
2625/**
2626 * Log slow I/O operations on the primary storage.
2627 */
2628message SlowIo {
2629 // Classifications of IO Operations.
2630 enum IoOperation {
2631 UNKNOWN = 0;
2632 READ = 1;
2633 WRITE = 2;
2634 UNMAP = 3;
2635 SYNC = 4;
2636 }
2637 optional IoOperation operation = 1;
2638
2639 // The number of slow IO operations of this type over 24 hours.
2640 optional int32 count = 2;
2641}
2642
2643/**
2644 * Log battery caused shutdown with the last recorded voltage.
2645 */
2646message BatteryCausedShutdown {
2647 // The last recorded battery voltage prior to shutdown.
2648 optional int32 last_recorded_micro_volt = 1;
2649}
2650
2651/**
Tej Singha72344992019-04-17 18:55:08 -07002652 * Logs when ThermalService receives throttling events.
2653 *
2654 * Logged from:
2655 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2656 */
2657message ThermalThrottlingSeverityStateChanged {
2658 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2659 optional android.os.TemperatureTypeEnum sensor_type = 1;
2660
2661 // The name of the temperature source. Eg. CPU0
2662 optional string sensor_name = 2;
2663
2664 // Temperature in tenths of a degree C.
2665 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2666 optional int32 temperature_deci_celsius = 3;
2667
2668 // Relative severity of the throttling, see enum definition.
2669 optional android.os.ThrottlingSeverityEnum severity = 4;
2670}
2671
2672/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002673 * Logs the duration of a davey (jank of >=700ms) when it occurs
2674 *
2675 * Logged from:
2676 * frameworks/base/libs/hwui/JankTracker.cpp
2677 */
2678message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002679 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002680 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002681
Tej Singhbb8554a2018-01-26 11:59:14 -08002682 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002683 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002684}
2685
2686/**
Bookatze5885242017-10-24 20:10:31 -07002687 * Logs phone signal strength changes.
2688 *
2689 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002690 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002691 */
2692message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002693 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2694 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002695}
2696
Yangster4ccebea2018-10-09 17:09:02 -07002697
2698/**
2699 * Logs when the phone state, sim state or signal strength changes
2700 *
2701 * Logged from:
2702 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2703 */
2704message PhoneServiceStateChanged {
2705 optional android.telephony.ServiceStateEnum state = 1;
2706 optional android.telephony.SimStateEnum sim_state = 2;
2707 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2708}
2709
2710/**
2711 * Logs when the phone becomes on or off.
2712 *
2713 * Logged from:
2714 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2715 */
2716message PhoneStateChanged {
2717 enum State {
2718 OFF = 0;
2719 ON = 1;
2720 }
2721 optional State state = 1;
2722}
2723
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002724message BackGesture {
2725 enum BackType {
2726 DEFAULT_BACK_TYPE = 0;
2727 COMPLETED = 1;
2728 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2729 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2730 INCOMPLETE = 4;
2731 }
2732 optional BackType type = 1;
2733
2734 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2735 enum WindowHorizontalLocation {
2736 DEFAULT_LOCATION = 0;
2737 LEFT = 1;
2738 RIGHT = 2;
2739 }
2740 optional WindowHorizontalLocation x_location = 3;
2741}
2742
2743message ExclusionRectStateChanged {
2744 optional string component_name = 1; // if not available, simply packageName
2745 optional int32 requested_height = 2; // px
2746 optional int32 rejected_height = 3; // px
2747
2748 enum WindowHorizontalLocation {
2749 DEFAULT_LOCATION = 0;
2750 LEFT = 1;
2751 RIGHT = 2;
2752 }
2753 optional WindowHorizontalLocation x_location = 4;
2754 optional bool landscape = 5;
2755 optional bool splitscreen = 6;
2756 optional int32 duration_millis = 7;
2757}
2758
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002759message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002760 optional android.stats.launcher.LauncherAction action = 1;
2761 optional android.stats.launcher.LauncherState src_state = 2;
2762 optional android.stats.launcher.LauncherState dst_state = 3;
2763 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002764 optional bool is_swipe_up_enabled = 5;
2765}
2766
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002767message StyleUIChanged {
2768 optional android.stats.style.Action action = 1;
2769 optional int32 color_package_hash = 2;
2770 optional int32 font_package_hash = 3;
2771 optional int32 shape_package_hash = 4;
2772 optional int32 clock_package_hash = 5;
2773 optional int32 launcher_grid = 6;
2774 optional int32 wallpaper_category_hash = 7;
2775 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002776 optional int32 color_preference = 9;
2777 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002778}
2779
David Chenc28b2bb2017-10-24 12:52:52 -07002780/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002781 * Logs when Settings UI has changed.
2782 *
2783 * Logged from:
2784 * packages/apps/Settings
2785 */
2786message SettingsUIChanged {
2787 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002788 * Where this SettingsUIChange event comes from. For example, if
2789 * it's a PAGE_VISIBLE event, where the page is opened from.
2790 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002791 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002792
2793 /**
2794 * What the UI action is.
2795 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002796 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002797
2798 /**
2799 * Where the action is happening
2800 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002801 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002802
2803 /**
2804 * What preference changed in this event.
2805 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002806 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002807
2808 /**
2809 * The new value of the changed preference.
2810 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002811 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002812}
2813
2814/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002815 * Logs basic timing information about touch events.
2816 * Reported at most every 5 minutes while device is being interacted with.
2817 *
2818 * Logged from:
2819 * frameworks/native/services/inputflinger
2820 */
2821message TouchEventReported {
2822 /**
2823 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002824 * and the standard deviation of the time spent processing touchscreen events
2825 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002826 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002827 * On supported devices, the starting point is taken during the hard interrupt inside the
2828 * kernel touch driver. On all other devices, the starting point is taken inside
2829 * the kernel's input event subsystem upon receipt of the input event.
2830 * The ending point is taken inside InputDispatcher, just after the input event
2831 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002832 */
2833 // Minimum value
2834 optional float latency_min_micros = 1;
2835 // Maximum value
2836 optional float latency_max_micros = 2;
2837 // Average value
2838 optional float latency_mean_micros = 3;
2839 // Standard deviation
2840 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002841 // Number of touch events (input_event) in this report
2842 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002843}
2844
2845/**
Philip Quinn0eded622019-01-29 12:46:28 -08002846 * Logs gesture classification and timing information for touch events.
2847 *
2848 * Logged from:
2849 * frameworks/base/core/java/android/view/GestureDetector.java
2850 * frameworks/base/core/java/android/view/View.java
2851 */
2852message TouchGestureClassified {
2853 // The source of the classification (e.g. Java class name).
2854 optional string source = 1;
2855
2856 enum Classification {
2857 UNKNOWN_CLASSIFICATION = 0;
2858 SINGLE_TAP = 1;
2859 DOUBLE_TAP = 2;
2860 LONG_PRESS = 3;
2861 DEEP_PRESS = 4;
2862 SCROLL = 5;
2863 }
2864 // The classification of the gesture.
2865 optional Classification classification = 2;
2866
2867 // The interval from the start of a touch event stream until the
2868 // classification was made.
2869 optional int32 latency_millis = 3;
2870
2871 // The distance from the location of the first touch event to the
2872 // location of the touch event when the classification was made.
2873 optional float displacement_px = 4;
2874}
2875
2876/**
David Chenc28b2bb2017-10-24 12:52:52 -07002877 * Logs that a setting was updated.
2878 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002879 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002880 * The tag and is_default allow resetting of settings to default values based on the specified
2881 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2882 */
2883message SettingChanged {
2884 // The name of the setting.
2885 optional string setting = 1;
2886
2887 // The change being imposed on this setting. May represent a number, eg "3".
2888 optional string value = 2;
2889
2890 // The new value of this setting. For most settings, this is same as value. For some settings,
2891 // value is +X or -X where X represents an element in a set. For example, if the previous value
2892 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2893 // The +/- feature is currently only used for location_providers_allowed.
2894 optional string new_value = 3;
2895
2896 // The previous value of this setting.
2897 optional string prev_value = 4;
2898
2899 // The tag used with the is_default for resetting sets of settings. This is generally null.
2900 optional string tag = 5;
2901
Bookatz90867622018-01-31 15:05:57 -08002902 // True if this setting with tag should be resettable.
2903 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002904
David Chenbd789912018-03-16 17:19:55 -07002905 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002906 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002907
2908 enum ChangeReason {
2909 UPDATED = 1; // Updated can be an insertion or an update.
2910 DELETED = 2;
2911 }
2912 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002913}
Chenjie Yub3dda412017-10-24 13:41:59 -07002914
Chenjie Yu05013b32017-11-21 10:21:41 -08002915/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002916 * Logs activity going to foreground or background
2917 *
2918 * Logged from:
2919 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2920 */
2921message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002922 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002923 optional string pkg_name = 2;
2924 optional string class_name = 3;
2925
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002926 enum State {
2927 BACKGROUND = 0;
2928 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002929 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002930 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002931}
David Chenc8a43242017-10-17 16:23:28 -07002932
2933/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002934 * Logs when a volume entered low Storage state.
2935 * Logged from:
2936 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2937 */
2938message LowStorageStateChanged {
2939 // Volume that ran out of storage.
2940 optional string volume_description = 1;
2941
2942 enum State {
2943 UNKNOWN = 0;
2944 OFF = 1;
2945 ON = 2;
2946 }
2947 optional State state = 2;
2948}
2949
2950/**
2951 * Logs when an app is downgraded.
2952 * Logged from:
2953 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2954 */
2955message AppDowngraded {
2956 optional string package_name = 1;
2957 // Size of the package (all data) before being downgraded.
2958 optional int64 size_in_bytes_before = 2;
2959 // Size of the package (all data) after being downgraded.
2960 optional int64 size_in_bytes_after = 3;
2961
2962 optional bool aggressive = 4;
2963}
2964
2965/**
2966 * Logs when an app is optimized after being downgraded.
2967 * Logged from:
2968 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2969 */
2970message AppOptimizedAfterDowngraded {
2971 optional string package_name = 1;
2972}
2973
2974/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002975 * Logs whenever an app is installed on external storage.
2976 * Logged from:
2977 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2978 */
2979message AppInstallOnExternalStorageReported {
2980 // The type of external storage.
2981 optional android.stats.storage.ExternalStorageType storage_type = 1;
2982 // The name of the package that is installed on the sd card.
2983 optional string package_name = 2;
2984}
2985
2986/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002987 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002988 * Logged from:
2989 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2990 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002991message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002992 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002993
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002994 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002995
2996 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002997 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002998 optional string process_name = 3;
2999
3000 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003001 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003002
3003 optional string package_name = 5;
3004
3005 enum InstantApp {
3006 UNAVAILABLE = 0;
3007 FALSE = 1;
3008 TRUE = 2;
3009 }
3010 optional InstantApp is_instant_app = 6;
3011
3012 enum ForegroundState {
3013 UNKNOWN = 0;
3014 BACKGROUND = 1;
3015 FOREGROUND = 2;
3016 }
3017 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003018
3019 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020}
David Chen9e3808c2017-11-20 17:25:34 -08003021
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003022/**
3023 * Logs when a WTF (What a Terrible Failure) happened.
3024 * Logged from:
3025 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3026 */
3027message WTFOccurred {
3028 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003029
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003030 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003031
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003032 // The name of the process.
3033 // system_server if it is not by an app
3034 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003035
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003036 // The pid if available. -1 means not available.
3037 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003038
3039 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003040}
3041
3042/**
3043 * Logs when system server reports low memory.
3044 * Logged from:
3045 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3046 */
3047message LowMemReported {
3048}
3049
3050/**
3051 * Logs when an app ANR (App Not Responding) occurs.
3052 * Logged from:
3053 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3054 */
3055message ANROccurred {
3056 optional int32 uid = 1 [(is_uid) = true];
3057
3058 optional string process_name = 2;
3059
3060 optional string short_component_name = 3;
3061
3062 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003063
3064 enum InstantApp {
3065 UNAVAILABLE = 0;
3066 FALSE = 1;
3067 TRUE = 2;
3068 }
3069 optional InstantApp is_instant_app = 5;
3070
3071 enum ForegroundState {
3072 UNKNOWN = 0;
3073 BACKGROUND = 1;
3074 FOREGROUND = 2;
3075 }
3076 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003077
3078 optional android.server.ErrorSource error_source = 7;
3079
3080 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003081}
3082
Bookatza7020bd2018-08-28 16:29:35 -07003083/**
3084 * Logs when the vibrator state changes.
3085 * Logged from:
3086 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3087 */
3088message VibratorStateChanged {
3089 repeated AttributionNode attribution_node = 1;
3090
3091 enum State {
3092 OFF = 0;
3093 ON = 1;
3094 }
3095 optional State state = 2;
3096
3097 // Duration (in milliseconds) requested to keep the vibrator on.
3098 // Only applicable for State == ON.
3099 optional int64 duration_millis = 3;
3100}
3101
David Chen0a368b22017-12-06 16:28:16 -08003102/*
3103 * Allows other apps to push events into statsd.
3104 * Logged from:
3105 * frameworks/base/core/java/android/util/StatsLog.java
3106 */
David Chen0b5c90c2018-01-25 16:51:49 -08003107message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003108 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003109 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003110
3111 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3112 optional int32 label = 2;
3113
3114 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3115 // predicates for the metrics).
3116 enum State {
3117 UNKNOWN = 0;
3118 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3119 STOP = 2;
3120 START = 3;
3121 }
3122 optional State state = 3;
3123}
3124
David Chen9e3808c2017-11-20 17:25:34 -08003125/**
Bookatz7948c872018-09-04 12:58:33 -07003126 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3127 * For example, this could be due to the user manually changing the time.
3128 *
3129 * Logged from:
3130 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3131 */
3132message WallClockTimeShifted {
3133 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3134 optional int64 wall_clock_timestamp_millis = 1;
3135}
3136
3137/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003138 * Logs when statsd detects an anomaly.
3139 *
3140 * Logged from:
3141 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3142 */
3143message AnomalyDetected {
3144 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003145 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003146
Yangster-mac94e197c2018-01-02 16:03:03 -08003147 // Id of the config whose anomaly detection alert fired.
3148 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003149
Yangster-mac94e197c2018-01-02 16:03:03 -08003150 // Id of the alert (i.e. name of the anomaly that was detected).
3151 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003152}
3153
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003154message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003155 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003156 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003157
3158 // The app package name.
3159 optional string pkg_name = 2;
3160
3161 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003162 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003163 WARM = 1;
3164 HOT = 2;
3165 COLD = 3;
3166 }
3167 // The transition type.
3168 optional TransitionType type = 3;
3169
3170 // The activity name.
3171 optional string activity_name = 4;
3172
3173 // The name of the calling app. Empty if not set.
3174 optional string calling_pkg_name = 5;
3175
3176 // Whether the app is an instant app.
3177 optional bool is_instant_app = 6;
3178
3179 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003180 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003181
Bookatz80d11a02018-01-16 10:46:35 -08003182 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003183
David Chen0b5c90c2018-01-25 16:51:49 -08003184 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003186 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003187 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003188 optional int32 bind_application_delay_millis = 11;
3189 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003190
3191 // Empty if not set.
3192 optional string launch_token = 13;
3193
Calin Juravle759fbda2018-02-20 19:52:30 +00003194 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003195 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003196
3197 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003198 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003199}
3200
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003201message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003202 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003203 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204
3205 // The app package name.
3206 optional string pkg_name = 2;
3207
3208 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003209 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210 WARM = 1;
3211 HOT = 2;
3212 COLD = 3;
3213 }
3214 // The transition type.
3215 optional TransitionType type = 3;
3216
3217 // The activity name.
3218 optional string activity_name = 4;
3219}
3220
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003221message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003222 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003223 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003224
3225 // The app package name.
3226 optional string pkg_name = 2;
3227
3228 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003229 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003230 WITH_BUNDLE = 1;
3231 WITHOUT_BUNDLE = 2;
3232 }
3233 // The transition type.
3234 optional TransitionType type = 3;
3235
3236 // The activity name.
3237 optional string activity_name = 4;
3238
3239 optional bool transition_process_running = 5;
3240
3241 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003242 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003243}
3244
Bookatz8fcd09a2017-12-18 13:01:10 -08003245/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003246 * Logs a picture-in-picture action
3247 * Logged from:
3248 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3249 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3250 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3251 */
3252message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003253 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003254 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003255
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003256 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003257
Chenjie Yu52cacc62017-12-08 18:11:45 -08003258 enum State {
3259 ENTERED = 1;
3260 EXPANDED_TO_FULL_SCREEN = 2;
3261 MINIMIZED = 3;
3262 DISMISSED = 4;
3263 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003264 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003265}
3266
3267/**
Chenjie Yue8904192017-12-08 19:12:57 -08003268 * Logs overlay action
3269 * Logged from:
3270 * services/core/java/com/android/server/wm/Session.java
3271 */
3272message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003273 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003274
tsaichristine5adc7e02020-01-14 17:07:39 -08003275 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003276
3277 optional bool using_alert_window = 3;
3278
3279 enum State {
3280 ENTERED = 1;
3281 EXITED = 2;
3282 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003283 optional State state = 4 [
3284 (state_field_option).option = EXCLUSIVE_STATE,
3285 (state_field_option).nested = false,
3286 (state_field_option).default_state_value = 2
3287 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003288}
3289
Adam Bookatz38767932020-02-05 12:13:40 -08003290/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003291 * Logs foreground service starts and stops.
3292 * Note that this is not when a service starts or stops, but when it is
3293 * considered foreground.
3294 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003295 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003296 */
3297message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003298 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003299 // package_name + "/" + class_name
3300 optional string short_name = 2;
3301
3302 enum State {
3303 ENTER = 1;
3304 EXIT = 2;
3305 }
3306 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003307
3308 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3309 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3310 optional bool allow_while_in_use_permission = 4;
3311}
3312
3313/**
3314 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3315 * A foreground service session is any continuous period during which the uid holds at least one
3316 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3317 * Accesses initiated while the uid is in the TOP state are ignored.
3318 * Sessions with no attempted accesses are not logged.
3319 * Logged from
3320 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3321 */
3322message ForegroundServiceAppOpSessionEnded {
3323 optional int32 uid = 1 [(is_uid) = true];
3324
3325 // The operation's name.
3326 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3327 // Only these named ops are actually logged.
3328 enum AppOpName {
3329 OP_NONE = -1; // Also represents UNKNOWN.
3330 OP_COARSE_LOCATION = 0;
3331 OP_FINE_LOCATION = 1;
3332 OP_CAMERA = 26;
3333 OP_RECORD_AUDIO = 27;
3334 }
3335 optional AppOpName app_op_name = 2 [default = OP_NONE];
3336
3337 // The uid's permission mode for accessing the AppOp during this fgs session.
3338 enum Mode {
3339 MODE_UNKNOWN = 0;
3340 MODE_ALLOWED = 1; // Always allowed
3341 MODE_IGNORED = 2; // Denied
3342 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3343 }
3344 optional Mode app_op_mode = 3;
3345
3346 // Number of times this AppOp was requested and allowed.
3347 optional int32 count_ops_accepted = 4;
3348 // Number of times this AppOp was requested but denied.
3349 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003350}
3351
Chenjie Yue8904192017-12-08 19:12:57 -08003352/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003353 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3354 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3355 * attributed back to the parent (host) uid. One example is Chrome.
3356 *
3357 * Logged from:
3358 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3359 */
3360message IsolatedUidChanged {
3361 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003362 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003363 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003364 optional int32 parent_uid = 1;
3365
3366 optional int32 isolated_uid = 2;
3367
3368 // We expect an isolated uid to be removed before if it's used for another parent uid.
3369 enum Event {
3370 REMOVED = 0;
3371 CREATED = 1;
3372 }
3373 optional Event event = 3;
3374}
3375
3376/*
3377 * Logs the reception of an incoming network packet causing the main system to wake up for
3378 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3379 * and processed by WakeupController.cpp.
3380 */
3381message PacketWakeupOccurred {
3382 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3383 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003384 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003385 // The interface name on which the packet was received.
3386 optional string iface = 2;
3387 // The ethertype value of the packet.
3388 optional int32 ethertype = 3;
3389 // String representation of the destination MAC address of the packet.
3390 optional string destination_hardware_address = 4;
3391 // String representation of the source address of the packet if this was an IP packet.
3392 optional string source_ip = 5;
3393 // String representation of the destination address of the packet if this was an IP packet.
3394 optional string destination_ip = 6;
3395 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3396 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3397 // families.
3398 optional int32 ip_next_header = 7;
3399 // The source port if this was a TCP or UDP packet.
3400 optional int32 source_port = 8;
3401 // The destination port if this was a TCP or UDP packet.
3402 optional int32 destination_port = 9;
3403}
3404
3405/*
3406 * Logs the memory stats for an app on startup.
3407 * Logged from:
3408 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3409 */
3410message AppStartMemoryStateCaptured {
3411 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003412 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003413
3414 // The process name.
3415 optional string process_name = 2;
3416
3417 // The activity name.
3418 optional string activity_name = 3;
3419
3420 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003421 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003422
3423 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003424 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003425
3426 // RSS
3427 optional int64 rss_in_bytes = 6;
3428
3429 // CACHE
3430 optional int64 cache_in_bytes = 7;
3431
3432 // SWAP
3433 optional int64 swap_in_bytes = 8;
3434}
3435
3436/*
3437 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3438 * for LMK event.
3439 * Logged from:
3440 * system/core/lmkd/lmkd.c
3441 */
3442message LmkStateChanged {
3443 enum State {
3444 UNKNOWN = 0;
3445 START = 1;
3446 STOP = 2;
3447 }
3448 optional State state = 1;
3449}
3450
3451/*
3452 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3453 * Logged from:
3454 * system/core/lmkd/lmkd.c
3455 */
3456message LmkKillOccurred {
3457 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003458 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003459
3460 // The process name.
3461 optional string process_name = 2;
3462
3463 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003464 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003465
3466 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003467 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003468
3469 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003470 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003471
3472 // RSS
3473 optional int64 rss_in_bytes = 6;
3474
3475 // CACHE
3476 optional int64 cache_in_bytes = 7;
3477
3478 // SWAP
3479 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003480
3481 // The elapsed real time of start of the process.
3482 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003483
3484 // Min oom adj score considered by lmkd.
3485 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003486}
3487
Rajeev Kumar51b54602018-03-01 12:18:26 -08003488/*
3489 * Logs when the ActivityManagerService detects that an app died.
3490 *
3491 * Logged from:
3492 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3493 */
3494message AppDied {
3495 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003496 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003497}
3498
Howard Ro21a039c2018-08-06 14:55:47 -07003499/**
3500 * An atom for generic metrics logging. Available from Android Q.
3501 */
3502message GenericAtom {
3503 // The uid of the application that sent this custom atom.
3504 optional int32 uid = 1 [(is_uid) = true];
3505
3506 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003507 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003508}
3509
Tej Singhd6d6d772018-09-05 17:41:25 -07003510/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003511 * Atom for simple logging of user interaction and impression events, such as "the user touched
3512 * this button" or "this dialog was displayed".
3513 * Keep the UI event stream clean: don't use for system or background events.
3514 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003515 *
3516 * Logged from:
3517 * frameworks/base/services/core/java/com/android/server/
3518 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003519 */
3520message UiEventReported {
3521 // The event_id.
3522 optional int32 event_id = 1;
3523 // The event's source or target uid and package, if applicable.
3524 // For example, the package posting a notification, or the destination package of a share.
3525 optional int32 uid = 2 [(is_uid) = true];
3526 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003527 // An identifier used to disambiguate which logs refer to a particular instance of some
3528 // UI element. Useful when there might be multiple instances simultaneously active.
3529 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003530}
3531
3532/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003533 * Reports a notification was created or updated.
3534 *
3535 * Logged from:
3536 * frameworks/base/services/core/java/com/android/server/notification/
3537 */
3538message NotificationReported {
3539 // The event_id (as for UiEventReported).
3540 optional int32 event_id = 1;
3541 // The notifying app's uid and package.
3542 optional int32 uid = 2 [(is_uid) = true];
3543 optional string package_name = 3;
3544 // A small system-assigned identifier for the notification.
3545 // Locally probably-unique, but expect collisions across users and/or days.
3546 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003547 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3548 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003549
3550 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003551 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3552 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3553 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003554
3555 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003556 optional string category = 10; // App-assigned notification category (API-defined strings)
3557 optional int32 style = 11; // App-assigned notification style
3558 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003559
3560 // Ordering, importance and interruptiveness
3561
Will Brockman7614f6962020-02-10 19:43:03 -05003562 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003563
Will Brockman7614f6962020-02-10 19:43:03 -05003564 optional android.stats.sysui.NotificationImportance importance = 14;
3565 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003566
3567 enum NotificationImportanceExplanation {
3568 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3569 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3570 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3571 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3572 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3573 // Like _APP, but based on pre-channels priority signal.
3574 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3575 }
3576
Will Brockman7614f6962020-02-10 19:43:03 -05003577 optional NotificationImportanceExplanation importance_source = 16;
3578 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3579 optional NotificationImportanceExplanation importance_initial_source = 18;
3580 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3581 optional int32 assistant_hash = 20;
3582 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003583}
3584
3585message Notification {
3586 // The notifying app's uid and package.
3587 optional int32 uid = 1 [(is_uid) = true];
3588 optional string package_name = 2;
3589 // A small system-assigned identifier for the notification.
3590 optional int32 instance_id = 3;
3591
3592 // Grouping information.
3593 optional int32 group_instance_id = 4;
3594 optional bool is_group_summary = 5;
3595
3596 // The section of the shade that the notification is in.
3597 // See NotificationSectionsManager.PriorityBucket.
3598 enum NotificationSection {
3599 SECTION_UNKNOWN = 0;
3600 SECTION_PEOPLE = 1;
3601 SECTION_ALERTING = 2;
3602 SECTION_SILENT = 3;
3603 }
3604 optional NotificationSection section = 6;
3605}
3606
3607message NotificationList {
3608 repeated Notification notifications = 1; // An ordered sequence of notifications.
3609}
3610
3611/**
3612 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3613 *
3614 * Logged from:
3615 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3616 */
3617message NotificationPanelReported {
3618 // The event_id (as for UiEventReported).
3619 optional int32 event_id = 1;
3620 optional int32 num_notifications = 2;
3621 // The notifications in the panel, in the order that they appear there.
3622 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3623}
3624
3625/**
3626 * Reports a notification channel, or channel group, was created, updated, or deleted.
3627 *
3628 * Logged from:
3629 * frameworks/base/services/core/java/com/android/server/notification/
3630 */
3631message NotificationChannelModified {
3632 // The event_id (as for UiEventReported).
3633 optional int32 event_id = 1;
3634 // The notifying app's uid and package.
3635 optional int32 uid = 2 [(is_uid) = true];
3636 optional string package_name = 3;
3637 // App-assigned notification channel ID or channel-group ID
3638 optional string channel_id = 4;
3639 // Previous importance setting, if applicable
3640 optional android.stats.sysui.NotificationImportance old_importance = 5;
3641 // New importance setting
3642 optional android.stats.sysui.NotificationImportance importance = 6;
3643}
3644
3645
3646/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003647 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003648 *
3649 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003650 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003651 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003652message BiometricAcquired {
3653 // Biometric modality that was acquired.
3654 optional android.hardware.biometrics.ModalityEnum modality = 1;
3655 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3656 optional int32 user = 2;
3657 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3658 optional bool is_crypto = 3;
3659 // Action that the device is performing. Acquired messages are only expected for enroll and
3660 // authenticate. Other actions may indicate an error.
3661 optional android.hardware.biometrics.ActionEnum action = 4;
3662 // The client that this acquisition was received for.
3663 optional android.hardware.biometrics.ClientEnum client = 5;
3664 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3665 optional int32 acquire_info = 6;
3666 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3667 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003668 // Dictates if this message should trigger additional debugging.
3669 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003670}
3671
3672/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003673 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003674 *
3675 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003676 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003677 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003678message BiometricAuthenticated {
3679 // Biometric modality that was used.
3680 optional android.hardware.biometrics.ModalityEnum modality = 1;
3681 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3682 optional int32 user = 2;
3683 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3684 // storage.
3685 optional bool is_crypto = 3;
3686 // The client that this acquisition was received for.
3687 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003688 // If authentication requires user confirmation. See BiometricPrompt's
3689 // setRequireConfirmation(bool) method.
3690 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003691
Kevin Chyn1741a072019-01-17 11:54:40 -08003692 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003693 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003694 REJECTED = 1;
3695 PENDING_CONFIRMATION = 2;
3696 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003697 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003698
3699 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003700 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003701 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3702 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3703 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3704 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003705 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003706 // Dictates if this message should trigger additional debugging.
3707 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003708}
3709
3710/**
3711 * Logs when a biometric error occurs.
3712 *
3713 * Logged from:
3714 * frameworks/base/services/core/java/com/android/server/biometrics
3715 */
3716message BiometricErrorOccurred {
3717 // Biometric modality that was used.
3718 optional android.hardware.biometrics.ModalityEnum modality = 1;
3719 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3720 optional int32 user = 2;
3721 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3722 optional bool is_crypto = 3;
3723 // Action that the device is performing.
3724 optional android.hardware.biometrics.ActionEnum action = 4;
3725 // The client that this acquisition was received for.
3726 optional android.hardware.biometrics.ClientEnum client = 5;
3727 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3728 // are unique to modality.
3729 optional int32 error_info = 6;
3730 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3731 // by the vendor and not specified by the HIDL interface.
3732 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003733 // Dictates if this message should trigger additional debugging.
3734 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003735 // Time spent during the authentication attempt.
3736 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003737}
3738
3739/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003740 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003741 * Logged from:
3742 * frameworks/base/services/core/java/com/android/server/biometrics
3743 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003744message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003745 // Biometric modality.
3746 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003747 // Type of issue detected.
3748 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003749 // Dictates if this message should trigger additional debugging.
3750 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003751}
Howard Ro688ae182018-09-25 00:09:36 -07003752
joshmccloskey6f952b22019-03-25 20:59:35 -07003753/**
3754 * Logs when a biometric enrollment occurs.
3755 *
3756 * Logged from:
3757 * frameworks/base/services/core/java/com/android/server/biometrics
3758 */
3759message BiometricEnrolled {
3760 // Biometric modality that was used.
3761 optional android.hardware.biometrics.ModalityEnum modality = 1;
3762 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3763 optional int32 user = 2;
3764 // The amount of time the enrollment took in milliseconds.
3765 optional int64 latency_millis = 3;
3766 // Whether or not the enrollment was successful.
3767 optional bool success = 4;
3768}
3769
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003770/*
Tej Singh0d176952019-01-16 19:10:54 -08003771 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003772 */
Tej Singh0d176952019-01-16 19:10:54 -08003773message FlagFlipUpdateOccurred {
3774 // If the event is from a flag config package, specify the package name.
3775 optional string flag_flip_package_name = 1;
3776
3777 // The order id of the package
3778 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003779}
3780
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003781/**
3782 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003783 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003784 */
3785message TrainExperimentIds {
3786 repeated int64 experiment_id = 1;
3787}
3788
Yangster-macb89807e2018-11-15 21:10:57 -08003789/*
3790 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003791 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003792 */
3793message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003794 // Name of the train.
3795 optional string train_name = 1;
3796 // Version code for a "train" of packages that need to be installed atomically
3797 optional int64 train_version_code = 2;
3798 // After installation of this package, device requires a restart.
3799 optional bool requires_staging = 3;
3800 // Rollback should be enabled for this install.
3801 optional bool rollback_enabled = 4;
3802 // Requires low latency monitoring if possible.
3803 optional bool requires_low_latency_monitor = 5;
3804
Yangster-macb89807e2018-11-15 21:10:57 -08003805 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003806 UNKNOWN = 0;
3807 INSTALL_REQUESTED = 1;
3808 INSTALL_STARTED = 2;
3809 INSTALL_STAGED_NOT_READY = 3;
3810 INSTALL_STAGED_READY = 4;
3811 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003812 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3813 // and INSTALL_FAILURE_COMMIT.
3814 INSTALL_FAILURE = 6 [deprecated = true];
3815 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003816 INSTALL_CANCELLED = 7;
3817 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003818 INSTALLER_ROLLBACK_INITIATED = 9;
3819 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3820 INSTALLER_ROLLBACK_STAGED = 11;
3821 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3822 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3823 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3824 INSTALLER_ROLLBACK_SUCCESS = 15;
3825 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003826 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3827 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3828 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3829 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3830 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3831 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003832 INSTALL_FAILURE_DOWNLOAD = 23;
3833 INSTALL_FAILURE_STATE_MISMATCH = 24;
3834 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003835 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003836 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003837 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003838 // Possible experiment ids for monitoring this push.
3839 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3840 // user id
3841 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003842 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003843 // Whether or not this is a rollback event
3844 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003845}
3846
Tej Singhc9203082019-05-03 13:42:23 -07003847/* Test atom, is not logged anywhere */
3848message TestAtomReported {
3849 repeated AttributionNode attribution_node = 1;
3850 optional int32 int_field = 2;
3851 optional int64 long_field = 3;
3852 optional float float_field = 4;
3853 optional string string_field = 5;
3854 optional bool boolean_field = 6;
3855 enum State {
3856 UNKNOWN = 0;
3857 OFF = 1;
3858 ON = 2;
3859 }
3860 optional State state = 7;
3861 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3862}
3863
Maggie Whitefc1aa592018-11-28 21:55:23 -08003864/** Represents USB port overheat event. */
3865message UsbPortOverheatEvent {
3866 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3867 optional int32 plug_temperature_deci_c = 1;
3868
3869 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3870 optional int32 max_temperature_deci_c = 2;
3871
3872 /* Time between USB plug event and overheat threshold trip, in seconds. */
3873 optional int32 time_to_overheat_secs = 3;
3874
3875 /* Time between overheat threshold trip and hysteresis, in seconds. */
3876 optional int32 time_to_hysteresis_secs = 4;
3877
3878 /* Time between hysteresis and active mitigation ending, in seconds. */
3879 optional int32 time_to_inactive_secs = 5;
3880};
3881
Maggie White8735b852019-01-18 11:40:49 -08003882/**
3883 * Logs total effective full charge and discharge cycles on a battery.
3884 * Here are some examples of one effective cycle:
3885 * 1) the battery charges from 0% to 100% and drains back to 0%,
3886 * 2) charging from 50% to 100% and draining back to 50% twice.
3887 * Pulled from:
3888 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3889 */
3890message BatteryCycleCount {
3891 /* Number of total charge and discharge cycles on the system battery. */
3892 optional int32 cycle_count = 1;
3893}
3894
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003895/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003896 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3897 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003898 * Pulled from:
3899 * StatsCompanionService
3900 */
3901
Carmen Agimof12dec122019-03-06 16:14:38 +00003902message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003903
Carmen Agimof12dec122019-03-06 16:14:38 +00003904 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003905 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003906 PUBLIC = 1;
3907 PRIVATE = 2;
3908 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003909 }
3910
Carmen Agimof12dec122019-03-06 16:14:38 +00003911 // The type of external storage.
3912 optional android.stats.storage.ExternalStorageType storage_type = 1;
3913 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3914 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003915 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003916 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003917}
3918
Yangster-macb89807e2018-11-15 21:10:57 -08003919/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003920 * Logs when a connection becomes available and lost.
3921 * Logged in StatsCompanionService.java
3922 */
3923message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003924 // Id of the network.
3925 optional int32 net_id = 1;
3926
3927 enum State {
3928 UNKNOWN = 0;
3929 CONNECTED = 1;
3930 DISCONNECTED = 2;
3931 }
3932 // Connected state of a network.
3933 optional State state = 2;
3934}
3935
3936/**
3937 * Logs when a service starts and stops.
3938 * Logged from:
3939 * services/core/java/com/android/server/am/ActiveServices.java
3940 */
3941message ServiceStateChanged {
3942
3943 optional int32 uid = 1 [(is_uid) = true];
3944
3945 optional string package_name = 2;
3946
3947 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003948
3949 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003950 START = 1;
3951 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003952 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003953
3954 optional State state = 4;
3955}
3956
3957/**
3958 * Logs when a service is launched.
3959 * Logged from:
3960 * services/core/java/com/android/server/am/ActiveServices.java
3961 */
3962message ServiceLaunchReported {
3963
3964 optional int32 uid = 1 [(is_uid) = true];
3965
3966 optional string package_name = 2;
3967
3968 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003969}
Howard Ro688ae182018-09-25 00:09:36 -07003970
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003971/**
3972 * Logs when a hidden API is used.
3973 *
3974 * Logged from:
3975 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3976 */
3977message HiddenApiUsed {
3978 // The uid of the app making the hidden access.
3979 optional int32 uid = 1 [(is_uid) = true];
3980
3981 // Signature of the method or field accessed.
3982 optional string signature = 2;
3983
3984 enum AccessMethod {
3985 NONE = 0;
3986 REFLECTION = 1;
3987 JNI = 2;
3988 LINKING = 3;
3989 }
3990
3991 // Type of access.
3992 optional AccessMethod access_method = 3;
3993
3994 // Whether the access was prevented or not.
3995 optional bool access_denied = 4;
3996}
3997
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003998/**
3999 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4000 * - When user sees privacy chip
4001 * - When user clicks privacy chip
4002 * - How does the user exit the Privacy Dialog
4003 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004004 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4005 */
4006message PrivacyIndicatorsInteracted {
4007
4008 enum Type {
4009 UNKNOWN = 0;
4010 CHIP_VIEWED = 1;
4011 CHIP_CLICKED = 2;
4012 DIALOG_PRIVACY_SETTINGS = 3;
4013 DIALOG_DISMISS = 4;
4014 DIALOG_LINE_ITEM = 5;
4015 }
4016
tsaichristine5adc7e02020-01-14 17:07:39 -08004017 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004018
4019 // Used if the type is LINE_ITEM
4020 optional string package_name = 2;
4021}
4022
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004023/**
4024 * Logs information about a package that is moved from the internal to external storage and vice
4025 * versa.
4026 * It logs the package name, the type of the external storage where the package is installed
4027 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4028 * and the move type: if it's from internal to external or the other way around.
4029 *
4030 * Logged from:
4031 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4032 */
4033message AppMovedStorageReported {
4034 enum MoveType {
4035 UNKNOWN = 0;
4036 TO_EXTERNAL = 1;
4037 TO_INTERNAL = 2;
4038 }
4039 // The type of the external storage.
4040 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4041 // The type of move.
4042 optional MoveType move_type = 2;
4043 // The name of the package that was moved.
4044 optional string package_name = 3;
4045}
4046
jianjin8f2dee02019-03-29 14:03:08 -07004047/**
4048 * Logs when system server watchdog occurs.
4049 * Logged from:
4050 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4051 */
4052message SystemServerWatchdogOccurred {
4053 optional string subject = 1;
4054}
4055
4056/**
4057 * Logs when new file added to tombstones.
4058 * Logged from:
4059 * frameworks/base/core/java/com/android/server/BootReceiver.java
4060 */
4061message TombStoneOccurred {
4062}
4063
Hai Zhang5d3328d2019-04-13 21:25:06 +08004064/*
4065 * Information about a role request
4066 *
4067 * Logged from:
4068 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4069 */
4070message RoleRequestResultReported {
4071 // UID of application requesting the role
4072 optional int32 requesting_uid = 1;
4073
4074 // Package name of application requesting the role
4075 optional string requesting_package_name = 2;
4076
4077 // The role to be granted
4078 optional string role_name = 3;
4079
4080 // The count of applications qualifying for the role
4081 optional int32 qualifying_count = 4;
4082
4083 // UID of application current granted the role
4084 optional int32 current_uid = 5;
4085
4086 // Package name of application current granted the role
4087 optional string current_package_name = 6;
4088
4089 // UID of another application that user chose to grant the role to, instead of the requesting
4090 // application
4091 optional int32 granted_another_uid = 7;
4092
4093 // Package name of another application that user chose to grant the role to, instead of the
4094 // requesting application
4095 optional string granted_another_package_name = 8;
4096
4097 enum Result {
4098 UNDEFINED = 0;
4099 // role request was ignored
4100 IGNORED = 1;
4101 // role request was ignored because it's already granted
4102 IGNORED_ALREADY_GRANTED = 2;
4103 // role request was ignored because the application isn't qualified
4104 IGNORED_NOT_QUALIFIED = 3;
4105 // role request was ignored because user said it should be always denied
4106 IGNORED_USER_ALWAYS_DENIED = 4;
4107 // role was granted by user action
4108 USER_GRANTED = 5;
4109 // role was denied by user action
4110 USER_DENIED = 6;
4111 // role was denied by user granting another application the role
4112 USER_DENIED_GRANTED_ANOTHER = 7;
4113 // role was denied and set to be always denied by the user
4114 USER_DENIED_WITH_ALWAYS = 8;
4115 }
4116 // The result of the role request
4117 optional Result result = 9;
4118}
4119
Mark Tabrya824a642019-11-05 12:26:12 -08004120/**
4121 * Logs when a Vehicle Maps Service client's connection state has changed
4122 *
4123 * Logged from:
4124 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4125 */
4126message VmsClientConnectionStateChanged {
4127 // The UID of the VMS client app
4128 optional int32 uid = 1 [(is_uid) = true];
4129
4130 enum State {
4131 UNKNOWN = 0;
4132 // Attempting to connect to the client
4133 CONNECTING = 1;
4134 // Client connection established
4135 CONNECTED = 2;
4136 // Client connection closed unexpectedly
4137 DISCONNECTED = 3;
4138 // Client connection closed by VMS
4139 TERMINATED = 4;
4140 // Error establishing the client connection
4141 CONNECTION_ERROR = 5;
4142 }
4143
4144 optional State state = 2;
4145}
4146
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004147/**
4148 * Logs when MediaProvider has successfully finished scanning a storage volume.
4149 *
4150 * Logged from:
4151 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4152 */
4153message MediaProviderScanEvent {
4154 enum Reason {
4155 // Scan triggered due to unknown reason
4156 UNKNOWN = 0;
4157 // Scan triggered due to storage volume being mounted
4158 MOUNTED = 1;
4159 // Scan triggered due to explicit user action or app request
4160 DEMAND = 2;
4161 // Scan triggered due to idle maintenance
4162 IDLE = 3;
4163 }
4164
4165 // Volume type that this event pertains to
4166 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4167 // Reason why this scan was triggered
4168 optional Reason reason = 2;
4169 // Total number of files scanned
4170 optional int64 item_count = 3;
4171 // Duration of scan, normalized per file
4172 optional float normalized_duration_millis = 4;
4173 // Number of database inserts, normalized per file
4174 optional float normalized_insert_count = 5;
4175 // Number of database updates, normalized per file
4176 optional float normalized_update_count = 6;
4177 // Number of database deletes, normalized per file
4178 optional float normalized_delete_count = 7;
4179}
4180
4181/**
4182 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4183 *
4184 * Logged from:
4185 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4186 */
4187message MediaProviderDeletionEvent {
4188 // Volume type that this event pertains to
4189 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4190 // Device timestamp when this deletion event occurred
4191 optional int64 timestamp_millis = 2;
4192 // App that requested deletion
4193 optional string package_name = 3;
4194 // Number of items that were deleted
4195 optional int32 item_count = 4;
4196}
4197
4198/**
4199 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4200 *
4201 * Logged from:
4202 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4203 */
4204message MediaProviderPermissionEvent {
4205 enum Result {
4206 UNKNOWN = 0;
4207 USER_GRANTED = 1;
4208 AUTO_GRANTED = 2;
4209 USER_DENIED = 3;
4210 USER_DENIED_WITH_PREJUDICE = 4;
4211 AUTO_DENIED = 5;
4212 }
4213
4214 // Volume type that this event pertains to
4215 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4216 // Device timestamp when this permission event occurred
4217 optional int64 timestamp_millis = 2;
4218 // App that requested permission
4219 optional string package_name = 3;
4220 // Number of items that were requested
4221 optional int32 item_count = 4;
4222 // Result of this request
4223 optional Result result = 5;
4224}
4225
4226/**
4227 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4228 *
4229 * Logged from:
4230 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4231 */
4232message MediaProviderSchemaChange {
4233 // Volume type that this event pertains to
4234 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4235 // Old database version code
4236 optional int32 version_from = 2;
4237 // New database version code
4238 optional int32 version_to = 3;
4239 // Total number of files in database
4240 optional int64 item_count = 4;
4241 // Duration of schema change, normalized per file
4242 optional float normalized_duration_millis = 5;
4243}
4244
4245/**
4246 * Logs when MediaProvider has finished an idle maintenance job.
4247 *
4248 * Logged from:
4249 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4250 */
4251message MediaProviderIdleMaintenance {
4252 // Volume type that this event pertains to
4253 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4254
4255 // Total number of files in database
4256 optional int64 item_count = 2;
4257 // Duration of idle maintenance, normalized per file
4258 optional float normalized_duration_millis = 3;
4259 // Number of thumbnails found to be stale, normalized per file
4260 optional float normalized_stale_thumbnails = 4;
4261 // Number of items found to be expired, normalized per file
4262 optional float normalized_expired_media = 5;
4263}
4264
Keun young Park3e033cb2019-12-18 11:27:35 -08004265/**
4266 * Represents boot time event with duration in ms.
4267 *
4268 * Logged from: bootstat and various system server components. Check each enums for details.
4269 */
4270message BootTimeEventDuration {
4271 enum DurationEvent {
4272 UNKNOWN = 0;
4273 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4274 ABSOLUTE_BOOT_TIME = 1;
4275 // Bootloader's 1st stage execution time.
4276 // Logged from bootstat.
4277 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4278 // Bootloader's 1st stage loading time.
4279 // Logged from bootstat.
4280 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4281 // Bootloader's kernel loading time.
4282 // Logged from bootstat.
4283 BOOTLOADER_KERNEL_LOAD = 4;
4284 // Bootloader's 2nd stage execution time.
4285 // Logged from bootstat.
4286 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4287 // Bootloader's 2nd stage loading time.
4288 // Logged from bootstat.
4289 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4290 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4291 // for locked device.
4292 // Logged from bootstat.
4293 BOOTLOADER_UI_WAIT = 7;
4294 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4295 // Logged from bootstat.
4296 BOOTLOADER_TOTAL = 8;
4297 // Shutdown duration inside init for the reboot before the current boot up.
4298 // Logged from f/b/services/.../BootReceiver.java.
4299 SHUTDOWN_DURATION = 9;
4300 // Total time for mounting of disk devices during bootup.
4301 // Logged from f/b/services/.../BootReceiver.java.
4302 MOUNT_DEFAULT_DURATION = 10;
4303 // Total time for early stage mounting of disk devices during bootup.
4304 // Logged from f/b/services/.../BootReceiver.java.
4305 MOUNT_EARLY_DURATION = 11;
4306 // Total time for late stage mounting of disk devices during bootup.
4307 // Logged from f/b/services/.../BootReceiver.java.
4308 MOUNT_LATE_DURATION = 12;
4309 // Average time to scan non-system app after OTA
4310 // Logged from f/b/services/.../PackageManagerService.java
4311 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4312 // Time to initialize Package manager after OTA
4313 // Logged from f/b/services/.../PackageManagerService.java
4314 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4315 // Time to scan all system app from Package manager after OTA
4316 // Logged from f/b/services/.../PackageManagerService.java
4317 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4318 // Init's total time for cold boot stage.
4319 // Logged from bootstat.
4320 COLDBOOT_WAIT = 16;
4321 // Init's total time for initializing selinux.
4322 // Logged from bootstat.
4323 SELINUX_INIT = 17;
4324 // Time since last factory reset.
4325 // Logged from bootstat.
4326 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004327 // Init's total time spent for completing the 1st stage.
4328 // Logged from bootstat.
4329 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004330 }
4331
4332 // Type of the event.
4333 optional DurationEvent event = 1;
4334 // Duration of the event in ms.
4335 optional int64 duration_millis = 2;
4336}
4337
4338/**
4339 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4340 * since boot-up.
4341 *
4342 * Logged from: bootstat and various system server components. Check each enums for details.
4343 */
4344message BootTimeEventElapsedTime {
4345 enum ElapsedTimeEvent {
4346 UNKNOWN = 0;
4347 // Time when init starts 1st stage. Logged from bootstat.
4348 ANDROID_INIT_STAGE_1 = 1;
4349 // Time when sys.boot_completed prop is set.
4350 // Logged from bootstat.
4351 BOOT_COMPLETE = 2;
4352 // BOOT_COMPLETE for encrypted device.
4353 BOOT_COMPLETE_ENCRYPTION = 3;
4354 // BOOT_COMPLETE for device with no encryption.
4355 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4356 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004357 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004358 // BOOT_COMPLETE after factory reset.
4359 FACTORY_RESET_BOOT_COMPLETE = 6;
4360 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4361 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004362 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4363 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004364 // BOOT_COMPLETE after OTA.
4365 OTA_BOOT_COMPLETE = 9;
4366 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4367 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004368 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4369 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004370 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4371 // Logged from f/b/services/.../UserController.java
4372 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4373 // Time when the system starts sending BOOT_COMPLETED broadcast.
4374 // Logged from f/b/services/.../UserController.java
4375 FRAMEWORK_BOOT_COMPLETED = 13;
4376 // Time when the package manager starts init.
4377 // Logged from f/b/services/.../SystemServer.java
4378 PACKAGE_MANAGER_INIT_START = 14;
4379 // Time when package manager is ready
4380 // Logged from f/b/services/.../SystemServer.java
4381 PACKAGE_MANAGER_INIT_READY = 15;
4382 // Represents the time when user has entered unlock credential for system with user pin.
4383 // Logged from bootstat.
4384 POST_DECRYPT = 16;
4385 // Represents the start of zygote's init.
4386 // Logged from zygote itself.
4387 ZYGOTE_INIT_START = 17;
4388 // Represents the start of secondary zygote's init.
4389 // TODO: add logging to zygote
4390 SECONDARY_ZYGOTE_INIT_START = 18;
4391 // Represents the start of system server's init.
4392 // Logged from f/b/services/.../SystemServer.java
4393 SYSTEM_SERVER_INIT_START = 19;
4394 // Represents the completion of system server's init.
4395 // Logged from f/b/services/.../SystemServer.java
4396 SYSTEM_SERVER_READY = 20;
4397 // Represents the start of launcher during boot-up.
4398 // TODO: add logging
4399 LAUNCHER_START = 21;
4400 // Represents the completion of launcher's initial rendering. User can use other apps from
4401 // launcher from this point.
4402 // TODO: add logging
4403 LAUNCHER_SHOWN = 22;
4404 }
4405
4406 // Type of the event.
4407 optional ElapsedTimeEvent event = 1;
4408 // Time since bootup for the event.
4409 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4410 optional int64 time_millis = 2;
4411}
4412
4413/**
4414 * Boot time events with UTC time.
4415 *
4416 * Logged from: bootstat and various system server components. Check each enums for details.
4417 */
4418message BootTimeEventUtcTime {
4419 enum UtcTimeEvent {
4420 UNKNOWN = 0;
4421 // Time of the bootstat's marking of 1st boot after the last factory reset.
4422 // Logged from bootstat.
4423 FACTORY_RESET_RESET_TIME = 1;
4424 // The time when bootstat records FACTORY_RESET_* events. This is close to
4425 // BOOT_COMPLETE time for the current bootup.
4426 // Logged from bootstat.
4427 FACTORY_RESET_CURRENT_TIME = 2;
4428 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4429 // Logged from bootstat.
4430 FACTORY_RESET_RECORD_VALUE = 3;
4431 }
4432
4433 // Type of the event.
4434 optional UtcTimeEvent event = 1;
4435 // UTC time for the event.
4436 optional int64 utc_time_secs = 2;
4437}
4438
4439/**
4440 * Boot time events representing specific error code during bootup.
4441 * Meaning of error code can be different per each event type.
4442 *
4443 * Logged from: bootstat and various system server components. Check each enums for details.
4444 */
4445message BootTimeEventErrorCode {
4446 enum ErrorCodeEvent {
4447 UNKNOWN = 0;
4448 // Linux error code for time() call to get the current UTC time.
4449 // Logged from bootstat.
4450 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4451 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4452 // as UMOUNT_STAT_* from init/reboot.cpp.
4453 // Logged from f/b/services/.../BootReceiver.java.
4454 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004455 // Reprepsents fie system mounting error code of /data partition for the current boot.
4456 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004457 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004458 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004459 }
4460
4461 // Type of the event.
4462 optional ErrorCodeEvent event = 1;
4463 // error code defined per each event type.
4464 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4465 // FS_MGR_FS_STAT.
4466 optional int32 error_code = 2;
4467}
4468
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004469/**
4470 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4471 * after an OTA.
4472 *
4473 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004474 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004475 */
4476message SnapshotMergeReported {
4477 // Keep in sync with
4478 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4479 enum UpdateState {
4480 // No update or merge is in progress.
4481 NONE = 0;
4482 // An update is applying; snapshots may already exist.
4483 INITIATED = 1;
4484 // An update is pending, but has not been successfully booted yet.
4485 UNVERIFIED = 2;
4486 // The kernel is merging in the background.
4487 MERGING = 3;
4488 // Post-merge cleanup steps could not be completed due to a transient
4489 // error, but the next reboot will finish any pending operations.
4490 MERGE_NEEDS_REBOOT = 4;
4491 // Merging is complete, and needs to be acknowledged.
4492 MERGE_COMPLETED = 5;
4493 // Merging failed due to an unrecoverable error.
4494 MERGE_FAILED = 6;
4495 // The update was implicitly cancelled, either by a rollback or a flash
4496 // operation via fastboot. This state can only be returned by WaitForMerge.
4497 CANCELLED = 7;
4498 };
4499
4500 // Status of the update after the merge attempts.
4501 optional UpdateState final_state = 1;
4502
4503 // Time to complete a merge operation in milliseconds.
4504 // A negative value corresponds to the case in which the merge operation
4505 // was interrupted and resumed (e.g. in case of a system reboot during the
4506 // merge).
4507 optional int64 duration_millis = 2;
4508
4509 // Number of reboots that occurred after issuing and before completing the
4510 // merge of all the snapshot devices.
4511 optional int32 intermediate_reboots = 3;
4512}
4513
Chenjie Yubbcbc602018-02-05 16:51:52 -08004514//////////////////////////////////////////////////////////////////////
4515// Pulled atoms below this line //
4516//////////////////////////////////////////////////////////////////////
4517
4518/**
David Chenc8a43242017-10-17 16:23:28 -07004519 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4520 *
4521 * Pulled from:
4522 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4523 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004524message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004525 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004526
4527 optional int64 rx_bytes = 2;
4528
4529 optional int64 rx_packets = 3;
4530
4531 optional int64 tx_bytes = 4;
4532
4533 optional int64 tx_packets = 5;
4534}
4535
4536/**
4537 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4538 *
4539 * Pulled from:
4540 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4541 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004542message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004543 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004544
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004545 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4546 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004547
4548 optional int64 rx_bytes = 3;
4549
4550 optional int64 rx_packets = 4;
4551
4552 optional int64 tx_bytes = 5;
4553
4554 optional int64 tx_packets = 6;
4555}
4556
4557/**
4558 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4559 *
4560 * Pulled from:
4561 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4562 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004563message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004564 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004565
4566 optional int64 rx_bytes = 2;
4567
4568 optional int64 rx_packets = 3;
4569
4570 optional int64 tx_bytes = 4;
4571
4572 optional int64 tx_packets = 5;
4573}
4574
4575/**
4576 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4577 *
4578 * Pulled from:
4579 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4580 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004581message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004582 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004583
Yao Chenc40a19d2018-03-15 16:48:25 -07004584 // 1 denotes foreground and 0 denotes background. This is called Set in
4585 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004586 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004587
4588 optional int64 rx_bytes = 3;
4589
4590 optional int64 rx_packets = 4;
4591
4592 optional int64 tx_bytes = 5;
4593
4594 optional int64 tx_packets = 6;
4595}
4596
4597/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004598 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4599 *
4600 * Pulled from:
4601 * StatsCompanionService
4602 */
4603message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004604 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004605
4606 optional int64 rx_bytes = 2;
4607
4608 optional int64 tx_bytes = 3;
4609}
4610
4611/**
David Chenc8a43242017-10-17 16:23:28 -07004612 * Pulls the kernel wakelock durations. This atom is adapted from
4613 * android/internal/os/KernelWakelockStats.java
4614 *
4615 * Pulled from:
4616 * StatsCompanionService using KernelWakelockReader.
4617 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004618message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004619 optional string name = 1;
4620
4621 optional int32 count = 2;
4622
4623 optional int32 version = 3;
4624
Yangster-maca8a30442018-10-13 23:46:34 -07004625 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004626}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004627
Chenjie Yu05013b32017-11-21 10:21:41 -08004628/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004629 * Pulls low power state information. If power.stats HAL is not available, this
4630 * includes platform and subsystem sleep state information,
4631 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4632 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004633 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004634 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004635 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4636 * as defined in:
4637 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004638 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004639message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004640 // Subsystem name
4641 optional string subsystem_name = 1;
4642 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4643 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004644 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4645 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004646 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004647 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004648 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004649 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004650 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004651}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004652
Chenjie Yu05013b32017-11-21 10:21:41 -08004653/**
Bookatz92da2832018-11-01 18:10:03 -07004654 * Pulls on-device power measurement information.
4655 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4656 * Pulled from:
4657 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4658 */
4659message OnDevicePowerMeasurement {
4660 // Name of the subsystem (to which the rail belongs).
4661 optional string subsystem_name = 1;
4662
4663 // Rail name. The rail lies within the subsystem.
4664 optional string rail_name = 2;
4665
4666 // Time (in ms since boot) at which the rail energy value was measured.
4667 // This may differ slightly from the time that statsd logs this information.
4668 optional uint64 measurement_timestamp_millis = 3;
4669
4670 // Accumulated energy used via the rail since device boot in uWs.
4671 optional uint64 energy_microwatt_secs = 4;
4672}
4673
4674/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004675 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004676 * Pulls the time the cpu spend on the frequency index. Frequency index
4677 * starts from highest to lowest. The value should be monotonically
4678 * increasing since boot. However, if there is a cpu
4679 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004680 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004681message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004682 optional uint32 cluster = 1;
4683 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004684 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004685}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004686
Chenjie Yu05013b32017-11-21 10:21:41 -08004687/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004688 * Pulls Cpu Time Per Uid.
4689 * Note that isolated process uid time should be attributed to host uids.
4690 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004691message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004692 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004693 optional uint64 user_time_micros = 2;
4694 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004695}
4696
4697/**
4698 * Pulls Cpu Time Per Uid per frequency.
4699 * Note that isolated process uid time should be attributed to host uids.
4700 * For each uid, we order the time by descending frequencies.
4701 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004702message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004703 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004704 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004705 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004706}
Hugo Benichi884970e2017-11-14 22:42:46 +09004707
Chenjie Yu05013b32017-11-21 10:21:41 -08004708/**
4709 * Pulls Wifi Controller Activity Energy Info
4710 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004711message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004712 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004713 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004714 // stack reported state
4715 // TODO: replace this with proto enum
4716 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004717 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004718 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004719 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004720 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004721 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004722 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004723 // product of current(mA), voltage(V) and time(ms)
4724 optional uint64 controller_energy_used = 6;
4725}
4726
4727/**
4728 * Pulls Modem Activity Energy Info
4729 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004730message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004731 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004732 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004733 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004734 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004735 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004736 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004737 /**
4738 * Tx power index
4739 * index 0 = tx_power < 0dBm
4740 * index 1 = 0dBm < tx_power < 5dBm
4741 * index 2 = 5dBm < tx_power < 15dBm
4742 * index 3 = 15dBm < tx_power < 20dBm
4743 * index 4 = tx_power > 20dBm
4744 */
4745 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004746 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004747 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004748 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004749 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004750 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004751 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004752 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004753 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004754 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004755 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004756 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004757 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004758 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004759}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004760
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004761/**
4762 * Pulls Bluetooth Activity Energy Info
4763 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4764 */
4765message BluetoothActivityInfo {
4766 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004767 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004768 // bluetooth stack state
4769 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004770 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004771 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004772 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004773 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004774 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004776 // product of current(mA), voltage(V) and time(ms)
4777 optional uint64 energy_used = 6;
4778}
4779
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004780/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004781 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004782 *
4783 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004784 */
4785message ProcessMemoryState {
4786 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004787 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004788
4789 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004790 // Usually package name, "system" for system server.
4791 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004792 optional string process_name = 2;
4793
Rafal Slawikda51b932018-12-13 16:31:33 +00004794 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004795 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004796
4797 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004798 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004799
4800 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004801 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004802
Rajeev Kumar90235992018-01-29 11:06:48 -08004803 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004804 // Value is read from memory.stat, field total_rss if per-app memory
4805 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004806 optional int64 rss_in_bytes = 6;
4807
4808 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004809 // Value is read from memory.stat, field total_cache if per-app memory
4810 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004811 optional int64 cache_in_bytes = 7;
4812
4813 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004814 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004815 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004816 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004817
Rafal Slawik203c3db2019-09-25 19:53:01 +01004818 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004819 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004820
Rafal Slawik203c3db2019-09-25 19:53:01 +01004821 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4822 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004823
Rafal Slawik203c3db2019-09-25 19:53:01 +01004824 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4825 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004826}
4827
4828/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004829 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004830 *
4831 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4832 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004833 *
4834 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004835 */
4836message ProcessMemoryHighWaterMark {
4837 // The uid if available. -1 means not available.
4838 optional int32 uid = 1 [(is_uid) = true];
4839
Rafal Slawikda51b932018-12-13 16:31:33 +00004840 // The process name.
4841 // Usually package name or process cmdline.
4842 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004843 optional string process_name = 2;
4844
Rafal Slawik239b6802019-09-09 18:46:01 +01004845 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4846 // computed by converting kilobytes to bytes.
4847 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4848
Rafal Slawik3bea8952018-11-15 12:39:33 +00004849 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4850 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004851 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004852}
4853
4854/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004855 * Logs the memory stats for a process.
4856 *
4857 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4858 * and for selected native processes.
4859 */
4860message ProcessMemorySnapshot {
4861 // The uid if available. -1 means not available.
4862 optional int32 uid = 1 [(is_uid) = true];
4863
4864 // The process name.
4865 // Usually package name or process cmdline.
4866 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4867 optional string process_name = 2;
4868
4869 // The pid of the process.
4870 // Allows to disambiguate instances of the process.
4871 optional int32 pid = 3;
4872
4873 // The current OOM score adjustment value.
4874 // Read from ProcessRecord for managed processes.
4875 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4876 optional int32 oom_score_adj = 4;
4877
4878 // The current RSS of the process.
4879 // VmRSS from /proc/pid/status.
4880 optional int32 rss_in_kilobytes = 5;
4881
4882 // The current anon RSS of the process.
4883 // RssAnon from /proc/pid/status.
4884 optional int32 anon_rss_in_kilobytes = 6;
4885
4886 // The current swap size of the process.
4887 // VmSwap from /proc/pid/status.
4888 optional int32 swap_in_kilobytes = 7;
4889
4890 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4891 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4892}
4893
4894/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004895 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004896 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004897message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004898 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004899}
4900
4901/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004902 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004903 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004904message SystemUptime {
4905 // Milliseconds since the system was booted.
4906 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4907 // for external input).
4908 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004909 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004910}
4911
4912/*
4913 * Reads from /proc/uid_concurrent_active_time which has the format:
4914 * active: X (X is # cores)
4915 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4916 * [uid1]: [time-0] [time-1] [time-2] ... ...
4917 * ...
4918 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4919 * The file contains a monotonically increasing count of time for a single boot.
4920 */
4921message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004922 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004923 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004924}
4925
4926/**
4927 * Reads from /proc/uid_concurrent_policy_time which has the format:
4928 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4929 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4930 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4931 * ...
4932 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4933 * The file contains a monotonically increasing count of time for a single boot.
4934 */
4935message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004936 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004937 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004938 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004939}
4940
4941/*
4942 * Pulls free disk space, for data, system partition and temporary directory.
4943 */
4944message DiskSpace {
4945 // available bytes in data partition
4946 optional uint64 data_available_bytes = 1;
4947 // available bytes in system partition
4948 optional uint64 system_available_bytes = 2;
4949 // available bytes in download cache or temp directories
4950 optional uint64 temp_available_bytes = 3;
4951}
Tej Singhbf972d92018-01-10 20:51:13 -08004952
4953/**
4954 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004955 *
4956 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004957 */
4958message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004959 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004960}
4961
4962/**
4963 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004964 * Pulled from:
4965 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004966 */
4967message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004968 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004969}
4970
4971/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004972 * Pulls battery voltage.
4973 * Pulled from:
4974 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4975 */
4976message BatteryVoltage {
4977 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004978 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004979}
4980
4981/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004982 * Pulls battery level (percent full, from 0 to 100).
4983 *
4984 * Pulled from:
4985 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4986 */
4987message BatteryLevel {
4988 // Battery level. Should be in [0, 100].
4989 optional int32 battery_level = 1;
4990}
4991
4992/**
Tej Singhd89137e2018-03-26 14:51:40 -07004993 * Pulls the temperature of various parts of the device.
4994 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004995 *
Maggie White442b6312019-04-05 16:26:44 -07004996 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004997 */
4998message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004999 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005000 optional android.os.TemperatureTypeEnum sensor_location = 1;
5001
5002 // The name of the temperature source. Eg. CPU0
5003 optional string sensor_name = 2;
5004
Tej Singhd89137e2018-03-26 14:51:40 -07005005 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005006 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005007 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005008
5009 // Relative severity of the throttling, see enum definition.
5010 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005011}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005012
5013/**
5014 * Pulls the statistics of calls to Binder.
5015 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005016 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5017 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005018 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005019 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005020 */
5021message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005022 // UID of the process responsible for the binder transaction. It will be set if the process
5023 // executing the binder transaction attribute the transaction to another uid using
5024 // Binder.setThreadWorkSource().
5025 //
5026 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005027 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005028 // UID of the process executing the binder transaction.
5029 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005030 // Fully qualified class name of the API call.
5031 //
5032 // This is a system server class name.
5033 //
5034 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5035 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5036 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5037 // commonly used APIs.
5038 optional string service_class_name = 2;
5039 // Method name of the API call. It can also be a transaction code if we cannot
5040 // resolve it to a name. See Binder#getTransactionName.
5041 //
5042 // This is a system server method name.
5043 optional string service_method_name = 3;
5044 // Total number of API calls.
5045 optional int64 call_count = 4;
5046 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5047 optional bool screen_interactive = 13;
5048 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5049 // call_count will be equal to recorded_call_count.
5050 //
5051 // If recorded_call_count is different than call_count, it means data collection has been
5052 // sampled. All the fields below will be sampled in this case.
5053 optional int64 recorded_call_count = 12;
5054 // Number of exceptions thrown by the API.
5055 optional int64 recorded_exception_count = 5;
5056 // Total latency of all API calls.
5057 // Average can be computed using total_latency_micros / recorded_call_count.
5058 optional int64 recorded_total_latency_micros = 6;
5059 // Maximum latency of one API call.
5060 optional int64 recorded_max_latency_micros = 7;
5061 // Total CPU usage of all API calls.
5062 // Average can be computed using total_cpu_micros / recorded_call_count.
5063 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5064 optional int64 recorded_total_cpu_micros = 8;
5065 // Maximum CPU usage of one API call.
5066 optional int64 recorded_max_cpu_micros = 9;
5067 // Maximum parcel reply size of one API call.
5068 optional int64 recorded_max_reply_size_bytes = 10;
5069 // Maximum parcel request size of one API call.
5070 optional int64 recorded_max_request_size_bytes = 11;
5071}
5072
5073/**
5074 * Pulls the statistics of exceptions during calls to Binder.
5075 *
5076 * Binder stats are cumulative from boot unless somebody reset the data using
5077 * > adb shell dumpsys binder_calls_stats --reset
5078 */
5079message BinderCallsExceptions {
5080 // Exception class name, e.g. java.lang.IllegalArgumentException.
5081 //
5082 // This is an exception class name thrown by the system server.
5083 optional string exception_class_name = 1;
5084 // Total number of exceptions.
5085 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005086}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005087
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005088/**
5089 * Pulls the statistics of message dispatching on HandlerThreads.
5090 *
5091 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5092 * config on the device.
5093 *
5094 * Next tag: 11
5095 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005096message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005097 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005098 optional int32 uid = 1 [(is_uid) = true];
5099
5100 // Fully qualified class name of the handler target class.
5101 //
5102 // This field does not contain PII. This is a system server class name.
5103 optional string handler_class_name = 2;
5104
5105 // The name of the thread that runs the Looper.
5106 //
5107 // This field does not contain PII. This is a system server thread name.
5108 optional string looper_thread_name = 3;
5109
5110 // The name of the dispatched message.
5111 //
5112 // This field does not contain PII. This is a system server constant or class
5113 // name.
5114 optional string message_name = 4;
5115
5116 // Total number of successfully dispatched messages.
5117 optional int64 message_count = 5;
5118
5119 // Total number of messages that failed dispatching.
5120 optional int64 exception_count = 6;
5121
5122 // Total number of processed messages we have data recorded for. If we
5123 // collected data for all the messages, message_count will be equal to
5124 // recorded_message_count.
5125 //
5126 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005127 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005128 optional int64 recorded_message_count = 7;
5129
5130 // Total latency of all processed messages.
5131 // Average can be computed using recorded_total_latency_micros /
5132 // recorded_message_count.
5133 optional int64 recorded_total_latency_micros = 8;
5134
5135 // Total CPU usage of all processed message.
5136 // Average can be computed using recorded_total_cpu_micros /
5137 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005138 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005139 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005140
5141 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5142 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005143
5144 // Max recorded CPU usage of all processed messages.
5145 optional int64 recorded_max_cpu_micros = 11;
5146
5147 // Max recorded latency of all processed messages.
5148 optional int64 recorded_max_latency_micros = 12;
5149
5150 // Total number of messages we tracked the dispatching delay for. If we
5151 // collected data for all the messages, message_count will be equal to
5152 // recorded_delay_message_count.
5153 //
5154 // If recorded_delay_message_count is different than message_count, it means data
5155 // collection has been sampled or/and not all messages specified the target dispatch time.
5156 // The fields below will be sampled in this case.
5157 optional int64 recorded_delay_message_count = 13;
5158
5159 // Total dispatching delay of all processed messages.
5160 // Calculated as a difference between the target dispatching time (Message.when)
5161 // and the actual dispatching time.
5162 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5163 optional int64 recorded_total_delay_millis = 14;
5164
5165 // Max dispatching delay of all processed messages.
5166 // Calculated as a difference between the target dispatching time (Message.when)
5167 // and the actual dispatching time.
5168 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005169}
Tej Singh86dc9db2018-09-06 00:39:57 +00005170
5171/**
5172 * Pulls disk information, such as write speed and latency.
5173 */
5174message DiskStats {
5175 // Time taken to open, write 512B to, and close a file.
5176 // -1 if error performing the check.
5177 optional int64 data_write_latency_millis = 1;
5178
5179 optional bool file_based_encryption = 2;
5180
5181 // Recent disk write speed in kB/s.
5182 // -1 if error querying storageed.
5183 // 0 if data is unavailable.
5184 optional int32 recent_disk_write_speed = 3;
5185}
5186
5187
5188/**
5189 * Free and total bytes of the Data, Cache, and System partition.
5190 */
5191message DirectoryUsage {
5192 enum Directory {
5193 UNKNOWN = 0;
5194 DATA = 1;
5195 CACHE = 2;
5196 SYSTEM = 3;
5197 }
5198 optional Directory directory = 1;
5199 optional int64 free_bytes = 2;
5200 optional int64 total_bytes = 3;
5201}
5202
5203
5204/**
5205 * Size of an application: apk size, data size, and cache size.
5206 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5207 * Information is only reported for apps with the primary user (user 0).
5208 * Sizes are aggregated by package name.
5209 */
5210message AppSize {
5211 // Including uids will involve modifying diskstats logic.
5212 optional string package_name = 1;
5213 // App size in bytes. -1 if unavailable.
5214 optional int64 app_size_bytes = 2;
5215 // App data size in bytes. -1 if unavailable.
5216 optional int64 app_data_size_bytes = 3;
5217 // App cache size in bytes. -1 if unavailable.
5218 optional int64 app_cache_size_bytes = 4;
5219 // Time that the cache file was produced.
5220 // Uses System.currentTimeMillis(), which is wall clock time.
5221 optional int64 cache_time_millis = 5;
5222}
5223
5224
5225/**
5226 * Size of a particular category. Eg: photos, videos.
5227 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5228 */
5229message CategorySize {
5230 enum Category {
5231 UNKNOWN = 0;
5232 APP_SIZE = 1;
5233 APP_DATA_SIZE = 2;
5234 APP_CACHE_SIZE = 3;
5235 PHOTOS = 4;
5236 VIDEOS = 5;
5237 AUDIO = 6;
5238 DOWNLOADS = 7;
5239 SYSTEM = 8;
5240 OTHER = 9;
5241 }
5242 optional Category category = 1;
5243 // Category size in bytes.
5244 optional int64 size_bytes = 2;
5245 // Time that the cache file was produced.
5246 // Uses System.currentTimeMillis(), which is wall clock time.
5247 optional int64 cache_time_millis = 3;
5248}
Tej Singhd6d6d772018-09-05 17:41:25 -07005249
5250/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005251 * Pulls per uid I/O stats. The stats are cumulative since boot.
5252 *
5253 * Read/write bytes are I/O events from a storage device
5254 * Read/write chars are data requested by read/write syscalls, and can be
5255 * satisfied by caching.
5256 *
5257 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5258 */
5259message DiskIo {
5260 optional int32 uid = 1 [(is_uid) = true];
5261 optional int64 fg_chars_read = 2;
5262 optional int64 fg_chars_write = 3;
5263 optional int64 fg_bytes_read = 4;
5264 optional int64 fg_bytes_write = 5;
5265 optional int64 bg_chars_read = 6;
5266 optional int64 bg_chars_write = 7;
5267 optional int64 bg_bytes_read = 8;
5268 optional int64 bg_bytes_write = 9;
5269 optional int64 fg_fsync = 10;
5270 optional int64 bg_fsync= 11;
5271}
5272
5273
5274/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005275 * Pulls the number of fingerprints for each user.
5276 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005277 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005278 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005279message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005280 // The associated user. Eg: 0 for owners, 10+ for others.
5281 // Defined in android/os/UserHandle.java
5282 optional int32 user = 1;
5283 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005284 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005285}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005286
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005287/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005288 * Pulls the number of faces for each user.
5289 *
5290 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5291 */
5292message NumFacesEnrolled {
5293 // The associated user. Eg: 0 for owners, 10+ for others.
5294 // Defined in android/os/UserHandle.java
5295 optional int32 user = 1;
5296 // Number of faces registered to that user.
5297 optional int32 num_faces_enrolled = 2;
5298}
5299/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005300 * A mapping of role holder -> role
5301 */
5302message RoleHolder {
5303 // uid of the role holder
5304 optional int32 uid = 1 [(is_uid) = true];
5305
5306 // package name of the role holder
5307 optional string package_name = 2;
5308
5309 // the role held
5310 optional string role = 3;
5311}
5312
Yangsteraf9aee72018-10-12 09:26:16 -07005313message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005314 // These are all in byte resolution.
5315 optional int64 min = 1 [deprecated = true];
5316 optional int64 average = 2 [deprecated = true];
5317 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005318
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005319 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5320 // int64 fields.
5321 optional int32 mean_kb = 4;
5322 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005323}
5324
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005325// A reduced subset of process states; reducing the number of possible states allows more
5326// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5327enum ProcessStateAggregated {
5328 PROCESS_STATE_UNKNOWN = 0;
5329 // Persistent system process.
5330 PROCESS_STATE_PERSISTENT = 1;
5331 // Top activity; actually any visible activity.
5332 PROCESS_STATE_TOP = 2;
5333 // Process binding to top or a foreground service.
5334 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5335 // Processing running a foreground service.
5336 PROCESS_STATE_FGS = 4;
5337 // Important foreground process (ime, wallpaper, etc).
5338 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5339 // Important background process.
5340 PROCESS_STATE_BACKGROUND = 6;
5341 // Process running a receiver.
5342 PROCESS_STATE_RECEIVER = 7;
5343 // All kinds of cached processes.
5344 PROCESS_STATE_CACHED = 8;
5345}
5346
5347// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005348message ProcessStatsStateProto {
5349 optional android.service.procstats.ScreenState screen_state = 1;
5350
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005351 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005352
5353 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5354 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005355 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5356
5357 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005358
5359 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005360 optional int64 duration_millis = 4 [deprecated = true];
5361 // Same as above, but with minute resolution so it fits into an int32.
5362 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005363
5364 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005365 optional int64 realtime_duration_millis = 9 [deprecated = true];
5366 // Same as above, but with minute resolution so it fits into an int32.
5367 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005368
5369 // # of samples taken
5370 optional int32 sample_size = 5;
5371
5372 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005373 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005374
5375 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005376 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005377
5378 // RSS is memory resident for this process
5379 optional AggStats rss = 8;
5380}
5381
5382// Next Tag: 7
5383message ProcessStatsProto {
5384 // Name of process.
5385 optional string process = 1;
5386
5387 // Uid of the process.
5388 optional int32 uid = 2;
5389
5390 // Information about how often kills occurred
5391 message Kill {
5392 // Count of excessive CPU kills
5393 optional int32 cpu = 1;
5394
5395 // Count of kills when cached
5396 optional int32 cached = 2;
5397
5398 // PSS stats during cached kill
5399 optional AggStats cached_pss = 3;
5400 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005401 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005402
5403 // Time and memory spent in various states.
5404 repeated ProcessStatsStateProto states = 5;
5405
5406 // Total time process has been running... screen_state, memory_state, and process_state
5407 // will not be set.
5408 optional ProcessStatsStateProto total_running_state = 6;
5409}
5410
5411message PackageServiceOperationStatsProto {
5412 // Operate enum: Started, Foreground, Bound, Executing
5413 optional android.service.procstats.ServiceOperationState operation = 1;
5414
5415 // Number of times the service was in this operation.
5416 optional int32 count = 2;
5417
5418 // Information about a state the service can be in.
5419 message StateStats {
5420 // Screen state enum.
5421 optional android.service.procstats.ScreenState screen_state = 1;
5422 // Memory state enum.
5423 optional android.service.procstats.MemoryState memory_state = 2;
5424
5425 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005426 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005427 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005428 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005429 }
5430 repeated StateStats state_stats = 3;
5431}
5432
5433message PackageServiceStatsProto {
5434 // Name of service component.
5435 optional string service_name = 1;
5436
5437 // The operation stats.
5438 // The package_name, package_uid, package_version, service_name will not be set to save space.
5439 repeated PackageServiceOperationStatsProto operation_stats = 2;
5440}
5441
5442message PackageAssociationSourceProcessStatsProto {
5443 // Uid of the process.
5444 optional int32 process_uid = 1;
5445 // Process name.
5446 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005447 // Package name.
5448 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005449 // Total count of the times this association appeared.
5450 optional int32 total_count = 3;
5451
5452 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005453 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005454
5455 // Total count of the times this association became actively impacting its target process.
5456 optional int32 active_count = 5;
5457
5458 // Information on one source in this association.
5459 message StateStats {
5460 // Process state enum.
5461 optional android.service.procstats.ProcessState process_state = 1;
5462 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005463 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005464 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005465 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005466 }
5467 repeated StateStats active_state_stats = 6;
5468}
5469
5470message PackageAssociationProcessStatsProto {
5471 // Name of the target component.
5472 optional string component_name = 1;
5473 // Information on one source in this association.
5474 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5475}
5476
5477
5478message ProcessStatsPackageProto {
5479 // Name of package.
5480 optional string package = 1;
5481
5482 // Uid of the package.
5483 optional int32 uid = 2;
5484
5485 // Version of the package.
5486 optional int64 version = 3;
5487
5488 // Stats for each process running with the package loaded in to it.
5489 repeated ProcessStatsProto process_stats = 4;
5490
5491 // Stats for each of the package's services.
5492 repeated PackageServiceStatsProto service_stats = 5;
5493
5494 // Stats for each association with the package.
5495 repeated PackageAssociationProcessStatsProto association_stats = 6;
5496}
5497
5498message ProcessStatsSectionProto {
5499 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005500 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005501
5502 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005503 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005504
5505 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005506 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005507
5508 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005509 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005510
5511 // System runtime library. e.g. "libdvm.so", "libart.so".
5512 optional string runtime = 5;
5513
5514 // whether kernel reports swapped pss.
5515 optional bool has_swapped_pss = 6;
5516
5517 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5518 enum Status {
5519 STATUS_UNKNOWN = 0;
5520 STATUS_COMPLETE = 1;
5521 STATUS_PARTIAL = 2;
5522 STATUS_SHUTDOWN = 3;
5523 STATUS_SYSPROPS = 4;
5524 }
5525 repeated Status status = 7;
5526
Chenjie Yub2ecc792019-01-17 10:27:26 -08005527 // Number of pages available of various types and sizes, representation fragmentation.
5528 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5529
Yangsteraf9aee72018-10-12 09:26:16 -07005530 // Stats for each process.
5531 repeated ProcessStatsProto process_stats = 8;
5532
5533 // Stats for each package.
5534 repeated ProcessStatsPackageProto package_stats = 9;
5535}
5536
Chenjie Yub2ecc792019-01-17 10:27:26 -08005537message ProcessStatsAvailablePagesProto {
5538 // Node these pages are in (as per /proc/pagetypeinfo)
5539 optional int32 node = 1;
5540
5541 // Zone these pages are in (as per /proc/pagetypeinfo)
5542 optional string zone = 2;
5543
5544 // Label for the type of these pages (as per /proc/pagetypeinfo)
5545 optional string label = 3;
5546
5547 // Distribution of number of pages available by order size. First entry in array is
5548 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5549 repeated int32 pages_per_order = 4;
5550}
5551
Chenjie Yu12e5e672018-09-14 15:54:59 -07005552/**
5553 * Pulled from ProcessStatsService.java
5554 */
5555message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005556 optional ProcessStatsSectionProto proc_stats_section = 1;
5557}
5558
Chenjie Yuf910b7802019-01-11 16:08:20 -08005559/**
5560 * Pulled from ProcessStatsService.java
5561 */
5562message ProcStatsPkgProc {
5563 optional ProcessStatsSectionProto proc_stats_section = 1;
5564}
5565
Chris Wrencdea3b72019-11-22 16:58:17 -05005566// Next Tag: 2
5567message PackageRemoteViewInfoProto {
5568 optional string package_name = 1;
5569 // add per-package additional info here (like channels)
5570}
5571
5572// Next Tag: 2
5573message NotificationRemoteViewsProto {
5574 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5575}
5576
5577/**
5578 * Pulled from NotificationManagerService.java
5579 */
5580message NotificationRemoteViews {
5581 optional NotificationRemoteViewsProto notification_remote_views = 1;
5582}
5583
Yotam Aron74299972020-01-16 16:20:58 +02005584/**
5585 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5586 */
5587message PackageNotificationPreferences {
5588 // Uid under which the package is installed.
5589 optional int32 uid = 1;
5590 // Notification importance, which specifies when and how a notification is displayed.
5591 // Specified under core/java/android/app/NotificationManager.java.
5592 optional int32 importance = 2;
5593 // Lockscreen visibility as set by the user.
5594 optional int32 visibility = 3;
5595 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5596 // PreferencesHelper.java)
5597 optional int32 user_locked_fields = 4;
5598}
5599
5600/**
5601 * Atom that contains a list of a package's channel preferences, pulled from
5602 * NotificationManagerService.java.
5603 */
5604message PackageNotificationChannelPreferences {
5605 // Uid under which the package is installed.
5606 optional int32 uid = 1;
5607 // Channel's ID. Should always be available.
5608 optional string channel_id = 2;
5609 // Channel's name. Should always be available.
5610 optional string channel_name = 3;
5611 // Channel's description. Optionally set by the channel creator.
5612 optional string description = 4;
5613 // Notification importance, which specifies when and how a notification is displayed. Specified
5614 // under core/java/android/app/NotificationManager.java.
5615 optional int32 importance = 5;
5616 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5617 // at core/java/android/app/NotificationChannel.java
5618 optional int32 user_locked_fields = 6;
5619 // Indicates if the channel was deleted by the app.
5620 optional bool is_deleted = 7;
5621}
5622
5623/**
5624 * Atom that contains a list of a package's channel group preferences, pulled from
5625 * NotificationManagerService.java.
5626 */
5627message PackageNotificationChannelGroupPreferences {
5628 // Uid under which the package is installed.
5629 optional int32 uid = 1;
5630 // Channel Group's ID. Should always be available.
5631 optional string group_id = 2;
5632 // Channel Group's name. Should always be available.
5633 optional string group_name = 3;
5634 // Channel Group's description. Optionally set by group creator.
5635 optional string description = 4;
5636 // Indicates if notifications from this channel group are blocked.
5637 optional bool is_blocked = 5;
5638 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5639 // at core/java/android/app/NotificationChannelGroup.java
5640 optional int32 user_locked_fields = 6;
5641}
5642
Yangsteraf9aee72018-10-12 09:26:16 -07005643message PowerProfileProto {
5644 optional double cpu_suspend = 1;
5645
5646 optional double cpu_idle = 2;
5647
5648 optional double cpu_active = 3;
5649
5650 message CpuCluster {
5651 optional int32 id = 1;
5652 optional double cluster_power = 2;
5653 optional int32 cores = 3;
5654 repeated int64 speed = 4;
5655 repeated double core_power = 5;
5656 }
5657
5658 repeated CpuCluster cpu_cluster = 40;
5659
5660 optional double wifi_scan = 4;
5661
5662 optional double wifi_on = 5;
5663
5664 optional double wifi_active = 6;
5665
5666 optional double wifi_controller_idle = 7;
5667
5668 optional double wifi_controller_rx = 8;
5669
5670 optional double wifi_controller_tx = 9;
5671
5672 repeated double wifi_controller_tx_levels = 10;
5673
5674 optional double wifi_controller_operating_voltage = 11;
5675
5676 optional double bluetooth_controller_idle = 12;
5677
5678 optional double bluetooth_controller_rx = 13;
5679
5680 optional double bluetooth_controller_tx = 14;
5681
5682 optional double bluetooth_controller_operating_voltage = 15;
5683
5684 optional double modem_controller_sleep = 16;
5685
5686 optional double modem_controller_idle = 17;
5687
5688 optional double modem_controller_rx = 18;
5689
5690 repeated double modem_controller_tx = 19;
5691
5692 optional double modem_controller_operating_voltage = 20;
5693
5694 optional double gps_on = 21;
5695
5696 repeated double gps_signal_quality_based = 22;
5697
5698 optional double gps_operating_voltage = 23;
5699
5700 optional double bluetooth_on = 24;
5701
5702 optional double bluetooth_active = 25;
5703
5704 optional double bluetooth_at_cmd = 26;
5705
5706 optional double ambient_display = 27;
5707
5708 optional double screen_on = 28;
5709
5710 optional double radio_on = 29;
5711
5712 optional double radio_scanning = 30;
5713
5714 optional double radio_active = 31;
5715
5716 optional double screen_full = 32;
5717
5718 optional double audio = 33;
5719
5720 optional double video = 34;
5721
5722 optional double flashlight = 35;
5723
5724 optional double memory = 36;
5725
5726 optional double camera = 37;
5727
5728 optional double wifi_batched_scan = 38;
5729
5730 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005731}
Chenjie Yuab530202018-09-26 12:39:20 -07005732
5733/**
5734 * power_profile.xml and other constants for power model calculations.
5735 * Pulled from PowerProfile.java
5736 */
5737message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005738 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005739}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005740
5741/**
arangelovd5db50e2018-10-12 20:24:39 +01005742 * Logs when a user restriction was added or removed.
5743 *
5744 * Logged from:
5745 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5746 */
5747message UserRestrictionChanged {
5748 // The raw string of the user restriction as defined in UserManager.
5749 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5750 optional string restriction = 1;
5751 // Whether the restriction is enabled or disabled.
5752 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005753}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005754
5755/**
5756 * Pulls process user time and system time. Puller takes a snapshot of all pids
5757 * in the system and returns cpu stats for those that are working at the time.
5758 * Dead pids will be dropped. Kernel processes are excluded.
5759 * Min cool-down is 5 sec.
5760 */
5761message ProcessCpuTime {
5762 optional int32 uid = 1 [(is_uid) = true];
5763
5764 optional string process_name = 2;
5765 // Process cpu time in user space, cumulative from boot/process start
5766 optional int64 user_time_millis = 3;
5767 // Process cpu time in system space, cumulative from boot/process start
5768 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005769}
Misha Wagner5a51e002018-10-03 15:04:09 +01005770
5771/**
5772 * Pulls the CPU usage for each thread.
5773 *
5774 * Read from /proc/$PID/task/$TID/time_in_state files.
5775 *
5776 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5777 * time_in_state files not being present on some phones, have not been addressed. These should be
5778 * considered before a public release.
5779 */
5780message CpuTimePerThreadFreq {
5781 // UID that owns the process.
5782 optional int32 uid = 1 [(is_uid) = true];
5783 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005784 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005785 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005786 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005787 // Name of the process taken from `/proc/$PID/cmdline`.
5788 optional string process_name = 4;
5789 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5790 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005791
5792 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5793 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5794 // frequencies are given here as the alternative is sending eight separate atoms. This method
5795 // significantly reduces the amount of data created
5796 optional int32 frequency1_khz = 6;
5797 optional int32 time1_millis = 7;
5798 optional int32 frequency2_khz = 8;
5799 optional int32 time2_millis = 9;
5800 optional int32 frequency3_khz = 10;
5801 optional int32 time3_millis = 11;
5802 optional int32 frequency4_khz = 12;
5803 optional int32 time4_millis = 13;
5804 optional int32 frequency5_khz = 14;
5805 optional int32 time5_millis = 15;
5806 optional int32 frequency6_khz = 16;
5807 optional int32 time6_millis = 17;
5808 optional int32 frequency7_khz = 18;
5809 optional int32 time7_millis = 19;
5810 optional int32 frequency8_khz = 20;
5811 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005812}
Bookatz75ee60422018-11-09 12:27:37 -08005813
5814/**
Bookatz366a4432018-11-20 09:42:33 -08005815 * Pulls information about the device's build.
5816 */
5817message BuildInformation {
5818 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5819 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5820 optional string fingerprint = 1;
5821
5822 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5823 optional string brand = 2;
5824
5825 // Build.PRODUCT. The name of the overall product.
5826 optional string product = 3;
5827
5828 // Build.DEVICE. The name of the industrial design.
5829 optional string device = 4;
5830
5831 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5832 optional string version_release = 5;
5833
5834 // Build.ID. E.g. a label like "M4-rc20".
5835 optional string id = 6;
5836
5837 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5838 // represent this build.
5839 optional string version_incremental = 7;
5840
5841 // Build.TYPE. The type of build, like "user" or "eng".
5842 optional string type = 8;
5843
5844 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5845 optional string tags = 9;
5846}
5847
5848/**
Adam He420947c2019-01-23 15:59:09 -08005849 * Logs information about mismatched caller for content capture.
5850 *
5851 * Logged from:
5852 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5853 */
5854message ContentCaptureCallerMismatchReported {
5855 optional string intended_package = 1;
5856 optional string calling_package = 2;
5857}
5858
5859/**
5860 * Logs information about content capture service events.
5861 *
5862 * Logged from:
5863 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5864 */
5865message ContentCaptureServiceEvents {
5866 // The type of event.
5867 enum Event {
5868 UNKNOWN = 0;
5869 ON_CONNECTED = 1;
5870 ON_DISCONNECTED = 2;
5871 SET_WHITELIST = 3;
5872 SET_DISABLED = 4;
5873 ON_USER_DATA_REMOVED = 5;
5874 }
5875 optional Event event = 1;
5876 // component/package of content capture service.
5877 optional string service_info = 2;
5878 // component/package of target.
5879 // it's a concatenated list of component/package for SET_WHITELIST event
5880 // separated by " ".
5881 optional string target_info = 3;
5882}
5883
5884/**
5885 * Logs information about content capture session events.
5886 *
5887 * Logged from:
5888 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5889 */
5890message ContentCaptureSessionEvents {
5891 // The type of event.
5892 enum Event {
5893 UNKNOWN = 0;
5894 ON_SESSION_STARTED = 1;
5895 ON_SESSION_FINISHED = 2;
5896 SESSION_NOT_CREATED = 3;
5897 }
5898 optional int32 session_id = 1;
5899 optional Event event = 2;
5900 // (n/a on session finished)
5901 optional int32 state_flags = 3;
5902 // component/package of content capture service.
5903 optional string service_info = 4;
5904 // component/package of app.
5905 // (n/a on session finished)
5906 optional string app_info = 5;
5907 optional bool is_child_session = 6;
5908}
5909
5910/**
5911 * Logs information about session being flushed.
5912 *
5913 * Logged from:
5914 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5915 */
5916message ContentCaptureFlushed {
5917 optional int32 session_id = 1;
5918 // component/package of content capture service.
5919 optional string service_info = 2;
5920 // component/package of app.
5921 optional string app_info = 3;
5922 // session start/finish events
5923 optional int32 child_session_started = 4;
5924 optional int32 child_session_finished = 5;
5925 // count of view events.
5926 optional int32 view_appeared_count = 6;
5927 optional int32 view_disappeared_count = 7;
5928 optional int32 view_text_changed_count = 8;
5929
5930 // Flush stats.
5931 optional int32 max_events = 9;
5932 optional int32 idle_flush_freq = 10;
5933 optional int32 text_flush_freq = 11;
5934 optional int32 flush_reason = 12;
5935}
5936
5937/**
Bookatz75ee60422018-11-09 12:27:37 -08005938 * Pulls on-device BatteryStats power use calculations for the overall device.
5939 */
5940message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005941 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5942 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5943 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5944 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005945}
5946
5947/**
5948 * Pulls on-device BatteryStats power use calculations broken down by uid.
5949 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5950 * that is attributed to non-uid items. They must all be included to get the total power use.
5951 */
5952message DeviceCalculatedPowerBlameUid {
5953 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5954 optional int32 uid = 1 [(is_uid) = true];
5955
Bookatz3dbc13a2018-12-21 12:16:51 -08005956 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5957 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5958 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005959}
5960
5961/**
5962 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5963 * drain type.
5964 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5965 * is attributed uids. They must all be included to get the total power use.
5966 */
5967message DeviceCalculatedPowerBlameOther {
5968 // The type of item whose power use is being reported.
5969 enum DrainType {
5970 AMBIENT_DISPLAY = 0;
5971 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5972 BLUETOOTH = 2;
5973 CAMERA = 3;
5974 // Cell-standby
5975 CELL = 4;
5976 FLASHLIGHT = 5;
5977 IDLE = 6;
5978 MEMORY = 7;
5979 // Amount that total computed drain exceeded the drain estimated using the
5980 // battery level changes and capacity.
5981 OVERCOUNTED = 8;
5982 PHONE = 9;
5983 SCREEN = 10;
5984 // Amount that total computed drain was below the drain estimated using the
5985 // battery level changes and capacity.
5986 UNACCOUNTED = 11;
5987 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5988 WIFI = 13;
5989 }
5990 optional DrainType drain_type = 1;
5991
Bookatz3dbc13a2018-12-21 12:16:51 -08005992 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5993 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5994 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005995}
arangelov4e994062018-11-13 16:12:38 +00005996
5997/**
5998 * Logs device policy features.
5999 *
6000 * Logged from:
6001 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6002 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6003 */
6004message DevicePolicyEvent {
6005 // The event id - unique for each event.
6006 optional android.stats.devicepolicy.EventId event_id = 1;
6007 // The admin package name.
6008 optional string admin_package_name = 2;
6009 // A generic integer parameter.
6010 optional int32 integer_value = 3;
6011 // A generic boolean parameter.
6012 optional bool boolean_value = 4;
6013 // A parameter specifying a time period in milliseconds.
6014 optional uint64 time_period_millis = 5;
6015 // A parameter specifying a list of package names, bundle extras or string parameters.
6016 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6017}
shawnlinea5b66b2018-11-13 15:05:29 +08006018
6019/**
6020 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6021 *
6022 * Logged from:
6023 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6024 */
6025message DocsUILaunchReported {
6026 optional android.stats.docsui.LaunchAction launch_action = 1;
6027 optional bool has_initial_uri = 2;
6028 optional android.stats.docsui.MimeType mime_type = 3;
6029 optional android.stats.docsui.Root initial_root = 4;
6030}
6031
6032/**
6033 * Logs root/app visited event in file managers/picker. Call this when the user
6034 * taps on root/app in hamburger menu.
6035 *
6036 * Logged from:
6037 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6038 */
6039message DocsUIRootVisitedReported {
6040 optional android.stats.docsui.ContextScope scope = 1;
6041 optional android.stats.docsui.Root root = 2;
6042}
6043
6044/**
6045 * Logs file operation stats. Call this when a file operation has completed.
6046 *
6047 * Logged from:
6048 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6049 */
6050message DocsUIFileOperationReported {
6051 optional android.stats.docsui.Provider provider = 1;
6052 optional android.stats.docsui.FileOperation file_op = 2;
6053}
6054
6055/**
6056 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6057 * mode.
6058 *
6059 * Logged from:
6060 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6061 */
6062message DocsUIFileOperationCopyMoveModeReported {
6063 optional android.stats.docsui.FileOperation file_op = 1;
6064 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6065}
6066
6067
6068/**
6069 * Logs file sub operation stats. Call this when a file operation has failed.
6070 *
6071 * Logged from:
6072 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6073 */
6074message DocsUIFileOperationFailureReported {
6075 optional android.stats.docsui.Authority authority = 1;
6076 optional android.stats.docsui.SubFileOperation sub_op = 2;
6077}
6078
6079/**
6080* Logs the cancellation of a file operation. Call this when a job is canceled
6081*
6082* Logged from:
6083* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6084*/
6085message DocsUIFileOperationCanceledReported {
6086 optional android.stats.docsui.FileOperation file_op = 1;
6087}
6088
6089/**
6090 * Logs startup time in milliseconds.
6091 *
6092 * Logged from:
6093 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6094 */
6095message DocsUIStartupMsReported {
6096 optional int32 startup_millis = 1;
6097}
6098
6099/**
6100 * Logs the action that was started by user.
6101 *
6102 * Logged from:
6103 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6104 */
6105message DocsUIUserActionReported {
6106 optional android.stats.docsui.UserAction action = 1;
6107}
6108
6109/**
6110 * Logs the invalid type when invalid scoped access is requested.
6111 *
6112 * Logged from:
6113 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6114 */
6115message DocsUIInvalidScopedAccessRequestReported {
6116 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006117}
Ben Murdochbab399f62018-12-06 11:01:38 +00006118
6119/**
shawnlina75e82d2019-01-07 10:31:12 +08006120 * Logs the package name that launches docsui picker mode.
6121 *
6122 * Logged from:
6123 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6124 */
6125message DocsUIPickerLaunchedFromReported {
6126 optional string package_name = 1;
6127}
6128
6129/**
6130 * Logs the search type.
6131 *
6132 * Logged from:
6133 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6134 */
6135message DocsUISearchTypeReported {
6136 optional android.stats.docsui.SearchType search_type = 1;
6137}
6138
6139/**
6140 * Logs the search mode.
6141 *
6142 * Logged from:
6143 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6144 */
6145message DocsUISearchModeReported {
6146 optional android.stats.docsui.SearchMode search_mode = 1;
6147}
6148
6149/**
6150 * Logs the pick result information.
6151 *
6152 * Logged from:
6153 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6154 */
6155message DocsUIPickResultReported {
6156 optional int32 total_action_count = 1;
6157 optional int64 duration_millis = 2;
6158 optional int32 file_count= 3;
6159 optional bool is_searching = 4;
6160 optional android.stats.docsui.Root picked_from = 5;
6161 optional android.stats.docsui.MimeType mime_type = 6;
6162 optional int32 repeatedly_pick_times = 7;
6163}
6164
6165/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006166 * Logs when an app's memory is compacted.
6167 *
6168 * Logged from:
6169 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6170 */
6171message AppCompacted {
6172 // The pid of the process being compacted.
6173 optional int32 pid = 1;
6174
6175 // The name of the process being compacted.
6176 optional string process_name = 2;
6177
6178 // The type of compaction.
6179 enum Action {
6180 UNKNOWN = 0;
6181 SOME = 1;
6182 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006183 PERSISTENT = 3;
6184 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006185 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006186 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006187
6188 // Total RSS in kilobytes consumed by the process prior to compaction.
6189 optional int64 before_rss_total_kilobytes = 4;
6190
6191 // File RSS in kilobytes consumed by the process prior to compaction.
6192 optional int64 before_rss_file_kilobytes = 5;
6193
6194 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6195 optional int64 before_rss_anon_kilobytes = 6;
6196
6197 // Swap in kilobytes consumed by the process prior to compaction.
6198 optional int64 before_swap_kilobytes = 7;
6199
6200 // Total RSS in kilobytes consumed by the process after compaction.
6201 optional int64 after_rss_total_kilobytes = 8;
6202
6203 // File RSS in kilobytes consumed by the process after compaction.
6204 optional int64 after_rss_file_kilobytes = 9;
6205
6206 // Anonymous RSS in kilobytes consumed by the process after compaction.
6207 optional int64 after_rss_anon_kilobytes = 10;
6208
6209 // Swap in kilobytes consumed by the process after compaction.
6210 optional int64 after_swap_kilobytes = 11;
6211
6212 // The time taken to perform compaction in milliseconds.
6213 optional int64 time_to_compact_millis = 12;
6214
6215 // The last compaction action performed for this app.
6216 optional Action last_action = 13;
6217
Ben Murdoch01720b82018-12-19 18:03:44 +00006218 // The last time that compaction was attempted on this process in milliseconds
6219 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6220 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006221
Ben Murdoch885c21b2019-03-15 18:02:04 +00006222 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006223 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006224
6225 // The process state at the time of compaction.
6226 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006227
6228 // Free ZRAM in kilobytes before compaction.
6229 optional int64 before_zram_free_kilobytes = 17;
6230
6231 // Free ZRAM in kilobytes after compaction.
6232 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006233}
lifr157fc552018-12-12 16:38:04 +08006234
6235/**
lifrb6b90b62019-03-29 00:40:17 +08006236 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6237 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6238 *
lifr1f74b052019-04-16 22:16:30 +08006239 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6240 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6241 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6242 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006243 */
6244message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006245 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006246
lifr1f74b052019-04-16 22:16:30 +08006247 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006248
6249 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006250 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006251
lifr1f74b052019-04-16 22:16:30 +08006252 // Only valid for event_type = EVENT_GETADDRINFO.
6253 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006254
lifr1f74b052019-04-16 22:16:30 +08006255 // Flags passed to android_res_nsend() defined in multinetwork.h
6256 // Only valid for event_type = EVENT_RESNSEND.
6257 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006258
lifrad9becc2019-05-20 11:04:41 +08006259 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006260
6261 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006262 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006263
6264 // Additional pass-through fields opaque to statsd.
6265 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006266 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006267
6268 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6269 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006270}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006271
6272/**
6273 * Logs when a data stall event occurs.
6274 *
6275 * Log from:
6276 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6277 */
6278message DataStallEvent {
6279 // Data stall evaluation type.
6280 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6281 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6282 optional int32 evaluation_type = 1;
6283 // See definition in data_stall_event.proto.
6284 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6285 // See definition in data_stall_event.proto.
6286 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6287 // See definition in data_stall_event.proto.
6288 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6289 // See definition in data_stall_event.proto.
6290 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6291 // See definition in data_stall_event.proto.
6292 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6293}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006294
6295/*
6296 * Logs when RescueParty resets some set of experiment flags.
6297 *
6298 * Logged from:
6299 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6300 */
6301message RescuePartyResetReported {
6302 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6303 optional int32 rescue_level = 1;
6304}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006305
6306/**
6307 * Logs when signed config is received from an APK, and if that config was applied successfully.
6308 * Logged from:
6309 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6310 */
6311message SignedConfigReported {
6312 enum Type {
6313 UNKNOWN_TYPE = 0;
6314 GLOBAL_SETTINGS = 1;
6315 }
6316 optional Type type = 1;
6317
6318 // The final status of the signed config received.
6319 enum Status {
6320 UNKNOWN_STATUS = 0;
6321 APPLIED = 1;
6322 BASE64_FAILURE_CONFIG = 2;
6323 BASE64_FAILURE_SIGNATURE = 3;
6324 SECURITY_EXCEPTION = 4;
6325 INVALID_CONFIG = 5;
6326 OLD_CONFIG = 6;
6327 SIGNATURE_CHECK_FAILED = 7;
6328 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006329 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006330 }
6331 optional Status status = 2;
6332
6333 // The version of the signed config processed.
6334 optional int32 version = 3;
6335
6336 // The package name that the config was extracted from.
6337 optional string from_package = 4;
6338
6339 enum Key {
6340 NO_KEY = 0;
6341 DEBUG = 1;
6342 PRODUCTION = 2;
6343 }
6344 // Which key was used to verify the config.
6345 optional Key verified_with = 5;
6346}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006347
6348/*
6349 * Logs GNSS Network-Initiated (NI) location events.
6350 *
6351 * Logged from:
6352 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6353 */
6354message GnssNiEventReported {
6355 // The type of GnssNiEvent.
6356 enum EventType {
6357 UNKNOWN = 0;
6358 NI_REQUEST = 1;
6359 NI_RESPONSE = 2;
6360 }
6361 optional EventType event_type = 1;
6362
6363 // An ID generated by HAL to associate NI notifications and UI responses.
6364 optional int32 notification_id = 2;
6365
6366 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006367 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006368
6369 // NI requires notification.
6370 optional bool need_notify = 4;
6371
6372 // NI requires verification.
6373 optional bool need_verify = 5;
6374
6375 // NI requires privacy override, no notification/minimal trace.
6376 optional bool privacy_override = 6;
6377
6378 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6379 // seconds.
6380 optional int32 timeout = 7;
6381
6382 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006383 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006384
6385 // String representing the requester of the network inititated location request.
6386 optional string requestor_id = 9;
6387
6388 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6389 // network initiated location request.
6390 optional string text = 10;
6391
6392 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006393 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006394
6395 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006396 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006397
6398 // True if SUPL ES is enabled.
6399 optional bool is_supl_es_enabled = 13;
6400
6401 // True if GNSS location is enabled.
6402 optional bool is_location_enabled = 14;
6403
6404 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006405 optional android.server.location.GnssUserResponseType user_response = 15;
6406}
6407
6408/**
6409 * Logs GNSS non-framework (NFW) location notification.
6410 *
6411 * Logged from:
6412 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6413 */
6414message GnssNfwNotificationReported {
6415 // Package name of the Android proxy application representing the non-framework entity that
6416 // requested location. Set to empty string if unknown.
6417 optional string proxy_app_package_name = 1;
6418
6419 // Protocol stack that initiated the non-framework location request.
6420 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6421
6422 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6423 // set to empty string. This field is opaque to the framework and used for logging purposes.
6424 optional string other_protocol_stack_name = 3;
6425
6426 // Source initiating/receiving the location information.
6427 optional android.server.location.NfwRequestor requestor = 4;
6428
6429 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6430 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6431 // and used for logging purposes.
6432 optional string requestor_id = 5;
6433
6434 // Indicates whether location information was provided for this request.
6435 optional android.server.location.NfwResponseType response_type = 6;
6436
6437 // True if the device is in user initiated emergency session.
6438 optional bool in_emergency_mode = 7;
6439
6440 // True if cached location is provided.
6441 optional bool is_cached_location = 8;
6442
6443 // True if proxy app permission mismatch between framework and GNSS HAL.
6444 optional bool is_permission_mismatched = 9;
6445}
6446
6447/**
6448 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6449 *
6450 * Logged from:
6451 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6452 */
6453message GnssConfigurationReported {
6454 // SUPL host name.
6455 optional string supl_host = 1;
6456
6457 // SUPL port number.
6458 optional int32 supl_port = 2;
6459
6460 // C2K host name.
6461 optional string c2k_host = 3;
6462
6463 // C2K port number.
6464 optional int32 c2k_port = 4;
6465
6466 // The SUPL version requested by Carrier.
6467 optional int32 supl_ver = 5;
6468
6469 // The SUPL mode.
6470 optional android.server.location.SuplMode supl_mode = 6;
6471
6472 // True if NI emergency SUPL restrictions is enabled.
6473 optional bool supl_es = 7;
6474
6475 // LTE Positioning Profile settings
6476 optional android.server.location.LppProfile lpp_profile = 8;
6477
6478 // Positioning protocol on A-Glonass system.
6479 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6480
6481 // True if emergency PDN is used. Otherwise, regular PDN is used.
6482 optional bool use_emergency_pdn_for_emergency_supl= 10;
6483
6484 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6485 optional android.server.location.GpsLock gps_lock = 11;
6486
6487 // Number of seconds to extend the emergency session duration post emergency call.
6488 optional int32 es_extension_sec = 12;
6489
6490 // The full list of package names of proxy Android applications representing the non-framework
6491 // location access entities (on/off the device) for which the framework user has granted
6492 // non-framework location access permission. The package names are concatenated in one string
6493 // with spaces as separators.
6494 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006495}
Jack Yu95b64f32018-12-13 18:26:11 +08006496
6497/**
6498 * Logs when a NFC device's error occurred.
6499 * Logged from:
6500 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6501 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6502 */
6503message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006504 enum Type {
6505 UNKNOWN = 0;
6506 CMD_TIMEOUT = 1;
6507 ERROR_NOTIFICATION = 2;
6508 AID_OVERFLOW = 3;
6509 }
6510 optional Type type = 1;
6511 // If it's nci cmd timeout, log the timeout command.
6512 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006513
Alex Salod7c3eef2019-01-25 14:43:27 -08006514 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006515}
6516
6517/**
6518 * Logs when a NFC device's state changed event
6519 * Logged from:
6520 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6521 */
6522message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006523 enum State {
6524 UNKNOWN = 0;
6525 OFF = 1;
6526 ON = 2;
6527 ON_LOCKED = 3; // Secure Nfc enabled.
6528 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6529 }
6530 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006531}
6532
6533/**
6534 * Logs when a NFC Beam Transaction occurred.
6535 * Logged from:
6536 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6537 */
6538message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006539 enum Operation {
6540 UNKNOWN = 0;
6541 SEND = 1;
6542 RECEIVE = 2;
6543 }
6544 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006545}
6546
6547/**
6548 * Logs when a NFC Card Emulation Transaction occurred.
6549 * Logged from:
6550 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6551 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6552 */
6553message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006554 enum Category {
6555 UNKNOWN = 0;
6556 HCE_PAYMENT = 1;
6557 HCE_OTHER = 2;
6558 OFFHOST = 3;
6559 }
6560 // Transaction belongs to HCE payment or HCE other category, or offhost.
6561 optional Category category = 1;
6562 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6563 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006564}
6565
6566/**
6567 * Logs when a NFC Tag event occurred.
6568 * Logged from:
6569 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6570 */
6571message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006572 enum Type {
6573 UNKNOWN = 0;
6574 URL = 1;
6575 BT_PAIRING = 2;
6576 PROVISION = 3;
6577 WIFI_CONNECT = 4;
6578 APP_LAUNCH = 5;
6579 OTHERS = 6;
6580 }
6581 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006582}
6583
6584/**
6585 * Logs when Hce transaction triggered
6586 * Logged from:
6587 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6588 */
6589message NfcHceTransactionOccurred {
6590 // The latency period(in microseconds) it took for the first HCE data
6591 // exchange.
6592 optional uint32 latency_micros = 1;
6593}
6594
6595/**
6596 * Logs when SecureElement state event changed
6597 * Logged from:
6598 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6599 */
6600message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006601 enum State {
6602 UNKNOWN = 0;
6603 INITIALIZED = 1;
6604 DISCONNECTED = 2;
6605 CONNECTED = 3;
6606 HALCRASH = 4;
6607 }
6608 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006609
Alex Salod7c3eef2019-01-25 14:43:27 -08006610 optional string state_change_reason = 2;
6611 // SIMx or eSEx.
6612 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006613}
6614
6615/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006616 * Information about a permission grant request
6617 */
6618message PermissionGrantRequestResultReported {
6619 // unique value identifying an API call. A API call might result in multiple of these atoms
6620 optional int64 request_id = 1;
6621
6622 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006623 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006624
6625 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006626 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006627
6628 // The permission to be granted
6629 optional string permission_name = 4;
6630
6631 // If the permission was explicitly requested via the API or added by the system
6632 optional bool is_implicit = 5;
6633
6634 enum Result {
6635 UNDEFINED = 0;
6636 // permission request was ignored
6637 IGNORED = 1;
6638 // permission request was ignored because it was user fixed
6639 IGNORED_USER_FIXED = 2;
6640 // permission request was ignored because it was policy fixed
6641 IGNORED_POLICY_FIXED = 3;
6642 // permission was granted by user action
6643 USER_GRANTED = 4;
6644 // permission was automatically granted
6645 AUTO_GRANTED = 5;
6646 // permission was denied by user action
6647 USER_DENIED = 6;
6648 // permission was denied with prejudice by the user
6649 USER_DENIED_WITH_PREJUDICE = 7;
6650 // permission was automatically denied
6651 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006652 // permission request was ignored because permission is restricted
6653 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006654 // one time permission was granted by user action
6655 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006656 // user ignored request by leaving the request screen without choosing any option
6657 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006658 // user granted the permission after being linked to settings
6659 USER_GRANTED_IN_SETTINGS = 12;
6660 // user denied the permission after being linked to settings
6661 USER_DENIED_IN_SETTINGS = 13;
6662 // user denied the permission with prejudice after being linked to settings
6663 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6664 // permission was automatically revoked after one-time permission expired
6665 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006666 // permission was automatically revoked for unused app
6667 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006668 }
6669 // The result of the permission grant
6670 optional Result result = 6;
6671}
6672
6673/**
Jack Yu95b64f32018-12-13 18:26:11 +08006674 * Logs when Omapi API used
6675 * Logged from:
6676 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6677 */
6678message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006679 enum Operation {
6680 UNKNOWN = 0;
6681 OPEN_CHANNEL = 1;
6682 }
6683 optional Operation operation = 1;
6684 // SIMx or eSEx.
6685 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006686
Alex Salod7c3eef2019-01-25 14:43:27 -08006687 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006688}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006689
6690/**
Alex Saloa060aee2019-01-21 14:36:41 -08006691 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6692 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006693 * Logged from:
6694 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6695 */
6696message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006697 optional int64 dispatch_latency_millis = 1;
6698}
6699
6700/**
6701 * Logs AttentionManagerService attention check result.
6702 *
6703 * Logged from:
6704 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6705 */
6706message AttentionManagerServiceResultReported {
6707 // See core/java/android/service/attention/AttentionService.java
6708 enum AttentionCheckResult {
6709 UNKNOWN = 20;
6710 ATTENTION_SUCCESS_ABSENT = 0;
6711 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006712 ATTENTION_FAILURE_UNKNOWN = 2;
6713 ATTENTION_FAILURE_CANCELLED = 3;
6714 ATTENTION_FAILURE_PREEMPTED = 4;
6715 ATTENTION_FAILURE_TIMED_OUT = 5;
6716 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006717 }
6718 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006719}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006720
6721/**
6722 * Logs when an adb connection changes state.
6723 *
6724 * Logged from:
6725 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6726 */
6727message AdbConnectionChanged {
6728 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6729 // previously selected for this system.
6730 optional int64 last_connection_time_millis = 1;
6731
6732 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6733 // to reconnect via adb without user interaction.
6734 optional int64 auth_window_millis = 2;
6735
6736 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6737 optional android.debug.AdbConnectionStateEnum state = 3;
6738
6739 // True if the 'always allow' option was selected for this system.
6740 optional bool always_allow = 4;
6741}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006742
6743/*
6744 * Logs the reported speech DSP status.
6745 *
6746 * Logged from:
6747 * Vendor audio implementation.
6748 */
6749message SpeechDspStatReported {
6750 // The total Speech DSP uptime in milliseconds.
6751 optional int32 total_uptime_millis = 1;
6752 // The total Speech DSP downtime in milliseconds.
6753 optional int32 total_downtime_millis = 2;
6754 optional int32 total_crash_count = 3;
6755 optional int32 total_recover_count = 4;
6756}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006757
6758/**
6759 * Logs USB connector contaminant status.
6760 *
6761 * Logged from: USB Service.
6762 */
6763message UsbContaminantReported {
6764 optional string id = 1;
6765 optional android.service.usb.ContaminantPresenceStatus status = 2;
6766}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006767
6768/**
6769 * This atom is for debugging purpose.
6770 */
6771message DebugElapsedClock {
6772 // Monotically increasing value for each pull.
6773 optional int64 pull_count = 1;
6774 // Time from System.elapsedRealtime.
6775 optional int64 elapsed_clock_millis = 2;
6776 // Time from System.elapsedRealtime.
6777 optional int64 same_elapsed_clock_millis = 3;
6778 // Diff between current elapsed time and elapsed time from previous pull.
6779 optional int64 elapsed_clock_diff_millis = 4;
6780
6781 enum Type {
6782 TYPE_UNKNOWN = 0;
6783 ALWAYS_PRESENT = 1;
6784 PRESENT_ON_ODD_PULLS = 2;
6785 }
6786 // Type of behavior for the pulled data.
6787 optional Type type = 5;
6788}
6789
6790/**
6791 * This atom is for debugging purpose.
6792 */
6793message DebugFailingElapsedClock {
6794 // Monotically increasing value for each pull.
6795 optional int64 pull_count = 1;
6796 // Time from System.elapsedRealtime.
6797 optional int64 elapsed_clock_millis = 2;
6798 // Time from System.elapsedRealtime.
6799 optional int64 same_elapsed_clock_millis = 3;
6800 // Diff between current elapsed time and elapsed time from previous pull.
6801 optional int64 elapsed_clock_diff_millis = 4;
6802}
Steven Wuacef6bb2019-01-23 14:21:17 -05006803
6804/** Logs System UI bubbles event changed.
6805 *
6806 * Logged from:
6807 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6808 */
6809message BubbleUIChanged {
6810
6811 // The app package that is posting the bubble.
6812 optional string package_name = 1;
6813
6814 // The notification channel that is posting the bubble.
6815 optional string notification_channel = 2;
6816
6817 // The notification id associated with the posted bubble.
6818 optional int32 notification_id = 3;
6819
6820 // The position of the bubble within the bubble stack.
6821 optional int32 position = 4;
6822
6823 // The total number of bubbles within the bubble stack.
6824 optional int32 total_number = 5;
6825
6826 // User interactions with the bubble.
6827 enum Action {
6828 UNKNOWN = 0;
6829 POSTED = 1;
6830 UPDATED = 2;
6831 EXPANDED = 3;
6832 COLLAPSED = 4;
6833 DISMISSED = 5;
6834 STACK_DISMISSED = 6;
6835 STACK_MOVED = 7;
6836 HEADER_GO_TO_APP = 8;
6837 HEADER_GO_TO_SETTINGS = 9;
6838 PERMISSION_OPT_IN = 10;
6839 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006840 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006841 SWIPE_LEFT = 13;
6842 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006843 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006844 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006845 }
6846 optional Action action = 6;
6847
6848 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6849 optional float normalized_x_position = 7;
6850 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006851
6852 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6853 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006854
6855 // Whether the bubble is an on-going one.
6856 optional bool is_ongoing = 10;
6857
6858 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006859 // This is deprecated and the value should be ignored.
6860 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006861}
Kweku Adams8845d012018-12-11 20:06:45 -08006862
6863/**
Steven Wu552f63f2019-02-05 13:41:36 -05006864 * Logs System UI bubbles developer errors.
6865 *
6866 * Logged from:
6867 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6868 */
6869message BubbleDeveloperErrorReported {
6870
6871 // The app package that is posting the bubble.
6872 optional string package_name = 1;
6873
6874 // Bubble developer error type enums.
6875 enum Error {
6876 UNKNOWN = 0;
6877 ACTIVITY_INFO_MISSING = 1;
6878 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6879 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6880 }
6881 optional Error error = 2 [default = UNKNOWN];
6882}
6883
6884/**
Kweku Adams8845d012018-12-11 20:06:45 -08006885 * Logs that a constraint for a scheduled job has changed.
6886 *
6887 * Logged from:
6888 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6889 */
6890message ScheduledJobConstraintChanged {
6891 repeated AttributionNode attribution_node = 1;
6892
6893 // Name of the job.
6894 optional string job_name = 2;
6895
6896 optional com.android.server.job.ConstraintEnum constraint = 3;
6897
6898 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006899 UNKNOWN = 0;
6900 UNSATISFIED = 1;
6901 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006902 }
6903 optional State state = 4;
6904}
Alex Salod7c3eef2019-01-25 14:43:27 -08006905
6906/**
6907 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6908 * returns true.
6909 *
6910 * Logged from:
6911 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6912 */
6913message ScreenTimeoutExtensionReported {
6914 // Describes how many times in a row did the power manager reset the screen off timeout.
6915 optional uint32 consecutive_timeout_extended_count = 1;
6916}
Hui Yu885aca12019-01-10 17:11:34 -08006917
6918/*
6919* Logs number of milliseconds it takes to start a process.
6920* The definition of app process start time is from the app launch time to
6921* the time that Zygote finished forking the app process and loaded the
6922* application package's java classes.
6923
6924* This metric is different from AppStartOccurred which is for foreground
6925* activity only.
6926
6927* ProcessStartTime can report all processes (both foreground and background)
6928* start time.
6929*
6930* Logged from:
6931* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6932*/
6933message ProcessStartTime {
6934 // The uid of the ProcessRecord.
6935 optional int32 uid = 1 [(is_uid) = true];
6936
6937 // The process pid.
6938 optional int32 pid = 2;
6939
6940 // The process name.
6941 // Usually package name, "system" for system server.
6942 // Provided by ActivityManagerService.
6943 optional string process_name = 3;
6944
6945 enum StartType {
6946 UNKNOWN = 0;
6947 WARM = 1;
6948 HOT = 2;
6949 COLD = 3;
6950 }
6951
6952 // The start type.
6953 optional StartType type = 4;
6954
6955 // The elapsed realtime at the start of the process.
6956 optional int64 process_start_time_millis = 5;
6957
6958 // Number of milliseconds it takes to reach bind application.
6959 optional int32 bind_application_delay_millis = 6;
6960
6961 // Number of milliseconds it takes to finish start of the process.
6962 optional int32 process_start_delay_millis = 7;
6963
6964 // hostingType field in ProcessRecord, the component type such as "activity",
6965 // "service", "content provider", "broadcast" or other strings.
6966 optional string hosting_type = 8;
6967
6968 // hostingNameStr field in ProcessRecord. The component class name that runs
6969 // in this process.
6970 optional string hosting_name = 9;
6971}
6972
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006973/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006974 * Track Media Codec usage
6975 * Logged from:
6976 * frameworks/av/media/libstagefright/MediaCodec.cpp
6977 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6978 */
6979message MediametricsCodecReported {
6980 optional int64 timestamp_nanos = 1;
6981 optional string package_name = 2;
6982 optional int64 package_version_code = 3;
6983 optional int64 media_apex_version = 4;
6984
6985 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6986}
6987
6988/**
6989 * Track Media Extractor (pulling video/audio streams out of containers) usage
6990 * Logged from:
6991 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6992 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6993 */
6994message MediametricsExtractorReported {
6995 optional int64 timestamp_nanos = 1;
6996 optional string package_name = 2;
6997 optional int64 package_version_code = 3;
6998 optional int64 media_apex_version = 4;
6999
7000 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7001}
7002
7003/**
7004 * Track how we arbitrate between microphone/input requests.
7005 * Logged from
7006 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7007 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7008 */
7009message MediametricsAudiopolicyReported {
7010 optional int64 timestamp_nanos = 1;
7011 optional string package_name = 2;
7012 optional int64 package_version_code = 3;
7013 optional int64 media_apex_version = 4;
7014
7015 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7016}
7017
7018/**
7019 * Track how we arbitrate between microphone requests.
7020 * Logged from
7021 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7022 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7023 */
7024message MediametricsAudiorecordReported {
7025 optional int64 timestamp_nanos = 1;
7026 optional string package_name = 2;
7027 optional int64 package_version_code = 3;
7028 optional int64 media_apex_version = 4;
7029
7030 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7031}
7032
7033/**
7034 * Track how we arbitrate between microphone/input requests.
7035 * Logged from
7036 * frameworks/av/media/libnblog/ReportPerformance.cpp
7037 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7038 */
7039message MediametricsAudiothreadReported {
7040 optional int64 timestamp_nanos = 1;
7041 optional string package_name = 2;
7042 optional int64 package_version_code = 3;
7043 optional int64 media_apex_version = 4;
7044
7045 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7046}
7047
7048/**
7049 * Track how we arbitrate between microphone/input requests.
7050 * Logged from
7051 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7052 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7053 */
7054message MediametricsAudiotrackReported {
7055 optional int64 timestamp_nanos = 1;
7056 optional string package_name = 2;
7057 optional int64 package_version_code = 3;
7058 optional int64 media_apex_version = 4;
7059
7060 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7061}
7062
7063/**
7064 * Track information about DRM framework performance
7065 * Logged from
7066 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7067 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7068 */
7069message MediametricsMediadrmReported {
7070 optional int64 timestamp_nanos = 1;
7071 optional string package_name = 2;
7072 optional int64 package_version_code = 3;
7073 optional int64 media_apex_version = 4;
7074
7075 // vendor+description tell about which DRM plugin is in use on this device
7076 optional string vendor = 5;
7077 optional string description = 6;
7078 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7079 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7080}
7081
7082/**
7083 * Track information about the widevine DRM plugin performance
7084 * Logged from
7085 * vendor/widevine/libwvdrmengine/cdm/metrics
7086 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7087 */
7088message MediametricsDrmWidevineReported {
7089 optional int64 timestamp_nanos = 1;
7090 optional string package_name = 2;
7091 optional int64 package_version_code = 3;
7092 optional int64 media_apex_version = 4;
7093
7094 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7095}
7096
7097/**
7098 * Track information about recordings (e.g. camcorder)
7099 * Logged from
7100 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7101 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7102 */
7103message MediametricsRecorderReported {
7104 optional int64 timestamp_nanos = 1;
7105 optional string package_name = 2;
7106 optional int64 package_version_code = 3;
7107 optional int64 media_apex_version = 4;
7108
7109 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7110}
7111
7112/**
7113 * Track Media Player usage
7114 * Logged from:
7115 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7116 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7117 */
7118message MediametricsNuPlayerReported {
7119 optional int64 timestamp_nanos = 1;
7120 optional string package_name = 2;
7121 optional int64 package_version_code = 3;
7122 optional int64 media_apex_version = 4;
7123
7124 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7125}
7126
7127/**
Robert Shiha4beed32019-08-19 14:15:23 -07007128 * Track Legacy DRM usage
7129 * Logged from
7130 * frameworks/av/drm/drmserver/DrmManager.cpp
7131 */
7132message MediametricsDrmManagerReported {
7133 optional int64 timestamp_nanos = 1;
7134 optional string package_name = 2;
7135 optional int64 package_version_code = 3;
7136 optional int64 media_apex_version = 4;
7137
7138 enum Method {
7139 METHOD_NOT_FOUND = -1;
7140 GET_CONSTRAINTS = 0;
7141 GET_METADATA = 1;
7142 CAN_HANDLE = 2;
7143 PROCESS_DRM_INFO = 3;
7144 ACQUIRE_DRM_INFO = 4;
7145 SAVE_RIGHTS = 5;
7146 GET_ORIGINAL_MIME_TYPE = 6;
7147 GET_DRM_OBJECT_TYPE = 7;
7148 CHECK_RIGHTS_STATUS = 8;
7149 REMOVE_RIGHTS = 9;
7150 REMOVE_ALL_RIGHTS = 10;
7151 OPEN_CONVERT_SESSION = 11;
7152 OPEN_DECRYPT_SESSION = 12;
7153 }
7154
7155 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7156 optional string plugin_id = 5;
7157 optional string description = 6;
7158 optional Method method = 7;
7159 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007160
7161 optional int64 get_constraints_count = 9;
7162 optional int64 get_metadata_count = 10;
7163 optional int64 can_handle_count = 11;
7164 optional int64 process_drm_info_count = 12;
7165 optional int64 acquire_drm_info_count = 13;
7166 optional int64 save_rights_count = 14;
7167 optional int64 get_original_mime_type_count = 15;
7168 optional int64 get_drm_object_type_count = 16;
7169 optional int64 check_rights_status_count = 17;
7170 optional int64 remove_rights_count = 18;
7171 optional int64 remove_all_rights_count = 19;
7172 optional int64 open_convert_session_count = 20;
7173 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007174}
7175
7176/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007177 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007178 * Pulled from: StatsCompanionService
7179*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007180message DangerousPermissionState {
7181 // Name of the permission
7182 optional string permission_name = 1;
7183
7184 // Uid of the package
7185 optional int32 uid = 2 [(is_uid) = true];
7186
7187 // Package requesting the permission
7188 optional string package_name = 3;
7189
7190 // If the permission is granted to the uid
7191 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007192
7193 // Permission flags as per android.content.pm.PermissionFlags
7194 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007195}
7196
Michael Groover4a0ca942019-01-24 17:41:25 -08007197/**
7198 * Logs when a package is denied access to a device identifier based on the new access requirements.
7199 *
7200 * Logged from:
7201 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7202 */
7203message DeviceIdentifierAccessDenied {
7204 // The name of the package denied access to the requested device identifier.
7205 optional string package_name = 1;
7206
7207 // The name of the device identifier method the package attempted to invoke.
7208 optional string method_name = 2;
7209
7210 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007211 // Starting from Android 11, this boolean is not set and will always be false.
7212 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007213
7214 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007215 // Starting from Android 11, this boolean is not set and will always be false.
7216 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007217}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007218
7219/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007220 * Pulls the ongoing mainline install train version code.
7221 * Pulled from StatsCompanionService
7222 */
7223message TrainInfo {
7224 optional int64 train_version_code = 1;
7225
7226 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007227
7228 optional string train_name = 3;
7229
7230 enum Status {
7231 UNKNOWN = 0;
7232 INSTALL_REQUESTED = 1;
7233 INSTALL_STARTED = 2;
7234 INSTALL_STAGED_NOT_READY = 3;
7235 INSTALL_STAGED_READY = 4;
7236 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007237 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7238 // and INSTALL_FAILURE_COMMIT.
7239 INSTALL_FAILURE = 6 [deprecated = true];
7240 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007241 INSTALL_CANCELLED = 7;
7242 INSTALLER_ROLLBACK_REQUESTED = 8;
7243 INSTALLER_ROLLBACK_INITIATED = 9;
7244 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7245 INSTALLER_ROLLBACK_STAGED = 11;
7246 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7247 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7248 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7249 INSTALLER_ROLLBACK_SUCCESS = 15;
7250 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007251 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7252 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7253 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7254 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7255 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7256 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007257 INSTALL_FAILURE_DOWNLOAD = 23;
7258 INSTALL_FAILURE_STATE_MISMATCH = 24;
7259 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007260 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007261 }
7262 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007263}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007264
7265/**
7266 * Logs the gesture stage changed event.
7267 *
7268 * Logged from:
7269 * frameworks/base/packages/SystemUI/
7270 */
7271message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007272 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007273}
7274
7275/**
7276 * Logs the feedback type.
7277 *
7278 * Logged from:
7279 * frameworks/base/packages/SystemUI/
7280 */
7281message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007282 // Whether or not the gesture was used.
7283 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007284}
7285
7286/**
7287 * Logs the progress.
7288 *
7289 * Logged from:
7290 * frameworks/base/packages/SystemUI/
7291 */
7292message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007293 // [0,100] progress for the assist gesture.
7294 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007295}
Neil Fullerdb14b482019-02-05 19:44:44 +00007296
7297/*
7298 * Information about the time zone data on a device.
7299 */
7300message TimeZoneDataInfo {
7301 // A version identifier for the data set on device. e.g. "2018i"
7302 optional string tzdb_version = 1;
7303}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007304
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007305/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007306 * Logs the GPU stats global health information.
7307 *
7308 * Logged from:
7309 * frameworks/native/services/gpuservice/gpustats/
7310 */
7311message GpuStatsGlobalInfo {
7312 // Package name of the gpu driver.
7313 optional string driver_package_name = 1;
7314
7315 // Version name of the gpu driver.
7316 optional string driver_version_name = 2;
7317
7318 // Version code of the gpu driver.
7319 optional int64 driver_version_code = 3;
7320
7321 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7322 optional int64 driver_build_time = 4;
7323
7324 // Total count of the gl driver gets loaded.
7325 optional int64 gl_loading_count = 5;
7326
7327 // Total count of the gl driver fails to be loaded.
7328 optional int64 gl_loading_failure_count = 6;
7329
7330 // Total count of the Vulkan driver gets loaded.
7331 optional int64 vk_loading_count = 7;
7332
7333 // Total count of the Vulkan driver fails to be loaded.
7334 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007335
7336 // Api version of the system Vulkan driver.
7337 optional int32 vulkan_version = 9;
7338
7339 // Api version of the system CPU Vulkan driver.
7340 optional int32 cpu_vulkan_version = 10;
7341
7342 // Api version of the system GLES driver.
7343 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007344
7345 // Total count of the angle driver gets loaded.
7346 optional int64 angle_loading_count = 12;
7347
7348 // Total count of the angle driver fails to be loaded.
7349 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007350}
7351
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007352/**
7353 * GPU driver loading time info.
7354 */
7355message GpuDriverLoadingTime {
7356 // List of all the driver loading times for this app. The list size is
7357 // capped at 50.
7358 repeated int64 driver_loading_time = 1;
7359}
7360
7361/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007362 * Logs the GPU stats per app health information.
7363 *
7364 * Logged from:
7365 * frameworks/native/services/gpuservice/gpustats/
7366 */
7367message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007368 // Package name of the application that loads the gpu driver. Total number
7369 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007370 optional string app_package_name = 1;
7371
7372 // Version code of the gpu driver this app loads.
7373 optional int64 driver_version_code = 2;
7374
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007375 // gl driver loading time info.
7376 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7377 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007378
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007379 // Vulkan driver loading time info.
7380 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7381 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007382
7383 // Angle driver loading time info.
7384 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7385 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007386
7387 // CPU Vulkan implementation is in use.
7388 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007389
7390 // App is not doing pre-rotation correctly.
7391 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007392
7393 // App creates GLESv1 context.
7394 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007395}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007396
7397/*
7398 * Logs the size of the system ion heap.
7399 *
7400 * Pulled from StatsCompanionService.
7401 */
7402message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007403 // Deprecated due to limited support of ion stats in debugfs.
7404 // Use `IonHeapSize` instead.
7405 option deprecated = true;
7406
Rafal Slawikd4e87572019-03-12 13:08:38 +00007407 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007408 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007409 optional int64 size_in_bytes = 1;
7410}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007411
Rafal Slawik77987ed2019-06-17 12:28:23 +01007412/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007413 * Logs the total size of the ion heap.
7414 *
7415 * Pulled from StatsCompanionService.
7416 */
7417message IonHeapSize {
7418 // Total size of all ion heaps in kilobytes.
7419 // Read from: /sys/kernel/ion/total_heaps_kb.
7420 optional int32 total_size_kb = 1;
7421}
7422
7423/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007424 * Logs the per-process size of the system ion heap.
7425 *
7426 * Pulled from StatsCompanionService.
7427 */
7428message ProcessSystemIonHeapSize {
7429 // The uid if available. -1 means not available.
7430 optional int32 uid = 1 [(is_uid) = true];
7431
7432 // The process name (from /proc/PID/cmdline).
7433 optional string process_name = 2;
7434
7435 // Sum of sizes of all allocations.
7436 optional int32 total_size_in_kilobytes = 3;
7437
7438 // Number of allocations.
7439 optional int32 allocation_count = 4;
7440
7441 // Size of the largest allocation.
7442 optional int32 max_size_in_kilobytes = 5;
7443}
7444
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007445/**
7446 * Push network stack events.
7447 *
7448 * Log from:
7449 * frameworks/base/packages/NetworkStack/
7450 */
7451message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007452 // The id that indicates the event reported from NetworkStack.
7453 optional int32 event_id = 1;
7454 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007455 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7456}
Carmen Agimofa769c152019-03-04 14:39:14 +00007457
7458/**
7459 * Logs the apps that are installed on the external storage.
7460 * Pulled from:
7461 * StatsCompanionService
7462 */
7463message AppsOnExternalStorageInfo {
7464 // The type of the external storage.
7465 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7466 // The name of the package that is installed on the external storage.
7467 optional string package_name = 2;
7468}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007469
7470/**
7471 * Logs the settings related to Face.
7472 * Logged from:
7473 * frameworks/base/services/core/java/com/android/server/stats
7474 */
7475message FaceSettings {
7476 // Whether or not face unlock is allowed on Keyguard.
7477 optional bool unlock_keyguard_enabled = 1;
7478 // Whether or not face unlock dismisses the Keyguard.
7479 optional bool unlock_dismisses_keyguard = 2;
7480 // Whether or not face unlock requires attention.
7481 optional bool unlock_attention_required = 3;
7482 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7483 optional bool unlock_app_enabled = 4;
7484 // Whether or not face unlock always requires user confirmation.
7485 optional bool unlock_always_require_confirmation = 5;
7486 // Whether or not a diverse set of poses are required during enrollment.
7487 optional bool unlock_diversity_required = 6;
7488}
Maggie White442b6312019-04-05 16:26:44 -07007489
7490/**
7491 * Logs cooling devices maintained by the kernel.
7492 *
7493 * Pulled from StatsCompanionService.java
7494 */
7495message CoolingDevice {
7496 // The type of cooling device being reported. Eg. CPU, GPU...
7497 optional android.os.CoolingTypeEnum device_location = 1;
7498 // The name of the cooling device source. Eg. CPU0
7499 optional string device_name = 2;
7500 // Current throttle state of the cooling device. The value can any unsigned
7501 // integer between 0 and max_state defined in its driver. 0 means device is
7502 // not in throttling, higher value means deeper throttling.
7503 optional int32 state = 3;
7504}
Ben Blount763a5d52019-04-10 11:48:58 -07007505
7506/**
7507 * Intelligence has several counter-type events that don't warrant a
7508 * full separate atom. These are primarily API call counters but also include
7509 * counters for feature usage and specific failure modes.
7510 *
7511 * Logged from the Intelligence mainline module.
7512 */
7513message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007514 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007515 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007516 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007517 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007518 // How many times the event occured (to report a batch of high frequency events).
7519 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007520 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007521 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007522}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007523
7524/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007525 * Logs when Car Power state changed.
7526 *
7527 * Logged from:
7528 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7529 */
7530message CarPowerStateChanged {
7531 // States come from CpmsState in CarPowerManagementService.java.
7532 enum State {
7533 WAIT_FOR_VHAL = 0;
7534 ON = 1;
7535 SHUTDOWN_PREPARE = 2;
7536 WAIT_FOR_FINISH = 3;
7537 SUSPEND = 4;
7538 SIMULATE_SLEEP = 5;
7539 }
7540 optional State state = 1;
7541}
7542
7543/**
7544 * Logs whether GarageMode is entered.
7545 *
7546 * Logged from:
7547 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7548 */
7549message GarageModeInfo {
7550 // Whether GarageMode is entered.
7551 optional bool is_garage_mode = 1;
7552}
Martijn Coenencd95d462019-04-25 17:09:45 +02007553
7554/**
7555 * Historical app ops data per package.
7556 */
7557message AppOps {
7558 // Uid of the package requesting the op
7559 optional int32 uid = 1 [(is_uid) = true];
7560
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007561 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007562 optional string package_name = 2;
7563
7564 // operation id; maps to the OP_* constants in AppOpsManager.java
7565 optional int32 op_id = 3;
7566
7567 // The number of times the op was granted while the app was in the
7568 // foreground (only for trusted requests)
7569 optional int64 trusted_foreground_granted_count = 4;
7570
7571 // The number of times the op was granted while the app was in the
7572 // background (only for trusted requests)
7573 optional int64 trusted_background_granted_count = 5;
7574
7575 // The number of times the op was rejected while the app was in the
7576 // foreground (only for trusted requests)
7577 optional int64 trusted_foreground_rejected_count = 6;
7578
7579 // The number of times the op was rejected while the app was in the
7580 // background (only for trusted requests)
7581 optional int64 trusted_background_rejected_count = 7;
7582
7583 // For long-running operations, total duration of the operation
7584 // while the app was in the foreground (only for trusted requests)
7585 optional int64 trusted_foreground_duration_millis = 8;
7586
7587 // For long-running operations, total duration of the operation
7588 // while the app was in the background (only for trusted requests)
7589 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007590
7591 // Whether AppOps is guarded by Runtime permission
7592 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007593}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007594
7595/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007596 * Historical app ops data per package and features.
7597 */
7598message AppFeaturesOps {
7599 // Uid of the package requesting the op
7600 optional int32 uid = 1 [(is_uid) = true];
7601
7602 // Name of the package performing the op
7603 optional string package_name = 2;
7604
7605 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7606 // Features must be provided through manifest using <feature> tag available in R and above.
7607 optional string feature_id = 3;
7608
7609 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7610 optional string op = 4;
7611
7612 // The number of times the op was granted while the app was in the
7613 // foreground (only for trusted requests)
7614 optional int64 trusted_foreground_granted_count = 5;
7615
7616 // The number of times the op was granted while the app was in the
7617 // background (only for trusted requests)
7618 optional int64 trusted_background_granted_count = 6;
7619
7620 // The number of times the op was rejected while the app was in the
7621 // foreground (only for trusted requests)
7622 optional int64 trusted_foreground_rejected_count = 7;
7623
7624 // The number of times the op was rejected while the app was in the
7625 // background (only for trusted requests)
7626 optional int64 trusted_background_rejected_count = 8;
7627
7628 // For long-running operations, total duration of the operation
7629 // while the app was in the foreground (only for trusted requests)
7630 optional int64 trusted_foreground_duration_millis = 9;
7631
7632 // For long-running operations, total duration of the operation
7633 // while the app was in the background (only for trusted requests)
7634 optional int64 trusted_background_duration_millis = 10;
7635
7636 // Whether AppOps is guarded by Runtime permission
7637 optional bool is_runtime_permission = 11;
7638}
7639
7640/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007641 * Location Manager API Usage information(e.g. API under usage,
7642 * API call's parameters).
7643 * Logged from:
7644 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7645 */
7646message LocationManagerApiUsageReported {
7647
7648 // Indicating if usage starts or usage ends.
7649 optional android.stats.location.UsageState state = 1;
7650
7651 // LocationManagerService's API in use.
7652 // We can identify which API from LocationManager is
7653 // invoking current LMS API by the combination of
7654 // API parameter(e.g. is_listener_null, is_intent_null,
7655 // is_location_request_null)
7656 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7657
7658 // Name of the package calling the API.
7659 optional string calling_package_name = 3;
7660
7661 // Type of the location provider.
7662 optional android.stats.location.ProviderType provider = 4;
7663
7664 // Quality of the location request
7665 optional android.stats.location.LocationRequestQuality quality = 5;
7666
7667 // The desired interval for active location updates, in milliseconds.
7668 // Bucketized to reduce cardinality.
7669 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7670
7671 // Minimum distance between location updates, in meters.
7672 // Bucketized to reduce cardinality.
7673 optional android.stats.location.SmallestDisplacementBucket
7674 bucketized_smallest_displacement = 7;
7675
7676 // The number of location updates.
7677 optional int64 num_updates = 8;
7678
7679 // The request expiration time, in millisecond since boot.
7680 // Bucketized to reduce cardinality.
7681 optional android.stats.location.ExpirationBucket
7682 bucketized_expire_in = 9;
7683
7684 // Type of Callback passed in for this API.
7685 optional android.stats.location.CallbackType callback_type = 10;
7686
7687 // The radius of the central point of the alert
7688 // region, in meters. Only for API REQUEST_GEOFENCE.
7689 // Bucketized to reduce cardinality.
7690 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7691
7692 // Activity Importance of API caller.
7693 // Categorized to 3 types that are interesting from location's perspective.
7694 optional android.stats.location.ActivityImportance activiy_importance = 12;
7695}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007696
7697/**
7698 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7699 */
7700message ReviewPermissionsFragmentResultReported {
7701 // unique value identifying a permission group change. A permission group change might result
7702 // in multiple of these atoms
7703 optional int64 change_id = 1;
7704
7705 // UID of package the permission belongs to
7706 optional int32 uid = 2 [(is_uid) = true];
7707
7708 // Name of package the permission belongs to
7709 optional string package_name = 3;
7710
7711 // The permission to be granted
7712 optional string permission_name = 4;
7713
7714 // The result of the permission grant
7715 optional bool permission_granted = 5;
7716}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007717
7718/**
7719* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7720* Logged from: RuntimePermissionUpdgradeController
7721*/
7722message RuntimePermissionsUpgradeResult {
7723 // Permission granted as result of upgrade
7724 optional string permission_name = 1;
7725
7726 // UID of package granted permission
7727 optional int32 uid = 2 [(is_uid) = true];
7728
7729 // Name of package granted permission
7730 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007731}
7732
7733/**
7734* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7735*/
7736message GrantPermissionsActivityButtonActions {
7737 // Permission granted as result of upgrade
7738 optional string permission_group_name = 1;
7739
7740 // UID of package granted permission
7741 optional int32 uid = 2 [(is_uid) = true];
7742
7743 // Name of package requesting permission
7744 optional string package_name = 3;
7745
7746 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7747 // LABEL_ constants in GrantPermissionActivity.java
7748 optional int32 buttons_presented = 4;
7749
7750 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7751 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007752
7753 // id which identifies single session of user interacting with permission controller
7754 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007755}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007756
7757/**
7758 * Information about LocationAccessCheck notification presented to user
7759 */
7760message LocationAccessCheckNotificationAction {
7761
7762 // id which identifies single session of user interacting with permission controller
7763 optional int64 session_id = 1;
7764
7765 // Uid of package for which location access check is presented
7766 optional int32 package_uid = 2;
7767
7768 // Name of package for which location access check is presented
7769 optional string package_name = 3;
7770
7771 enum Result {
7772 UNDEFINED = 0;
7773 // notification was presented to the user
7774 NOTIFICATION_PRESENTED = 1;
7775 // notification was declined by the user
7776 NOTIFICATION_DECLINED = 2;
7777 // notification was clicked by the user
7778 NOTIFICATION_CLICKED = 3;
7779 }
7780
7781 // View / interaction recorded
7782 optional Result result = 4;
7783}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007784
7785/**
7786 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7787 */
7788message AppPermissionFragmentActionReported {
7789 // id which identifies single session of user interacting with permission controller
7790 optional int64 session_id = 1;
7791
7792 // unique value identifying a permission group change. A permission group change might result
7793 // in multiple of these atoms
7794 optional int64 change_id = 2;
7795
7796 // UID of package the permission belongs to
7797 optional int32 uid = 3 [(is_uid) = true];
7798
7799 // Name of package the permission belongs to
7800 optional string package_name = 4;
7801
7802 // The permission to be granted
7803 optional string permission_name = 5;
7804
7805 // The result of the permission grant
7806 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007807
7808 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7809 optional int32 permission_flags = 7;
7810
7811 enum Button {
7812 UNDEFINED = 0;
7813 // Allow button
7814 ALLOW = 1;
7815 // Deny button
7816 DENY = 2;
7817 // Ask every time button
7818 ASK_EVERY_TIME = 3;
7819 // Allow all the time button
7820 ALLOW_ALWAYS = 4;
7821 // Allow only while using the app button
7822 ALLOW_FOREGROUND = 5;
7823 // Same is Deny button but shown in while in use dialog
7824 DENY_FOREGROUND = 6;
7825 }
7826
7827 // Button pressed in the dialog
7828 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007829}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007830
7831/**
7832* Information about a AppPermissionFragment viewed by user
7833*/
7834message AppPermissionFragmentViewed {
7835 // id which identifies single session of user interacting with permission controller
7836 optional int64 session_id = 1;
7837
7838 // UID of package for which permissions are viewed
7839 optional int32 uid = 2 [(is_uid) = true];
7840
7841 // Name of package for which permissions are viewed
7842 optional string package_name = 3;
7843
7844 // Permission group viewed
7845 optional string permission_group_name = 4;
7846}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007847
7848/**
7849* Information about a AppPermissionsFragment viewed by user
7850*/
7851message AppPermissionsFragmentViewed {
7852 // id which identifies single session of user interacting with permission controller
7853 optional int64 session_id = 1;
7854
7855 // id which identifies single view as every view might have several logging records
7856 // with different package information attached
7857 optional int64 view_id = 2;
7858
7859 // Permission group viewed
7860 optional string permission_group_name = 3;
7861
7862 // UID of package for which permissions are viewed
7863 optional int32 uid = 4 [(is_uid) = true];
7864
7865 // Name of package for which permissions are viewed
7866 optional string package_name = 5;
7867
7868 // Category in which permission is included
7869 enum Category {
7870 UNDEFINED = 0;
7871 ALLOWED = 1;
7872 ALLOWED_FOREGROUND = 2;
7873 DENIED = 3;
7874 }
7875 optional Category category = 6;
7876}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007877
7878/**
7879* Information about a PermissionAppsFragment viewed by user.
7880* Logged from ui/handheld/PermissionAppsFragment.java
7881*/
7882message PermissionAppsFragmentViewed {
7883 // id which identifies single session of user interacting with permission controller
7884 optional int64 session_id = 1;
7885
7886 // id which identifies single view as every view might have several logging records
7887 // with different package information attached
7888 optional int64 view_id = 2;
7889
7890 // Permission group viewed
7891 optional string permission_group_name = 3;
7892
7893 // UID of package for which permissions are viewed
7894 optional int32 uid = 4 [(is_uid) = true];
7895
7896 // Name of package for which permissions are viewed
7897 optional string package_name = 5;
7898
7899 // Category in which app is included
7900 enum Category {
7901 UNDEFINED = 0;
7902 ALLOWED = 1;
7903 ALLOWED_FOREGROUND = 2;
7904 DENIED = 3;
7905 }
7906 optional Category category = 6;
7907}
Tony Make2b1b672019-07-29 16:59:47 +01007908
7909/**
7910 * Logs when there is a smart selection related event.
7911 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7912 * Logged from: TextClassifierEventLogger.java
7913 */
7914message TextSelectionEvent {
7915 // A session ID.
7916 optional string session_id = 1;
7917
7918 // Event type of this event.
7919 optional android.stats.textclassifier.EventType event_type = 2;
7920
Tony Mak9c84bd22019-12-09 07:27:25 +00007921 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007922 optional string model_name = 3;
7923
7924 // Type of widget that was involved in triggering this event.
7925 optional android.stats.textclassifier.WidgetType widget_type = 4;
7926
7927 // Index of this event in a session.
7928 optional int32 event_index = 5;
7929
7930 // Entity type that is involved.
7931 optional string entity_type = 6;
7932
7933 // Relative word index of the start of the selection.
7934 optional int32 relative_word_start_index = 7;
7935
7936 // Relative word (exclusive) index of the end of the selection.
7937 optional int32 relative_word_end_index = 8;
7938
7939 // Relative word index of the start of the smart selection.
7940 optional int32 relative_suggested_word_start_index = 9;
7941
7942 // Relative word (exclusive) index of the end of the smart selection.
7943 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007944
7945 // Name of source package.
7946 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007947}
7948
7949/**
7950 * Logs when there is a smart linkify related event.
7951 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7952 * Logged from: TextClassifierEventLogger.java
7953 */
7954message TextLinkifyEvent {
7955 // A session ID.
7956 optional string session_id = 1;
7957
7958 // Event type of this event.
7959 optional android.stats.textclassifier.EventType event_type = 2;
7960
Tony Mak9c84bd22019-12-09 07:27:25 +00007961 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007962 optional string model_name = 3;
7963
7964 // Type of widget that was involved in triggering this event.
7965 optional android.stats.textclassifier.WidgetType widget_type = 4;
7966
7967 // Index of this event in a session.
7968 optional int32 event_index = 5;
7969
7970 // Entity type that is involved.
7971 optional string entity_type = 6;
7972
7973 // Number of links detected.
7974 optional int32 num_links = 7;
7975
7976 // The total length of all links.
7977 optional int32 linked_text_length = 8;
7978
7979 // Length of input text.
7980 optional int32 text_length = 9;
7981
7982 // Time spent on generating links in ms.
7983 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007984
7985 // Name of source package.
7986 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007987}
7988
7989/**
7990 * Logs when there is a conversation actions related event.
7991 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7992 * Logged from: TextClassifierEventLogger.java
7993 */
7994message ConversationActionsEvent {
7995 // A session ID.
7996 optional string session_id = 1;
7997
7998 // Event type of this event.
7999 optional android.stats.textclassifier.EventType event_type = 2;
8000
Tony Mak9c84bd22019-12-09 07:27:25 +00008001 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008002 optional string model_name = 3;
8003
8004 // Type of widget that was involved in triggering this event.
8005 optional android.stats.textclassifier.WidgetType widget_type = 4;
8006
8007 // The first entity type that is involved.
8008 optional string first_entity_type = 5;
8009
8010 // The second entity type that is involved.
8011 optional string second_entity_type = 6;
8012
8013 // The third entity type that is involved.
8014 optional string third_entity_type = 7;
8015
8016 // The score of the first entity type.
8017 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008018
8019 // Name of source package.
8020 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008021
8022 // Name of the annotator model that is involved in this event.
8023 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008024}
8025
8026/**
8027 * Logs when there is a language detection related event.
8028 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8029 * Logged from: TextClassifierEventLogger.java
8030 */
8031message LanguageDetectionEvent {
8032 // A session ID.
8033 optional string session_id = 1;
8034
8035 // Event type of this event.
8036 optional android.stats.textclassifier.EventType event_type = 2;
8037
Tony Mak9c84bd22019-12-09 07:27:25 +00008038 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008039 optional string model_name = 3;
8040
8041 // Type of widget that was involved in triggering this event.
8042 optional android.stats.textclassifier.WidgetType widget_type = 4;
8043
8044 // Detected language.
8045 optional string language_tag = 5;
8046
8047 // Score of the detected language.
8048 optional float score = 6;
8049
8050 // Position of this action.
8051 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008052
8053 // Name of source package.
8054 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008055}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008056
8057/**
8058 * Information about an OTA update attempt by update_engine.
8059 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8060 */
8061message UpdateEngineUpdateAttemptReported {
8062 // The number of attempts for the update engine to apply a given payload.
8063 optional int32 attempt_number = 1;
8064
8065 optional android.stats.otaupdate.PayloadType payload_type = 2;
8066
8067 // The total time in minutes for the update engine to apply a given payload.
8068 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8069 // it's increased when the system is sleeping.
8070 optional int32 duration_boottime_in_minutes = 3;
8071
8072 // The total time in minutes for the update engine to apply a given payload.
8073 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8074 // and it's not increased when the system is sleeping.
8075 optional int32 duration_monotonic_in_minutes = 4;
8076
8077 // The size of the payload in MiBs.
8078 optional int32 payload_size_mib = 5;
8079
8080 // The attempt result reported by the update engine for an OTA update.
8081 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8082
8083 // The error code reported by the update engine after an OTA update attempt
8084 // on A/B devices.
8085 optional android.stats.otaupdate.ErrorCode error_code = 7;
8086
8087 // The build fingerprint of the source system. The value is read from a
8088 // system property when the device takes the update. e.g.
8089 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8090 optional string source_fingerprint = 8;
8091}
8092
8093/**
8094 * Information about all the attempts the device make before finishing the
8095 * successful update.
8096 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8097 */
8098message UpdateEngineSuccessfulUpdateReported {
8099 // The number of attempts for the update engine to apply the payload for a
8100 // successful update.
8101 optional int32 attempt_count = 1;
8102
8103 optional android.stats.otaupdate.PayloadType payload_type = 2;
8104
8105 optional int32 payload_size_mib = 3;
8106
8107 // The total number of bytes downloaded by update_engine since the last
8108 // successful update.
8109 optional int32 total_bytes_downloaded_mib = 4;
8110
8111 // The ratio in percentage of the over-downloaded bytes compared to the
8112 // total bytes needed to successfully install the update. e.g. 200 if we
8113 // download 200MiB in total for a 100MiB package.
8114 optional int32 download_overhead_percentage = 5;
8115
8116 // The total time in minutes for the update engine to apply the payload for a
8117 // successful update.
8118 optional int32 total_duration_minutes = 6;
8119
8120 // The number of reboot of the device during a successful update.
8121 optional int32 reboot_count = 7;
8122}
Alec Mourie088e762019-07-02 13:10:55 -07008123
8124/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008125 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8126 * key to indicate whether it was successful or not.
8127 *
8128 * Logged from:
8129 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8130 */
8131message RebootEscrowRecoveryReported {
8132 optional bool successful = 1;
8133}
8134
8135/**
Alec Mourie088e762019-07-02 13:10:55 -07008136 * Global display pipeline metrics reported by SurfaceFlinger.
8137 * Pulled from:
8138 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8139 */
8140message SurfaceflingerStatsGlobalInfo {
8141 // Total number of frames presented during the tracing period
8142 optional int64 total_frames = 1;
8143 // Total number of frames missed
8144 optional int64 missed_frames = 2;
8145 // Total number of frames that fell back to client composition
8146 optional int64 client_composition_frames = 3;
8147 // Total time the display was turned on
8148 optional int64 display_on_millis = 4;
8149 // Total time that was spent performing animations.
8150 // This is derived from the present-to-present layer histogram
8151 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008152 // Total number of event connections tracked by SurfaceFlinger at the time
8153 // of this pull. If this number grows prohibitively large, then this can
8154 // cause jank due to resource contention.
8155 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008156 // Set of timings measured from when SurfaceFlinger began compositing a
8157 // frame, until the frame was requested to be presented to the display. This
8158 // measures SurfaceFlinger's total CPU walltime on the critical path per
8159 // frame.
8160 optional FrameTimingHistogram frame_duration = 7
8161 [(android.os.statsd.log_mode) = MODE_BYTES];
8162 // Set of timings measured from when SurfaceFlinger first began using the
8163 // GPU to composite a frame, until the GPU has finished compositing that
8164 // frame. This measures the total additional time SurfaceFlinger needed to
8165 // perform due to falling back into GPU composition.
8166 optional FrameTimingHistogram render_engine_timing = 8
8167 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008168}
8169
8170/**
8171 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8172 * The number of layers uploaded will be restricted due to size limitations.
8173 * Pulled from:
8174 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8175 */
8176message SurfaceflingerStatsLayerInfo {
8177 // The layer for this set of metrics
8178 // For now we can infer that the package name is included in the layer
8179 // name.
8180 optional string layer_name = 1;
8181 // Total number of frames presented
8182 optional int64 total_frames = 2;
8183 // Total number of dropped frames while latching a buffer for this layer.
8184 optional int64 dropped_frames = 3;
8185 // Set of timings measured between successive presentation timestamps.
8186 optional FrameTimingHistogram present_to_present = 4
8187 [(android.os.statsd.log_mode) = MODE_BYTES];
8188 // Set of timings measured from when an app queued a buffer for
8189 // presentation, until the buffer was actually presented to the
8190 // display.
8191 optional FrameTimingHistogram post_to_present = 5
8192 [(android.os.statsd.log_mode) = MODE_BYTES];
8193 // Set of timings measured from when a buffer is ready to be presented,
8194 // until the buffer was actually presented to the display.
8195 optional FrameTimingHistogram acquire_to_present = 6
8196 [(android.os.statsd.log_mode) = MODE_BYTES];
8197 // Set of timings measured from when a buffer was latched by
8198 // SurfaceFlinger, until the buffer was presented to the display
8199 optional FrameTimingHistogram latch_to_present = 7
8200 [(android.os.statsd.log_mode) = MODE_BYTES];
8201 // Set of timings measured from the desired presentation to the actual
8202 // presentation time
8203 optional FrameTimingHistogram desired_to_present = 8
8204 [(android.os.statsd.log_mode) = MODE_BYTES];
8205 // Set of timings measured from when an app queued a buffer for
8206 // presentation, until the buffer was ready to be presented.
8207 optional FrameTimingHistogram post_to_acquire = 9
8208 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008209 // Frames missed latch because the acquire fence didn't fire
8210 optional int64 late_acquire_frames = 10;
8211 // Frames latched early because the desired present time was bad
8212 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008213}
8214
8215/**
8216 * Histogram of frame counts bucketed by time in milliseconds.
8217 * Because of size limitations, we hard-cap the number of buckets, with
8218 * buckets for corresponding to larger milliseconds being less precise.
8219 */
8220message FrameTimingHistogram {
8221 // Timings in milliseconds that describes a set of histogram buckets
8222 repeated int32 time_millis_buckets = 1;
8223 // Number of frames that match to each time_millis, i.e. the bucket
8224 // contents
8225 // It's required that len(time_millis) == len(frame_count)
8226 repeated int64 frame_counts = 2;
8227}
Emilian Peev6729f372019-08-29 09:14:09 -07008228
Emilian Peev6729f372019-08-29 09:14:09 -07008229/**
8230 * Information about camera facing and API level usage.
8231 * Logged from:
8232 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8233 */
8234message CameraActionEvent {
8235 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008236 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008237
8238 // Camera API level used
8239 optional int32 api_level = 2;
8240
8241 // Name of client package
8242 optional string package_name = 3;
8243
8244 // Camera facing
8245 enum Facing {
8246 UNKNOWN = 0;
8247 BACK = 1;
8248 FRONT = 2;
8249 EXTERNAL = 3;
8250 }
8251 optional Facing facing = 4;
8252}
atrost01a20932019-08-28 15:40:37 +01008253
8254/**
8255 * Logs when a compatibility change is affecting an app.
8256 *
8257 * Logged from:
8258 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8259 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8260 */
8261message AppCompatibilityChangeReported {
8262 // The UID of the app being affected by the compatibilty change.
8263 optional int32 uid = 1 [(is_uid) = true];
8264
8265 // The ID of the change affecting the app.
8266 optional int64 change_id = 2;
8267
8268 enum State {
8269 UNKNOWN_STATE = 0;
8270 ENABLED = 1;
8271 DISABLED = 2;
8272 LOGGED = 3;
8273 }
8274
8275 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8276 // logged otherwise.
8277 optional State state = 3;
8278
8279 enum Source {
8280 UNKNOWN_SOURCE = 0;
8281 APP_PROCESS = 1;
8282 SYSTEM_SERVER = 2;
8283 }
8284
8285 // Where it was logged from.
8286 optional Source source = 4;
8287
8288}
Hector Dearman40579f62019-11-01 13:19:30 +00008289
8290/**
8291 * Logged from
8292 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8293 */
8294message PerfettoUploaded {
8295 enum Event {
8296 PERFETTO_UNDEFINED = 0;
8297 PERFETTO_TRACE_BEGIN = 1;
8298 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8299 PERFETTO_ON_CONNECT = 3;
8300 PERFETTO_ON_TRACING_DISABLED = 4;
8301 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8302 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8303 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8304 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8305 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8306 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8307 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8308 PERFETTO_TRIGGER_BEGIN = 12;
8309 PERFETTO_TRIGGER_SUCCESS = 13;
8310 PERFETTO_TRIGGER_FAILURE = 14;
8311 PERFETTO_HIT_GUARDRAILS = 15;
8312 PERFETTO_ON_TIMEOUT = 16;
8313 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8314 }
8315
8316 // Which stage of the pipeline we are reporting from.
8317 optional Event event = 1;
8318
8319 // UUID matching the one set inside the SystemInfo trace packet.
8320 optional int64 trace_uuid_lsb = 2;
8321 optional int64 trace_uuid_msb = 3;
8322}
Mark Tabrya824a642019-11-05 12:26:12 -08008323
8324/**
8325 * Pulls client metrics on data transferred via Vehicle Maps Service.
8326 * Metrics are keyed by uid + layer.
8327 *
8328 * Pulled from:
8329 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8330 */
8331message VmsClientStats {
8332 // UID of the VMS client app
8333 optional int32 uid = 1 [(is_uid) = true];
8334
8335 // VMS layer definition
8336 optional int32 layer_type = 2;
8337 optional int32 layer_channel = 3;
8338 optional int32 layer_version = 4;
8339
8340 // Bytes and packets sent by the client for the layer
8341 optional int64 tx_bytes = 5;
8342 optional int64 tx_packets = 6;
8343
8344 // Bytes and packets received by the client for the layer
8345 optional int64 rx_bytes = 7;
8346 optional int64 rx_packets = 8;
8347
8348 // Bytes and packets dropped due to client error
8349 optional int64 dropped_bytes = 9;
8350 optional int64 dropped_packets = 10;
8351}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008352
8353/**
8354 * State of a dangerous permission requested by a package - sampled
8355 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8356*/
8357message DangerousPermissionStateSampled {
8358 // Name of the permission
8359 optional string permission_name = 1;
8360
8361 // Uid of the package
8362 optional int32 uid = 2 [(is_uid) = true];
8363
8364 // If the permission is granted to the uid
8365 optional bool is_granted = 3;
8366
8367 // Permission flags as per android.content.pm.PermissionFlags
8368 optional int32 permission_flags = 4;
8369}
8370
Stan Iliev637ba5e2019-08-16 13:43:08 -04008371/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008372 * HWUI stats for a given app.
8373 */
8374message GraphicsStats {
8375 // The package name of the app
8376 optional string package_name = 1;
8377
8378 // The version code of the app
8379 optional int64 version_code = 2;
8380
8381 // The start & end timestamps in UTC as
8382 // milliseconds since January 1, 1970
8383 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008384 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008385
Stan Ilievb6517192020-02-18 10:12:42 -05008386 optional int64 end_millis = 4;
8387
8388 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8389 enum PipelineType {
8390 UNKNOWN = 0;
8391 GL = 1;
8392 VULKAN = 2;
8393 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008394
8395 // HWUI renders pipeline type: GL or Vulkan.
8396 optional PipelineType pipeline = 5;
8397
8398 // Distinct frame count.
8399 optional int32 total_frames = 6;
8400
8401 // Number of "missed vsync" events.
8402 optional int32 missed_vsync_count = 7;
8403
8404 // Number of frames in triple-buffering scenario (high input latency)
8405 optional int32 high_input_latency_count = 8;
8406
8407 // Number of "slow UI thread" events.
8408 optional int32 slow_ui_thread_count = 9;
8409
8410 // Number of "slow bitmap upload" events.
8411 optional int32 slow_bitmap_upload_count = 10;
8412
8413 // Number of "slow draw" events.
8414 optional int32 slow_draw_count = 11;
8415
8416 // Number of frames that missed their deadline (aka, visibly janked)
8417 optional int32 missed_deadline_count = 12;
8418
8419 // The frame time histogram for the package
8420 optional FrameTimingHistogram cpu_histogram = 13
8421 [(android.os.statsd.log_mode) = MODE_BYTES];
8422
8423 // The gpu frame time histogram for the package
8424 optional FrameTimingHistogram gpu_histogram = 14
8425 [(android.os.statsd.log_mode) = MODE_BYTES];
8426
8427 // UI mainline module version.
8428 optional int64 version_ui_module = 15;
8429
8430 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8431 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8432 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8433 // more apps are running / rendering.
8434 optional bool is_today = 16;
8435}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008436
8437/**
8438 * Message related to dangerous (runtime) app ops access
8439 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008440message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008441 // Uid of the package accessing app op
8442 optional int32 uid = 1 [(is_uid) = true];
8443
8444 // Name of the package accessing app op
8445 optional string package_name = 2;
8446
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008447 // operation string id per OPSTR_ constants in AppOpsManager.java
8448 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008449
8450 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8451 // Features must be provided through manifest using <feature> tag available in R and above.
8452 optional string feature_id = 4;
8453
8454 // message related to app op access, limited to 600 chars by API
8455 optional string message = 5;
8456
8457 enum SamplingStrategy {
8458 DEFAULT = 0;
8459 UNIFORM = 1;
8460 RARELY_USED = 2;
8461 }
8462
8463 // sampling strategy used to collect this message
8464 optional SamplingStrategy sampling_strategy = 6;
8465}
8466
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008467/*
8468 * Logs userspace reboot outcome and duration.
8469 *
8470 * Logged from:
8471 * frameworks/base/core/java/com/android/server/BootReceiver.java
8472 */
8473message UserspaceRebootReported {
8474 // Possible outcomes of userspace reboot.
8475 enum Outcome {
8476 // Default value in case platform failed to determine the outcome.
8477 OUTCOME_UNKNOWN = 0;
8478 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8479 SUCCESS = 1;
8480 // Userspace reboot shutdown sequence was aborted.
8481 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8482 // Remounting userdata into checkpointing mode failed.
8483 FAILED_USERDATA_REMOUNT = 3;
8484 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8485 // reboot.
8486 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8487 }
8488 // Outcome of userspace reboot. Always set.
8489 optional Outcome outcome = 1;
8490 // Duration of userspace reboot in case it has a successful outcome.
8491 // Duration is measured as time between userspace reboot was initiated and until boot completed
8492 // (e.g. sys.boot_completed=1).
8493 optional int64 duration_millis = 2;
8494 // State of primary user's (user0) credential encryption storage.
8495 enum UserEncryptionState {
8496 // Default value.
8497 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8498 // Credential encrypted storage is unlocked.
8499 UNLOCKED = 1;
8500 // Credential encrypted storage is locked.
8501 LOCKED = 2;
8502 }
8503 // State of primary user's encryption storage at the moment boot completed. Always set.
8504 optional UserEncryptionState user_encryption_state = 3;
8505}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008506
8507/*
8508 * Logs integrity check information during each install.
8509 *
8510 * Logged from:
8511 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8512 */
8513message IntegrityCheckResultReported {
8514 optional string package_name = 1;
8515 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008516 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008517 optional string installer_package_name = 4;
8518 enum Response {
8519 UNKNOWN = 0;
8520 ALLOWED = 1;
8521 REJECTED = 2;
8522 FORCE_ALLOWED = 3;
8523 }
8524 optional Response response = 5;
8525 // An estimate on the cause of the response. This will only be populated for
8526 // REJECTED and FORCE_ALLOWED
8527 optional bool caused_by_app_cert_rule = 6;
8528 optional bool caused_by_installer_rule = 7;
8529}
8530
8531/**
8532 * Logs the information about the rules and the provider whenever rules are
8533 * pushed into AppIntegrityManager.
8534 *
8535 * Logged from:
8536 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8537 */
8538message IntegrityRulesPushed {
8539 optional bool success = 1;
8540 // Package name of the app that pushed the rules.
8541 optional string rule_provider = 2;
8542 // Version string of arbitrary format provided by the rule provider to
8543 // identify the rules.
8544 optional string rule_version = 3;
8545}
Jordan Liubedfa702019-12-20 15:08:45 -08008546
8547/**
8548 * Logs when a cell broadcast message is received on the device.
8549 *
8550 * Logged from CellBroadcastService module:
8551 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8552 */
8553message CellBroadcastMessageReported {
8554 // The type of Cell Broadcast message
8555 enum CbType {
8556 UNKNOWN_TYPE = 0;
8557 GSM = 1;
8558 CDMA = 2;
8559 CDMA_SPC = 3;
8560 }
8561
8562 // GSM, CDMA, CDMA-SCP
8563 optional CbType type = 1;
8564}
8565
8566/**
8567 * Logs when an error occurs while handling a cell broadcast message;
8568 *
8569 * Logged from CellBroadcastService module:
8570 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8571 */
8572message CellBroadcastMessageError {
8573 // The type of error raised when trying to handle a cell broadcast message
8574 enum ErrorType {
8575 UNKNOWN_TYPE = 0;
8576 CDMA_DECODING_ERROR = 1;
8577 CDMA_SCP_EMPTY = 2;
8578 CDMA_SCP_HANDLING_ERROR = 3;
8579 GSM_INVALID_HEADER_LENGTH = 4;
8580 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8581 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8582 GSM_INVALID_PDU = 7;
8583 GSM_INVALID_GEO_FENCING_DATA = 8;
8584 GSM_UMTS_INVALID_WAC = 9;
8585 FAILED_TO_INSERT_TO_DB = 10;
8586 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8587 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8588 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8589 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8590 }
8591
8592 // What kind of error occurred
8593 optional ErrorType type = 1;
8594
8595 // Exception message (or log message) associated with the error (max 1000 chars)
8596 optional string exception_message = 2;
8597}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008598
8599/**
8600 * Logs when the SDK Extensions test app has polled the current version.
8601 * This is atom ID 354.
8602 *
8603 * Logged from:
8604 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8605 */
8606message SdkExtensionStatus {
8607 enum ApiCallStatus {
8608 CALL_NOT_ATTEMPTED = 0;
8609 CALL_SUCCESSFUL = 1;
8610 CALL_FAILED = 2;
8611 }
8612
8613 optional ApiCallStatus result = 1;
8614
8615 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8616 optional int32 r_extension_version = 2;
8617
8618 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8619 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8620 optional int32 failed_call_symbol = 3;
8621}
Marco Ballesio497aff42020-01-24 08:39:42 -08008622
8623/**
8624 * Logs when an app is frozen or unfrozen.
8625 *
8626 * Logged from:
8627 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8628 */
8629message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008630 // The type of event.
8631 enum Action {
8632 UNKNOWN = 0;
8633 FREEZE_APP = 1;
8634 UNFREEZE_APP = 2;
8635 }
8636 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008637
Blake Kragten6ce382a2020-01-16 20:20:46 -08008638 // Pid of the process being frozen.
8639 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008640
Blake Kragten6ce382a2020-01-16 20:20:46 -08008641 // Name of the process being frozen.
8642 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008643
Blake Kragten6ce382a2020-01-16 20:20:46 -08008644 // Time since last unfrozen.
8645 optional int64 time_unfrozen_millis = 4;
8646}
8647
8648/**
8649 * Logs gnss stats from location service provider
8650 *
8651 * Pulled from:
8652 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8653 */
8654
8655message GnssStats {
8656 // Number of location reports since boot
8657 optional int64 location_reports = 1;
8658
8659 // Total pulled reports of Location failures since boot
8660 optional int64 location_failure_reports = 2;
8661
8662 // Number of time to first fix reports since boot
8663 optional int64 time_to_first_fix_reports = 3;
8664
8665 // Total pulled reported time to first fix (in milli-seconds) since boot
8666 optional int64 time_to_first_fix_milli_s = 4;
8667
8668 // Number of position accuracy reports since boot
8669 optional int64 position_accuracy_reports = 5;
8670
8671 // Total pulled reported position accuracy (in meters) since boot
8672 optional int64 position_accuracy_meters = 6;
8673
8674 // Number of top 4 average CN0 reports since boot
8675 optional int64 top_four_average_cn0_reports = 7;
8676
8677 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8678 optional int64 top_four_average_cn0_db_mhz = 8;
8679
8680 // Number of l5 top 4 average CN0 reports since boot
8681 optional int64 l5_top_four_average_cn0_reports = 9;
8682
8683 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8684 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8685
8686 // Total number of sv status messages reports since boot
8687 optional int64 sv_status_reports = 11;
8688
8689 // Total number of sv status messages reports, where sv is used in fix since boot
8690 optional int64 sv_status_reports_used_in_fix = 12;
8691
8692 // Total number of L5 sv status messages reports since boot
8693 optional int64 l5_sv_status_reports = 13;
8694
8695 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8696 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008697}