blob: 652775b2568a6d97e00f6273c5d705296f009b61 [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"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000395 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 }
David Chenc8a43242017-10-17 16:23:28 -0700397
David Chen6e3e6cb2018-01-03 16:14:06 -0800398 // Pulled events will start at field 10000.
Blake Kragten6ce382a2020-01-16 20:20:46 -0800399 // Next: 10075
David Chenc8a43242017-10-17 16:23:28 -0700400 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
402 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
403 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
404 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
405 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
406 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800407 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800408 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
409 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
410 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
411 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
412 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
413 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
414 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
415 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
416 SystemUptime system_uptime = 10015 [(module) = "framework"];
417 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
418 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000419 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800420 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
421 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800422 Temperature temperature = 10021 [(module) = "framework"];
423 BinderCalls binder_calls = 10022 [(module) = "framework"];
424 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
425 LooperStats looper_stats = 10024 [(module) = "framework"];
426 DiskStats disk_stats = 10025 [(module) = "framework"];
427 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
428 AppSize app_size = 10027 [(module) = "framework"];
429 CategorySize category_size = 10028 [(module) = "framework"];
430 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800431 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
433 DiskIo disk_io = 10032 [(module) = "framework"];
434 PowerProfile power_profile = 10033 [(module) = "framework"];
435 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
436 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
437 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700438 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
440 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
441 10040 [(module) = "framework"];
442 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
443 10041 [(module) = "framework"];
444 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800445 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
449 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
450 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
451 RoleHolder role_holder = 10049 [(module) = "framework"];
452 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800453 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
455 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800456 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
457 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
459 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
460 FaceSettings face_settings = 10058 [(module) = "framework"];
461 CoolingDevice cooling_device = 10059 [(module) = "framework"];
462 AppOps app_ops = 10060 [(module) = "framework"];
463 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700464 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
465 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800467 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
469 DangerousPermissionStateSampled dangerous_permission_state_sampled =
470 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400471 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000472 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000473 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200474 PackageNotificationPreferences package_notification_preferences =
475 10071 [(module) = "framework"];
476 PackageNotificationChannelPreferences package_notification_channel_preferences =
477 10072 [(module) = "framework"];
478 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
479 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800480 GnssStats gnss_stats = 10074 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700481 }
yroa1fe77c2018-02-26 14:22:54 -0800482
Bookatz76aafcf2018-09-17 16:17:10 -0700483 // DO NOT USE field numbers above 100,000 in AOSP.
484 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
485 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100486
487 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700488}
489
Yao Chend54f9dd2017-10-17 17:37:48 +0000490/**
Yangster-mac20877162017-12-22 17:19:39 -0800491 * This proto represents a node of an attribution chain.
492 * Note: All attribution chains are represented as a repeated field of type
493 * AttributionNode. It is understood that in such arrays, the order is that
494 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000495 */
Yangster-mac20877162017-12-22 17:19:39 -0800496message AttributionNode {
497 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800498 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800499
Yangster-mac20877162017-12-22 17:19:39 -0800500 // The (optional) string tag for an element in the attribution chain. If the
501 // element has no tag, it is encoded as an empty string.
502 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700503}
504
Yangster-mac48b3d622018-08-18 12:38:11 -0700505message KeyValuePair {
506 optional int32 key = 1;
507 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700508 int32 value_int = 2;
509 int64 value_long = 3;
510 string value_str = 4;
511 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700512 }
513}
514
515message KeyValuePairsAtom {
516 optional int32 uid = 1;
517 repeated KeyValuePair pairs = 2;
518}
519
Yao Chend54f9dd2017-10-17 17:37:48 +0000520/*
521 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800522 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000523 *
524 * RULES:
525 * - The field ids for each atom must start at 1, and count upwards by 1.
526 * Skipping field ids is not allowed.
527 * - These form an API, so renaming, renumbering or removing fields is
528 * not allowed between android releases. (This is not currently enforced,
529 * but there will be a tool to enforce this restriction).
530 * - The types must be built-in protocol buffer types, namely, no sub-messages
531 * are allowed (yet). The bytes type is also not allowed.
532 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800533 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000534 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800535 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000536 * - A field that is a uid should be a string field, tagged with the [xxx]
537 * annotation. The generated code on android will be represented by UIDs,
538 * and those UIDs will be translated in xxx to those strings.
539 *
540 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700541 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 * - If there is a UID, it goes first. Think in an object-oriented fashion.
543 * *****************************************************************************
544 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700545
Yao Chend54f9dd2017-10-17 17:37:48 +0000546/**
Tej Singha72344992019-04-17 18:55:08 -0700547 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700548 * Logs when the Thermal service HAL notifies the throttling start/stop events.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
552 */
553message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700554 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700555 optional android.os.TemperatureTypeEnum sensor_type = 1;
556
Maggie White442b6312019-04-05 16:26:44 -0700557 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700558 enum State {
559 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700560 START = 1; // START indicated that throttling was triggered.
561 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700562 }
Yangster-mace16189a2018-08-26 12:20:16 -0700563 optional State state = 2;
564
565 optional float temperature = 3;
566}
567
568/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * Logs when the screen state changes.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
573 */
574message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800575 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800576 optional android.view.DisplayStateEnum state = 1
577 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578}
Yao Chend54f9dd2017-10-17 17:37:48 +0000579
580/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700581 * Logs that the process state of the uid, as determined by ActivityManager
582 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 *
584 * Logged from:
585 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
586 */
Bookatzc1a050a2017-10-10 15:49:28 -0700587message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800588 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000589
Bookatzdb026a22018-01-10 19:01:56 -0800590 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800591 optional android.app.ProcessStateEnum state = 2
592 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000593}
594
595/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700596 * Logs process state change of a process, as per the activity manager.
597 *
598 * Logged from:
599 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
600 */
601message ProcessStateChanged {
602 optional int32 uid = 1;
603 optional string process_name = 2;
604 optional string package_name = 3;
605 // TODO: remove this when validation is done
606 optional int64 version = 5;
607 // The state, from frameworks/base/core/proto/android/app/enums.proto.
608 optional android.app.ProcessStateEnum state = 4;
609}
610
611/**
612 * Logs when ActivityManagerService sleep state is changed.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
616 */
617message ActivityManagerSleepStateChanged {
618 // TODO: import frameworks proto
619 enum State {
620 UNKNOWN = 0;
621 ASLEEP = 1;
622 AWAKE = 2;
623 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700625}
626
627/**
628 * Logs when system memory state changes.
629 *
630 * Logged from:
631 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
632 */
633message MemoryFactorStateChanged {
634 // TODO: import frameworks proto
635 enum State {
636 MEMORY_UNKNOWN = 0;
637 NORMAL = 1; // normal.
638 MODERATE = 2; // moderate memory pressure.
639 LOW = 3; // low memory.
640 CRITICAL = 4; // critical memory.
641
642 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800643 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700644}
645
646/**
647 * Logs when app is using too much cpu, according to ActivityManagerService.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
651 */
652message ExcessiveCpuUsageReported {
653 optional int32 uid = 1;
654 optional string process_name = 2;
655 optional string package_name = 3;
656 // package version. TODO: remove this when validation is done
657 optional int64 version = 4;
658}
659
660/**
661 * Logs when a cached process is killed, along with its pss.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message CachedKillReported {
667 optional int32 uid = 1;
668 optional string process_name = 2;
669 optional string package_name = 3;
670 // TODO: remove this when validation is done
671 optional int64 version = 5;
672 optional int64 pss = 4;
673}
674
675/**
xshu2c3d9e42019-09-26 17:54:02 -0700676 * Logs the change in wifi health.
677 *
678 * Logged from:
679 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
680 */
681message WifiHealthStatReported {
682 // duration this stat is obtained over in milliseconds
683 optional int32 duration_millis = 1;
684 // whether wifi is classified as sufficient for the user's data traffic, determined
685 // by whether the calculated throughput exceeds the average demand within |duration_millis|
686 optional bool is_sufficient = 2;
687 // whether the calculated throughput is exceeds the minimum required for typical usage
688 optional bool is_throughput_good = 3;
689 // whether cellular data is available
690 optional bool is_cell_data_available = 4;
691 // the WLAN channel the connected network is on (ie. 2412)
692 optional int32 frequency = 5;
693}
694
695/**
696 * Logged when wifi detects a significant change in connection failure rate.
697 *
698 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
699 *
700 */
701message WifiFailureStatReported {
702 enum AbnormalityType {
703 UNKNOWN = 0;
704 SIGNIFICANT_INCREASE = 1;
705 SIGNIFICANT_DECREASE = 2;
706 SIMPLY_HIGH = 3;
707 }
708 enum FailureType {
709 FAILURE_UNKNOWN = 0;
710 FAILURE_CONNECTION = 1;
711 FAILURE_ASSOCIATION_REJECTION = 2;
712 FAILURE_ASSOCIATION_TIMEOUT = 3;
713 FAILURE_AUTHENTICATION = 4;
714 FAILURE_NON_LOCAL_DISCONNECTION = 5;
715 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
716 }
717 // Reason for uploading this stat
718 optional AbnormalityType abnormality_type = 1;
719 // The particular type of failure
720 optional FailureType failure_type = 2;
721 // How many times we have encountered this combination of AbnormalityType and FailureType
722 optional int32 failure_count = 3;
723}
724
725/**
726 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
727 *
728 * Logged from:
729 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
730 */
731message WifiConnectionResultReported {
732 enum FailureCode {
733 FAILURE_UNKNOWN = 0;
734 FAILURE_ASSOCIATION_TIMEOUT = 1;
735 FAILURE_ASSOCIATION_REJECTION = 2;
736 FAILURE_AUTHENTICATION_GENERAL = 3;
737 FAILURE_AUTHENTICATION_EAP = 4;
738 FAILURE_DHCP = 5;
739 FAILURE_NETWORK_DISCONNECTION = 6;
740 FAILURE_ROAM_TIMEOUT = 7;
741 }
742 // true represents a successful connection
743 optional bool connection_result = 1;
744 // reason for the connection failure
745 optional FailureCode failure_code = 2;
746 // scan rssi before the connection attempt
747 optional int32 rssi = 3;
748}
749
750/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700751 * Logs when memory stats of a process is reported.
752 *
753 * Logged from:
754 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
755 */
756message ProcessMemoryStatReported {
757 optional int32 uid = 1;
758 optional string process_name = 2;
759 optional string package_name = 3;
760 //TODO: remove this when validation is done
761 optional int64 version = 9;
762 optional int64 pss = 4;
763 optional int64 uss = 5;
764 optional int64 rss = 6;
765 enum Type {
766 ADD_PSS_INTERNAL_SINGLE = 0;
767 ADD_PSS_INTERNAL_ALL_MEM = 1;
768 ADD_PSS_INTERNAL_ALL_POLL = 2;
769 ADD_PSS_EXTERNAL = 3;
770 ADD_PSS_EXTERNAL_SLOW = 4;
771 }
772 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800773 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700774}
775
776/**
Bookatzc1a050a2017-10-10 15:49:28 -0700777 * Logs that a process started, finished, crashed, or ANRed.
778 *
779 * Logged from:
780 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
781 */
782message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700783 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700784
David Chen0b5c90c2018-01-25 16:51:49 -0800785 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800786 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700787
Bookatzddccf0a2017-11-28 16:48:14 -0800788 // What lifecycle state the process changed to.
789 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800790 enum State {
791 FINISHED = 0;
792 STARTED = 1;
793 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800794 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800795 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700796}
797
Bookatzc1a050a2017-10-10 15:49:28 -0700798/**
799 * Logs when the ble scan state changes.
800 *
801 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700802 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700803 */
804message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800805 repeated AttributionNode attribution_node = 1
806 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700807
808 enum State {
809 OFF = 0;
810 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700811 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
812 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700813 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800814 optional State state = 2 [
815 (state_field_option).option = EXCLUSIVE_STATE,
816 (state_field_option).default_state_value = 0 /* State.OFF */,
817 (state_field_option).reset_state_value = 2 /* State.RESET */,
818 (state_field_option).nested = true
819 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700820
Bookatze5ec0b42018-03-26 13:34:56 -0700821 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800822 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700823 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800824 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700825 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800826 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700827}
828
829/**
830 * Logs reporting of a ble scan finding results.
831 *
832 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700833 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700834 */
Bookatzae6738e2018-09-13 11:38:56 -0700835// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700836message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800837 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700838
839 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800840 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700841}
842
843/**
844 * Logs when a sensor state changes.
845 *
846 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700847 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700848 */
849message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800850 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700851
Bookatzc1a050a2017-10-10 15:49:28 -0700852 // The id (int) of the sensor.
853 optional int32 sensor_id = 2;
854
855 enum State {
856 OFF = 0;
857 ON = 1;
858 }
859 optional State state = 3;
860}
861
Bookatzc1a050a2017-10-10 15:49:28 -0700862/**
863 * Logs when GPS state changes.
864 *
865 * Logged from:
866 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
867 */
868message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800869 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700870
871 enum State {
872 OFF = 0;
873 ON = 1;
874 }
875 optional State state = 2;
876}
877
Bookatz48d362e2018-11-06 15:49:08 -0800878/**
879 * Logs when GPS signal quality.
880 *
881 * Logged from:
882 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
883 */
884message GpsSignalQualityChanged {
885 optional android.server.location.GpsSignalQualityEnum level = 1;
886}
887
Bookatzc1a050a2017-10-10 15:49:28 -0700888
889/**
890 * Logs when a sync manager sync state changes.
891 *
892 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700893 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700894 */
895message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800896 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700897
David Chen0b5c90c2018-01-25 16:51:49 -0800898 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800899 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700900
901 enum State {
902 OFF = 0;
903 ON = 1;
904 }
905 optional State state = 3;
906}
907
Yangster-mac96353002018-09-05 11:18:55 -0700908/*
909 * Deferred job stats.
910 *
911 * Logged from:
912 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
913*/
914message DeferredJobStatsReported {
915 repeated AttributionNode attribution_node = 1;
916
917 // Number of jobs deferred.
918 optional int32 num_jobs_deferred = 2;
919
920 // Time since the last job runs.
921 optional int64 time_since_last_job_millis = 3;
922}
923
Bookatzc1a050a2017-10-10 15:49:28 -0700924/**
925 * Logs when a job scheduler job state changes.
926 *
927 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700928 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700929 */
930message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800931 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700932
933 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800934 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700935
936 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800937 FINISHED = 0;
938 STARTED = 1;
939 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700940 }
941 optional State state = 3;
942
Tej Singh33a412b2018-03-16 18:43:59 -0700943 // The reason a job has stopped.
944 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700945 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700946 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100947
948 // The standby bucket of the app that scheduled the job. These match the framework constants
949 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
950 // already assigned 0.
951 enum Bucket {
952 UNKNOWN = -1;
953 ACTIVE = 0;
954 WORKING_SET = 1;
955 FREQUENT = 2;
956 RARE = 3;
957 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800958 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100959 }
960 optional Bucket standby_bucket = 5 [default = UNKNOWN];
961
962 // The job id (as assigned by the app).
963 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700964}
965
966/**
967 * Logs when the audio state changes.
968 *
969 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700971 */
972message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800973 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700974
975 enum State {
976 OFF = 0;
977 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700978 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
979 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700980 }
981 optional State state = 2;
982}
983
984/**
985 * Logs when the video codec state changes.
986 *
987 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700988 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700989 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800990message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800991 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700992
993 enum State {
994 OFF = 0;
995 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700996 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
997 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700998 }
999 optional State state = 2;
1000}
1001
1002/**
1003 * Logs when the flashlight state changes.
1004 *
1005 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001006 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001007 */
1008message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001009 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001010
1011 enum State {
1012 OFF = 0;
1013 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001014 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1015 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001016 }
1017 optional State state = 2;
1018}
1019
1020/**
1021 * Logs when the camera state changes.
1022 *
1023 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001024 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001025 */
1026message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001027 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001028
1029 enum State {
1030 OFF = 0;
1031 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001032 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1033 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001034 }
1035 optional State state = 2;
1036}
1037
1038/**
1039 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001040 *
1041 * Logged from:
1042 * TODO
1043 */
Bookatzd6746242017-10-24 18:39:35 -07001044message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001045 repeated AttributionNode attribution_node = 1
1046 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001047
Bookatz1a1b0462018-01-12 11:47:03 -08001048 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1049 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001050 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001051 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001052
1053 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001054 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001055
1056 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001057 RELEASE = 0;
1058 ACQUIRE = 1;
1059 CHANGE_RELEASE = 2;
1060 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001061 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001062 optional State state = 4 [
1063 (state_field_option).option = EXCLUSIVE_STATE,
1064 (state_field_option).default_state_value = 0,
1065 (state_field_option).nested = true
1066 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001067}
1068
1069/**
Bookatzc1a050a2017-10-10 15:49:28 -07001070 * Logs when a partial wakelock is considered 'long' (over 1 min).
1071 *
1072 * Logged from:
1073 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1074 */
1075message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001076 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001077
Yao Chend54f9dd2017-10-17 17:37:48 +00001078 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1079 optional string tag = 2;
1080
Bookatzc1a050a2017-10-10 15:49:28 -07001081 // TODO: I have no idea what this is.
1082 optional string history_tag = 3;
1083
1084 enum State {
1085 OFF = 0;
1086 ON = 1;
1087 }
1088 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001089}
1090
Bookatzc1a050a2017-10-10 15:49:28 -07001091/**
Bookatza66083f2018-09-20 17:24:00 -07001092 * Logs when the device is interactive, according to the PowerManager Notifier.
1093 *
1094 * Logged from:
1095 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1096 */
1097message InteractiveStateChanged {
1098 enum State {
1099 OFF = 0;
1100 ON = 1;
1101 }
1102 optional State state = 1;
1103}
1104
1105/**
Bookatzc1a050a2017-10-10 15:49:28 -07001106 * Logs Battery Saver state change.
1107 *
1108 * Logged from:
1109 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1110 */
1111message BatterySaverModeStateChanged {
1112 enum State {
1113 OFF = 0;
1114 ON = 1;
1115 }
1116 optional State state = 1;
1117}
1118
1119/**
1120 * Logs Doze mode state change.
1121 *
1122 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001123 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001124 */
1125message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001126 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001127}
1128
1129
1130/**
1131 * Logs state change of Doze mode including maintenance windows.
1132 *
1133 * Logged from:
1134 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1135 */
1136message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001137 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001138}
1139
1140/**
1141 * Logs screen brightness level.
1142 *
1143 * Logged from:
1144 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1145 */
1146message ScreenBrightnessChanged {
1147 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1148 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001149}
1150
1151/**
1152 * Logs battery level (percent full, from 0 to 100).
1153 *
1154 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001155 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001156 */
1157message BatteryLevelChanged {
1158 // Battery level. Should be in [0, 100].
1159 optional int32 battery_level = 1;
1160}
1161
1162/**
1163 * Logs change in charging status of the device.
1164 *
1165 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001166 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001167 */
1168message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001169 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1170 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001171}
1172
1173/**
1174 * Logs whether the device is plugged in, and what power source it is using.
1175 *
1176 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001177 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001178 */
1179message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001180 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1181 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001182}
1183
Bookatz8c6571b2017-10-24 15:04:41 -07001184/**
1185 * Logs when an app's wakeup alarm fires.
1186 *
1187 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001188 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001189 */
1190message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001191 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001192
1193 // Name of the wakeup alarm.
1194 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001195
1196 // Name of source package (for historical reasons, since BatteryStats tracked it).
1197 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001198
1199 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1200 enum Bucket {
1201 UNKNOWN = 0;
1202 EXEMPTED = 5;
1203 ACTIVE = 10;
1204 WORKING_SET = 20;
1205 FREQUENT = 30;
1206 RARE = 40;
1207 NEVER = 50;
1208 }
1209 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1210 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001211}
1212
1213/**
1214 * Logs when an an app causes the mobile radio to change state.
1215 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1216 *
1217 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001218 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001219 */
1220message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001221 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001222
Bookatz1a1b0462018-01-12 11:47:03 -08001223 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1224 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001225}
1226
1227/**
1228 * Logs when an an app causes the wifi radio to change state.
1229 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1230 *
1231 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001232 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001233 */
1234message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001235 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001236
Bookatz1a1b0462018-01-12 11:47:03 -08001237 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1238 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001239}
1240
1241/**
1242 * Logs kernel wakeup reasons and aborts.
1243 *
1244 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001245 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001246 */
1247message KernelWakeupReported {
1248 // Name of the kernel wakeup reason (or abort).
1249 optional string wakeup_reason_name = 1;
1250
1251 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001252 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001253}
1254
1255/**
Bookatzda1798c2018-12-13 14:16:00 -08001256 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001257 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001258 *
1259 * Logged from:
1260 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1261 */
1262message WifiEnabledStateChanged {
1263 enum State {
1264 OFF = 0;
1265 ON = 1;
1266 }
1267 optional State state = 1;
1268}
1269
1270/**
tsaichristinececebdc2020-02-04 14:05:56 -08001271 * This atom is deprecated starting in R.
1272 *
Bookatzda1798c2018-12-13 14:16:00 -08001273 * 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 -08001274 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1275 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001276 *
1277 * Logged from:
1278 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1279 */
1280message WifiRunningStateChanged {
1281 repeated AttributionNode attribution_node = 1;
1282
1283 enum State {
1284 OFF = 0;
1285 ON = 1;
1286 }
1287 optional State state = 2;
1288}
1289
1290/**
Bookatze5885242017-10-24 20:10:31 -07001291 * Logs wifi locks held by an app.
1292 *
1293 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001295 */
1296message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001297 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001298
1299 enum State {
1300 OFF = 0;
1301 ON = 1;
1302 }
1303 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001304
1305 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1306 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001307}
1308
1309/**
1310 * Logs wifi signal strength changes.
1311 *
1312 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001313 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001314 */
1315message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001316 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1317 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001318}
1319
1320/**
1321 * Logs wifi scans performed by an app.
1322 *
1323 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001324 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001325 */
1326message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001327 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001328
1329 enum State {
1330 OFF = 0;
1331 ON = 1;
1332 }
1333 optional State state = 2;
1334}
1335
1336/**
Tej Singh4503e102018-01-04 14:35:01 -08001337 * Logs wifi multicast locks held by an app
1338 *
1339 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001340 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001341 */
1342message WifiMulticastLockStateChanged {
1343 repeated AttributionNode attribution_node = 1;
1344
1345 enum State {
1346 OFF = 0;
1347 ON = 1;
1348 }
1349 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001350
1351 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001352}
1353
1354/**
Tej Singh1ea42892018-01-19 09:27:00 -08001355 * Logs shutdown reason and duration on next boot.
1356 *
1357 * Logged from:
1358 * frameworks/base/core/java/com/android/server/BootReceiver.java
1359 */
1360message ShutdownSequenceReported {
1361 // True if shutdown is for a reboot. Default: false if we do not know.
1362 optional bool reboot = 1;
1363
1364 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1365 optional string reason = 2;
1366
1367 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1368 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001369 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001370
1371 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001372 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001373}
1374
Tej Singh6483ea42018-01-25 17:45:49 -08001375
1376/**
1377 * Logs boot reason and duration.
1378 *
1379 * Logged from:
1380 * system/core/bootstat/bootstat.cpp
1381 */
1382message BootSequenceReported {
1383 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1384 // Default: "<EMPTY>" if not available.
1385 optional string bootloader_reason = 1;
1386
1387 // Reason for system boot. Eg. bootloader, reboot,userrequested
1388 // Default: "<EMPTY>" if not available.
1389 optional string system_reason = 2;
1390
1391 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001392 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001393
1394 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001395 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001396
1397 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001398 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001399
1400 // Time since last boot in ms. Default: 0 if not available.
1401 optional int64 time_since_last_boot = 6;
1402}
1403
Tej Singhc477d9c2018-02-05 18:31:39 -08001404
1405/**
1406 * Logs call state and disconnect cause (if applicable).
1407 *
1408 * Logged from:
1409 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1410 */
1411message CallStateChanged {
1412 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1413 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1414 optional android.telecom.CallStateEnum call_state = 1;
1415
1416 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1417 // This value is only applicable when the call_state is DISCONNECTED, and
1418 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1419 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1420 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1421
1422 // True if the call is self-managed, which are apps that use the
1423 // telecom infrastructure to make their own calls.
1424 optional bool self_managed = 3;
1425
1426 // True if call is external. External calls are calls on connected Wear
1427 // devices but show up in Telecom so the user can pull them onto the device.
1428 optional bool external_call = 4;
1429}
1430
Tej Singh1ea42892018-01-19 09:27:00 -08001431/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001432 * Logs keyguard state. The keyguard is the lock screen.
1433 *
1434 * Logged from:
1435 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1436 */
1437message KeyguardStateChanged {
1438 enum State {
1439 UNKNOWN = 0;
1440 // The keyguard is hidden when the phone is unlocked.
1441 HIDDEN = 1;
1442 // The keyguard is shown when the phone is locked (screen turns off).
1443 SHOWN= 2;
1444 // The keyguard is occluded when something is overlaying the keyguard.
1445 // Eg. Opening the camera while on the lock screen.
1446 OCCLUDED = 3;
1447 }
1448 optional State state = 1;
1449}
1450
1451/**
1452 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1453 * prompts the user to enter a password (pattern, pin, etc).
1454 *
1455 * Logged from:
1456 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1457 */
1458
1459message KeyguardBouncerStateChanged {
1460 enum State {
1461 UNKNOWN = 0;
1462 // Bouncer is hidden, either as a result of successfully entering the
1463 // password, screen timing out, or user going back to lock screen.
1464 HIDDEN = 1;
1465 // This is when the user is being prompted to enter the password.
1466 SHOWN = 2;
1467 }
1468 optional State state = 1;
1469}
1470
1471/**
1472 * Logs the result of entering a password into the keyguard bouncer.
1473 *
1474 * Logged from:
1475 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1476 */
1477message KeyguardBouncerPasswordEntered {
1478 enum BouncerResult {
1479 UNKNOWN = 0;
1480 // The password entered was incorrect.
1481 FAILURE = 1;
1482 // The password entered was correct.
1483 SUCCESS = 2;
1484 }
1485 optional BouncerResult result = 1;
1486}
1487
Tej Singha883b372018-02-15 11:30:01 -08001488/*
1489 * Logs changes to the configuration of the device. The configuration is defined
1490 * in frameworks/base/core/java/android/content/res/Configuration.java
1491 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1492 * Please go there to interpret the possible values each field can be.
1493 *
1494 * Logged from:
1495 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1496 */
1497message ResourceConfigurationChanged {
1498 // Bit mask of color capabilities of the screen.
1499 // Contains information about the color gamut and hdr mode of the screen.
1500 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001501 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001502
1503 // The target screen density being rendered to.
1504 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001505 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001506
1507 // Current user preference for the scaling factor for fonts,
1508 // relative to the base density scaling.
1509 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001510 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001511
1512 // Flag indicating whether the hard keyboard is hidden.
1513 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001514 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001515
1516 // The type of keyboard attached to the device.
1517 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1518 optional int32 keyboard = 5;
1519
1520 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1521 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001522 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001523
1524 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1525 // 0 if undefined.
1526 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1527 optional int32 mcc = 7;
1528
1529 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1530 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1531 // MNC_ZERO symbol defined in Configuration.java.
1532 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1533 optional int32 mnc = 8;
1534
1535 // The kind of navigation available on the device.
1536 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1537 optional int32 navigation = 9;
1538
1539 // Flag indicating whether the navigation is available.
1540 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001541 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001542
1543 // Overall orientation of the screen.
1544 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1545 optional int32 orientation = 11;
1546
1547 // The current height of the available screen space, in dp units.
1548 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001549 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001550
1551 // Bit mask of overall layout of the screen.
1552 // Contains information about screen size, whether the screen is wider/taller
1553 // than normal, whether the screen layout is right-tl-left or left-to-right,
1554 // and whether the screen has a rounded shape.
1555 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001556 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001557
1558 // Current width of the available screen space, in dp units.
1559 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001560 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001561
1562 // The smallest screen size an application will see in normal operation.
1563 // This is the smallest value of both screenWidthDp and screenHeightDp
1564 // in portrait and landscape.
1565 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001566 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001567
1568 // The type of touch screen attached to the device.
1569 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1570 optional int32 touchscreen = 16;
1571
1572 // Bit mask of the ui mode.
1573 // Contains information about the overall ui mode of the device.
1574 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1575 // Also contains information about whether the device is in night mode.
1576 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001577 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001578}
1579
Tej Singheee317b2018-03-07 19:28:05 -08001580
1581/**
1582 * Logs changes in the connection state of the mobile radio.
1583 *
1584 * Logged from:
1585 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1586 */
1587message MobileConnectionStateChanged {
1588 // States are from the state machine DataConnection.java.
1589 enum State {
1590 UNKNOWN = 0;
1591 // The connection is inactive, or disconnected.
1592 INACTIVE = 1;
1593 // The connection is being activated, or connecting.
1594 ACTIVATING = 2;
1595 // The connection is active, or connected.
1596 ACTIVE = 3;
1597 // The connection is disconnecting.
1598 DISCONNECTING = 4;
1599 // The connection is disconnecting after creating a connection.
1600 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1601 }
1602 optional State state = 1;
1603 // For multi-sim phones, this distinguishes between the sim cards.
1604 optional int32 sim_slot_index = 2;
1605 // Used to identify the connection. Starts at 0 and increments by 1 for
1606 // every new network created. Resets whenever the device reboots.
1607 optional int32 data_connection_id = 3;
1608 // A bitmask for the capabilities of this connection.
1609 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1610 // Default value (if we have no information): 0
1611 optional int64 capabilities = 4;
1612 // If this connection has internet.
1613 // This just checks if the DEFAULT bit of capabilities is set.
1614 optional bool has_internet = 5;
1615}
1616
1617/**
1618 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1619 *
1620 * Logged from:
1621 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1622 */
1623message MobileRadioTechnologyChanged {
1624 optional android.telephony.NetworkTypeEnum state = 1;
1625 // For multi-sim phones, this distinguishes between the sim cards.
1626 optional int32 sim_slot_index = 2;
1627}
1628
Andrew Chantb56388b2018-03-22 21:07:33 -07001629/**
1630 * Logs the VID and PID of any connected USB devices.
1631 *
1632 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1633 *
1634 * Logged by Vendor.
1635 */
1636message UsbDeviceAttached {
1637 optional int32 vid = 1;
1638 optional int32 pid = 2;
1639 optional bool has_audio = 3;
1640 optional bool has_hid = 4;
1641 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001642 enum State {
1643 STATE_DISCONNECTED = 0;
1644 STATE_CONNECTED = 1;
1645 }
1646 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001647 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001648}
1649
Tej Singheee317b2018-03-07 19:28:05 -08001650
Tej Singhdd7bd352018-02-09 19:33:15 -08001651/**
Tej Singh5d991e12018-03-09 19:48:11 -08001652 * Logs when Bluetooth is enabled and disabled.
1653 *
1654 * Logged from:
1655 * services/core/java/com/android/server/BluetoothManagerService.java
1656 */
1657message BluetoothEnabledStateChanged {
1658 repeated AttributionNode attribution_node = 1;
1659 // Whether or not bluetooth is enabled on the device.
1660 enum State {
1661 UNKNOWN = 0;
1662 ENABLED = 1;
1663 DISABLED = 2;
1664 }
1665 optional State state = 2;
1666 // The reason for being enabled/disabled.
1667 // Eg. Airplane mode, crash, application request.
1668 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1669 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001670 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001671}
1672
1673/**
Jack Hed9837c82019-01-09 01:19:13 -08001674 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001675 *
1676 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001677 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1678 *
1679 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001680 */
1681message BluetoothConnectionStateChanged {
1682 // The state of the connection.
1683 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1684 optional android.bluetooth.ConnectionStateEnum state = 1;
1685 // An identifier that can be used to match connect and disconnect events.
1686 // Currently is last two bytes of a hash of a device level ID and
1687 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001688 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001689 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001690 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1691 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001692 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001693 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001694 // An identifier that can be used to match events for this device.
1695 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1696 // Salt: Randomly generated 256 bit value
1697 // Hash algorithm: HMAC-SHA256
1698 // Size: 32 byte
1699 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001700 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001701}
1702
1703/**
1704 * Logs when a Bluetooth device connects and disconnects over ACL
1705 *
1706 * Logged from:
1707 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1708 *
1709 * Next Tag: 3
1710 */
1711message BluetoothAclConnectionStateChanged {
1712 // An identifier that can be used to match events for this device.
1713 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1714 // Salt: Randomly generated 256 bit value
1715 // Hash algorithm: HMAC-SHA256
1716 // Size: 32 byte
1717 // Default: null or empty if the device identifier is not known
1718 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1719 // The state of the connection.
1720 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1721 optional android.bluetooth.ConnectionStateEnum state = 2;
1722}
1723
1724/**
1725 * Logs when a Bluetooth device connects and disconnects over SCO
1726 *
1727 * Logged from:
1728 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1729 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1730 *
1731 * Next Tag: 4
1732 */
1733message BluetoothScoConnectionStateChanged {
1734 // An identifier that can be used to match events for this device.
1735 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1736 // Salt: Randomly generated 256 bit value
1737 // Hash algorithm: HMAC-SHA256
1738 // Size: 32 byte
1739 // Default: null or empty if the device identifier is not known
1740 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1741 // The state of the connection.
1742 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1743 optional android.bluetooth.ConnectionStateEnum state = 2;
1744 // Codec used for this SCO connection
1745 // Default: UNKNOWN
1746 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001747}
1748
Jack Hec27040a2019-01-09 20:54:41 -08001749/**
1750 * Logged when active device of a profile changes
1751 *
1752 * Logged from:
1753 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1754 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1755 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1756 */
1757message BluetoothActiveDeviceChanged {
1758 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1759 // From android.bluetooth.BluetoothProfile
1760 optional int32 bt_profile = 1;
1761 // An identifier that can be used to match events for this new active device.
1762 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1763 // Salt: Randomly generated 256 bit value
1764 // Hash algorithm: HMAC-SHA256
1765 // Size: 32 byte
1766 // Default: null or empty if there is no active device for this profile
1767 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1768}
1769
Jack Heab86dbd22018-12-18 15:43:27 -08001770// Logs when there is an event affecting Bluetooth device's link layer connection.
1771// - This event is triggered when there is a related HCI command or event
1772// - Users of this metrics can deduce Bluetooth device's connection state from these events
1773// - HCI commands are logged before the command is sent, after receiving command status, and after
1774// receiving command complete
1775// - HCI events are logged when they arrive
1776//
1777// Low level log from system/bt
1778//
1779// Bluetooth classic commands:
1780// - CMD_CREATE_CONNECTION
1781// - CMD_DISCONNECT
1782// - CMD_CREATE_CONNECTION_CANCEL
1783// - CMD_ACCEPT_CONNECTION_REQUEST
1784// - CMD_REJECT_CONNECTION_REQUEST
1785// - CMD_SETUP_ESCO_CONNECTION
1786// - CMD_ACCEPT_ESCO_CONNECTION
1787// - CMD_REJECT_ESCO_CONNECTION
1788// - CMD_ENH_SETUP_ESCO_CONNECTION
1789// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1790//
1791// Bluetooth low energy commands:
1792// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1793// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1794// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1795// - CMD_BLE_CLEAR_WHITE_LIST
1796// - CMD_BLE_ADD_WHITE_LIST
1797// - CMD_BLE_REMOVE_WHITE_LIST
1798//
1799// Bluetooth classic events:
1800// - EVT_CONNECTION_COMP
1801// - EVT_CONNECTION_REQUEST
1802// - EVT_DISCONNECTION_COMP
1803// - EVT_ESCO_CONNECTION_COMP
1804// - EVT_ESCO_CONNECTION_CHANGED
1805//
1806// Bluetooth low energy meta events:
1807// - BLE_EVT_CONN_COMPLETE_EVT
1808// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1809//
1810// Next tag: 10
1811message BluetoothLinkLayerConnectionEvent {
1812 // An identifier that can be used to match events for this device.
1813 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1814 // Salt: Randomly generated 256 bit value
1815 // Hash algorithm: HMAC-SHA256
1816 // Size: 32 byte
1817 // Default: null or empty if the device identifier is not known
1818 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1819 // Connection handle of this connection if available
1820 // Range: 0x0000 - 0x0EFF (12 bits)
1821 // Default: 0xFFFF if the handle is unknown
1822 optional int32 connection_handle = 2;
1823 // Direction of the link
1824 // Default: DIRECTION_UNKNOWN
1825 optional android.bluetooth.DirectionEnum direction = 3;
1826 // Type of this link
1827 // Default: LINK_TYPE_UNKNOWN
1828 optional android.bluetooth.LinkTypeEnum type = 4;
1829
1830 // Reason metadata for this link layer connection event, rules for interpretation:
1831 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1832 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1833 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1834 // set and valid, ignore hci_ble_event
1835
1836 // HCI command associated with this event
1837 // Default: CMD_UNKNOWN
1838 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1839 // HCI event associated with this event
1840 // Default: EVT_UNKNOWN
1841 optional android.bluetooth.hci.EventEnum hci_event = 6;
1842 // HCI BLE meta event associated with this event
1843 // Default: BLE_EVT_UNKNOWN
1844 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1845 // HCI command status code if this is triggerred by hci_cmd
1846 // Default: STATUS_UNKNOWN
1847 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1848 // HCI reason code associated with this event
1849 // Default: STATUS_UNKNOWN
1850 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1851}
1852
Howard Roe103fe22019-01-17 16:52:16 -08001853/**
1854 * Logs when a module is rolled back by Watchdog.
1855 *
1856 * Logged from: Rollback Manager
1857 */
1858message WatchdogRollbackOccurred {
1859 enum RollbackType {
1860 UNKNOWN = 0;
1861 ROLLBACK_INITIATE = 1;
1862 ROLLBACK_SUCCESS = 2;
1863 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001864 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001865 }
1866 optional RollbackType rollback_type = 1;
1867
1868 optional string package_name = 2;
1869
1870 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001871
1872 enum RollbackReasonType {
1873 REASON_UNKNOWN = 0;
1874 REASON_NATIVE_CRASH = 1;
1875 REASON_EXPLICIT_HEALTH_CHECK = 2;
1876 REASON_APP_CRASH = 3;
1877 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001878 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001879 }
1880 optional RollbackReasonType rollback_reason = 4;
1881
1882 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1883 // is initiated. Empty if the package is unknown.
1884 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001885
1886 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001887}
1888
Jack Hec27040a2019-01-09 20:54:41 -08001889/**
1890 * Logs when there is a change in Bluetooth A2DP playback state
1891 *
1892 * Logged from:
1893 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1894 */
1895message BluetoothA2dpPlaybackStateChanged {
1896 // An identifier that can be used to match events for this device.
1897 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1898 // Salt: Randomly generated 256 bit value
1899 // Hash algorithm: HMAC-SHA256
1900 // Size: 32 byte
1901 // Default: null or empty if the device identifier is not known
1902 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1903 // Current playback state
1904 // Default: PLAYBACK_STATE_UNKNOWN
1905 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1906 // Current audio coding mode
1907 // Default: AUDIO_CODING_MODE_UNKNOWN
1908 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1909}
1910
1911/**
1912 * Logs when there is a change in A2DP codec config for a particular remote device
1913 *
1914 * Logged from:
1915 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1916 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1917 */
1918message BluetoothA2dpCodecConfigChanged {
1919 // An identifier that can be used to match events for this device.
1920 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1921 // Salt: Randomly generated 256 bit value
1922 // Hash algorithm: HMAC-SHA256
1923 // Size: 32 byte
1924 // Default: null or empty if the device identifier is not known
1925 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1926 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1927 // Default SOURCE_CODEC_TYPE_INVALID
1928 optional int32 codec_type = 2;
1929 // Codec priroity, the higher the more preferred, -1 for disabled
1930 // Default: CODEC_PRIORITY_DEFAULT
1931 optional int32 codec_priority = 3;
1932 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1933 // Default: SAMPLE_RATE_NONE
1934 optional int32 sample_rate = 4;
1935 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1936 // Default: BITS_PER_SAMPLE_NONE
1937 optional int32 bits_per_sample = 5;
1938 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1939 // Default: CHANNEL_MODE_NONE
1940 optional int32 channel_mode = 6;
1941 // Codec specific values
1942 // Default 0
1943 optional int64 codec_specific_1 = 7;
1944 optional int64 codec_specific_2 = 8;
1945 optional int64 codec_specific_3 = 9;
1946 optional int64 codec_specific_4 = 10;
1947}
1948
1949/**
1950 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1951 * Each codec's capability is logged separately due to statsd restriction
1952 *
1953 * Logged from:
1954 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1955 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1956 */
1957message BluetoothA2dpCodecCapabilityChanged {
1958 // An identifier that can be used to match events for this device.
1959 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1960 // Salt: Randomly generated 256 bit value
1961 // Hash algorithm: HMAC-SHA256
1962 // Size: 32 byte
1963 // Default: null or empty if the device identifier is not known
1964 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1965 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1966 // Default SOURCE_CODEC_TYPE_INVALID
1967 optional int32 codec_type = 2;
1968 // Codec priroity, the higher the more preferred, -1 for disabled
1969 // Default: CODEC_PRIORITY_DEFAULT
1970 optional int32 codec_priority = 3;
1971 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1972 // in BluetoothCodecConfig
1973 // Default: empty and SAMPLE_RATE_NONE for individual item
1974 optional int32 sample_rate = 4;
1975 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1976 // in BluetoothCodecConfig
1977 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1978 optional int32 bits_per_sample = 5;
1979 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1980 // BluetoothCodecConfig
1981 // Default: empty and CHANNEL_MODE_NONE for individual item
1982 optional int32 channel_mode = 6;
1983 // Codec specific values
1984 // Default 0
1985 optional int64 codec_specific_1 = 7;
1986 optional int64 codec_specific_2 = 8;
1987 optional int64 codec_specific_3 = 9;
1988 optional int64 codec_specific_4 = 10;
1989}
1990
1991/**
1992 * Logs when A2DP failed to read from PCM source.
1993 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1994 *
1995 * Logged from:
1996 * system/bt
1997 */
1998message BluetoothA2dpAudioUnderrunReported {
1999 // An identifier that can be used to match events for this device.
2000 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2001 // Salt: Randomly generated 256 bit value
2002 // Hash algorithm: HMAC-SHA256
2003 // Size: 32 byte
2004 // Default: null or empty if the device identifier is not known
2005 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2006 // Encoding interval in nanoseconds
2007 // Default: 0
2008 optional int64 encoding_interval_nanos = 2;
2009 // Number of bytes of PCM data that could not be read from the source
2010 // Default: 0
2011 optional int32 num_missing_pcm_bytes = 3;
2012}
2013
2014/**
2015 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2016 * buffer queue is full and we have to drop data
2017 *
2018 * Logged from:
2019 * system/bt
2020 */
2021message BluetoothA2dpAudioOverrunReported {
2022 // An identifier that can be used to match events for this device.
2023 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2024 // Salt: Randomly generated 256 bit value
2025 // Hash algorithm: HMAC-SHA256
2026 // Size: 32 byte
2027 // Default: null or empty if the device identifier is not known
2028 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2029 // Encoding interval in nanoseconds
2030 // Default: 0
2031 optional int64 encoding_interval_nanos = 2;
2032 // Number of buffers dropped in this event
2033 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2034 // Default: 0
2035 optional int32 num_dropped_buffers = 3;
2036 // Number of encoded buffers dropped in this event
2037 // Default 0
2038 optional int32 num_dropped_encoded_frames = 4;
2039 // Number of encoded bytes dropped in this event
2040 // Default: 0
2041 optional int32 num_dropped_encoded_bytes = 5;
2042}
2043
2044/**
2045 * Logs when we receive reports regarding a device's RSSI value
2046 *
2047 * Logged from:
2048 * system/bt
2049 */
2050message BluetoothDeviceRssiReported {
2051 // An identifier that can be used to match events for this device.
2052 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2053 // Salt: Randomly generated 256 bit value
2054 // Hash algorithm: HMAC-SHA256
2055 // Size: 32 byte
2056 // Default: null or empty if the device identifier is not known
2057 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2058 // Connection handle of this connection if available
2059 // Range: 0x0000 - 0x0EFF (12 bits)
2060 // Default: 0xFFFF if the handle is unknown
2061 optional int32 connection_handle = 2;
2062 // HCI command status code if this is triggerred by hci_cmd
2063 // Default: STATUS_UNKNOWN
2064 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2065 // BR/EDR
2066 // Range: -128 ≤ N ≤ 127 (signed integer)
2067 // Units: dB
2068 // LE:
2069 // Range: -127 to 20, 127 (signed integer)
2070 // Units: dBm
2071 // Invalid when an out of range value is reported
2072 optional int32 rssi = 4;
2073}
2074
2075/**
2076 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2077 *
2078 * Logged from:
2079 * system/bt
2080 */
2081message BluetoothDeviceFailedContactCounterReported {
2082 // An identifier that can be used to match events for this device.
2083 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2084 // Salt: Randomly generated 256 bit value
2085 // Hash algorithm: HMAC-SHA256
2086 // Size: 32 byte
2087 // Default: null or empty if the device identifier is not known
2088 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2089 // Connection handle of this connection if available
2090 // Range: 0x0000 - 0x0EFF (12 bits)
2091 // Default: 0xFFFF if the handle is unknown
2092 optional int32 connection_handle = 2;
2093 // HCI command status code if this is triggerred by hci_cmd
2094 // Default: STATUS_UNKNOWN
2095 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2096 // Number of consecutive failed contacts for a connection corresponding to the Handle
2097 // Range: uint16_t, 0-0xFFFF
2098 // Default: 0xFFFFF
2099 optional int32 failed_contact_counter = 4;
2100}
2101
2102/**
2103 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2104 *
2105 * Logged from:
2106 * system/bt
2107 */
2108message BluetoothDeviceTxPowerLevelReported {
2109 // An identifier that can be used to match events for this device.
2110 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2111 // Salt: Randomly generated 256 bit value
2112 // Hash algorithm: HMAC-SHA256
2113 // Size: 32 byte
2114 // Default: null or empty if the device identifier is not known
2115 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2116 // Connection handle of this connection if available
2117 // Range: 0x0000 - 0x0EFF (12 bits)
2118 // Default: 0xFFFF if the handle is unknown
2119 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002120 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002121 // Default: STATUS_UNKNOWN
2122 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2123 // Range: -30 ≤ N ≤ 20
2124 // Units: dBm
2125 // Invalid when an out of range value is reported
2126 optional int32 transmit_power_level = 4;
2127}
Jack Heab86dbd22018-12-18 15:43:27 -08002128
Tej Singh5d991e12018-03-09 19:48:11 -08002129/**
Jack He1021a612019-01-20 21:22:46 -08002130 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2131 * receiving an HCI command from the host
2132 *
2133 * Logged from: system/bt
2134 */
2135message BluetoothHciTimeoutReported {
2136 // HCI command associated with this event
2137 // Default: CMD_UNKNOWN
2138 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2139}
2140
2141/**
2142 * Logs when we receive Bluetooth Link Quality Report event from the controller
2143 * See Android Bluetooth HCI specification for more details
2144 *
2145 * Note: all count and bytes field are counted since last event
2146 *
2147 * Logged from: system/bt
2148 */
2149message BluetoothQualityReportReported {
2150 // Quality report ID
2151 // Original type: uint8_t
2152 // Default: BQR_ID_UNKNOWN
2153 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2154 // Packet type of the connection
2155 // Original type: uint8_t
2156 // Default: BQR_PACKET_TYPE_UNKNOWN
2157 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2158 // Connection handle of the connection
2159 // Original type: uint16_t
2160 optional int32 connection_handle = 3;
2161 // Performing Role for the connection
2162 // Original type: uint8_t
2163 optional int32 connection_role = 4;
2164 // Current Transmit Power Level for the connection. This value is the same as the controller's
2165 // response to the HCI_Read_Transmit_Power_Level HCI command
2166 // Original type: uint8_t
2167 optional int32 tx_power_level = 5;
2168 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2169 // absolute receiver signal strength value
2170 // Original type: int8_t
2171 optional int32 rssi = 6;
2172 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2173 // channels used by the link currently
2174 // Original type: uint8_t
2175 optional int32 snr = 7;
2176 // Indicates the number of unused channels in AFH_channel_map
2177 // Original type: uint8_t
2178 optional int32 unused_afh_channel_count = 8;
2179 // Indicates the number of the channels which are interfered and quality is bad but are still
2180 // selected for AFH
2181 // Original type: uint8_t
2182 optional int32 afh_select_unideal_channel_count = 9;
2183 // Current Link Supervision Timeout Setting
2184 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2185 // Original type: uint16_t
2186 optional int32 lsto = 10;
2187 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2188 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2189 // 0x01 (Piconet Clock)
2190 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2191 // Original type: uint32_t
2192 optional int64 connection_piconet_clock = 11;
2193 // The count of retransmission
2194 // Original type: uint32_t
2195 optional int64 retransmission_count = 12;
2196 // The count of no RX
2197 // Original type: uint32_t
2198 optional int64 no_rx_count = 13;
2199 // The count of NAK (Negative Acknowledge)
2200 // Original type: uint32_t
2201 optional int64 nak_count = 14;
2202 // Controller timestamp of last TX ACK
2203 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2204 // Original type: uint32_t
2205 optional int64 last_tx_ack_timestamp = 15;
2206 // The count of Flow-off (STOP)
2207 // Original type: uint32_t
2208 optional int64 flow_off_count = 16;
2209 // Controller timestamp of last Flow-on (GO)
2210 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2211 // Original type: uint32_t
2212 optional int64 last_flow_on_timestamp = 17;
2213 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2214 // Original type: uint32_t
2215 optional int64 buffer_overflow_bytes = 18;
2216 // Buffer underflow count (in byte) since last event
2217 // Original type: uint32_t
2218 optional int64 buffer_underflow_bytes = 19;
2219}
2220
2221/**
2222 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2223 *
2224 * Notes:
2225 * - Each event can be partially filled as we might learn different pieces of device
2226 * information at different time
2227 * - Multiple device info events can be combined to give more complete picture
2228 * - When multiple device info events tries to describe the same information, the
2229 * later one wins
2230 *
2231 * Logged from:
2232 * packages/apps/Bluetooth
2233 */
Jack Heaea26982019-04-04 11:19:48 -07002234message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002235 // An identifier that can be used to match events for this device.
2236 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2237 // Salt: Randomly generated 256 bit value
2238 // Hash algorithm: HMAC-SHA256
2239 // Size: 32 byte
2240 // Default: null or empty if the device identifier is not known
2241 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2242 // Where is this device info obtained from
2243 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2244 // Name of the data source
2245 // For EXTERNAL: package name of the data source
2246 // For INTERNAL: null for general case, component name otherwise
2247 optional string source_name = 3;
2248 // Name of the manufacturer of this device
2249 optional string manufacturer = 4;
2250 // Model of this device
2251 optional string model = 5;
2252 // Hardware version of this device
2253 optional string hardware_version = 6;
2254 // Software version of this device
2255 optional string software_version = 7;
2256}
2257
2258/**
2259 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2260 * device, as documented by the Bluetooth Core HCI specification
2261 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2262 * Vol 2, Part E, Page 1118
2263 *
2264 * Logged from:
2265 * system/bt
2266 */
2267message BluetoothRemoteVersionInfoReported {
2268 // Connection handle of the connection
2269 // Original type: uint16_t
2270 optional int32 connection_handle = 1;
2271 // HCI command status code
2272 // Default: STATUS_UNKNOWN
2273 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2274 // 1 byte Version of current LMP in the remote controller
2275 optional int32 lmp_version = 3;
2276 // 2 bytes LMP manufacturer code of the remote controller
2277 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2278 optional int32 lmp_manufacturer_code = 4;
2279 // 4 bytes subversion of the LMP in the remote controller
2280 optional int32 lmp_subversion = 5;
2281}
2282
2283/**
2284 * Logs when certain Bluetooth SDP attributes are discovered
2285 * Constant definitions are from:
2286 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2287 *
2288 * Current logged attributes:
2289 * - BluetoothProfileDescriptorList
2290 * - Supported Features Bitmask
2291 *
2292 * Logged from:
2293 * system/bt
2294 */
2295message BluetoothSdpAttributeReported {
2296 // An identifier that can be used to match events for this device.
2297 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2298 // Salt: Randomly generated 256 bit value
2299 // Hash algorithm: HMAC-SHA256
2300 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2301 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2302 // Original type: uint16_t
2303 optional int32 protocol_uuid = 2;
2304 // Short form UUIDs used to identify Bluetooth SDP attribute types
2305 // Original type: uint16_t
2306 optional int32 attribute_id = 3;
2307 // Attribute value for the particular attribute
2308 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2309}
2310
2311/**
2312 * Logs when bond state of a Bluetooth device changes
2313 *
2314 * Logged from:
2315 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2316 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2317 */
2318message BluetoothBondStateChanged {
2319 // An identifier that can be used to match events for this device.
2320 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2321 // Salt: Randomly generated 256 bit value
2322 // Hash algorithm: HMAC-SHA256
2323 // Size: 32 byte
2324 // Default: null or empty if the device identifier is not known
2325 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2326 // Preferred transport type to remote dual mode device
2327 // Default: TRANSPORT_AUTO means no preference
2328 optional android.bluetooth.TransportTypeEnum transport = 2;
2329 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2330 // Default: UNKNOWN
2331 optional android.bluetooth.DeviceTypeEnum type = 3;
2332 // Current bond state (NONE, BONDING, BONDED)
2333 // Default: BOND_STATE_UNKNOWN
2334 optional android.bluetooth.BondStateEnum bond_state = 4;
2335 // Bonding sub state
2336 // Default: BOND_SUB_STATE_UNKNOWN
2337 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2338 // Unbond Reason
2339 // Default: UNBOND_REASON_UNKNOWN
2340 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2341}
2342
2343/**
2344 * Logs there is an event related Bluetooth classic pairing
2345 *
2346 * Logged from:
2347 * system/bt
2348 */
2349message BluetoothClassicPairingEventReported {
2350 // An identifier that can be used to match events for this device.
2351 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2352 // Salt: Randomly generated 256 bit value
2353 // Hash algorithm: HMAC-SHA256
2354 // Size: 32 byte
2355 // Default: null or empty if the device identifier is not known
2356 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2357 // Connection handle of this connection if available
2358 // Range: 0x0000 - 0x0EFF (12 bits)
2359 // Default: 0xFFFF if the handle is unknown
2360 optional int32 connection_handle = 2;
2361 // HCI command associated with this event
2362 // Default: CMD_UNKNOWN
2363 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2364 // HCI event associated with this event
2365 // Default: EVT_UNKNOWN
2366 optional android.bluetooth.hci.EventEnum hci_event = 4;
2367 // HCI command status code if this is triggerred by hci_cmd
2368 // Default: STATUS_UNKNOWN
2369 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2370 // HCI reason code associated with this event
2371 // Default: STATUS_UNKNOWN
2372 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002373 // A status value related to this specific event
2374 // Default: 0
2375 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002376}
2377
2378/**
2379 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2380 *
2381 * Logged from:
2382 * system/bt
2383 */
2384message BluetoothSmpPairingEventReported {
2385 // An identifier that can be used to match events for this device.
2386 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2387 // Salt: Randomly generated 256 bit value
2388 // Hash algorithm: HMAC-SHA256
2389 // Size: 32 byte
2390 // Default: null or empty if the device identifier is not known
2391 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2392 // SMP command sent or received over L2CAP
2393 // Default: CMD_UNKNOWN
2394 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2395 // Whether this command is sent or received
2396 // Default: DIRECTION_UNKNOWN
2397 optional android.bluetooth.DirectionEnum direction = 3;
2398 // SMP failure reason code
2399 // Default: PAIRING_FAIL_REASON_DEFAULT
2400 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2401}
2402
2403/**
Jack He815cdba2019-01-30 17:24:55 -08002404 * Logs when a Bluetooth socket’s connection state changed
2405 *
2406 * Logged from:
2407 * system/bt
2408 */
2409message BluetoothSocketConnectionStateChanged {
2410 // An identifier that can be used to match events for this device.
2411 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2412 // Salt: Randomly generated 256 bit value
2413 // Hash algorithm: HMAC-SHA256
2414 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002415 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002416 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002417 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002418 // Default 0 when unknown or don't care
2419 optional int32 port = 2;
2420 // Socket type as mentioned in
2421 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2422 // Default: SOCKET_TYPE_UNKNOWN
2423 optional android.bluetooth.SocketTypeEnum type = 3;
2424 // Socket connection state
2425 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2426 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2427 // Number of bytes sent to remote device during this connection
2428 optional int64 tx_bytes = 5;
2429 // Number of bytes received from remote device during this connection
2430 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002431 // Socket owner's UID
2432 optional int32 uid = 7 [(is_uid) = true];
2433 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2434 // |port| must be spawned by |server_port|
2435 // Default 0 when unknown or don't care
2436 optional int32 server_port = 8;
2437 // Whether this is a server listener socket
2438 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002439}
2440
2441/**
Jack He71426802019-04-02 13:32:52 -07002442 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2443 *
2444 * Logged from:
2445 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2446 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2447 *
2448 */
2449message BluetoothClassOfDeviceReported {
2450 // An identifier that can be used to match events for this device.
2451 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2452 // Salt: Randomly generated 256 bit value
2453 // Hash algorithm: HMAC-SHA256
2454 // Size: 32 byte
2455 // Default: null or empty if this is a server listener socket
2456 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2457 // Class of Device (CoD) value including both Major, Minor device class and service class
2458 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2459 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2460 // Default: 0
2461 optional int32 class_of_device = 2;
2462}
2463
2464/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002465 * Logs when something is plugged into or removed from the USB-C connector.
2466 *
2467 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002468 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002469 */
2470message UsbConnectorStateChanged {
2471 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002472 STATE_DISCONNECTED = 0;
2473 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002474 }
2475 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002476 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002477 // Last active session in ms.
2478 // 0 when the port is in connected state.
2479 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002480}
2481
2482/**
2483 * Logs the reported speaker impedance.
2484 *
2485 * Logged from:
2486 * Vendor audio implementation.
2487 */
2488message SpeakerImpedanceReported {
2489 optional int32 speaker_location = 1;
2490 optional int32 impedance = 2;
2491}
2492
2493/**
2494 * Logs the report of a failed hardware.
2495 *
2496 * Logged from:
2497 * Vendor HALs.
2498 *
2499 */
2500message HardwareFailed {
2501 enum HardwareType {
2502 HARDWARE_FAILED_UNKNOWN = 0;
2503 HARDWARE_FAILED_MICROPHONE = 1;
2504 HARDWARE_FAILED_CODEC = 2;
2505 HARDWARE_FAILED_SPEAKER = 3;
2506 HARDWARE_FAILED_FINGERPRINT = 4;
2507 }
2508 optional HardwareType hardware_type = 1;
2509
Maggie White6dcd8572019-01-31 14:11:50 -08002510 /**
2511 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002512 * the same hardware_type. The specific locations are vendor defined integers,
2513 * referring to board-specific numbering schemes.
2514 */
2515 optional int32 hardware_location = 2;
2516
Maggie White6dcd8572019-01-31 14:11:50 -08002517 /**
2518 * failure_code is specific to the HardwareType of the failed hardware.
2519 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002520 */
Maggie White6dcd8572019-01-31 14:11:50 -08002521 enum HardwareErrorCode {
2522 UNKNOWN = 0;
2523 COMPLETE = 1;
2524 SPEAKER_HIGH_Z = 2;
2525 SPEAKER_SHORT = 3;
2526 FINGERPRINT_SENSOR_BROKEN = 4;
2527 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002528 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002529 }
2530 optional int32 failure_code = 3;
2531}
2532
2533/**
2534 * Log an event when the device has been physically dropped.
2535 * Reported from the /vendor partition.
2536 */
2537message PhysicalDropDetected {
2538 // Confidence that the event was actually a drop, 0 -> 100
2539 optional int32 confidence_pctg = 1;
2540 // Peak acceleration of the drop, in 1/1000s of a g.
2541 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002542 // Duration of freefall in ms
2543 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002544}
2545
2546/**
2547 * Log bucketed battery charge cycles.
2548 *
2549 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002550 * a given charge point. For example, if 10 cycle buckets are
2551 * initialized, bucket 1 is the lowest 1/10th of the battery,
2552 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002553 *
2554 * Logged from:
2555 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2556 */
2557message ChargeCyclesReported {
2558 optional int32 cycle_bucket_1 = 1;
2559 optional int32 cycle_bucket_2 = 2;
2560 optional int32 cycle_bucket_3 = 3;
2561 optional int32 cycle_bucket_4 = 4;
2562 optional int32 cycle_bucket_5 = 5;
2563 optional int32 cycle_bucket_6 = 6;
2564 optional int32 cycle_bucket_7 = 7;
2565 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002566 optional int32 cycle_bucket_9 = 9;
2567 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002568}
2569
2570/**
Howard Roa46b6582018-09-18 16:45:02 -07002571 * Log battery health snapshot.
2572 *
2573 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2574 * are snapshotted periodically over 24hrs.
2575 */
2576message BatteryHealthSnapshot {
2577 enum BatterySnapshotType {
2578 UNKNOWN = 0;
2579 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2580 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2581 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2582 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2583 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2584 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2585 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2586 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2587 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2588 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2589 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2590 }
2591 optional BatterySnapshotType type = 1;
2592 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002593 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002594 // Voltage Battery Voltage, in microVolts.
2595 optional int32 voltage_micro_volt = 3;
2596 // Current Battery current, in microAmps.
2597 optional int32 current_micro_amps = 4;
2598 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2599 optional int32 open_circuit_micro_volt = 5;
2600 // Resistance Battery Resistance, in microOhms.
2601 optional int32 resistance_micro_ohm = 6;
2602 // Level Battery Level, as % of full.
2603 optional int32 level_percent = 7;
2604}
2605
2606/**
2607 * Log slow I/O operations on the primary storage.
2608 */
2609message SlowIo {
2610 // Classifications of IO Operations.
2611 enum IoOperation {
2612 UNKNOWN = 0;
2613 READ = 1;
2614 WRITE = 2;
2615 UNMAP = 3;
2616 SYNC = 4;
2617 }
2618 optional IoOperation operation = 1;
2619
2620 // The number of slow IO operations of this type over 24 hours.
2621 optional int32 count = 2;
2622}
2623
2624/**
2625 * Log battery caused shutdown with the last recorded voltage.
2626 */
2627message BatteryCausedShutdown {
2628 // The last recorded battery voltage prior to shutdown.
2629 optional int32 last_recorded_micro_volt = 1;
2630}
2631
2632/**
Tej Singha72344992019-04-17 18:55:08 -07002633 * Logs when ThermalService receives throttling events.
2634 *
2635 * Logged from:
2636 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2637 */
2638message ThermalThrottlingSeverityStateChanged {
2639 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2640 optional android.os.TemperatureTypeEnum sensor_type = 1;
2641
2642 // The name of the temperature source. Eg. CPU0
2643 optional string sensor_name = 2;
2644
2645 // Temperature in tenths of a degree C.
2646 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2647 optional int32 temperature_deci_celsius = 3;
2648
2649 // Relative severity of the throttling, see enum definition.
2650 optional android.os.ThrottlingSeverityEnum severity = 4;
2651}
2652
2653/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002654 * Logs the duration of a davey (jank of >=700ms) when it occurs
2655 *
2656 * Logged from:
2657 * frameworks/base/libs/hwui/JankTracker.cpp
2658 */
2659message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002660 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002661 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002662
Tej Singhbb8554a2018-01-26 11:59:14 -08002663 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002664 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002665}
2666
2667/**
Bookatze5885242017-10-24 20:10:31 -07002668 * Logs phone signal strength changes.
2669 *
2670 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002671 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002672 */
2673message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002674 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2675 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002676}
2677
Yangster4ccebea2018-10-09 17:09:02 -07002678
2679/**
2680 * Logs when the phone state, sim state or signal strength changes
2681 *
2682 * Logged from:
2683 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2684 */
2685message PhoneServiceStateChanged {
2686 optional android.telephony.ServiceStateEnum state = 1;
2687 optional android.telephony.SimStateEnum sim_state = 2;
2688 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2689}
2690
2691/**
2692 * Logs when the phone becomes on or off.
2693 *
2694 * Logged from:
2695 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2696 */
2697message PhoneStateChanged {
2698 enum State {
2699 OFF = 0;
2700 ON = 1;
2701 }
2702 optional State state = 1;
2703}
2704
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002705message BackGesture {
2706 enum BackType {
2707 DEFAULT_BACK_TYPE = 0;
2708 COMPLETED = 1;
2709 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2710 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2711 INCOMPLETE = 4;
2712 }
2713 optional BackType type = 1;
2714
2715 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2716 enum WindowHorizontalLocation {
2717 DEFAULT_LOCATION = 0;
2718 LEFT = 1;
2719 RIGHT = 2;
2720 }
2721 optional WindowHorizontalLocation x_location = 3;
2722}
2723
2724message ExclusionRectStateChanged {
2725 optional string component_name = 1; // if not available, simply packageName
2726 optional int32 requested_height = 2; // px
2727 optional int32 rejected_height = 3; // px
2728
2729 enum WindowHorizontalLocation {
2730 DEFAULT_LOCATION = 0;
2731 LEFT = 1;
2732 RIGHT = 2;
2733 }
2734 optional WindowHorizontalLocation x_location = 4;
2735 optional bool landscape = 5;
2736 optional bool splitscreen = 6;
2737 optional int32 duration_millis = 7;
2738}
2739
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002740message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002741 optional android.stats.launcher.LauncherAction action = 1;
2742 optional android.stats.launcher.LauncherState src_state = 2;
2743 optional android.stats.launcher.LauncherState dst_state = 3;
2744 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002745 optional bool is_swipe_up_enabled = 5;
2746}
2747
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002748message StyleUIChanged {
2749 optional android.stats.style.Action action = 1;
2750 optional int32 color_package_hash = 2;
2751 optional int32 font_package_hash = 3;
2752 optional int32 shape_package_hash = 4;
2753 optional int32 clock_package_hash = 5;
2754 optional int32 launcher_grid = 6;
2755 optional int32 wallpaper_category_hash = 7;
2756 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002757 optional int32 color_preference = 9;
2758 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002759}
2760
David Chenc28b2bb2017-10-24 12:52:52 -07002761/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002762 * Logs when Settings UI has changed.
2763 *
2764 * Logged from:
2765 * packages/apps/Settings
2766 */
2767message SettingsUIChanged {
2768 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002769 * Where this SettingsUIChange event comes from. For example, if
2770 * it's a PAGE_VISIBLE event, where the page is opened from.
2771 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002772 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002773
2774 /**
2775 * What the UI action is.
2776 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002777 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002778
2779 /**
2780 * Where the action is happening
2781 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002782 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002783
2784 /**
2785 * What preference changed in this event.
2786 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002787 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002788
2789 /**
2790 * The new value of the changed preference.
2791 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002792 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002793}
2794
2795/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002796 * Logs basic timing information about touch events.
2797 * Reported at most every 5 minutes while device is being interacted with.
2798 *
2799 * Logged from:
2800 * frameworks/native/services/inputflinger
2801 */
2802message TouchEventReported {
2803 /**
2804 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002805 * and the standard deviation of the time spent processing touchscreen events
2806 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002807 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002808 * On supported devices, the starting point is taken during the hard interrupt inside the
2809 * kernel touch driver. On all other devices, the starting point is taken inside
2810 * the kernel's input event subsystem upon receipt of the input event.
2811 * The ending point is taken inside InputDispatcher, just after the input event
2812 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002813 */
2814 // Minimum value
2815 optional float latency_min_micros = 1;
2816 // Maximum value
2817 optional float latency_max_micros = 2;
2818 // Average value
2819 optional float latency_mean_micros = 3;
2820 // Standard deviation
2821 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002822 // Number of touch events (input_event) in this report
2823 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002824}
2825
2826/**
Philip Quinn0eded622019-01-29 12:46:28 -08002827 * Logs gesture classification and timing information for touch events.
2828 *
2829 * Logged from:
2830 * frameworks/base/core/java/android/view/GestureDetector.java
2831 * frameworks/base/core/java/android/view/View.java
2832 */
2833message TouchGestureClassified {
2834 // The source of the classification (e.g. Java class name).
2835 optional string source = 1;
2836
2837 enum Classification {
2838 UNKNOWN_CLASSIFICATION = 0;
2839 SINGLE_TAP = 1;
2840 DOUBLE_TAP = 2;
2841 LONG_PRESS = 3;
2842 DEEP_PRESS = 4;
2843 SCROLL = 5;
2844 }
2845 // The classification of the gesture.
2846 optional Classification classification = 2;
2847
2848 // The interval from the start of a touch event stream until the
2849 // classification was made.
2850 optional int32 latency_millis = 3;
2851
2852 // The distance from the location of the first touch event to the
2853 // location of the touch event when the classification was made.
2854 optional float displacement_px = 4;
2855}
2856
2857/**
David Chenc28b2bb2017-10-24 12:52:52 -07002858 * Logs that a setting was updated.
2859 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002860 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002861 * The tag and is_default allow resetting of settings to default values based on the specified
2862 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2863 */
2864message SettingChanged {
2865 // The name of the setting.
2866 optional string setting = 1;
2867
2868 // The change being imposed on this setting. May represent a number, eg "3".
2869 optional string value = 2;
2870
2871 // The new value of this setting. For most settings, this is same as value. For some settings,
2872 // value is +X or -X where X represents an element in a set. For example, if the previous value
2873 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2874 // The +/- feature is currently only used for location_providers_allowed.
2875 optional string new_value = 3;
2876
2877 // The previous value of this setting.
2878 optional string prev_value = 4;
2879
2880 // The tag used with the is_default for resetting sets of settings. This is generally null.
2881 optional string tag = 5;
2882
Bookatz90867622018-01-31 15:05:57 -08002883 // True if this setting with tag should be resettable.
2884 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002885
David Chenbd789912018-03-16 17:19:55 -07002886 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002887 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002888
2889 enum ChangeReason {
2890 UPDATED = 1; // Updated can be an insertion or an update.
2891 DELETED = 2;
2892 }
2893 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002894}
Chenjie Yub3dda412017-10-24 13:41:59 -07002895
Chenjie Yu05013b32017-11-21 10:21:41 -08002896/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002897 * Logs activity going to foreground or background
2898 *
2899 * Logged from:
2900 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2901 */
2902message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002903 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002904 optional string pkg_name = 2;
2905 optional string class_name = 3;
2906
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002907 enum State {
2908 BACKGROUND = 0;
2909 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002910 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002911 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002912}
David Chenc8a43242017-10-17 16:23:28 -07002913
2914/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002915 * Logs when a volume entered low Storage state.
2916 * Logged from:
2917 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2918 */
2919message LowStorageStateChanged {
2920 // Volume that ran out of storage.
2921 optional string volume_description = 1;
2922
2923 enum State {
2924 UNKNOWN = 0;
2925 OFF = 1;
2926 ON = 2;
2927 }
2928 optional State state = 2;
2929}
2930
2931/**
2932 * Logs when an app is downgraded.
2933 * Logged from:
2934 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2935 */
2936message AppDowngraded {
2937 optional string package_name = 1;
2938 // Size of the package (all data) before being downgraded.
2939 optional int64 size_in_bytes_before = 2;
2940 // Size of the package (all data) after being downgraded.
2941 optional int64 size_in_bytes_after = 3;
2942
2943 optional bool aggressive = 4;
2944}
2945
2946/**
2947 * Logs when an app is optimized after being downgraded.
2948 * Logged from:
2949 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2950 */
2951message AppOptimizedAfterDowngraded {
2952 optional string package_name = 1;
2953}
2954
2955/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002956 * Logs whenever an app is installed on external storage.
2957 * Logged from:
2958 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2959 */
2960message AppInstallOnExternalStorageReported {
2961 // The type of external storage.
2962 optional android.stats.storage.ExternalStorageType storage_type = 1;
2963 // The name of the package that is installed on the sd card.
2964 optional string package_name = 2;
2965}
2966
2967/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002968 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002969 * Logged from:
2970 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2971 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002972message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002973 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002974
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002975 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002976
2977 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002978 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002979 optional string process_name = 3;
2980
2981 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002982 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002983
2984 optional string package_name = 5;
2985
2986 enum InstantApp {
2987 UNAVAILABLE = 0;
2988 FALSE = 1;
2989 TRUE = 2;
2990 }
2991 optional InstantApp is_instant_app = 6;
2992
2993 enum ForegroundState {
2994 UNKNOWN = 0;
2995 BACKGROUND = 1;
2996 FOREGROUND = 2;
2997 }
2998 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002999
3000 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003001}
David Chen9e3808c2017-11-20 17:25:34 -08003002
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003003/**
3004 * Logs when a WTF (What a Terrible Failure) happened.
3005 * Logged from:
3006 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3007 */
3008message WTFOccurred {
3009 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003010
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003011 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003012
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003013 // The name of the process.
3014 // system_server if it is not by an app
3015 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003016
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003017 // The pid if available. -1 means not available.
3018 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003019
3020 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003021}
3022
3023/**
3024 * Logs when system server reports low memory.
3025 * Logged from:
3026 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3027 */
3028message LowMemReported {
3029}
3030
3031/**
3032 * Logs when an app ANR (App Not Responding) occurs.
3033 * Logged from:
3034 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3035 */
3036message ANROccurred {
3037 optional int32 uid = 1 [(is_uid) = true];
3038
3039 optional string process_name = 2;
3040
3041 optional string short_component_name = 3;
3042
3043 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003044
3045 enum InstantApp {
3046 UNAVAILABLE = 0;
3047 FALSE = 1;
3048 TRUE = 2;
3049 }
3050 optional InstantApp is_instant_app = 5;
3051
3052 enum ForegroundState {
3053 UNKNOWN = 0;
3054 BACKGROUND = 1;
3055 FOREGROUND = 2;
3056 }
3057 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003058
3059 optional android.server.ErrorSource error_source = 7;
3060
3061 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003062}
3063
Bookatza7020bd2018-08-28 16:29:35 -07003064/**
3065 * Logs when the vibrator state changes.
3066 * Logged from:
3067 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3068 */
3069message VibratorStateChanged {
3070 repeated AttributionNode attribution_node = 1;
3071
3072 enum State {
3073 OFF = 0;
3074 ON = 1;
3075 }
3076 optional State state = 2;
3077
3078 // Duration (in milliseconds) requested to keep the vibrator on.
3079 // Only applicable for State == ON.
3080 optional int64 duration_millis = 3;
3081}
3082
David Chen0a368b22017-12-06 16:28:16 -08003083/*
3084 * Allows other apps to push events into statsd.
3085 * Logged from:
3086 * frameworks/base/core/java/android/util/StatsLog.java
3087 */
David Chen0b5c90c2018-01-25 16:51:49 -08003088message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003089 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003090 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003091
3092 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3093 optional int32 label = 2;
3094
3095 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3096 // predicates for the metrics).
3097 enum State {
3098 UNKNOWN = 0;
3099 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3100 STOP = 2;
3101 START = 3;
3102 }
3103 optional State state = 3;
3104}
3105
David Chen9e3808c2017-11-20 17:25:34 -08003106/**
Bookatz7948c872018-09-04 12:58:33 -07003107 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3108 * For example, this could be due to the user manually changing the time.
3109 *
3110 * Logged from:
3111 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3112 */
3113message WallClockTimeShifted {
3114 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3115 optional int64 wall_clock_timestamp_millis = 1;
3116}
3117
3118/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003119 * Logs when statsd detects an anomaly.
3120 *
3121 * Logged from:
3122 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3123 */
3124message AnomalyDetected {
3125 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003126 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003127
Yangster-mac94e197c2018-01-02 16:03:03 -08003128 // Id of the config whose anomaly detection alert fired.
3129 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003130
Yangster-mac94e197c2018-01-02 16:03:03 -08003131 // Id of the alert (i.e. name of the anomaly that was detected).
3132 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003133}
3134
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003135message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003136 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003137 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003138
3139 // The app package name.
3140 optional string pkg_name = 2;
3141
3142 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003143 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003144 WARM = 1;
3145 HOT = 2;
3146 COLD = 3;
3147 }
3148 // The transition type.
3149 optional TransitionType type = 3;
3150
3151 // The activity name.
3152 optional string activity_name = 4;
3153
3154 // The name of the calling app. Empty if not set.
3155 optional string calling_pkg_name = 5;
3156
3157 // Whether the app is an instant app.
3158 optional bool is_instant_app = 6;
3159
3160 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003161 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003162
Bookatz80d11a02018-01-16 10:46:35 -08003163 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003164
David Chen0b5c90c2018-01-25 16:51:49 -08003165 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003166 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003167 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003168 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003169 optional int32 bind_application_delay_millis = 11;
3170 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003171
3172 // Empty if not set.
3173 optional string launch_token = 13;
3174
Calin Juravle759fbda2018-02-20 19:52:30 +00003175 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003176 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003177
3178 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003179 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003180}
3181
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003182message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003183 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003184 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185
3186 // The app package name.
3187 optional string pkg_name = 2;
3188
3189 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003190 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003191 WARM = 1;
3192 HOT = 2;
3193 COLD = 3;
3194 }
3195 // The transition type.
3196 optional TransitionType type = 3;
3197
3198 // The activity name.
3199 optional string activity_name = 4;
3200}
3201
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003202message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003203 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003204 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205
3206 // The app package name.
3207 optional string pkg_name = 2;
3208
3209 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003210 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003211 WITH_BUNDLE = 1;
3212 WITHOUT_BUNDLE = 2;
3213 }
3214 // The transition type.
3215 optional TransitionType type = 3;
3216
3217 // The activity name.
3218 optional string activity_name = 4;
3219
3220 optional bool transition_process_running = 5;
3221
3222 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003223 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003224}
3225
Bookatz8fcd09a2017-12-18 13:01:10 -08003226/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003227 * Logs a picture-in-picture action
3228 * Logged from:
3229 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3230 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3231 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3232 */
3233message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003234 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003235 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003236
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003237 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003238
Chenjie Yu52cacc62017-12-08 18:11:45 -08003239 enum State {
3240 ENTERED = 1;
3241 EXPANDED_TO_FULL_SCREEN = 2;
3242 MINIMIZED = 3;
3243 DISMISSED = 4;
3244 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003245 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003246}
3247
3248/**
Chenjie Yue8904192017-12-08 19:12:57 -08003249 * Logs overlay action
3250 * Logged from:
3251 * services/core/java/com/android/server/wm/Session.java
3252 */
3253message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003254 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003255
tsaichristine5adc7e02020-01-14 17:07:39 -08003256 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003257
3258 optional bool using_alert_window = 3;
3259
3260 enum State {
3261 ENTERED = 1;
3262 EXITED = 2;
3263 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003264 optional State state = 4 [
3265 (state_field_option).option = EXCLUSIVE_STATE,
3266 (state_field_option).nested = false,
3267 (state_field_option).default_state_value = 2
3268 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003269}
3270
Chenjie Yuccfe6452018-01-30 11:33:21 -08003271/*
3272 * Logs foreground service starts and stops.
3273 * Note that this is not when a service starts or stops, but when it is
3274 * considered foreground.
3275 * Logged from
3276 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3277 */
3278message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003279 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003280 // package_name + "/" + class_name
3281 optional string short_name = 2;
3282
3283 enum State {
3284 ENTER = 1;
3285 EXIT = 2;
3286 }
3287 optional State state = 3;
3288}
3289
Chenjie Yue8904192017-12-08 19:12:57 -08003290/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003291 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3292 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3293 * attributed back to the parent (host) uid. One example is Chrome.
3294 *
3295 * Logged from:
3296 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3297 */
3298message IsolatedUidChanged {
3299 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003300 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003301 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003302 optional int32 parent_uid = 1;
3303
3304 optional int32 isolated_uid = 2;
3305
3306 // We expect an isolated uid to be removed before if it's used for another parent uid.
3307 enum Event {
3308 REMOVED = 0;
3309 CREATED = 1;
3310 }
3311 optional Event event = 3;
3312}
3313
3314/*
3315 * Logs the reception of an incoming network packet causing the main system to wake up for
3316 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3317 * and processed by WakeupController.cpp.
3318 */
3319message PacketWakeupOccurred {
3320 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3321 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003322 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003323 // The interface name on which the packet was received.
3324 optional string iface = 2;
3325 // The ethertype value of the packet.
3326 optional int32 ethertype = 3;
3327 // String representation of the destination MAC address of the packet.
3328 optional string destination_hardware_address = 4;
3329 // String representation of the source address of the packet if this was an IP packet.
3330 optional string source_ip = 5;
3331 // String representation of the destination address of the packet if this was an IP packet.
3332 optional string destination_ip = 6;
3333 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3334 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3335 // families.
3336 optional int32 ip_next_header = 7;
3337 // The source port if this was a TCP or UDP packet.
3338 optional int32 source_port = 8;
3339 // The destination port if this was a TCP or UDP packet.
3340 optional int32 destination_port = 9;
3341}
3342
3343/*
3344 * Logs the memory stats for an app on startup.
3345 * Logged from:
3346 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3347 */
3348message AppStartMemoryStateCaptured {
3349 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003350 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003351
3352 // The process name.
3353 optional string process_name = 2;
3354
3355 // The activity name.
3356 optional string activity_name = 3;
3357
3358 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003359 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003360
3361 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003362 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003363
3364 // RSS
3365 optional int64 rss_in_bytes = 6;
3366
3367 // CACHE
3368 optional int64 cache_in_bytes = 7;
3369
3370 // SWAP
3371 optional int64 swap_in_bytes = 8;
3372}
3373
3374/*
3375 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3376 * for LMK event.
3377 * Logged from:
3378 * system/core/lmkd/lmkd.c
3379 */
3380message LmkStateChanged {
3381 enum State {
3382 UNKNOWN = 0;
3383 START = 1;
3384 STOP = 2;
3385 }
3386 optional State state = 1;
3387}
3388
3389/*
3390 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3391 * Logged from:
3392 * system/core/lmkd/lmkd.c
3393 */
3394message LmkKillOccurred {
3395 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003396 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003397
3398 // The process name.
3399 optional string process_name = 2;
3400
3401 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003402 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003403
3404 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003405 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003406
3407 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003408 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003409
3410 // RSS
3411 optional int64 rss_in_bytes = 6;
3412
3413 // CACHE
3414 optional int64 cache_in_bytes = 7;
3415
3416 // SWAP
3417 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003418
3419 // The elapsed real time of start of the process.
3420 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003421
3422 // Min oom adj score considered by lmkd.
3423 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003424}
3425
Rajeev Kumar51b54602018-03-01 12:18:26 -08003426/*
3427 * Logs when the ActivityManagerService detects that an app died.
3428 *
3429 * Logged from:
3430 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3431 */
3432message AppDied {
3433 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003434 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003435}
3436
Howard Ro21a039c2018-08-06 14:55:47 -07003437/**
3438 * An atom for generic metrics logging. Available from Android Q.
3439 */
3440message GenericAtom {
3441 // The uid of the application that sent this custom atom.
3442 optional int32 uid = 1 [(is_uid) = true];
3443
3444 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003445 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003446}
3447
Tej Singhd6d6d772018-09-05 17:41:25 -07003448/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003449 * Atom for simple logging of user interaction and impression events, such as "the user touched
3450 * this button" or "this dialog was displayed".
3451 * Keep the UI event stream clean: don't use for system or background events.
3452 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003453 *
3454 * Logged from:
3455 * frameworks/base/services/core/java/com/android/server/
3456 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003457 */
3458message UiEventReported {
3459 // The event_id.
3460 optional int32 event_id = 1;
3461 // The event's source or target uid and package, if applicable.
3462 // For example, the package posting a notification, or the destination package of a share.
3463 optional int32 uid = 2 [(is_uid) = true];
3464 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003465 // An identifier used to disambiguate which logs refer to a particular instance of some
3466 // UI element. Useful when there might be multiple instances simultaneously active.
3467 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003468}
3469
3470/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003471 * Reports a notification was created or updated.
3472 *
3473 * Logged from:
3474 * frameworks/base/services/core/java/com/android/server/notification/
3475 */
3476message NotificationReported {
3477 // The event_id (as for UiEventReported).
3478 optional int32 event_id = 1;
3479 // The notifying app's uid and package.
3480 optional int32 uid = 2 [(is_uid) = true];
3481 optional string package_name = 3;
3482 // A small system-assigned identifier for the notification.
3483 // Locally probably-unique, but expect collisions across users and/or days.
3484 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003485 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3486 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003487
3488 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003489 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3490 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3491 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003492
3493 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003494 optional string category = 10; // App-assigned notification category (API-defined strings)
3495 optional int32 style = 11; // App-assigned notification style
3496 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003497
3498 // Ordering, importance and interruptiveness
3499
Will Brockman7614f6962020-02-10 19:43:03 -05003500 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003501
Will Brockman7614f6962020-02-10 19:43:03 -05003502 optional android.stats.sysui.NotificationImportance importance = 14;
3503 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003504
3505 enum NotificationImportanceExplanation {
3506 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3507 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3508 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3509 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3510 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3511 // Like _APP, but based on pre-channels priority signal.
3512 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3513 }
3514
Will Brockman7614f6962020-02-10 19:43:03 -05003515 optional NotificationImportanceExplanation importance_source = 16;
3516 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3517 optional NotificationImportanceExplanation importance_initial_source = 18;
3518 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3519 optional int32 assistant_hash = 20;
3520 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003521}
3522
3523message Notification {
3524 // The notifying app's uid and package.
3525 optional int32 uid = 1 [(is_uid) = true];
3526 optional string package_name = 2;
3527 // A small system-assigned identifier for the notification.
3528 optional int32 instance_id = 3;
3529
3530 // Grouping information.
3531 optional int32 group_instance_id = 4;
3532 optional bool is_group_summary = 5;
3533
3534 // The section of the shade that the notification is in.
3535 // See NotificationSectionsManager.PriorityBucket.
3536 enum NotificationSection {
3537 SECTION_UNKNOWN = 0;
3538 SECTION_PEOPLE = 1;
3539 SECTION_ALERTING = 2;
3540 SECTION_SILENT = 3;
3541 }
3542 optional NotificationSection section = 6;
3543}
3544
3545message NotificationList {
3546 repeated Notification notifications = 1; // An ordered sequence of notifications.
3547}
3548
3549/**
3550 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3551 *
3552 * Logged from:
3553 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3554 */
3555message NotificationPanelReported {
3556 // The event_id (as for UiEventReported).
3557 optional int32 event_id = 1;
3558 optional int32 num_notifications = 2;
3559 // The notifications in the panel, in the order that they appear there.
3560 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3561}
3562
3563/**
3564 * Reports a notification channel, or channel group, was created, updated, or deleted.
3565 *
3566 * Logged from:
3567 * frameworks/base/services/core/java/com/android/server/notification/
3568 */
3569message NotificationChannelModified {
3570 // The event_id (as for UiEventReported).
3571 optional int32 event_id = 1;
3572 // The notifying app's uid and package.
3573 optional int32 uid = 2 [(is_uid) = true];
3574 optional string package_name = 3;
3575 // App-assigned notification channel ID or channel-group ID
3576 optional string channel_id = 4;
3577 // Previous importance setting, if applicable
3578 optional android.stats.sysui.NotificationImportance old_importance = 5;
3579 // New importance setting
3580 optional android.stats.sysui.NotificationImportance importance = 6;
3581}
3582
3583
3584/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003585 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003586 *
3587 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003588 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003589 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003590message BiometricAcquired {
3591 // Biometric modality that was acquired.
3592 optional android.hardware.biometrics.ModalityEnum modality = 1;
3593 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3594 optional int32 user = 2;
3595 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3596 optional bool is_crypto = 3;
3597 // Action that the device is performing. Acquired messages are only expected for enroll and
3598 // authenticate. Other actions may indicate an error.
3599 optional android.hardware.biometrics.ActionEnum action = 4;
3600 // The client that this acquisition was received for.
3601 optional android.hardware.biometrics.ClientEnum client = 5;
3602 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3603 optional int32 acquire_info = 6;
3604 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3605 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003606 // Dictates if this message should trigger additional debugging.
3607 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003608}
3609
3610/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003611 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003612 *
3613 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003614 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003615 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003616message BiometricAuthenticated {
3617 // Biometric modality that was used.
3618 optional android.hardware.biometrics.ModalityEnum modality = 1;
3619 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3620 optional int32 user = 2;
3621 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3622 // storage.
3623 optional bool is_crypto = 3;
3624 // The client that this acquisition was received for.
3625 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003626 // If authentication requires user confirmation. See BiometricPrompt's
3627 // setRequireConfirmation(bool) method.
3628 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003629
Kevin Chyn1741a072019-01-17 11:54:40 -08003630 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003631 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003632 REJECTED = 1;
3633 PENDING_CONFIRMATION = 2;
3634 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003635 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003636
3637 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003638 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003639 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3640 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3641 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3642 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003643 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003644 // Dictates if this message should trigger additional debugging.
3645 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003646}
3647
3648/**
3649 * Logs when a biometric error occurs.
3650 *
3651 * Logged from:
3652 * frameworks/base/services/core/java/com/android/server/biometrics
3653 */
3654message BiometricErrorOccurred {
3655 // Biometric modality that was used.
3656 optional android.hardware.biometrics.ModalityEnum modality = 1;
3657 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3658 optional int32 user = 2;
3659 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3660 optional bool is_crypto = 3;
3661 // Action that the device is performing.
3662 optional android.hardware.biometrics.ActionEnum action = 4;
3663 // The client that this acquisition was received for.
3664 optional android.hardware.biometrics.ClientEnum client = 5;
3665 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3666 // are unique to modality.
3667 optional int32 error_info = 6;
3668 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3669 // by the vendor and not specified by the HIDL interface.
3670 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003671 // Dictates if this message should trigger additional debugging.
3672 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003673 // Time spent during the authentication attempt.
3674 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003675}
3676
3677/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003678 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003679 * Logged from:
3680 * frameworks/base/services/core/java/com/android/server/biometrics
3681 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003682message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003683 // Biometric modality.
3684 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003685 // Type of issue detected.
3686 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003687 // Dictates if this message should trigger additional debugging.
3688 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003689}
Howard Ro688ae182018-09-25 00:09:36 -07003690
joshmccloskey6f952b22019-03-25 20:59:35 -07003691/**
3692 * Logs when a biometric enrollment occurs.
3693 *
3694 * Logged from:
3695 * frameworks/base/services/core/java/com/android/server/biometrics
3696 */
3697message BiometricEnrolled {
3698 // Biometric modality that was used.
3699 optional android.hardware.biometrics.ModalityEnum modality = 1;
3700 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3701 optional int32 user = 2;
3702 // The amount of time the enrollment took in milliseconds.
3703 optional int64 latency_millis = 3;
3704 // Whether or not the enrollment was successful.
3705 optional bool success = 4;
3706}
3707
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003708/*
Tej Singh0d176952019-01-16 19:10:54 -08003709 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003710 */
Tej Singh0d176952019-01-16 19:10:54 -08003711message FlagFlipUpdateOccurred {
3712 // If the event is from a flag config package, specify the package name.
3713 optional string flag_flip_package_name = 1;
3714
3715 // The order id of the package
3716 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003717}
3718
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003719/**
3720 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003721 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003722 */
3723message TrainExperimentIds {
3724 repeated int64 experiment_id = 1;
3725}
3726
Yangster-macb89807e2018-11-15 21:10:57 -08003727/*
3728 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003729 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003730 */
3731message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003732 // Name of the train.
3733 optional string train_name = 1;
3734 // Version code for a "train" of packages that need to be installed atomically
3735 optional int64 train_version_code = 2;
3736 // After installation of this package, device requires a restart.
3737 optional bool requires_staging = 3;
3738 // Rollback should be enabled for this install.
3739 optional bool rollback_enabled = 4;
3740 // Requires low latency monitoring if possible.
3741 optional bool requires_low_latency_monitor = 5;
3742
Yangster-macb89807e2018-11-15 21:10:57 -08003743 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003744 UNKNOWN = 0;
3745 INSTALL_REQUESTED = 1;
3746 INSTALL_STARTED = 2;
3747 INSTALL_STAGED_NOT_READY = 3;
3748 INSTALL_STAGED_READY = 4;
3749 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003750 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3751 // and INSTALL_FAILURE_COMMIT.
3752 INSTALL_FAILURE = 6 [deprecated = true];
3753 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003754 INSTALL_CANCELLED = 7;
3755 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003756 INSTALLER_ROLLBACK_INITIATED = 9;
3757 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3758 INSTALLER_ROLLBACK_STAGED = 11;
3759 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3760 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3761 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3762 INSTALLER_ROLLBACK_SUCCESS = 15;
3763 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003764 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3765 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3766 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3767 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3768 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3769 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003770 INSTALL_FAILURE_DOWNLOAD = 23;
3771 INSTALL_FAILURE_STATE_MISMATCH = 24;
3772 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003773 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003774 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003775 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003776 // Possible experiment ids for monitoring this push.
3777 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3778 // user id
3779 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003780 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003781 // Whether or not this is a rollback event
3782 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003783}
3784
Tej Singhc9203082019-05-03 13:42:23 -07003785/* Test atom, is not logged anywhere */
3786message TestAtomReported {
3787 repeated AttributionNode attribution_node = 1;
3788 optional int32 int_field = 2;
3789 optional int64 long_field = 3;
3790 optional float float_field = 4;
3791 optional string string_field = 5;
3792 optional bool boolean_field = 6;
3793 enum State {
3794 UNKNOWN = 0;
3795 OFF = 1;
3796 ON = 2;
3797 }
3798 optional State state = 7;
3799 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3800}
3801
Maggie Whitefc1aa592018-11-28 21:55:23 -08003802/** Represents USB port overheat event. */
3803message UsbPortOverheatEvent {
3804 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3805 optional int32 plug_temperature_deci_c = 1;
3806
3807 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3808 optional int32 max_temperature_deci_c = 2;
3809
3810 /* Time between USB plug event and overheat threshold trip, in seconds. */
3811 optional int32 time_to_overheat_secs = 3;
3812
3813 /* Time between overheat threshold trip and hysteresis, in seconds. */
3814 optional int32 time_to_hysteresis_secs = 4;
3815
3816 /* Time between hysteresis and active mitigation ending, in seconds. */
3817 optional int32 time_to_inactive_secs = 5;
3818};
3819
Maggie White8735b852019-01-18 11:40:49 -08003820/**
3821 * Logs total effective full charge and discharge cycles on a battery.
3822 * Here are some examples of one effective cycle:
3823 * 1) the battery charges from 0% to 100% and drains back to 0%,
3824 * 2) charging from 50% to 100% and draining back to 50% twice.
3825 * Pulled from:
3826 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3827 */
3828message BatteryCycleCount {
3829 /* Number of total charge and discharge cycles on the system battery. */
3830 optional int32 cycle_count = 1;
3831}
3832
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003833/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003834 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3835 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003836 * Pulled from:
3837 * StatsCompanionService
3838 */
3839
Carmen Agimof12dec122019-03-06 16:14:38 +00003840message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003841
Carmen Agimof12dec122019-03-06 16:14:38 +00003842 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003843 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003844 PUBLIC = 1;
3845 PRIVATE = 2;
3846 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003847 }
3848
Carmen Agimof12dec122019-03-06 16:14:38 +00003849 // The type of external storage.
3850 optional android.stats.storage.ExternalStorageType storage_type = 1;
3851 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3852 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003853 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003854 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003855}
3856
Yangster-macb89807e2018-11-15 21:10:57 -08003857/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003858 * Logs when a connection becomes available and lost.
3859 * Logged in StatsCompanionService.java
3860 */
3861message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003862 // Id of the network.
3863 optional int32 net_id = 1;
3864
3865 enum State {
3866 UNKNOWN = 0;
3867 CONNECTED = 1;
3868 DISCONNECTED = 2;
3869 }
3870 // Connected state of a network.
3871 optional State state = 2;
3872}
3873
3874/**
3875 * Logs when a service starts and stops.
3876 * Logged from:
3877 * services/core/java/com/android/server/am/ActiveServices.java
3878 */
3879message ServiceStateChanged {
3880
3881 optional int32 uid = 1 [(is_uid) = true];
3882
3883 optional string package_name = 2;
3884
3885 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003886
3887 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003888 START = 1;
3889 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003890 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003891
3892 optional State state = 4;
3893}
3894
3895/**
3896 * Logs when a service is launched.
3897 * Logged from:
3898 * services/core/java/com/android/server/am/ActiveServices.java
3899 */
3900message ServiceLaunchReported {
3901
3902 optional int32 uid = 1 [(is_uid) = true];
3903
3904 optional string package_name = 2;
3905
3906 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003907}
Howard Ro688ae182018-09-25 00:09:36 -07003908
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003909/**
3910 * Logs when a hidden API is used.
3911 *
3912 * Logged from:
3913 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3914 */
3915message HiddenApiUsed {
3916 // The uid of the app making the hidden access.
3917 optional int32 uid = 1 [(is_uid) = true];
3918
3919 // Signature of the method or field accessed.
3920 optional string signature = 2;
3921
3922 enum AccessMethod {
3923 NONE = 0;
3924 REFLECTION = 1;
3925 JNI = 2;
3926 LINKING = 3;
3927 }
3928
3929 // Type of access.
3930 optional AccessMethod access_method = 3;
3931
3932 // Whether the access was prevented or not.
3933 optional bool access_denied = 4;
3934}
3935
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003936/**
3937 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3938 * - When user sees privacy chip
3939 * - When user clicks privacy chip
3940 * - How does the user exit the Privacy Dialog
3941 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003942 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3943 */
3944message PrivacyIndicatorsInteracted {
3945
3946 enum Type {
3947 UNKNOWN = 0;
3948 CHIP_VIEWED = 1;
3949 CHIP_CLICKED = 2;
3950 DIALOG_PRIVACY_SETTINGS = 3;
3951 DIALOG_DISMISS = 4;
3952 DIALOG_LINE_ITEM = 5;
3953 }
3954
tsaichristine5adc7e02020-01-14 17:07:39 -08003955 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003956
3957 // Used if the type is LINE_ITEM
3958 optional string package_name = 2;
3959}
3960
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003961/**
3962 * Logs information about a package that is moved from the internal to external storage and vice
3963 * versa.
3964 * It logs the package name, the type of the external storage where the package is installed
3965 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3966 * and the move type: if it's from internal to external or the other way around.
3967 *
3968 * Logged from:
3969 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3970 */
3971message AppMovedStorageReported {
3972 enum MoveType {
3973 UNKNOWN = 0;
3974 TO_EXTERNAL = 1;
3975 TO_INTERNAL = 2;
3976 }
3977 // The type of the external storage.
3978 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3979 // The type of move.
3980 optional MoveType move_type = 2;
3981 // The name of the package that was moved.
3982 optional string package_name = 3;
3983}
3984
jianjin8f2dee02019-03-29 14:03:08 -07003985/**
3986 * Logs when system server watchdog occurs.
3987 * Logged from:
3988 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3989 */
3990message SystemServerWatchdogOccurred {
3991 optional string subject = 1;
3992}
3993
3994/**
3995 * Logs when new file added to tombstones.
3996 * Logged from:
3997 * frameworks/base/core/java/com/android/server/BootReceiver.java
3998 */
3999message TombStoneOccurred {
4000}
4001
Hai Zhang5d3328d2019-04-13 21:25:06 +08004002/*
4003 * Information about a role request
4004 *
4005 * Logged from:
4006 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4007 */
4008message RoleRequestResultReported {
4009 // UID of application requesting the role
4010 optional int32 requesting_uid = 1;
4011
4012 // Package name of application requesting the role
4013 optional string requesting_package_name = 2;
4014
4015 // The role to be granted
4016 optional string role_name = 3;
4017
4018 // The count of applications qualifying for the role
4019 optional int32 qualifying_count = 4;
4020
4021 // UID of application current granted the role
4022 optional int32 current_uid = 5;
4023
4024 // Package name of application current granted the role
4025 optional string current_package_name = 6;
4026
4027 // UID of another application that user chose to grant the role to, instead of the requesting
4028 // application
4029 optional int32 granted_another_uid = 7;
4030
4031 // Package name of another application that user chose to grant the role to, instead of the
4032 // requesting application
4033 optional string granted_another_package_name = 8;
4034
4035 enum Result {
4036 UNDEFINED = 0;
4037 // role request was ignored
4038 IGNORED = 1;
4039 // role request was ignored because it's already granted
4040 IGNORED_ALREADY_GRANTED = 2;
4041 // role request was ignored because the application isn't qualified
4042 IGNORED_NOT_QUALIFIED = 3;
4043 // role request was ignored because user said it should be always denied
4044 IGNORED_USER_ALWAYS_DENIED = 4;
4045 // role was granted by user action
4046 USER_GRANTED = 5;
4047 // role was denied by user action
4048 USER_DENIED = 6;
4049 // role was denied by user granting another application the role
4050 USER_DENIED_GRANTED_ANOTHER = 7;
4051 // role was denied and set to be always denied by the user
4052 USER_DENIED_WITH_ALWAYS = 8;
4053 }
4054 // The result of the role request
4055 optional Result result = 9;
4056}
4057
Mark Tabrya824a642019-11-05 12:26:12 -08004058/**
4059 * Logs when a Vehicle Maps Service client's connection state has changed
4060 *
4061 * Logged from:
4062 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4063 */
4064message VmsClientConnectionStateChanged {
4065 // The UID of the VMS client app
4066 optional int32 uid = 1 [(is_uid) = true];
4067
4068 enum State {
4069 UNKNOWN = 0;
4070 // Attempting to connect to the client
4071 CONNECTING = 1;
4072 // Client connection established
4073 CONNECTED = 2;
4074 // Client connection closed unexpectedly
4075 DISCONNECTED = 3;
4076 // Client connection closed by VMS
4077 TERMINATED = 4;
4078 // Error establishing the client connection
4079 CONNECTION_ERROR = 5;
4080 }
4081
4082 optional State state = 2;
4083}
4084
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004085/**
4086 * Logs when MediaProvider has successfully finished scanning a storage volume.
4087 *
4088 * Logged from:
4089 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4090 */
4091message MediaProviderScanEvent {
4092 enum Reason {
4093 // Scan triggered due to unknown reason
4094 UNKNOWN = 0;
4095 // Scan triggered due to storage volume being mounted
4096 MOUNTED = 1;
4097 // Scan triggered due to explicit user action or app request
4098 DEMAND = 2;
4099 // Scan triggered due to idle maintenance
4100 IDLE = 3;
4101 }
4102
4103 // Volume type that this event pertains to
4104 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4105 // Reason why this scan was triggered
4106 optional Reason reason = 2;
4107 // Total number of files scanned
4108 optional int64 item_count = 3;
4109 // Duration of scan, normalized per file
4110 optional float normalized_duration_millis = 4;
4111 // Number of database inserts, normalized per file
4112 optional float normalized_insert_count = 5;
4113 // Number of database updates, normalized per file
4114 optional float normalized_update_count = 6;
4115 // Number of database deletes, normalized per file
4116 optional float normalized_delete_count = 7;
4117}
4118
4119/**
4120 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4121 *
4122 * Logged from:
4123 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4124 */
4125message MediaProviderDeletionEvent {
4126 // Volume type that this event pertains to
4127 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4128 // Device timestamp when this deletion event occurred
4129 optional int64 timestamp_millis = 2;
4130 // App that requested deletion
4131 optional string package_name = 3;
4132 // Number of items that were deleted
4133 optional int32 item_count = 4;
4134}
4135
4136/**
4137 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4138 *
4139 * Logged from:
4140 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4141 */
4142message MediaProviderPermissionEvent {
4143 enum Result {
4144 UNKNOWN = 0;
4145 USER_GRANTED = 1;
4146 AUTO_GRANTED = 2;
4147 USER_DENIED = 3;
4148 USER_DENIED_WITH_PREJUDICE = 4;
4149 AUTO_DENIED = 5;
4150 }
4151
4152 // Volume type that this event pertains to
4153 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4154 // Device timestamp when this permission event occurred
4155 optional int64 timestamp_millis = 2;
4156 // App that requested permission
4157 optional string package_name = 3;
4158 // Number of items that were requested
4159 optional int32 item_count = 4;
4160 // Result of this request
4161 optional Result result = 5;
4162}
4163
4164/**
4165 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4166 *
4167 * Logged from:
4168 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4169 */
4170message MediaProviderSchemaChange {
4171 // Volume type that this event pertains to
4172 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4173 // Old database version code
4174 optional int32 version_from = 2;
4175 // New database version code
4176 optional int32 version_to = 3;
4177 // Total number of files in database
4178 optional int64 item_count = 4;
4179 // Duration of schema change, normalized per file
4180 optional float normalized_duration_millis = 5;
4181}
4182
4183/**
4184 * Logs when MediaProvider has finished an idle maintenance job.
4185 *
4186 * Logged from:
4187 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4188 */
4189message MediaProviderIdleMaintenance {
4190 // Volume type that this event pertains to
4191 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4192
4193 // Total number of files in database
4194 optional int64 item_count = 2;
4195 // Duration of idle maintenance, normalized per file
4196 optional float normalized_duration_millis = 3;
4197 // Number of thumbnails found to be stale, normalized per file
4198 optional float normalized_stale_thumbnails = 4;
4199 // Number of items found to be expired, normalized per file
4200 optional float normalized_expired_media = 5;
4201}
4202
Keun young Park3e033cb2019-12-18 11:27:35 -08004203/**
4204 * Represents boot time event with duration in ms.
4205 *
4206 * Logged from: bootstat and various system server components. Check each enums for details.
4207 */
4208message BootTimeEventDuration {
4209 enum DurationEvent {
4210 UNKNOWN = 0;
4211 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4212 ABSOLUTE_BOOT_TIME = 1;
4213 // Bootloader's 1st stage execution time.
4214 // Logged from bootstat.
4215 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4216 // Bootloader's 1st stage loading time.
4217 // Logged from bootstat.
4218 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4219 // Bootloader's kernel loading time.
4220 // Logged from bootstat.
4221 BOOTLOADER_KERNEL_LOAD = 4;
4222 // Bootloader's 2nd stage execution time.
4223 // Logged from bootstat.
4224 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4225 // Bootloader's 2nd stage loading time.
4226 // Logged from bootstat.
4227 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4228 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4229 // for locked device.
4230 // Logged from bootstat.
4231 BOOTLOADER_UI_WAIT = 7;
4232 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4233 // Logged from bootstat.
4234 BOOTLOADER_TOTAL = 8;
4235 // Shutdown duration inside init for the reboot before the current boot up.
4236 // Logged from f/b/services/.../BootReceiver.java.
4237 SHUTDOWN_DURATION = 9;
4238 // Total time for mounting of disk devices during bootup.
4239 // Logged from f/b/services/.../BootReceiver.java.
4240 MOUNT_DEFAULT_DURATION = 10;
4241 // Total time for early stage mounting of disk devices during bootup.
4242 // Logged from f/b/services/.../BootReceiver.java.
4243 MOUNT_EARLY_DURATION = 11;
4244 // Total time for late stage mounting of disk devices during bootup.
4245 // Logged from f/b/services/.../BootReceiver.java.
4246 MOUNT_LATE_DURATION = 12;
4247 // Average time to scan non-system app after OTA
4248 // Logged from f/b/services/.../PackageManagerService.java
4249 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4250 // Time to initialize Package manager after OTA
4251 // Logged from f/b/services/.../PackageManagerService.java
4252 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4253 // Time to scan all system app from Package manager after OTA
4254 // Logged from f/b/services/.../PackageManagerService.java
4255 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4256 // Init's total time for cold boot stage.
4257 // Logged from bootstat.
4258 COLDBOOT_WAIT = 16;
4259 // Init's total time for initializing selinux.
4260 // Logged from bootstat.
4261 SELINUX_INIT = 17;
4262 // Time since last factory reset.
4263 // Logged from bootstat.
4264 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004265 // Init's total time spent for completing the 1st stage.
4266 // Logged from bootstat.
4267 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004268 }
4269
4270 // Type of the event.
4271 optional DurationEvent event = 1;
4272 // Duration of the event in ms.
4273 optional int64 duration_millis = 2;
4274}
4275
4276/**
4277 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4278 * since boot-up.
4279 *
4280 * Logged from: bootstat and various system server components. Check each enums for details.
4281 */
4282message BootTimeEventElapsedTime {
4283 enum ElapsedTimeEvent {
4284 UNKNOWN = 0;
4285 // Time when init starts 1st stage. Logged from bootstat.
4286 ANDROID_INIT_STAGE_1 = 1;
4287 // Time when sys.boot_completed prop is set.
4288 // Logged from bootstat.
4289 BOOT_COMPLETE = 2;
4290 // BOOT_COMPLETE for encrypted device.
4291 BOOT_COMPLETE_ENCRYPTION = 3;
4292 // BOOT_COMPLETE for device with no encryption.
4293 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4294 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004295 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004296 // BOOT_COMPLETE after factory reset.
4297 FACTORY_RESET_BOOT_COMPLETE = 6;
4298 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4299 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004300 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4301 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004302 // BOOT_COMPLETE after OTA.
4303 OTA_BOOT_COMPLETE = 9;
4304 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4305 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004306 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4307 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004308 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4309 // Logged from f/b/services/.../UserController.java
4310 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4311 // Time when the system starts sending BOOT_COMPLETED broadcast.
4312 // Logged from f/b/services/.../UserController.java
4313 FRAMEWORK_BOOT_COMPLETED = 13;
4314 // Time when the package manager starts init.
4315 // Logged from f/b/services/.../SystemServer.java
4316 PACKAGE_MANAGER_INIT_START = 14;
4317 // Time when package manager is ready
4318 // Logged from f/b/services/.../SystemServer.java
4319 PACKAGE_MANAGER_INIT_READY = 15;
4320 // Represents the time when user has entered unlock credential for system with user pin.
4321 // Logged from bootstat.
4322 POST_DECRYPT = 16;
4323 // Represents the start of zygote's init.
4324 // Logged from zygote itself.
4325 ZYGOTE_INIT_START = 17;
4326 // Represents the start of secondary zygote's init.
4327 // TODO: add logging to zygote
4328 SECONDARY_ZYGOTE_INIT_START = 18;
4329 // Represents the start of system server's init.
4330 // Logged from f/b/services/.../SystemServer.java
4331 SYSTEM_SERVER_INIT_START = 19;
4332 // Represents the completion of system server's init.
4333 // Logged from f/b/services/.../SystemServer.java
4334 SYSTEM_SERVER_READY = 20;
4335 // Represents the start of launcher during boot-up.
4336 // TODO: add logging
4337 LAUNCHER_START = 21;
4338 // Represents the completion of launcher's initial rendering. User can use other apps from
4339 // launcher from this point.
4340 // TODO: add logging
4341 LAUNCHER_SHOWN = 22;
4342 }
4343
4344 // Type of the event.
4345 optional ElapsedTimeEvent event = 1;
4346 // Time since bootup for the event.
4347 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4348 optional int64 time_millis = 2;
4349}
4350
4351/**
4352 * Boot time events with UTC time.
4353 *
4354 * Logged from: bootstat and various system server components. Check each enums for details.
4355 */
4356message BootTimeEventUtcTime {
4357 enum UtcTimeEvent {
4358 UNKNOWN = 0;
4359 // Time of the bootstat's marking of 1st boot after the last factory reset.
4360 // Logged from bootstat.
4361 FACTORY_RESET_RESET_TIME = 1;
4362 // The time when bootstat records FACTORY_RESET_* events. This is close to
4363 // BOOT_COMPLETE time for the current bootup.
4364 // Logged from bootstat.
4365 FACTORY_RESET_CURRENT_TIME = 2;
4366 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4367 // Logged from bootstat.
4368 FACTORY_RESET_RECORD_VALUE = 3;
4369 }
4370
4371 // Type of the event.
4372 optional UtcTimeEvent event = 1;
4373 // UTC time for the event.
4374 optional int64 utc_time_secs = 2;
4375}
4376
4377/**
4378 * Boot time events representing specific error code during bootup.
4379 * Meaning of error code can be different per each event type.
4380 *
4381 * Logged from: bootstat and various system server components. Check each enums for details.
4382 */
4383message BootTimeEventErrorCode {
4384 enum ErrorCodeEvent {
4385 UNKNOWN = 0;
4386 // Linux error code for time() call to get the current UTC time.
4387 // Logged from bootstat.
4388 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4389 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4390 // as UMOUNT_STAT_* from init/reboot.cpp.
4391 // Logged from f/b/services/.../BootReceiver.java.
4392 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004393 // Reprepsents fie system mounting error code of /data partition for the current boot.
4394 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004395 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004396 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004397 }
4398
4399 // Type of the event.
4400 optional ErrorCodeEvent event = 1;
4401 // error code defined per each event type.
4402 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4403 // FS_MGR_FS_STAT.
4404 optional int32 error_code = 2;
4405}
4406
Chenjie Yubbcbc602018-02-05 16:51:52 -08004407//////////////////////////////////////////////////////////////////////
4408// Pulled atoms below this line //
4409//////////////////////////////////////////////////////////////////////
4410
4411/**
David Chenc8a43242017-10-17 16:23:28 -07004412 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4413 *
4414 * Pulled from:
4415 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4416 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004417message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004418 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004419
4420 optional int64 rx_bytes = 2;
4421
4422 optional int64 rx_packets = 3;
4423
4424 optional int64 tx_bytes = 4;
4425
4426 optional int64 tx_packets = 5;
4427}
4428
4429/**
4430 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4431 *
4432 * Pulled from:
4433 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4434 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004435message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004436 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004437
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004438 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4439 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004440
4441 optional int64 rx_bytes = 3;
4442
4443 optional int64 rx_packets = 4;
4444
4445 optional int64 tx_bytes = 5;
4446
4447 optional int64 tx_packets = 6;
4448}
4449
4450/**
4451 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4452 *
4453 * Pulled from:
4454 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4455 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004456message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004457 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004458
4459 optional int64 rx_bytes = 2;
4460
4461 optional int64 rx_packets = 3;
4462
4463 optional int64 tx_bytes = 4;
4464
4465 optional int64 tx_packets = 5;
4466}
4467
4468/**
4469 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4470 *
4471 * Pulled from:
4472 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4473 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004474message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004475 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004476
Yao Chenc40a19d2018-03-15 16:48:25 -07004477 // 1 denotes foreground and 0 denotes background. This is called Set in
4478 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004479 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004480
4481 optional int64 rx_bytes = 3;
4482
4483 optional int64 rx_packets = 4;
4484
4485 optional int64 tx_bytes = 5;
4486
4487 optional int64 tx_packets = 6;
4488}
4489
4490/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004491 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4492 *
4493 * Pulled from:
4494 * StatsCompanionService
4495 */
4496message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004497 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004498
4499 optional int64 rx_bytes = 2;
4500
4501 optional int64 tx_bytes = 3;
4502}
4503
4504/**
David Chenc8a43242017-10-17 16:23:28 -07004505 * Pulls the kernel wakelock durations. This atom is adapted from
4506 * android/internal/os/KernelWakelockStats.java
4507 *
4508 * Pulled from:
4509 * StatsCompanionService using KernelWakelockReader.
4510 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004511message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004512 optional string name = 1;
4513
4514 optional int32 count = 2;
4515
4516 optional int32 version = 3;
4517
Yangster-maca8a30442018-10-13 23:46:34 -07004518 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004519}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004520
Chenjie Yu05013b32017-11-21 10:21:41 -08004521/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004522 * Pulls low power state information. If power.stats HAL is not available, this
4523 * includes platform and subsystem sleep state information,
4524 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4525 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004526 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004527 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004528 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4529 * as defined in:
4530 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004531 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004532message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004533 // Subsystem name
4534 optional string subsystem_name = 1;
4535 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4536 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004537 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4538 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004539 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004540 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004541 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004542 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004543 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004544}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004545
Chenjie Yu05013b32017-11-21 10:21:41 -08004546/**
Bookatz92da2832018-11-01 18:10:03 -07004547 * Pulls on-device power measurement information.
4548 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4549 * Pulled from:
4550 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4551 */
4552message OnDevicePowerMeasurement {
4553 // Name of the subsystem (to which the rail belongs).
4554 optional string subsystem_name = 1;
4555
4556 // Rail name. The rail lies within the subsystem.
4557 optional string rail_name = 2;
4558
4559 // Time (in ms since boot) at which the rail energy value was measured.
4560 // This may differ slightly from the time that statsd logs this information.
4561 optional uint64 measurement_timestamp_millis = 3;
4562
4563 // Accumulated energy used via the rail since device boot in uWs.
4564 optional uint64 energy_microwatt_secs = 4;
4565}
4566
4567/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004568 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004569 * Pulls the time the cpu spend on the frequency index. Frequency index
4570 * starts from highest to lowest. The value should be monotonically
4571 * increasing since boot. However, if there is a cpu
4572 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004573 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004574message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004575 optional uint32 cluster = 1;
4576 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004577 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004578}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004579
Chenjie Yu05013b32017-11-21 10:21:41 -08004580/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004581 * Pulls Cpu Time Per Uid.
4582 * Note that isolated process uid time should be attributed to host uids.
4583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004584message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004585 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004586 optional uint64 user_time_micros = 2;
4587 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004588}
4589
4590/**
4591 * Pulls Cpu Time Per Uid per frequency.
4592 * Note that isolated process uid time should be attributed to host uids.
4593 * For each uid, we order the time by descending frequencies.
4594 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004595message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004596 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004597 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004598 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004599}
Hugo Benichi884970e2017-11-14 22:42:46 +09004600
Chenjie Yu05013b32017-11-21 10:21:41 -08004601/**
4602 * Pulls Wifi Controller Activity Energy Info
4603 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004604message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004605 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004606 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004607 // stack reported state
4608 // TODO: replace this with proto enum
4609 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004610 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004611 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004612 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004613 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004614 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004615 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004616 // product of current(mA), voltage(V) and time(ms)
4617 optional uint64 controller_energy_used = 6;
4618}
4619
4620/**
4621 * Pulls Modem Activity Energy Info
4622 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004623message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004624 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004625 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004626 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004627 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004628 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004629 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004630 /**
4631 * Tx power index
4632 * index 0 = tx_power < 0dBm
4633 * index 1 = 0dBm < tx_power < 5dBm
4634 * index 2 = 5dBm < tx_power < 15dBm
4635 * index 3 = 15dBm < tx_power < 20dBm
4636 * index 4 = tx_power > 20dBm
4637 */
4638 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004639 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004640 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004641 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004642 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004643 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004644 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004645 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004646 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004647 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004648 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004649 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004650 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004651 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004652}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004653
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004654/**
4655 * Pulls Bluetooth Activity Energy Info
4656 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4657 */
4658message BluetoothActivityInfo {
4659 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004660 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004661 // bluetooth stack state
4662 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004663 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004664 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004665 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004666 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004667 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004668 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004669 // product of current(mA), voltage(V) and time(ms)
4670 optional uint64 energy_used = 6;
4671}
4672
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004673/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004674 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004675 *
4676 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004677 */
4678message ProcessMemoryState {
4679 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004680 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004681
4682 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004683 // Usually package name, "system" for system server.
4684 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004685 optional string process_name = 2;
4686
Rafal Slawikda51b932018-12-13 16:31:33 +00004687 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004688 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004689
4690 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004691 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004692
4693 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004694 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004695
Rajeev Kumar90235992018-01-29 11:06:48 -08004696 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004697 // Value is read from memory.stat, field total_rss if per-app memory
4698 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004699 optional int64 rss_in_bytes = 6;
4700
4701 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004702 // Value is read from memory.stat, field total_cache if per-app memory
4703 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004704 optional int64 cache_in_bytes = 7;
4705
4706 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004707 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004708 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004709 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004710
Rafal Slawik203c3db2019-09-25 19:53:01 +01004711 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004712 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004713
Rafal Slawik203c3db2019-09-25 19:53:01 +01004714 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4715 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004716
Rafal Slawik203c3db2019-09-25 19:53:01 +01004717 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4718 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004719}
4720
4721/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004722 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004723 *
4724 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4725 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004726 *
4727 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004728 */
4729message ProcessMemoryHighWaterMark {
4730 // The uid if available. -1 means not available.
4731 optional int32 uid = 1 [(is_uid) = true];
4732
Rafal Slawikda51b932018-12-13 16:31:33 +00004733 // The process name.
4734 // Usually package name or process cmdline.
4735 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004736 optional string process_name = 2;
4737
Rafal Slawik239b6802019-09-09 18:46:01 +01004738 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4739 // computed by converting kilobytes to bytes.
4740 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4741
Rafal Slawik3bea8952018-11-15 12:39:33 +00004742 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4743 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004744 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004745}
4746
4747/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004748 * Logs the memory stats for a process.
4749 *
4750 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4751 * and for selected native processes.
4752 */
4753message ProcessMemorySnapshot {
4754 // The uid if available. -1 means not available.
4755 optional int32 uid = 1 [(is_uid) = true];
4756
4757 // The process name.
4758 // Usually package name or process cmdline.
4759 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4760 optional string process_name = 2;
4761
4762 // The pid of the process.
4763 // Allows to disambiguate instances of the process.
4764 optional int32 pid = 3;
4765
4766 // The current OOM score adjustment value.
4767 // Read from ProcessRecord for managed processes.
4768 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4769 optional int32 oom_score_adj = 4;
4770
4771 // The current RSS of the process.
4772 // VmRSS from /proc/pid/status.
4773 optional int32 rss_in_kilobytes = 5;
4774
4775 // The current anon RSS of the process.
4776 // RssAnon from /proc/pid/status.
4777 optional int32 anon_rss_in_kilobytes = 6;
4778
4779 // The current swap size of the process.
4780 // VmSwap from /proc/pid/status.
4781 optional int32 swap_in_kilobytes = 7;
4782
4783 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4784 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4785}
4786
4787/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004788 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004789 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004790message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004791 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004792}
4793
4794/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004795 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004796 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004797message SystemUptime {
4798 // Milliseconds since the system was booted.
4799 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4800 // for external input).
4801 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004802 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004803}
4804
4805/*
4806 * Reads from /proc/uid_concurrent_active_time which has the format:
4807 * active: X (X is # cores)
4808 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4809 * [uid1]: [time-0] [time-1] [time-2] ... ...
4810 * ...
4811 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4812 * The file contains a monotonically increasing count of time for a single boot.
4813 */
4814message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004815 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004816 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004817}
4818
4819/**
4820 * Reads from /proc/uid_concurrent_policy_time which has the format:
4821 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4822 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4823 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4824 * ...
4825 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4826 * The file contains a monotonically increasing count of time for a single boot.
4827 */
4828message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004829 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004830 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004831 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004832}
4833
4834/*
4835 * Pulls free disk space, for data, system partition and temporary directory.
4836 */
4837message DiskSpace {
4838 // available bytes in data partition
4839 optional uint64 data_available_bytes = 1;
4840 // available bytes in system partition
4841 optional uint64 system_available_bytes = 2;
4842 // available bytes in download cache or temp directories
4843 optional uint64 temp_available_bytes = 3;
4844}
Tej Singhbf972d92018-01-10 20:51:13 -08004845
4846/**
4847 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004848 *
4849 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004850 */
4851message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004852 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004853}
4854
4855/**
4856 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004857 * Pulled from:
4858 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004859 */
4860message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004861 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004862}
4863
4864/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004865 * Pulls battery voltage.
4866 * Pulled from:
4867 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4868 */
4869message BatteryVoltage {
4870 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004871 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004872}
4873
4874/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004875 * Pulls battery level (percent full, from 0 to 100).
4876 *
4877 * Pulled from:
4878 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4879 */
4880message BatteryLevel {
4881 // Battery level. Should be in [0, 100].
4882 optional int32 battery_level = 1;
4883}
4884
4885/**
Tej Singhd89137e2018-03-26 14:51:40 -07004886 * Pulls the temperature of various parts of the device.
4887 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004888 *
Maggie White442b6312019-04-05 16:26:44 -07004889 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004890 */
4891message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004892 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004893 optional android.os.TemperatureTypeEnum sensor_location = 1;
4894
4895 // The name of the temperature source. Eg. CPU0
4896 optional string sensor_name = 2;
4897
Tej Singhd89137e2018-03-26 14:51:40 -07004898 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004899 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004900 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004901
4902 // Relative severity of the throttling, see enum definition.
4903 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004904}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004905
4906/**
4907 * Pulls the statistics of calls to Binder.
4908 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004909 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4910 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004911 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004912 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004913 */
4914message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004915 // UID of the process responsible for the binder transaction. It will be set if the process
4916 // executing the binder transaction attribute the transaction to another uid using
4917 // Binder.setThreadWorkSource().
4918 //
4919 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004920 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004921 // UID of the process executing the binder transaction.
4922 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004923 // Fully qualified class name of the API call.
4924 //
4925 // This is a system server class name.
4926 //
4927 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4928 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4929 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4930 // commonly used APIs.
4931 optional string service_class_name = 2;
4932 // Method name of the API call. It can also be a transaction code if we cannot
4933 // resolve it to a name. See Binder#getTransactionName.
4934 //
4935 // This is a system server method name.
4936 optional string service_method_name = 3;
4937 // Total number of API calls.
4938 optional int64 call_count = 4;
4939 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4940 optional bool screen_interactive = 13;
4941 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4942 // call_count will be equal to recorded_call_count.
4943 //
4944 // If recorded_call_count is different than call_count, it means data collection has been
4945 // sampled. All the fields below will be sampled in this case.
4946 optional int64 recorded_call_count = 12;
4947 // Number of exceptions thrown by the API.
4948 optional int64 recorded_exception_count = 5;
4949 // Total latency of all API calls.
4950 // Average can be computed using total_latency_micros / recorded_call_count.
4951 optional int64 recorded_total_latency_micros = 6;
4952 // Maximum latency of one API call.
4953 optional int64 recorded_max_latency_micros = 7;
4954 // Total CPU usage of all API calls.
4955 // Average can be computed using total_cpu_micros / recorded_call_count.
4956 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4957 optional int64 recorded_total_cpu_micros = 8;
4958 // Maximum CPU usage of one API call.
4959 optional int64 recorded_max_cpu_micros = 9;
4960 // Maximum parcel reply size of one API call.
4961 optional int64 recorded_max_reply_size_bytes = 10;
4962 // Maximum parcel request size of one API call.
4963 optional int64 recorded_max_request_size_bytes = 11;
4964}
4965
4966/**
4967 * Pulls the statistics of exceptions during calls to Binder.
4968 *
4969 * Binder stats are cumulative from boot unless somebody reset the data using
4970 * > adb shell dumpsys binder_calls_stats --reset
4971 */
4972message BinderCallsExceptions {
4973 // Exception class name, e.g. java.lang.IllegalArgumentException.
4974 //
4975 // This is an exception class name thrown by the system server.
4976 optional string exception_class_name = 1;
4977 // Total number of exceptions.
4978 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004979}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004980
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004981/**
4982 * Pulls the statistics of message dispatching on HandlerThreads.
4983 *
4984 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4985 * config on the device.
4986 *
4987 * Next tag: 11
4988 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004989message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004990 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004991 optional int32 uid = 1 [(is_uid) = true];
4992
4993 // Fully qualified class name of the handler target class.
4994 //
4995 // This field does not contain PII. This is a system server class name.
4996 optional string handler_class_name = 2;
4997
4998 // The name of the thread that runs the Looper.
4999 //
5000 // This field does not contain PII. This is a system server thread name.
5001 optional string looper_thread_name = 3;
5002
5003 // The name of the dispatched message.
5004 //
5005 // This field does not contain PII. This is a system server constant or class
5006 // name.
5007 optional string message_name = 4;
5008
5009 // Total number of successfully dispatched messages.
5010 optional int64 message_count = 5;
5011
5012 // Total number of messages that failed dispatching.
5013 optional int64 exception_count = 6;
5014
5015 // Total number of processed messages we have data recorded for. If we
5016 // collected data for all the messages, message_count will be equal to
5017 // recorded_message_count.
5018 //
5019 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005020 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005021 optional int64 recorded_message_count = 7;
5022
5023 // Total latency of all processed messages.
5024 // Average can be computed using recorded_total_latency_micros /
5025 // recorded_message_count.
5026 optional int64 recorded_total_latency_micros = 8;
5027
5028 // Total CPU usage of all processed message.
5029 // Average can be computed using recorded_total_cpu_micros /
5030 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005031 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005032 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005033
5034 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5035 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005036
5037 // Max recorded CPU usage of all processed messages.
5038 optional int64 recorded_max_cpu_micros = 11;
5039
5040 // Max recorded latency of all processed messages.
5041 optional int64 recorded_max_latency_micros = 12;
5042
5043 // Total number of messages we tracked the dispatching delay for. If we
5044 // collected data for all the messages, message_count will be equal to
5045 // recorded_delay_message_count.
5046 //
5047 // If recorded_delay_message_count is different than message_count, it means data
5048 // collection has been sampled or/and not all messages specified the target dispatch time.
5049 // The fields below will be sampled in this case.
5050 optional int64 recorded_delay_message_count = 13;
5051
5052 // Total dispatching delay of all processed messages.
5053 // Calculated as a difference between the target dispatching time (Message.when)
5054 // and the actual dispatching time.
5055 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5056 optional int64 recorded_total_delay_millis = 14;
5057
5058 // Max dispatching delay of all processed messages.
5059 // Calculated as a difference between the target dispatching time (Message.when)
5060 // and the actual dispatching time.
5061 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005062}
Tej Singh86dc9db2018-09-06 00:39:57 +00005063
5064/**
5065 * Pulls disk information, such as write speed and latency.
5066 */
5067message DiskStats {
5068 // Time taken to open, write 512B to, and close a file.
5069 // -1 if error performing the check.
5070 optional int64 data_write_latency_millis = 1;
5071
5072 optional bool file_based_encryption = 2;
5073
5074 // Recent disk write speed in kB/s.
5075 // -1 if error querying storageed.
5076 // 0 if data is unavailable.
5077 optional int32 recent_disk_write_speed = 3;
5078}
5079
5080
5081/**
5082 * Free and total bytes of the Data, Cache, and System partition.
5083 */
5084message DirectoryUsage {
5085 enum Directory {
5086 UNKNOWN = 0;
5087 DATA = 1;
5088 CACHE = 2;
5089 SYSTEM = 3;
5090 }
5091 optional Directory directory = 1;
5092 optional int64 free_bytes = 2;
5093 optional int64 total_bytes = 3;
5094}
5095
5096
5097/**
5098 * Size of an application: apk size, data size, and cache size.
5099 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5100 * Information is only reported for apps with the primary user (user 0).
5101 * Sizes are aggregated by package name.
5102 */
5103message AppSize {
5104 // Including uids will involve modifying diskstats logic.
5105 optional string package_name = 1;
5106 // App size in bytes. -1 if unavailable.
5107 optional int64 app_size_bytes = 2;
5108 // App data size in bytes. -1 if unavailable.
5109 optional int64 app_data_size_bytes = 3;
5110 // App cache size in bytes. -1 if unavailable.
5111 optional int64 app_cache_size_bytes = 4;
5112 // Time that the cache file was produced.
5113 // Uses System.currentTimeMillis(), which is wall clock time.
5114 optional int64 cache_time_millis = 5;
5115}
5116
5117
5118/**
5119 * Size of a particular category. Eg: photos, videos.
5120 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5121 */
5122message CategorySize {
5123 enum Category {
5124 UNKNOWN = 0;
5125 APP_SIZE = 1;
5126 APP_DATA_SIZE = 2;
5127 APP_CACHE_SIZE = 3;
5128 PHOTOS = 4;
5129 VIDEOS = 5;
5130 AUDIO = 6;
5131 DOWNLOADS = 7;
5132 SYSTEM = 8;
5133 OTHER = 9;
5134 }
5135 optional Category category = 1;
5136 // Category size in bytes.
5137 optional int64 size_bytes = 2;
5138 // Time that the cache file was produced.
5139 // Uses System.currentTimeMillis(), which is wall clock time.
5140 optional int64 cache_time_millis = 3;
5141}
Tej Singhd6d6d772018-09-05 17:41:25 -07005142
5143/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005144 * Pulls per uid I/O stats. The stats are cumulative since boot.
5145 *
5146 * Read/write bytes are I/O events from a storage device
5147 * Read/write chars are data requested by read/write syscalls, and can be
5148 * satisfied by caching.
5149 *
5150 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5151 */
5152message DiskIo {
5153 optional int32 uid = 1 [(is_uid) = true];
5154 optional int64 fg_chars_read = 2;
5155 optional int64 fg_chars_write = 3;
5156 optional int64 fg_bytes_read = 4;
5157 optional int64 fg_bytes_write = 5;
5158 optional int64 bg_chars_read = 6;
5159 optional int64 bg_chars_write = 7;
5160 optional int64 bg_bytes_read = 8;
5161 optional int64 bg_bytes_write = 9;
5162 optional int64 fg_fsync = 10;
5163 optional int64 bg_fsync= 11;
5164}
5165
5166
5167/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005168 * Pulls the number of fingerprints for each user.
5169 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005170 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005171 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005172message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005173 // The associated user. Eg: 0 for owners, 10+ for others.
5174 // Defined in android/os/UserHandle.java
5175 optional int32 user = 1;
5176 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005177 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005178}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005179
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005180/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005181 * Pulls the number of faces for each user.
5182 *
5183 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5184 */
5185message NumFacesEnrolled {
5186 // The associated user. Eg: 0 for owners, 10+ for others.
5187 // Defined in android/os/UserHandle.java
5188 optional int32 user = 1;
5189 // Number of faces registered to that user.
5190 optional int32 num_faces_enrolled = 2;
5191}
5192/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005193 * A mapping of role holder -> role
5194 */
5195message RoleHolder {
5196 // uid of the role holder
5197 optional int32 uid = 1 [(is_uid) = true];
5198
5199 // package name of the role holder
5200 optional string package_name = 2;
5201
5202 // the role held
5203 optional string role = 3;
5204}
5205
Yangsteraf9aee72018-10-12 09:26:16 -07005206message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005207 // These are all in byte resolution.
5208 optional int64 min = 1 [deprecated = true];
5209 optional int64 average = 2 [deprecated = true];
5210 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005211
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005212 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5213 // int64 fields.
5214 optional int32 mean_kb = 4;
5215 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005216}
5217
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005218// A reduced subset of process states; reducing the number of possible states allows more
5219// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5220enum ProcessStateAggregated {
5221 PROCESS_STATE_UNKNOWN = 0;
5222 // Persistent system process.
5223 PROCESS_STATE_PERSISTENT = 1;
5224 // Top activity; actually any visible activity.
5225 PROCESS_STATE_TOP = 2;
5226 // Process binding to top or a foreground service.
5227 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5228 // Processing running a foreground service.
5229 PROCESS_STATE_FGS = 4;
5230 // Important foreground process (ime, wallpaper, etc).
5231 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5232 // Important background process.
5233 PROCESS_STATE_BACKGROUND = 6;
5234 // Process running a receiver.
5235 PROCESS_STATE_RECEIVER = 7;
5236 // All kinds of cached processes.
5237 PROCESS_STATE_CACHED = 8;
5238}
5239
5240// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005241message ProcessStatsStateProto {
5242 optional android.service.procstats.ScreenState screen_state = 1;
5243
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005244 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005245
5246 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5247 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005248 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5249
5250 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005251
5252 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005253 optional int64 duration_millis = 4 [deprecated = true];
5254 // Same as above, but with minute resolution so it fits into an int32.
5255 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005256
5257 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005258 optional int64 realtime_duration_millis = 9 [deprecated = true];
5259 // Same as above, but with minute resolution so it fits into an int32.
5260 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005261
5262 // # of samples taken
5263 optional int32 sample_size = 5;
5264
5265 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005266 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005267
5268 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005269 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005270
5271 // RSS is memory resident for this process
5272 optional AggStats rss = 8;
5273}
5274
5275// Next Tag: 7
5276message ProcessStatsProto {
5277 // Name of process.
5278 optional string process = 1;
5279
5280 // Uid of the process.
5281 optional int32 uid = 2;
5282
5283 // Information about how often kills occurred
5284 message Kill {
5285 // Count of excessive CPU kills
5286 optional int32 cpu = 1;
5287
5288 // Count of kills when cached
5289 optional int32 cached = 2;
5290
5291 // PSS stats during cached kill
5292 optional AggStats cached_pss = 3;
5293 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005294 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005295
5296 // Time and memory spent in various states.
5297 repeated ProcessStatsStateProto states = 5;
5298
5299 // Total time process has been running... screen_state, memory_state, and process_state
5300 // will not be set.
5301 optional ProcessStatsStateProto total_running_state = 6;
5302}
5303
5304message PackageServiceOperationStatsProto {
5305 // Operate enum: Started, Foreground, Bound, Executing
5306 optional android.service.procstats.ServiceOperationState operation = 1;
5307
5308 // Number of times the service was in this operation.
5309 optional int32 count = 2;
5310
5311 // Information about a state the service can be in.
5312 message StateStats {
5313 // Screen state enum.
5314 optional android.service.procstats.ScreenState screen_state = 1;
5315 // Memory state enum.
5316 optional android.service.procstats.MemoryState memory_state = 2;
5317
5318 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005319 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005320 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005321 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005322 }
5323 repeated StateStats state_stats = 3;
5324}
5325
5326message PackageServiceStatsProto {
5327 // Name of service component.
5328 optional string service_name = 1;
5329
5330 // The operation stats.
5331 // The package_name, package_uid, package_version, service_name will not be set to save space.
5332 repeated PackageServiceOperationStatsProto operation_stats = 2;
5333}
5334
5335message PackageAssociationSourceProcessStatsProto {
5336 // Uid of the process.
5337 optional int32 process_uid = 1;
5338 // Process name.
5339 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005340 // Package name.
5341 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005342 // Total count of the times this association appeared.
5343 optional int32 total_count = 3;
5344
5345 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005346 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005347
5348 // Total count of the times this association became actively impacting its target process.
5349 optional int32 active_count = 5;
5350
5351 // Information on one source in this association.
5352 message StateStats {
5353 // Process state enum.
5354 optional android.service.procstats.ProcessState process_state = 1;
5355 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005356 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005357 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005358 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005359 }
5360 repeated StateStats active_state_stats = 6;
5361}
5362
5363message PackageAssociationProcessStatsProto {
5364 // Name of the target component.
5365 optional string component_name = 1;
5366 // Information on one source in this association.
5367 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5368}
5369
5370
5371message ProcessStatsPackageProto {
5372 // Name of package.
5373 optional string package = 1;
5374
5375 // Uid of the package.
5376 optional int32 uid = 2;
5377
5378 // Version of the package.
5379 optional int64 version = 3;
5380
5381 // Stats for each process running with the package loaded in to it.
5382 repeated ProcessStatsProto process_stats = 4;
5383
5384 // Stats for each of the package's services.
5385 repeated PackageServiceStatsProto service_stats = 5;
5386
5387 // Stats for each association with the package.
5388 repeated PackageAssociationProcessStatsProto association_stats = 6;
5389}
5390
5391message ProcessStatsSectionProto {
5392 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005393 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005394
5395 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005396 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005397
5398 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005399 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005400
5401 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005402 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005403
5404 // System runtime library. e.g. "libdvm.so", "libart.so".
5405 optional string runtime = 5;
5406
5407 // whether kernel reports swapped pss.
5408 optional bool has_swapped_pss = 6;
5409
5410 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5411 enum Status {
5412 STATUS_UNKNOWN = 0;
5413 STATUS_COMPLETE = 1;
5414 STATUS_PARTIAL = 2;
5415 STATUS_SHUTDOWN = 3;
5416 STATUS_SYSPROPS = 4;
5417 }
5418 repeated Status status = 7;
5419
Chenjie Yub2ecc792019-01-17 10:27:26 -08005420 // Number of pages available of various types and sizes, representation fragmentation.
5421 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5422
Yangsteraf9aee72018-10-12 09:26:16 -07005423 // Stats for each process.
5424 repeated ProcessStatsProto process_stats = 8;
5425
5426 // Stats for each package.
5427 repeated ProcessStatsPackageProto package_stats = 9;
5428}
5429
Chenjie Yub2ecc792019-01-17 10:27:26 -08005430message ProcessStatsAvailablePagesProto {
5431 // Node these pages are in (as per /proc/pagetypeinfo)
5432 optional int32 node = 1;
5433
5434 // Zone these pages are in (as per /proc/pagetypeinfo)
5435 optional string zone = 2;
5436
5437 // Label for the type of these pages (as per /proc/pagetypeinfo)
5438 optional string label = 3;
5439
5440 // Distribution of number of pages available by order size. First entry in array is
5441 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5442 repeated int32 pages_per_order = 4;
5443}
5444
Chenjie Yu12e5e672018-09-14 15:54:59 -07005445/**
5446 * Pulled from ProcessStatsService.java
5447 */
5448message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005449 optional ProcessStatsSectionProto proc_stats_section = 1;
5450}
5451
Chenjie Yuf910b7802019-01-11 16:08:20 -08005452/**
5453 * Pulled from ProcessStatsService.java
5454 */
5455message ProcStatsPkgProc {
5456 optional ProcessStatsSectionProto proc_stats_section = 1;
5457}
5458
Chris Wrencdea3b72019-11-22 16:58:17 -05005459// Next Tag: 2
5460message PackageRemoteViewInfoProto {
5461 optional string package_name = 1;
5462 // add per-package additional info here (like channels)
5463}
5464
5465// Next Tag: 2
5466message NotificationRemoteViewsProto {
5467 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5468}
5469
5470/**
5471 * Pulled from NotificationManagerService.java
5472 */
5473message NotificationRemoteViews {
5474 optional NotificationRemoteViewsProto notification_remote_views = 1;
5475}
5476
Yotam Aron74299972020-01-16 16:20:58 +02005477/**
5478 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5479 */
5480message PackageNotificationPreferences {
5481 // Uid under which the package is installed.
5482 optional int32 uid = 1;
5483 // Notification importance, which specifies when and how a notification is displayed.
5484 // Specified under core/java/android/app/NotificationManager.java.
5485 optional int32 importance = 2;
5486 // Lockscreen visibility as set by the user.
5487 optional int32 visibility = 3;
5488 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5489 // PreferencesHelper.java)
5490 optional int32 user_locked_fields = 4;
5491}
5492
5493/**
5494 * Atom that contains a list of a package's channel preferences, pulled from
5495 * NotificationManagerService.java.
5496 */
5497message PackageNotificationChannelPreferences {
5498 // Uid under which the package is installed.
5499 optional int32 uid = 1;
5500 // Channel's ID. Should always be available.
5501 optional string channel_id = 2;
5502 // Channel's name. Should always be available.
5503 optional string channel_name = 3;
5504 // Channel's description. Optionally set by the channel creator.
5505 optional string description = 4;
5506 // Notification importance, which specifies when and how a notification is displayed. Specified
5507 // under core/java/android/app/NotificationManager.java.
5508 optional int32 importance = 5;
5509 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5510 // at core/java/android/app/NotificationChannel.java
5511 optional int32 user_locked_fields = 6;
5512 // Indicates if the channel was deleted by the app.
5513 optional bool is_deleted = 7;
5514}
5515
5516/**
5517 * Atom that contains a list of a package's channel group preferences, pulled from
5518 * NotificationManagerService.java.
5519 */
5520message PackageNotificationChannelGroupPreferences {
5521 // Uid under which the package is installed.
5522 optional int32 uid = 1;
5523 // Channel Group's ID. Should always be available.
5524 optional string group_id = 2;
5525 // Channel Group's name. Should always be available.
5526 optional string group_name = 3;
5527 // Channel Group's description. Optionally set by group creator.
5528 optional string description = 4;
5529 // Indicates if notifications from this channel group are blocked.
5530 optional bool is_blocked = 5;
5531 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5532 // at core/java/android/app/NotificationChannelGroup.java
5533 optional int32 user_locked_fields = 6;
5534}
5535
Yangsteraf9aee72018-10-12 09:26:16 -07005536message PowerProfileProto {
5537 optional double cpu_suspend = 1;
5538
5539 optional double cpu_idle = 2;
5540
5541 optional double cpu_active = 3;
5542
5543 message CpuCluster {
5544 optional int32 id = 1;
5545 optional double cluster_power = 2;
5546 optional int32 cores = 3;
5547 repeated int64 speed = 4;
5548 repeated double core_power = 5;
5549 }
5550
5551 repeated CpuCluster cpu_cluster = 40;
5552
5553 optional double wifi_scan = 4;
5554
5555 optional double wifi_on = 5;
5556
5557 optional double wifi_active = 6;
5558
5559 optional double wifi_controller_idle = 7;
5560
5561 optional double wifi_controller_rx = 8;
5562
5563 optional double wifi_controller_tx = 9;
5564
5565 repeated double wifi_controller_tx_levels = 10;
5566
5567 optional double wifi_controller_operating_voltage = 11;
5568
5569 optional double bluetooth_controller_idle = 12;
5570
5571 optional double bluetooth_controller_rx = 13;
5572
5573 optional double bluetooth_controller_tx = 14;
5574
5575 optional double bluetooth_controller_operating_voltage = 15;
5576
5577 optional double modem_controller_sleep = 16;
5578
5579 optional double modem_controller_idle = 17;
5580
5581 optional double modem_controller_rx = 18;
5582
5583 repeated double modem_controller_tx = 19;
5584
5585 optional double modem_controller_operating_voltage = 20;
5586
5587 optional double gps_on = 21;
5588
5589 repeated double gps_signal_quality_based = 22;
5590
5591 optional double gps_operating_voltage = 23;
5592
5593 optional double bluetooth_on = 24;
5594
5595 optional double bluetooth_active = 25;
5596
5597 optional double bluetooth_at_cmd = 26;
5598
5599 optional double ambient_display = 27;
5600
5601 optional double screen_on = 28;
5602
5603 optional double radio_on = 29;
5604
5605 optional double radio_scanning = 30;
5606
5607 optional double radio_active = 31;
5608
5609 optional double screen_full = 32;
5610
5611 optional double audio = 33;
5612
5613 optional double video = 34;
5614
5615 optional double flashlight = 35;
5616
5617 optional double memory = 36;
5618
5619 optional double camera = 37;
5620
5621 optional double wifi_batched_scan = 38;
5622
5623 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005624}
Chenjie Yuab530202018-09-26 12:39:20 -07005625
5626/**
5627 * power_profile.xml and other constants for power model calculations.
5628 * Pulled from PowerProfile.java
5629 */
5630message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005631 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005632}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005633
5634/**
arangelovd5db50e2018-10-12 20:24:39 +01005635 * Logs when a user restriction was added or removed.
5636 *
5637 * Logged from:
5638 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5639 */
5640message UserRestrictionChanged {
5641 // The raw string of the user restriction as defined in UserManager.
5642 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5643 optional string restriction = 1;
5644 // Whether the restriction is enabled or disabled.
5645 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005646}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005647
5648/**
5649 * Pulls process user time and system time. Puller takes a snapshot of all pids
5650 * in the system and returns cpu stats for those that are working at the time.
5651 * Dead pids will be dropped. Kernel processes are excluded.
5652 * Min cool-down is 5 sec.
5653 */
5654message ProcessCpuTime {
5655 optional int32 uid = 1 [(is_uid) = true];
5656
5657 optional string process_name = 2;
5658 // Process cpu time in user space, cumulative from boot/process start
5659 optional int64 user_time_millis = 3;
5660 // Process cpu time in system space, cumulative from boot/process start
5661 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005662}
Misha Wagner5a51e002018-10-03 15:04:09 +01005663
5664/**
5665 * Pulls the CPU usage for each thread.
5666 *
5667 * Read from /proc/$PID/task/$TID/time_in_state files.
5668 *
5669 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5670 * time_in_state files not being present on some phones, have not been addressed. These should be
5671 * considered before a public release.
5672 */
5673message CpuTimePerThreadFreq {
5674 // UID that owns the process.
5675 optional int32 uid = 1 [(is_uid) = true];
5676 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005677 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005678 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005679 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005680 // Name of the process taken from `/proc/$PID/cmdline`.
5681 optional string process_name = 4;
5682 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5683 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005684
5685 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5686 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5687 // frequencies are given here as the alternative is sending eight separate atoms. This method
5688 // significantly reduces the amount of data created
5689 optional int32 frequency1_khz = 6;
5690 optional int32 time1_millis = 7;
5691 optional int32 frequency2_khz = 8;
5692 optional int32 time2_millis = 9;
5693 optional int32 frequency3_khz = 10;
5694 optional int32 time3_millis = 11;
5695 optional int32 frequency4_khz = 12;
5696 optional int32 time4_millis = 13;
5697 optional int32 frequency5_khz = 14;
5698 optional int32 time5_millis = 15;
5699 optional int32 frequency6_khz = 16;
5700 optional int32 time6_millis = 17;
5701 optional int32 frequency7_khz = 18;
5702 optional int32 time7_millis = 19;
5703 optional int32 frequency8_khz = 20;
5704 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005705}
Bookatz75ee60422018-11-09 12:27:37 -08005706
5707/**
Bookatz366a4432018-11-20 09:42:33 -08005708 * Pulls information about the device's build.
5709 */
5710message BuildInformation {
5711 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5712 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5713 optional string fingerprint = 1;
5714
5715 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5716 optional string brand = 2;
5717
5718 // Build.PRODUCT. The name of the overall product.
5719 optional string product = 3;
5720
5721 // Build.DEVICE. The name of the industrial design.
5722 optional string device = 4;
5723
5724 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5725 optional string version_release = 5;
5726
5727 // Build.ID. E.g. a label like "M4-rc20".
5728 optional string id = 6;
5729
5730 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5731 // represent this build.
5732 optional string version_incremental = 7;
5733
5734 // Build.TYPE. The type of build, like "user" or "eng".
5735 optional string type = 8;
5736
5737 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5738 optional string tags = 9;
5739}
5740
5741/**
Adam He420947c2019-01-23 15:59:09 -08005742 * Logs information about mismatched caller for content capture.
5743 *
5744 * Logged from:
5745 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5746 */
5747message ContentCaptureCallerMismatchReported {
5748 optional string intended_package = 1;
5749 optional string calling_package = 2;
5750}
5751
5752/**
5753 * Logs information about content capture service events.
5754 *
5755 * Logged from:
5756 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5757 */
5758message ContentCaptureServiceEvents {
5759 // The type of event.
5760 enum Event {
5761 UNKNOWN = 0;
5762 ON_CONNECTED = 1;
5763 ON_DISCONNECTED = 2;
5764 SET_WHITELIST = 3;
5765 SET_DISABLED = 4;
5766 ON_USER_DATA_REMOVED = 5;
5767 }
5768 optional Event event = 1;
5769 // component/package of content capture service.
5770 optional string service_info = 2;
5771 // component/package of target.
5772 // it's a concatenated list of component/package for SET_WHITELIST event
5773 // separated by " ".
5774 optional string target_info = 3;
5775}
5776
5777/**
5778 * Logs information about content capture session events.
5779 *
5780 * Logged from:
5781 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5782 */
5783message ContentCaptureSessionEvents {
5784 // The type of event.
5785 enum Event {
5786 UNKNOWN = 0;
5787 ON_SESSION_STARTED = 1;
5788 ON_SESSION_FINISHED = 2;
5789 SESSION_NOT_CREATED = 3;
5790 }
5791 optional int32 session_id = 1;
5792 optional Event event = 2;
5793 // (n/a on session finished)
5794 optional int32 state_flags = 3;
5795 // component/package of content capture service.
5796 optional string service_info = 4;
5797 // component/package of app.
5798 // (n/a on session finished)
5799 optional string app_info = 5;
5800 optional bool is_child_session = 6;
5801}
5802
5803/**
5804 * Logs information about session being flushed.
5805 *
5806 * Logged from:
5807 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5808 */
5809message ContentCaptureFlushed {
5810 optional int32 session_id = 1;
5811 // component/package of content capture service.
5812 optional string service_info = 2;
5813 // component/package of app.
5814 optional string app_info = 3;
5815 // session start/finish events
5816 optional int32 child_session_started = 4;
5817 optional int32 child_session_finished = 5;
5818 // count of view events.
5819 optional int32 view_appeared_count = 6;
5820 optional int32 view_disappeared_count = 7;
5821 optional int32 view_text_changed_count = 8;
5822
5823 // Flush stats.
5824 optional int32 max_events = 9;
5825 optional int32 idle_flush_freq = 10;
5826 optional int32 text_flush_freq = 11;
5827 optional int32 flush_reason = 12;
5828}
5829
5830/**
Bookatz75ee60422018-11-09 12:27:37 -08005831 * Pulls on-device BatteryStats power use calculations for the overall device.
5832 */
5833message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005834 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5835 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5836 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5837 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005838}
5839
5840/**
5841 * Pulls on-device BatteryStats power use calculations broken down by uid.
5842 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5843 * that is attributed to non-uid items. They must all be included to get the total power use.
5844 */
5845message DeviceCalculatedPowerBlameUid {
5846 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5847 optional int32 uid = 1 [(is_uid) = true];
5848
Bookatz3dbc13a2018-12-21 12:16:51 -08005849 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5850 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5851 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005852}
5853
5854/**
5855 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5856 * drain type.
5857 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5858 * is attributed uids. They must all be included to get the total power use.
5859 */
5860message DeviceCalculatedPowerBlameOther {
5861 // The type of item whose power use is being reported.
5862 enum DrainType {
5863 AMBIENT_DISPLAY = 0;
5864 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5865 BLUETOOTH = 2;
5866 CAMERA = 3;
5867 // Cell-standby
5868 CELL = 4;
5869 FLASHLIGHT = 5;
5870 IDLE = 6;
5871 MEMORY = 7;
5872 // Amount that total computed drain exceeded the drain estimated using the
5873 // battery level changes and capacity.
5874 OVERCOUNTED = 8;
5875 PHONE = 9;
5876 SCREEN = 10;
5877 // Amount that total computed drain was below the drain estimated using the
5878 // battery level changes and capacity.
5879 UNACCOUNTED = 11;
5880 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5881 WIFI = 13;
5882 }
5883 optional DrainType drain_type = 1;
5884
Bookatz3dbc13a2018-12-21 12:16:51 -08005885 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5886 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5887 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005888}
arangelov4e994062018-11-13 16:12:38 +00005889
5890/**
5891 * Logs device policy features.
5892 *
5893 * Logged from:
5894 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5895 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5896 */
5897message DevicePolicyEvent {
5898 // The event id - unique for each event.
5899 optional android.stats.devicepolicy.EventId event_id = 1;
5900 // The admin package name.
5901 optional string admin_package_name = 2;
5902 // A generic integer parameter.
5903 optional int32 integer_value = 3;
5904 // A generic boolean parameter.
5905 optional bool boolean_value = 4;
5906 // A parameter specifying a time period in milliseconds.
5907 optional uint64 time_period_millis = 5;
5908 // A parameter specifying a list of package names, bundle extras or string parameters.
5909 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5910}
shawnlinea5b66b2018-11-13 15:05:29 +08005911
5912/**
5913 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5914 *
5915 * Logged from:
5916 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5917 */
5918message DocsUILaunchReported {
5919 optional android.stats.docsui.LaunchAction launch_action = 1;
5920 optional bool has_initial_uri = 2;
5921 optional android.stats.docsui.MimeType mime_type = 3;
5922 optional android.stats.docsui.Root initial_root = 4;
5923}
5924
5925/**
5926 * Logs root/app visited event in file managers/picker. Call this when the user
5927 * taps on root/app in hamburger menu.
5928 *
5929 * Logged from:
5930 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5931 */
5932message DocsUIRootVisitedReported {
5933 optional android.stats.docsui.ContextScope scope = 1;
5934 optional android.stats.docsui.Root root = 2;
5935}
5936
5937/**
5938 * Logs file operation stats. Call this when a file operation has completed.
5939 *
5940 * Logged from:
5941 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5942 */
5943message DocsUIFileOperationReported {
5944 optional android.stats.docsui.Provider provider = 1;
5945 optional android.stats.docsui.FileOperation file_op = 2;
5946}
5947
5948/**
5949 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5950 * mode.
5951 *
5952 * Logged from:
5953 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5954 */
5955message DocsUIFileOperationCopyMoveModeReported {
5956 optional android.stats.docsui.FileOperation file_op = 1;
5957 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5958}
5959
5960
5961/**
5962 * Logs file sub operation stats. Call this when a file operation has failed.
5963 *
5964 * Logged from:
5965 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5966 */
5967message DocsUIFileOperationFailureReported {
5968 optional android.stats.docsui.Authority authority = 1;
5969 optional android.stats.docsui.SubFileOperation sub_op = 2;
5970}
5971
5972/**
5973* Logs the cancellation of a file operation. Call this when a job is canceled
5974*
5975* Logged from:
5976* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5977*/
5978message DocsUIFileOperationCanceledReported {
5979 optional android.stats.docsui.FileOperation file_op = 1;
5980}
5981
5982/**
5983 * Logs startup time in milliseconds.
5984 *
5985 * Logged from:
5986 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5987 */
5988message DocsUIStartupMsReported {
5989 optional int32 startup_millis = 1;
5990}
5991
5992/**
5993 * Logs the action that was started by user.
5994 *
5995 * Logged from:
5996 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5997 */
5998message DocsUIUserActionReported {
5999 optional android.stats.docsui.UserAction action = 1;
6000}
6001
6002/**
6003 * Logs the invalid type when invalid scoped access is requested.
6004 *
6005 * Logged from:
6006 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6007 */
6008message DocsUIInvalidScopedAccessRequestReported {
6009 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006010}
Ben Murdochbab399f62018-12-06 11:01:38 +00006011
6012/**
shawnlina75e82d2019-01-07 10:31:12 +08006013 * Logs the package name that launches docsui picker mode.
6014 *
6015 * Logged from:
6016 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6017 */
6018message DocsUIPickerLaunchedFromReported {
6019 optional string package_name = 1;
6020}
6021
6022/**
6023 * Logs the search type.
6024 *
6025 * Logged from:
6026 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6027 */
6028message DocsUISearchTypeReported {
6029 optional android.stats.docsui.SearchType search_type = 1;
6030}
6031
6032/**
6033 * Logs the search mode.
6034 *
6035 * Logged from:
6036 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6037 */
6038message DocsUISearchModeReported {
6039 optional android.stats.docsui.SearchMode search_mode = 1;
6040}
6041
6042/**
6043 * Logs the pick result information.
6044 *
6045 * Logged from:
6046 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6047 */
6048message DocsUIPickResultReported {
6049 optional int32 total_action_count = 1;
6050 optional int64 duration_millis = 2;
6051 optional int32 file_count= 3;
6052 optional bool is_searching = 4;
6053 optional android.stats.docsui.Root picked_from = 5;
6054 optional android.stats.docsui.MimeType mime_type = 6;
6055 optional int32 repeatedly_pick_times = 7;
6056}
6057
6058/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006059 * Logs when an app's memory is compacted.
6060 *
6061 * Logged from:
6062 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6063 */
6064message AppCompacted {
6065 // The pid of the process being compacted.
6066 optional int32 pid = 1;
6067
6068 // The name of the process being compacted.
6069 optional string process_name = 2;
6070
6071 // The type of compaction.
6072 enum Action {
6073 UNKNOWN = 0;
6074 SOME = 1;
6075 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006076 PERSISTENT = 3;
6077 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006078 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006079 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006080
6081 // Total RSS in kilobytes consumed by the process prior to compaction.
6082 optional int64 before_rss_total_kilobytes = 4;
6083
6084 // File RSS in kilobytes consumed by the process prior to compaction.
6085 optional int64 before_rss_file_kilobytes = 5;
6086
6087 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6088 optional int64 before_rss_anon_kilobytes = 6;
6089
6090 // Swap in kilobytes consumed by the process prior to compaction.
6091 optional int64 before_swap_kilobytes = 7;
6092
6093 // Total RSS in kilobytes consumed by the process after compaction.
6094 optional int64 after_rss_total_kilobytes = 8;
6095
6096 // File RSS in kilobytes consumed by the process after compaction.
6097 optional int64 after_rss_file_kilobytes = 9;
6098
6099 // Anonymous RSS in kilobytes consumed by the process after compaction.
6100 optional int64 after_rss_anon_kilobytes = 10;
6101
6102 // Swap in kilobytes consumed by the process after compaction.
6103 optional int64 after_swap_kilobytes = 11;
6104
6105 // The time taken to perform compaction in milliseconds.
6106 optional int64 time_to_compact_millis = 12;
6107
6108 // The last compaction action performed for this app.
6109 optional Action last_action = 13;
6110
Ben Murdoch01720b82018-12-19 18:03:44 +00006111 // The last time that compaction was attempted on this process in milliseconds
6112 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6113 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006114
Ben Murdoch885c21b2019-03-15 18:02:04 +00006115 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006116 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006117
6118 // The process state at the time of compaction.
6119 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006120
6121 // Free ZRAM in kilobytes before compaction.
6122 optional int64 before_zram_free_kilobytes = 17;
6123
6124 // Free ZRAM in kilobytes after compaction.
6125 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006126}
lifr157fc552018-12-12 16:38:04 +08006127
6128/**
lifrb6b90b62019-03-29 00:40:17 +08006129 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6130 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6131 *
lifr1f74b052019-04-16 22:16:30 +08006132 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6133 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6134 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6135 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006136 */
6137message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006138 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006139
lifr1f74b052019-04-16 22:16:30 +08006140 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006141
6142 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006143 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006144
lifr1f74b052019-04-16 22:16:30 +08006145 // Only valid for event_type = EVENT_GETADDRINFO.
6146 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006147
lifr1f74b052019-04-16 22:16:30 +08006148 // Flags passed to android_res_nsend() defined in multinetwork.h
6149 // Only valid for event_type = EVENT_RESNSEND.
6150 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006151
lifrad9becc2019-05-20 11:04:41 +08006152 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006153
6154 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006155 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006156
6157 // Additional pass-through fields opaque to statsd.
6158 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006159 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006160
6161 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6162 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006163}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006164
6165/**
6166 * Logs when a data stall event occurs.
6167 *
6168 * Log from:
6169 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6170 */
6171message DataStallEvent {
6172 // Data stall evaluation type.
6173 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6174 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6175 optional int32 evaluation_type = 1;
6176 // See definition in data_stall_event.proto.
6177 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6178 // See definition in data_stall_event.proto.
6179 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6180 // See definition in data_stall_event.proto.
6181 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6182 // See definition in data_stall_event.proto.
6183 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6184 // See definition in data_stall_event.proto.
6185 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6186}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006187
6188/*
6189 * Logs when RescueParty resets some set of experiment flags.
6190 *
6191 * Logged from:
6192 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6193 */
6194message RescuePartyResetReported {
6195 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6196 optional int32 rescue_level = 1;
6197}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006198
6199/**
6200 * Logs when signed config is received from an APK, and if that config was applied successfully.
6201 * Logged from:
6202 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6203 */
6204message SignedConfigReported {
6205 enum Type {
6206 UNKNOWN_TYPE = 0;
6207 GLOBAL_SETTINGS = 1;
6208 }
6209 optional Type type = 1;
6210
6211 // The final status of the signed config received.
6212 enum Status {
6213 UNKNOWN_STATUS = 0;
6214 APPLIED = 1;
6215 BASE64_FAILURE_CONFIG = 2;
6216 BASE64_FAILURE_SIGNATURE = 3;
6217 SECURITY_EXCEPTION = 4;
6218 INVALID_CONFIG = 5;
6219 OLD_CONFIG = 6;
6220 SIGNATURE_CHECK_FAILED = 7;
6221 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006222 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006223 }
6224 optional Status status = 2;
6225
6226 // The version of the signed config processed.
6227 optional int32 version = 3;
6228
6229 // The package name that the config was extracted from.
6230 optional string from_package = 4;
6231
6232 enum Key {
6233 NO_KEY = 0;
6234 DEBUG = 1;
6235 PRODUCTION = 2;
6236 }
6237 // Which key was used to verify the config.
6238 optional Key verified_with = 5;
6239}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006240
6241/*
6242 * Logs GNSS Network-Initiated (NI) location events.
6243 *
6244 * Logged from:
6245 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6246 */
6247message GnssNiEventReported {
6248 // The type of GnssNiEvent.
6249 enum EventType {
6250 UNKNOWN = 0;
6251 NI_REQUEST = 1;
6252 NI_RESPONSE = 2;
6253 }
6254 optional EventType event_type = 1;
6255
6256 // An ID generated by HAL to associate NI notifications and UI responses.
6257 optional int32 notification_id = 2;
6258
6259 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006260 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006261
6262 // NI requires notification.
6263 optional bool need_notify = 4;
6264
6265 // NI requires verification.
6266 optional bool need_verify = 5;
6267
6268 // NI requires privacy override, no notification/minimal trace.
6269 optional bool privacy_override = 6;
6270
6271 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6272 // seconds.
6273 optional int32 timeout = 7;
6274
6275 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006276 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006277
6278 // String representing the requester of the network inititated location request.
6279 optional string requestor_id = 9;
6280
6281 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6282 // network initiated location request.
6283 optional string text = 10;
6284
6285 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006286 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006287
6288 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006289 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006290
6291 // True if SUPL ES is enabled.
6292 optional bool is_supl_es_enabled = 13;
6293
6294 // True if GNSS location is enabled.
6295 optional bool is_location_enabled = 14;
6296
6297 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006298 optional android.server.location.GnssUserResponseType user_response = 15;
6299}
6300
6301/**
6302 * Logs GNSS non-framework (NFW) location notification.
6303 *
6304 * Logged from:
6305 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6306 */
6307message GnssNfwNotificationReported {
6308 // Package name of the Android proxy application representing the non-framework entity that
6309 // requested location. Set to empty string if unknown.
6310 optional string proxy_app_package_name = 1;
6311
6312 // Protocol stack that initiated the non-framework location request.
6313 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6314
6315 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6316 // set to empty string. This field is opaque to the framework and used for logging purposes.
6317 optional string other_protocol_stack_name = 3;
6318
6319 // Source initiating/receiving the location information.
6320 optional android.server.location.NfwRequestor requestor = 4;
6321
6322 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6323 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6324 // and used for logging purposes.
6325 optional string requestor_id = 5;
6326
6327 // Indicates whether location information was provided for this request.
6328 optional android.server.location.NfwResponseType response_type = 6;
6329
6330 // True if the device is in user initiated emergency session.
6331 optional bool in_emergency_mode = 7;
6332
6333 // True if cached location is provided.
6334 optional bool is_cached_location = 8;
6335
6336 // True if proxy app permission mismatch between framework and GNSS HAL.
6337 optional bool is_permission_mismatched = 9;
6338}
6339
6340/**
6341 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6342 *
6343 * Logged from:
6344 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6345 */
6346message GnssConfigurationReported {
6347 // SUPL host name.
6348 optional string supl_host = 1;
6349
6350 // SUPL port number.
6351 optional int32 supl_port = 2;
6352
6353 // C2K host name.
6354 optional string c2k_host = 3;
6355
6356 // C2K port number.
6357 optional int32 c2k_port = 4;
6358
6359 // The SUPL version requested by Carrier.
6360 optional int32 supl_ver = 5;
6361
6362 // The SUPL mode.
6363 optional android.server.location.SuplMode supl_mode = 6;
6364
6365 // True if NI emergency SUPL restrictions is enabled.
6366 optional bool supl_es = 7;
6367
6368 // LTE Positioning Profile settings
6369 optional android.server.location.LppProfile lpp_profile = 8;
6370
6371 // Positioning protocol on A-Glonass system.
6372 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6373
6374 // True if emergency PDN is used. Otherwise, regular PDN is used.
6375 optional bool use_emergency_pdn_for_emergency_supl= 10;
6376
6377 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6378 optional android.server.location.GpsLock gps_lock = 11;
6379
6380 // Number of seconds to extend the emergency session duration post emergency call.
6381 optional int32 es_extension_sec = 12;
6382
6383 // The full list of package names of proxy Android applications representing the non-framework
6384 // location access entities (on/off the device) for which the framework user has granted
6385 // non-framework location access permission. The package names are concatenated in one string
6386 // with spaces as separators.
6387 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006388}
Jack Yu95b64f32018-12-13 18:26:11 +08006389
6390/**
6391 * Logs when a NFC device's error occurred.
6392 * Logged from:
6393 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6394 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6395 */
6396message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006397 enum Type {
6398 UNKNOWN = 0;
6399 CMD_TIMEOUT = 1;
6400 ERROR_NOTIFICATION = 2;
6401 AID_OVERFLOW = 3;
6402 }
6403 optional Type type = 1;
6404 // If it's nci cmd timeout, log the timeout command.
6405 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006406
Alex Salod7c3eef2019-01-25 14:43:27 -08006407 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006408}
6409
6410/**
6411 * Logs when a NFC device's state changed event
6412 * Logged from:
6413 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6414 */
6415message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006416 enum State {
6417 UNKNOWN = 0;
6418 OFF = 1;
6419 ON = 2;
6420 ON_LOCKED = 3; // Secure Nfc enabled.
6421 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6422 }
6423 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006424}
6425
6426/**
6427 * Logs when a NFC Beam Transaction occurred.
6428 * Logged from:
6429 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6430 */
6431message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006432 enum Operation {
6433 UNKNOWN = 0;
6434 SEND = 1;
6435 RECEIVE = 2;
6436 }
6437 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006438}
6439
6440/**
6441 * Logs when a NFC Card Emulation Transaction occurred.
6442 * Logged from:
6443 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6444 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6445 */
6446message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006447 enum Category {
6448 UNKNOWN = 0;
6449 HCE_PAYMENT = 1;
6450 HCE_OTHER = 2;
6451 OFFHOST = 3;
6452 }
6453 // Transaction belongs to HCE payment or HCE other category, or offhost.
6454 optional Category category = 1;
6455 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6456 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006457}
6458
6459/**
6460 * Logs when a NFC Tag event occurred.
6461 * Logged from:
6462 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6463 */
6464message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006465 enum Type {
6466 UNKNOWN = 0;
6467 URL = 1;
6468 BT_PAIRING = 2;
6469 PROVISION = 3;
6470 WIFI_CONNECT = 4;
6471 APP_LAUNCH = 5;
6472 OTHERS = 6;
6473 }
6474 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006475}
6476
6477/**
6478 * Logs when Hce transaction triggered
6479 * Logged from:
6480 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6481 */
6482message NfcHceTransactionOccurred {
6483 // The latency period(in microseconds) it took for the first HCE data
6484 // exchange.
6485 optional uint32 latency_micros = 1;
6486}
6487
6488/**
6489 * Logs when SecureElement state event changed
6490 * Logged from:
6491 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6492 */
6493message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006494 enum State {
6495 UNKNOWN = 0;
6496 INITIALIZED = 1;
6497 DISCONNECTED = 2;
6498 CONNECTED = 3;
6499 HALCRASH = 4;
6500 }
6501 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006502
Alex Salod7c3eef2019-01-25 14:43:27 -08006503 optional string state_change_reason = 2;
6504 // SIMx or eSEx.
6505 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006506}
6507
6508/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006509 * Information about a permission grant request
6510 */
6511message PermissionGrantRequestResultReported {
6512 // unique value identifying an API call. A API call might result in multiple of these atoms
6513 optional int64 request_id = 1;
6514
6515 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006516 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006517
6518 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006519 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006520
6521 // The permission to be granted
6522 optional string permission_name = 4;
6523
6524 // If the permission was explicitly requested via the API or added by the system
6525 optional bool is_implicit = 5;
6526
6527 enum Result {
6528 UNDEFINED = 0;
6529 // permission request was ignored
6530 IGNORED = 1;
6531 // permission request was ignored because it was user fixed
6532 IGNORED_USER_FIXED = 2;
6533 // permission request was ignored because it was policy fixed
6534 IGNORED_POLICY_FIXED = 3;
6535 // permission was granted by user action
6536 USER_GRANTED = 4;
6537 // permission was automatically granted
6538 AUTO_GRANTED = 5;
6539 // permission was denied by user action
6540 USER_DENIED = 6;
6541 // permission was denied with prejudice by the user
6542 USER_DENIED_WITH_PREJUDICE = 7;
6543 // permission was automatically denied
6544 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006545 // permission request was ignored because permission is restricted
6546 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006547 // one time permission was granted by user action
6548 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006549 // user ignored request by leaving the request screen without choosing any option
6550 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006551 // user granted the permission after being linked to settings
6552 USER_GRANTED_IN_SETTINGS = 12;
6553 // user denied the permission after being linked to settings
6554 USER_DENIED_IN_SETTINGS = 13;
6555 // user denied the permission with prejudice after being linked to settings
6556 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6557 // permission was automatically revoked after one-time permission expired
6558 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006559 // permission was automatically revoked for unused app
6560 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006561 }
6562 // The result of the permission grant
6563 optional Result result = 6;
6564}
6565
6566/**
Jack Yu95b64f32018-12-13 18:26:11 +08006567 * Logs when Omapi API used
6568 * Logged from:
6569 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6570 */
6571message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006572 enum Operation {
6573 UNKNOWN = 0;
6574 OPEN_CHANNEL = 1;
6575 }
6576 optional Operation operation = 1;
6577 // SIMx or eSEx.
6578 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006579
Alex Salod7c3eef2019-01-25 14:43:27 -08006580 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006581}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006582
6583/**
Alex Saloa060aee2019-01-21 14:36:41 -08006584 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6585 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006586 * Logged from:
6587 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6588 */
6589message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006590 optional int64 dispatch_latency_millis = 1;
6591}
6592
6593/**
6594 * Logs AttentionManagerService attention check result.
6595 *
6596 * Logged from:
6597 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6598 */
6599message AttentionManagerServiceResultReported {
6600 // See core/java/android/service/attention/AttentionService.java
6601 enum AttentionCheckResult {
6602 UNKNOWN = 20;
6603 ATTENTION_SUCCESS_ABSENT = 0;
6604 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006605 ATTENTION_FAILURE_UNKNOWN = 2;
6606 ATTENTION_FAILURE_CANCELLED = 3;
6607 ATTENTION_FAILURE_PREEMPTED = 4;
6608 ATTENTION_FAILURE_TIMED_OUT = 5;
6609 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006610 }
6611 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006612}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006613
6614/**
6615 * Logs when an adb connection changes state.
6616 *
6617 * Logged from:
6618 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6619 */
6620message AdbConnectionChanged {
6621 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6622 // previously selected for this system.
6623 optional int64 last_connection_time_millis = 1;
6624
6625 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6626 // to reconnect via adb without user interaction.
6627 optional int64 auth_window_millis = 2;
6628
6629 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6630 optional android.debug.AdbConnectionStateEnum state = 3;
6631
6632 // True if the 'always allow' option was selected for this system.
6633 optional bool always_allow = 4;
6634}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006635
6636/*
6637 * Logs the reported speech DSP status.
6638 *
6639 * Logged from:
6640 * Vendor audio implementation.
6641 */
6642message SpeechDspStatReported {
6643 // The total Speech DSP uptime in milliseconds.
6644 optional int32 total_uptime_millis = 1;
6645 // The total Speech DSP downtime in milliseconds.
6646 optional int32 total_downtime_millis = 2;
6647 optional int32 total_crash_count = 3;
6648 optional int32 total_recover_count = 4;
6649}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006650
6651/**
6652 * Logs USB connector contaminant status.
6653 *
6654 * Logged from: USB Service.
6655 */
6656message UsbContaminantReported {
6657 optional string id = 1;
6658 optional android.service.usb.ContaminantPresenceStatus status = 2;
6659}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006660
6661/**
6662 * This atom is for debugging purpose.
6663 */
6664message DebugElapsedClock {
6665 // Monotically increasing value for each pull.
6666 optional int64 pull_count = 1;
6667 // Time from System.elapsedRealtime.
6668 optional int64 elapsed_clock_millis = 2;
6669 // Time from System.elapsedRealtime.
6670 optional int64 same_elapsed_clock_millis = 3;
6671 // Diff between current elapsed time and elapsed time from previous pull.
6672 optional int64 elapsed_clock_diff_millis = 4;
6673
6674 enum Type {
6675 TYPE_UNKNOWN = 0;
6676 ALWAYS_PRESENT = 1;
6677 PRESENT_ON_ODD_PULLS = 2;
6678 }
6679 // Type of behavior for the pulled data.
6680 optional Type type = 5;
6681}
6682
6683/**
6684 * This atom is for debugging purpose.
6685 */
6686message DebugFailingElapsedClock {
6687 // Monotically increasing value for each pull.
6688 optional int64 pull_count = 1;
6689 // Time from System.elapsedRealtime.
6690 optional int64 elapsed_clock_millis = 2;
6691 // Time from System.elapsedRealtime.
6692 optional int64 same_elapsed_clock_millis = 3;
6693 // Diff between current elapsed time and elapsed time from previous pull.
6694 optional int64 elapsed_clock_diff_millis = 4;
6695}
Steven Wuacef6bb2019-01-23 14:21:17 -05006696
6697/** Logs System UI bubbles event changed.
6698 *
6699 * Logged from:
6700 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6701 */
6702message BubbleUIChanged {
6703
6704 // The app package that is posting the bubble.
6705 optional string package_name = 1;
6706
6707 // The notification channel that is posting the bubble.
6708 optional string notification_channel = 2;
6709
6710 // The notification id associated with the posted bubble.
6711 optional int32 notification_id = 3;
6712
6713 // The position of the bubble within the bubble stack.
6714 optional int32 position = 4;
6715
6716 // The total number of bubbles within the bubble stack.
6717 optional int32 total_number = 5;
6718
6719 // User interactions with the bubble.
6720 enum Action {
6721 UNKNOWN = 0;
6722 POSTED = 1;
6723 UPDATED = 2;
6724 EXPANDED = 3;
6725 COLLAPSED = 4;
6726 DISMISSED = 5;
6727 STACK_DISMISSED = 6;
6728 STACK_MOVED = 7;
6729 HEADER_GO_TO_APP = 8;
6730 HEADER_GO_TO_SETTINGS = 9;
6731 PERMISSION_OPT_IN = 10;
6732 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006733 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006734 SWIPE_LEFT = 13;
6735 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006736 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006737 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006738 }
6739 optional Action action = 6;
6740
6741 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6742 optional float normalized_x_position = 7;
6743 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006744
6745 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6746 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006747
6748 // Whether the bubble is an on-going one.
6749 optional bool is_ongoing = 10;
6750
6751 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006752 // This is deprecated and the value should be ignored.
6753 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006754}
Kweku Adams8845d012018-12-11 20:06:45 -08006755
6756/**
Steven Wu552f63f2019-02-05 13:41:36 -05006757 * Logs System UI bubbles developer errors.
6758 *
6759 * Logged from:
6760 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6761 */
6762message BubbleDeveloperErrorReported {
6763
6764 // The app package that is posting the bubble.
6765 optional string package_name = 1;
6766
6767 // Bubble developer error type enums.
6768 enum Error {
6769 UNKNOWN = 0;
6770 ACTIVITY_INFO_MISSING = 1;
6771 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6772 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6773 }
6774 optional Error error = 2 [default = UNKNOWN];
6775}
6776
6777/**
Kweku Adams8845d012018-12-11 20:06:45 -08006778 * Logs that a constraint for a scheduled job has changed.
6779 *
6780 * Logged from:
6781 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6782 */
6783message ScheduledJobConstraintChanged {
6784 repeated AttributionNode attribution_node = 1;
6785
6786 // Name of the job.
6787 optional string job_name = 2;
6788
6789 optional com.android.server.job.ConstraintEnum constraint = 3;
6790
6791 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006792 UNKNOWN = 0;
6793 UNSATISFIED = 1;
6794 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006795 }
6796 optional State state = 4;
6797}
Alex Salod7c3eef2019-01-25 14:43:27 -08006798
6799/**
6800 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6801 * returns true.
6802 *
6803 * Logged from:
6804 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6805 */
6806message ScreenTimeoutExtensionReported {
6807 // Describes how many times in a row did the power manager reset the screen off timeout.
6808 optional uint32 consecutive_timeout_extended_count = 1;
6809}
Hui Yu885aca12019-01-10 17:11:34 -08006810
6811/*
6812* Logs number of milliseconds it takes to start a process.
6813* The definition of app process start time is from the app launch time to
6814* the time that Zygote finished forking the app process and loaded the
6815* application package's java classes.
6816
6817* This metric is different from AppStartOccurred which is for foreground
6818* activity only.
6819
6820* ProcessStartTime can report all processes (both foreground and background)
6821* start time.
6822*
6823* Logged from:
6824* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6825*/
6826message ProcessStartTime {
6827 // The uid of the ProcessRecord.
6828 optional int32 uid = 1 [(is_uid) = true];
6829
6830 // The process pid.
6831 optional int32 pid = 2;
6832
6833 // The process name.
6834 // Usually package name, "system" for system server.
6835 // Provided by ActivityManagerService.
6836 optional string process_name = 3;
6837
6838 enum StartType {
6839 UNKNOWN = 0;
6840 WARM = 1;
6841 HOT = 2;
6842 COLD = 3;
6843 }
6844
6845 // The start type.
6846 optional StartType type = 4;
6847
6848 // The elapsed realtime at the start of the process.
6849 optional int64 process_start_time_millis = 5;
6850
6851 // Number of milliseconds it takes to reach bind application.
6852 optional int32 bind_application_delay_millis = 6;
6853
6854 // Number of milliseconds it takes to finish start of the process.
6855 optional int32 process_start_delay_millis = 7;
6856
6857 // hostingType field in ProcessRecord, the component type such as "activity",
6858 // "service", "content provider", "broadcast" or other strings.
6859 optional string hosting_type = 8;
6860
6861 // hostingNameStr field in ProcessRecord. The component class name that runs
6862 // in this process.
6863 optional string hosting_name = 9;
6864}
6865
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006866/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006867 * Track Media Codec usage
6868 * Logged from:
6869 * frameworks/av/media/libstagefright/MediaCodec.cpp
6870 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6871 */
6872message MediametricsCodecReported {
6873 optional int64 timestamp_nanos = 1;
6874 optional string package_name = 2;
6875 optional int64 package_version_code = 3;
6876 optional int64 media_apex_version = 4;
6877
6878 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6879}
6880
6881/**
6882 * Track Media Extractor (pulling video/audio streams out of containers) usage
6883 * Logged from:
6884 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6885 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6886 */
6887message MediametricsExtractorReported {
6888 optional int64 timestamp_nanos = 1;
6889 optional string package_name = 2;
6890 optional int64 package_version_code = 3;
6891 optional int64 media_apex_version = 4;
6892
6893 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6894}
6895
6896/**
6897 * Track how we arbitrate between microphone/input requests.
6898 * Logged from
6899 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6900 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6901 */
6902message MediametricsAudiopolicyReported {
6903 optional int64 timestamp_nanos = 1;
6904 optional string package_name = 2;
6905 optional int64 package_version_code = 3;
6906 optional int64 media_apex_version = 4;
6907
6908 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6909}
6910
6911/**
6912 * Track how we arbitrate between microphone requests.
6913 * Logged from
6914 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6915 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6916 */
6917message MediametricsAudiorecordReported {
6918 optional int64 timestamp_nanos = 1;
6919 optional string package_name = 2;
6920 optional int64 package_version_code = 3;
6921 optional int64 media_apex_version = 4;
6922
6923 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6924}
6925
6926/**
6927 * Track how we arbitrate between microphone/input requests.
6928 * Logged from
6929 * frameworks/av/media/libnblog/ReportPerformance.cpp
6930 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6931 */
6932message MediametricsAudiothreadReported {
6933 optional int64 timestamp_nanos = 1;
6934 optional string package_name = 2;
6935 optional int64 package_version_code = 3;
6936 optional int64 media_apex_version = 4;
6937
6938 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6939}
6940
6941/**
6942 * Track how we arbitrate between microphone/input requests.
6943 * Logged from
6944 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6945 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6946 */
6947message MediametricsAudiotrackReported {
6948 optional int64 timestamp_nanos = 1;
6949 optional string package_name = 2;
6950 optional int64 package_version_code = 3;
6951 optional int64 media_apex_version = 4;
6952
6953 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6954}
6955
6956/**
6957 * Track information about DRM framework performance
6958 * Logged from
6959 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6960 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6961 */
6962message MediametricsMediadrmReported {
6963 optional int64 timestamp_nanos = 1;
6964 optional string package_name = 2;
6965 optional int64 package_version_code = 3;
6966 optional int64 media_apex_version = 4;
6967
6968 // vendor+description tell about which DRM plugin is in use on this device
6969 optional string vendor = 5;
6970 optional string description = 6;
6971 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6972 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6973}
6974
6975/**
6976 * Track information about the widevine DRM plugin performance
6977 * Logged from
6978 * vendor/widevine/libwvdrmengine/cdm/metrics
6979 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6980 */
6981message MediametricsDrmWidevineReported {
6982 optional int64 timestamp_nanos = 1;
6983 optional string package_name = 2;
6984 optional int64 package_version_code = 3;
6985 optional int64 media_apex_version = 4;
6986
6987 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6988}
6989
6990/**
6991 * Track information about recordings (e.g. camcorder)
6992 * Logged from
6993 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6994 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6995 */
6996message MediametricsRecorderReported {
6997 optional int64 timestamp_nanos = 1;
6998 optional string package_name = 2;
6999 optional int64 package_version_code = 3;
7000 optional int64 media_apex_version = 4;
7001
7002 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7003}
7004
7005/**
7006 * Track Media Player usage
7007 * Logged from:
7008 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7009 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7010 */
7011message MediametricsNuPlayerReported {
7012 optional int64 timestamp_nanos = 1;
7013 optional string package_name = 2;
7014 optional int64 package_version_code = 3;
7015 optional int64 media_apex_version = 4;
7016
7017 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7018}
7019
7020/**
Robert Shiha4beed32019-08-19 14:15:23 -07007021 * Track Legacy DRM usage
7022 * Logged from
7023 * frameworks/av/drm/drmserver/DrmManager.cpp
7024 */
7025message MediametricsDrmManagerReported {
7026 optional int64 timestamp_nanos = 1;
7027 optional string package_name = 2;
7028 optional int64 package_version_code = 3;
7029 optional int64 media_apex_version = 4;
7030
7031 enum Method {
7032 METHOD_NOT_FOUND = -1;
7033 GET_CONSTRAINTS = 0;
7034 GET_METADATA = 1;
7035 CAN_HANDLE = 2;
7036 PROCESS_DRM_INFO = 3;
7037 ACQUIRE_DRM_INFO = 4;
7038 SAVE_RIGHTS = 5;
7039 GET_ORIGINAL_MIME_TYPE = 6;
7040 GET_DRM_OBJECT_TYPE = 7;
7041 CHECK_RIGHTS_STATUS = 8;
7042 REMOVE_RIGHTS = 9;
7043 REMOVE_ALL_RIGHTS = 10;
7044 OPEN_CONVERT_SESSION = 11;
7045 OPEN_DECRYPT_SESSION = 12;
7046 }
7047
7048 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7049 optional string plugin_id = 5;
7050 optional string description = 6;
7051 optional Method method = 7;
7052 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007053
7054 optional int64 get_constraints_count = 9;
7055 optional int64 get_metadata_count = 10;
7056 optional int64 can_handle_count = 11;
7057 optional int64 process_drm_info_count = 12;
7058 optional int64 acquire_drm_info_count = 13;
7059 optional int64 save_rights_count = 14;
7060 optional int64 get_original_mime_type_count = 15;
7061 optional int64 get_drm_object_type_count = 16;
7062 optional int64 check_rights_status_count = 17;
7063 optional int64 remove_rights_count = 18;
7064 optional int64 remove_all_rights_count = 19;
7065 optional int64 open_convert_session_count = 20;
7066 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007067}
7068
7069/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007070 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007071 * Pulled from: StatsCompanionService
7072*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007073message DangerousPermissionState {
7074 // Name of the permission
7075 optional string permission_name = 1;
7076
7077 // Uid of the package
7078 optional int32 uid = 2 [(is_uid) = true];
7079
7080 // Package requesting the permission
7081 optional string package_name = 3;
7082
7083 // If the permission is granted to the uid
7084 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007085
7086 // Permission flags as per android.content.pm.PermissionFlags
7087 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007088}
7089
Michael Groover4a0ca942019-01-24 17:41:25 -08007090/**
7091 * Logs when a package is denied access to a device identifier based on the new access requirements.
7092 *
7093 * Logged from:
7094 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7095 */
7096message DeviceIdentifierAccessDenied {
7097 // The name of the package denied access to the requested device identifier.
7098 optional string package_name = 1;
7099
7100 // The name of the device identifier method the package attempted to invoke.
7101 optional string method_name = 2;
7102
7103 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007104 // Starting from Android 11, this boolean is not set and will always be false.
7105 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007106
7107 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007108 // Starting from Android 11, this boolean is not set and will always be false.
7109 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007110}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007111
7112/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007113 * Pulls the ongoing mainline install train version code.
7114 * Pulled from StatsCompanionService
7115 */
7116message TrainInfo {
7117 optional int64 train_version_code = 1;
7118
7119 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007120
7121 optional string train_name = 3;
7122
7123 enum Status {
7124 UNKNOWN = 0;
7125 INSTALL_REQUESTED = 1;
7126 INSTALL_STARTED = 2;
7127 INSTALL_STAGED_NOT_READY = 3;
7128 INSTALL_STAGED_READY = 4;
7129 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007130 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7131 // and INSTALL_FAILURE_COMMIT.
7132 INSTALL_FAILURE = 6 [deprecated = true];
7133 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007134 INSTALL_CANCELLED = 7;
7135 INSTALLER_ROLLBACK_REQUESTED = 8;
7136 INSTALLER_ROLLBACK_INITIATED = 9;
7137 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7138 INSTALLER_ROLLBACK_STAGED = 11;
7139 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7140 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7141 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7142 INSTALLER_ROLLBACK_SUCCESS = 15;
7143 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007144 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7145 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7146 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7147 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7148 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7149 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007150 INSTALL_FAILURE_DOWNLOAD = 23;
7151 INSTALL_FAILURE_STATE_MISMATCH = 24;
7152 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007153 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007154 }
7155 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007156}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007157
7158/**
7159 * Logs the gesture stage changed event.
7160 *
7161 * Logged from:
7162 * frameworks/base/packages/SystemUI/
7163 */
7164message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007165 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007166}
7167
7168/**
7169 * Logs the feedback type.
7170 *
7171 * Logged from:
7172 * frameworks/base/packages/SystemUI/
7173 */
7174message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007175 // Whether or not the gesture was used.
7176 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007177}
7178
7179/**
7180 * Logs the progress.
7181 *
7182 * Logged from:
7183 * frameworks/base/packages/SystemUI/
7184 */
7185message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007186 // [0,100] progress for the assist gesture.
7187 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007188}
Neil Fullerdb14b482019-02-05 19:44:44 +00007189
7190/*
7191 * Information about the time zone data on a device.
7192 */
7193message TimeZoneDataInfo {
7194 // A version identifier for the data set on device. e.g. "2018i"
7195 optional string tzdb_version = 1;
7196}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007197
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007198/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007199 * Logs the GPU stats global health information.
7200 *
7201 * Logged from:
7202 * frameworks/native/services/gpuservice/gpustats/
7203 */
7204message GpuStatsGlobalInfo {
7205 // Package name of the gpu driver.
7206 optional string driver_package_name = 1;
7207
7208 // Version name of the gpu driver.
7209 optional string driver_version_name = 2;
7210
7211 // Version code of the gpu driver.
7212 optional int64 driver_version_code = 3;
7213
7214 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7215 optional int64 driver_build_time = 4;
7216
7217 // Total count of the gl driver gets loaded.
7218 optional int64 gl_loading_count = 5;
7219
7220 // Total count of the gl driver fails to be loaded.
7221 optional int64 gl_loading_failure_count = 6;
7222
7223 // Total count of the Vulkan driver gets loaded.
7224 optional int64 vk_loading_count = 7;
7225
7226 // Total count of the Vulkan driver fails to be loaded.
7227 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007228
7229 // Api version of the system Vulkan driver.
7230 optional int32 vulkan_version = 9;
7231
7232 // Api version of the system CPU Vulkan driver.
7233 optional int32 cpu_vulkan_version = 10;
7234
7235 // Api version of the system GLES driver.
7236 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007237
7238 // Total count of the angle driver gets loaded.
7239 optional int64 angle_loading_count = 12;
7240
7241 // Total count of the angle driver fails to be loaded.
7242 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007243}
7244
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007245/**
7246 * GPU driver loading time info.
7247 */
7248message GpuDriverLoadingTime {
7249 // List of all the driver loading times for this app. The list size is
7250 // capped at 50.
7251 repeated int64 driver_loading_time = 1;
7252}
7253
7254/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007255 * Logs the GPU stats per app health information.
7256 *
7257 * Logged from:
7258 * frameworks/native/services/gpuservice/gpustats/
7259 */
7260message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007261 // Package name of the application that loads the gpu driver. Total number
7262 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007263 optional string app_package_name = 1;
7264
7265 // Version code of the gpu driver this app loads.
7266 optional int64 driver_version_code = 2;
7267
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007268 // gl driver loading time info.
7269 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7270 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007271
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007272 // Vulkan driver loading time info.
7273 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7274 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007275
7276 // Angle driver loading time info.
7277 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7278 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007279
7280 // CPU Vulkan implementation is in use.
7281 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007282
7283 // App is not doing pre-rotation correctly.
7284 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007285
7286 // App creates GLESv1 context.
7287 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007288}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007289
7290/*
7291 * Logs the size of the system ion heap.
7292 *
7293 * Pulled from StatsCompanionService.
7294 */
7295message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007296 // Deprecated due to limited support of ion stats in debugfs.
7297 // Use `IonHeapSize` instead.
7298 option deprecated = true;
7299
Rafal Slawikd4e87572019-03-12 13:08:38 +00007300 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007301 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007302 optional int64 size_in_bytes = 1;
7303}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007304
Rafal Slawik77987ed2019-06-17 12:28:23 +01007305/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007306 * Logs the total size of the ion heap.
7307 *
7308 * Pulled from StatsCompanionService.
7309 */
7310message IonHeapSize {
7311 // Total size of all ion heaps in kilobytes.
7312 // Read from: /sys/kernel/ion/total_heaps_kb.
7313 optional int32 total_size_kb = 1;
7314}
7315
7316/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007317 * Logs the per-process size of the system ion heap.
7318 *
7319 * Pulled from StatsCompanionService.
7320 */
7321message ProcessSystemIonHeapSize {
7322 // The uid if available. -1 means not available.
7323 optional int32 uid = 1 [(is_uid) = true];
7324
7325 // The process name (from /proc/PID/cmdline).
7326 optional string process_name = 2;
7327
7328 // Sum of sizes of all allocations.
7329 optional int32 total_size_in_kilobytes = 3;
7330
7331 // Number of allocations.
7332 optional int32 allocation_count = 4;
7333
7334 // Size of the largest allocation.
7335 optional int32 max_size_in_kilobytes = 5;
7336}
7337
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007338/**
7339 * Push network stack events.
7340 *
7341 * Log from:
7342 * frameworks/base/packages/NetworkStack/
7343 */
7344message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007345 // The id that indicates the event reported from NetworkStack.
7346 optional int32 event_id = 1;
7347 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007348 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7349}
Carmen Agimofa769c152019-03-04 14:39:14 +00007350
7351/**
7352 * Logs the apps that are installed on the external storage.
7353 * Pulled from:
7354 * StatsCompanionService
7355 */
7356message AppsOnExternalStorageInfo {
7357 // The type of the external storage.
7358 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7359 // The name of the package that is installed on the external storage.
7360 optional string package_name = 2;
7361}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007362
7363/**
7364 * Logs the settings related to Face.
7365 * Logged from:
7366 * frameworks/base/services/core/java/com/android/server/stats
7367 */
7368message FaceSettings {
7369 // Whether or not face unlock is allowed on Keyguard.
7370 optional bool unlock_keyguard_enabled = 1;
7371 // Whether or not face unlock dismisses the Keyguard.
7372 optional bool unlock_dismisses_keyguard = 2;
7373 // Whether or not face unlock requires attention.
7374 optional bool unlock_attention_required = 3;
7375 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7376 optional bool unlock_app_enabled = 4;
7377 // Whether or not face unlock always requires user confirmation.
7378 optional bool unlock_always_require_confirmation = 5;
7379 // Whether or not a diverse set of poses are required during enrollment.
7380 optional bool unlock_diversity_required = 6;
7381}
Maggie White442b6312019-04-05 16:26:44 -07007382
7383/**
7384 * Logs cooling devices maintained by the kernel.
7385 *
7386 * Pulled from StatsCompanionService.java
7387 */
7388message CoolingDevice {
7389 // The type of cooling device being reported. Eg. CPU, GPU...
7390 optional android.os.CoolingTypeEnum device_location = 1;
7391 // The name of the cooling device source. Eg. CPU0
7392 optional string device_name = 2;
7393 // Current throttle state of the cooling device. The value can any unsigned
7394 // integer between 0 and max_state defined in its driver. 0 means device is
7395 // not in throttling, higher value means deeper throttling.
7396 optional int32 state = 3;
7397}
Ben Blount763a5d52019-04-10 11:48:58 -07007398
7399/**
7400 * Intelligence has several counter-type events that don't warrant a
7401 * full separate atom. These are primarily API call counters but also include
7402 * counters for feature usage and specific failure modes.
7403 *
7404 * Logged from the Intelligence mainline module.
7405 */
7406message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007407 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007408 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007409 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007410 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007411 // How many times the event occured (to report a batch of high frequency events).
7412 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007413 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007414 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007415}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007416
7417/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007418 * Logs when Car Power state changed.
7419 *
7420 * Logged from:
7421 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7422 */
7423message CarPowerStateChanged {
7424 // States come from CpmsState in CarPowerManagementService.java.
7425 enum State {
7426 WAIT_FOR_VHAL = 0;
7427 ON = 1;
7428 SHUTDOWN_PREPARE = 2;
7429 WAIT_FOR_FINISH = 3;
7430 SUSPEND = 4;
7431 SIMULATE_SLEEP = 5;
7432 }
7433 optional State state = 1;
7434}
7435
7436/**
7437 * Logs whether GarageMode is entered.
7438 *
7439 * Logged from:
7440 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7441 */
7442message GarageModeInfo {
7443 // Whether GarageMode is entered.
7444 optional bool is_garage_mode = 1;
7445}
Martijn Coenencd95d462019-04-25 17:09:45 +02007446
7447/**
7448 * Historical app ops data per package.
7449 */
7450message AppOps {
7451 // Uid of the package requesting the op
7452 optional int32 uid = 1 [(is_uid) = true];
7453
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007454 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007455 optional string package_name = 2;
7456
7457 // operation id; maps to the OP_* constants in AppOpsManager.java
7458 optional int32 op_id = 3;
7459
7460 // The number of times the op was granted while the app was in the
7461 // foreground (only for trusted requests)
7462 optional int64 trusted_foreground_granted_count = 4;
7463
7464 // The number of times the op was granted while the app was in the
7465 // background (only for trusted requests)
7466 optional int64 trusted_background_granted_count = 5;
7467
7468 // The number of times the op was rejected while the app was in the
7469 // foreground (only for trusted requests)
7470 optional int64 trusted_foreground_rejected_count = 6;
7471
7472 // The number of times the op was rejected while the app was in the
7473 // background (only for trusted requests)
7474 optional int64 trusted_background_rejected_count = 7;
7475
7476 // For long-running operations, total duration of the operation
7477 // while the app was in the foreground (only for trusted requests)
7478 optional int64 trusted_foreground_duration_millis = 8;
7479
7480 // For long-running operations, total duration of the operation
7481 // while the app was in the background (only for trusted requests)
7482 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007483
7484 // Whether AppOps is guarded by Runtime permission
7485 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007486}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007487
7488/**
7489 * Location Manager API Usage information(e.g. API under usage,
7490 * API call's parameters).
7491 * Logged from:
7492 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7493 */
7494message LocationManagerApiUsageReported {
7495
7496 // Indicating if usage starts or usage ends.
7497 optional android.stats.location.UsageState state = 1;
7498
7499 // LocationManagerService's API in use.
7500 // We can identify which API from LocationManager is
7501 // invoking current LMS API by the combination of
7502 // API parameter(e.g. is_listener_null, is_intent_null,
7503 // is_location_request_null)
7504 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7505
7506 // Name of the package calling the API.
7507 optional string calling_package_name = 3;
7508
7509 // Type of the location provider.
7510 optional android.stats.location.ProviderType provider = 4;
7511
7512 // Quality of the location request
7513 optional android.stats.location.LocationRequestQuality quality = 5;
7514
7515 // The desired interval for active location updates, in milliseconds.
7516 // Bucketized to reduce cardinality.
7517 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7518
7519 // Minimum distance between location updates, in meters.
7520 // Bucketized to reduce cardinality.
7521 optional android.stats.location.SmallestDisplacementBucket
7522 bucketized_smallest_displacement = 7;
7523
7524 // The number of location updates.
7525 optional int64 num_updates = 8;
7526
7527 // The request expiration time, in millisecond since boot.
7528 // Bucketized to reduce cardinality.
7529 optional android.stats.location.ExpirationBucket
7530 bucketized_expire_in = 9;
7531
7532 // Type of Callback passed in for this API.
7533 optional android.stats.location.CallbackType callback_type = 10;
7534
7535 // The radius of the central point of the alert
7536 // region, in meters. Only for API REQUEST_GEOFENCE.
7537 // Bucketized to reduce cardinality.
7538 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7539
7540 // Activity Importance of API caller.
7541 // Categorized to 3 types that are interesting from location's perspective.
7542 optional android.stats.location.ActivityImportance activiy_importance = 12;
7543}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007544
7545/**
7546 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7547 */
7548message ReviewPermissionsFragmentResultReported {
7549 // unique value identifying a permission group change. A permission group change might result
7550 // in multiple of these atoms
7551 optional int64 change_id = 1;
7552
7553 // UID of package the permission belongs to
7554 optional int32 uid = 2 [(is_uid) = true];
7555
7556 // Name of package the permission belongs to
7557 optional string package_name = 3;
7558
7559 // The permission to be granted
7560 optional string permission_name = 4;
7561
7562 // The result of the permission grant
7563 optional bool permission_granted = 5;
7564}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007565
7566/**
7567* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7568* Logged from: RuntimePermissionUpdgradeController
7569*/
7570message RuntimePermissionsUpgradeResult {
7571 // Permission granted as result of upgrade
7572 optional string permission_name = 1;
7573
7574 // UID of package granted permission
7575 optional int32 uid = 2 [(is_uid) = true];
7576
7577 // Name of package granted permission
7578 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007579}
7580
7581/**
7582* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7583*/
7584message GrantPermissionsActivityButtonActions {
7585 // Permission granted as result of upgrade
7586 optional string permission_group_name = 1;
7587
7588 // UID of package granted permission
7589 optional int32 uid = 2 [(is_uid) = true];
7590
7591 // Name of package requesting permission
7592 optional string package_name = 3;
7593
7594 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7595 // LABEL_ constants in GrantPermissionActivity.java
7596 optional int32 buttons_presented = 4;
7597
7598 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7599 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007600
7601 // id which identifies single session of user interacting with permission controller
7602 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007603}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007604
7605/**
7606 * Information about LocationAccessCheck notification presented to user
7607 */
7608message LocationAccessCheckNotificationAction {
7609
7610 // id which identifies single session of user interacting with permission controller
7611 optional int64 session_id = 1;
7612
7613 // Uid of package for which location access check is presented
7614 optional int32 package_uid = 2;
7615
7616 // Name of package for which location access check is presented
7617 optional string package_name = 3;
7618
7619 enum Result {
7620 UNDEFINED = 0;
7621 // notification was presented to the user
7622 NOTIFICATION_PRESENTED = 1;
7623 // notification was declined by the user
7624 NOTIFICATION_DECLINED = 2;
7625 // notification was clicked by the user
7626 NOTIFICATION_CLICKED = 3;
7627 }
7628
7629 // View / interaction recorded
7630 optional Result result = 4;
7631}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007632
7633/**
7634 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7635 */
7636message AppPermissionFragmentActionReported {
7637 // id which identifies single session of user interacting with permission controller
7638 optional int64 session_id = 1;
7639
7640 // unique value identifying a permission group change. A permission group change might result
7641 // in multiple of these atoms
7642 optional int64 change_id = 2;
7643
7644 // UID of package the permission belongs to
7645 optional int32 uid = 3 [(is_uid) = true];
7646
7647 // Name of package the permission belongs to
7648 optional string package_name = 4;
7649
7650 // The permission to be granted
7651 optional string permission_name = 5;
7652
7653 // The result of the permission grant
7654 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007655
7656 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7657 optional int32 permission_flags = 7;
7658
7659 enum Button {
7660 UNDEFINED = 0;
7661 // Allow button
7662 ALLOW = 1;
7663 // Deny button
7664 DENY = 2;
7665 // Ask every time button
7666 ASK_EVERY_TIME = 3;
7667 // Allow all the time button
7668 ALLOW_ALWAYS = 4;
7669 // Allow only while using the app button
7670 ALLOW_FOREGROUND = 5;
7671 // Same is Deny button but shown in while in use dialog
7672 DENY_FOREGROUND = 6;
7673 }
7674
7675 // Button pressed in the dialog
7676 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007677}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007678
7679/**
7680* Information about a AppPermissionFragment viewed by user
7681*/
7682message AppPermissionFragmentViewed {
7683 // id which identifies single session of user interacting with permission controller
7684 optional int64 session_id = 1;
7685
7686 // UID of package for which permissions are viewed
7687 optional int32 uid = 2 [(is_uid) = true];
7688
7689 // Name of package for which permissions are viewed
7690 optional string package_name = 3;
7691
7692 // Permission group viewed
7693 optional string permission_group_name = 4;
7694}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007695
7696/**
7697* Information about a AppPermissionsFragment viewed by user
7698*/
7699message AppPermissionsFragmentViewed {
7700 // id which identifies single session of user interacting with permission controller
7701 optional int64 session_id = 1;
7702
7703 // id which identifies single view as every view might have several logging records
7704 // with different package information attached
7705 optional int64 view_id = 2;
7706
7707 // Permission group viewed
7708 optional string permission_group_name = 3;
7709
7710 // UID of package for which permissions are viewed
7711 optional int32 uid = 4 [(is_uid) = true];
7712
7713 // Name of package for which permissions are viewed
7714 optional string package_name = 5;
7715
7716 // Category in which permission is included
7717 enum Category {
7718 UNDEFINED = 0;
7719 ALLOWED = 1;
7720 ALLOWED_FOREGROUND = 2;
7721 DENIED = 3;
7722 }
7723 optional Category category = 6;
7724}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007725
7726/**
7727* Information about a PermissionAppsFragment viewed by user.
7728* Logged from ui/handheld/PermissionAppsFragment.java
7729*/
7730message PermissionAppsFragmentViewed {
7731 // id which identifies single session of user interacting with permission controller
7732 optional int64 session_id = 1;
7733
7734 // id which identifies single view as every view might have several logging records
7735 // with different package information attached
7736 optional int64 view_id = 2;
7737
7738 // Permission group viewed
7739 optional string permission_group_name = 3;
7740
7741 // UID of package for which permissions are viewed
7742 optional int32 uid = 4 [(is_uid) = true];
7743
7744 // Name of package for which permissions are viewed
7745 optional string package_name = 5;
7746
7747 // Category in which app is included
7748 enum Category {
7749 UNDEFINED = 0;
7750 ALLOWED = 1;
7751 ALLOWED_FOREGROUND = 2;
7752 DENIED = 3;
7753 }
7754 optional Category category = 6;
7755}
Tony Make2b1b672019-07-29 16:59:47 +01007756
7757/**
7758 * Logs when there is a smart selection related event.
7759 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7760 * Logged from: TextClassifierEventLogger.java
7761 */
7762message TextSelectionEvent {
7763 // A session ID.
7764 optional string session_id = 1;
7765
7766 // Event type of this event.
7767 optional android.stats.textclassifier.EventType event_type = 2;
7768
Tony Mak9c84bd22019-12-09 07:27:25 +00007769 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007770 optional string model_name = 3;
7771
7772 // Type of widget that was involved in triggering this event.
7773 optional android.stats.textclassifier.WidgetType widget_type = 4;
7774
7775 // Index of this event in a session.
7776 optional int32 event_index = 5;
7777
7778 // Entity type that is involved.
7779 optional string entity_type = 6;
7780
7781 // Relative word index of the start of the selection.
7782 optional int32 relative_word_start_index = 7;
7783
7784 // Relative word (exclusive) index of the end of the selection.
7785 optional int32 relative_word_end_index = 8;
7786
7787 // Relative word index of the start of the smart selection.
7788 optional int32 relative_suggested_word_start_index = 9;
7789
7790 // Relative word (exclusive) index of the end of the smart selection.
7791 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007792
7793 // Name of source package.
7794 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007795}
7796
7797/**
7798 * Logs when there is a smart linkify related event.
7799 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7800 * Logged from: TextClassifierEventLogger.java
7801 */
7802message TextLinkifyEvent {
7803 // A session ID.
7804 optional string session_id = 1;
7805
7806 // Event type of this event.
7807 optional android.stats.textclassifier.EventType event_type = 2;
7808
Tony Mak9c84bd22019-12-09 07:27:25 +00007809 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007810 optional string model_name = 3;
7811
7812 // Type of widget that was involved in triggering this event.
7813 optional android.stats.textclassifier.WidgetType widget_type = 4;
7814
7815 // Index of this event in a session.
7816 optional int32 event_index = 5;
7817
7818 // Entity type that is involved.
7819 optional string entity_type = 6;
7820
7821 // Number of links detected.
7822 optional int32 num_links = 7;
7823
7824 // The total length of all links.
7825 optional int32 linked_text_length = 8;
7826
7827 // Length of input text.
7828 optional int32 text_length = 9;
7829
7830 // Time spent on generating links in ms.
7831 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007832
7833 // Name of source package.
7834 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007835}
7836
7837/**
7838 * Logs when there is a conversation actions related event.
7839 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7840 * Logged from: TextClassifierEventLogger.java
7841 */
7842message ConversationActionsEvent {
7843 // A session ID.
7844 optional string session_id = 1;
7845
7846 // Event type of this event.
7847 optional android.stats.textclassifier.EventType event_type = 2;
7848
Tony Mak9c84bd22019-12-09 07:27:25 +00007849 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007850 optional string model_name = 3;
7851
7852 // Type of widget that was involved in triggering this event.
7853 optional android.stats.textclassifier.WidgetType widget_type = 4;
7854
7855 // The first entity type that is involved.
7856 optional string first_entity_type = 5;
7857
7858 // The second entity type that is involved.
7859 optional string second_entity_type = 6;
7860
7861 // The third entity type that is involved.
7862 optional string third_entity_type = 7;
7863
7864 // The score of the first entity type.
7865 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007866
7867 // Name of source package.
7868 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007869
7870 // Name of the annotator model that is involved in this event.
7871 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007872}
7873
7874/**
7875 * Logs when there is a language detection related event.
7876 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7877 * Logged from: TextClassifierEventLogger.java
7878 */
7879message LanguageDetectionEvent {
7880 // A session ID.
7881 optional string session_id = 1;
7882
7883 // Event type of this event.
7884 optional android.stats.textclassifier.EventType event_type = 2;
7885
Tony Mak9c84bd22019-12-09 07:27:25 +00007886 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007887 optional string model_name = 3;
7888
7889 // Type of widget that was involved in triggering this event.
7890 optional android.stats.textclassifier.WidgetType widget_type = 4;
7891
7892 // Detected language.
7893 optional string language_tag = 5;
7894
7895 // Score of the detected language.
7896 optional float score = 6;
7897
7898 // Position of this action.
7899 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007900
7901 // Name of source package.
7902 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007903}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007904
7905/**
7906 * Information about an OTA update attempt by update_engine.
7907 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7908 */
7909message UpdateEngineUpdateAttemptReported {
7910 // The number of attempts for the update engine to apply a given payload.
7911 optional int32 attempt_number = 1;
7912
7913 optional android.stats.otaupdate.PayloadType payload_type = 2;
7914
7915 // The total time in minutes for the update engine to apply a given payload.
7916 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7917 // it's increased when the system is sleeping.
7918 optional int32 duration_boottime_in_minutes = 3;
7919
7920 // The total time in minutes for the update engine to apply a given payload.
7921 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7922 // and it's not increased when the system is sleeping.
7923 optional int32 duration_monotonic_in_minutes = 4;
7924
7925 // The size of the payload in MiBs.
7926 optional int32 payload_size_mib = 5;
7927
7928 // The attempt result reported by the update engine for an OTA update.
7929 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7930
7931 // The error code reported by the update engine after an OTA update attempt
7932 // on A/B devices.
7933 optional android.stats.otaupdate.ErrorCode error_code = 7;
7934
7935 // The build fingerprint of the source system. The value is read from a
7936 // system property when the device takes the update. e.g.
7937 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7938 optional string source_fingerprint = 8;
7939}
7940
7941/**
7942 * Information about all the attempts the device make before finishing the
7943 * successful update.
7944 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7945 */
7946message UpdateEngineSuccessfulUpdateReported {
7947 // The number of attempts for the update engine to apply the payload for a
7948 // successful update.
7949 optional int32 attempt_count = 1;
7950
7951 optional android.stats.otaupdate.PayloadType payload_type = 2;
7952
7953 optional int32 payload_size_mib = 3;
7954
7955 // The total number of bytes downloaded by update_engine since the last
7956 // successful update.
7957 optional int32 total_bytes_downloaded_mib = 4;
7958
7959 // The ratio in percentage of the over-downloaded bytes compared to the
7960 // total bytes needed to successfully install the update. e.g. 200 if we
7961 // download 200MiB in total for a 100MiB package.
7962 optional int32 download_overhead_percentage = 5;
7963
7964 // The total time in minutes for the update engine to apply the payload for a
7965 // successful update.
7966 optional int32 total_duration_minutes = 6;
7967
7968 // The number of reboot of the device during a successful update.
7969 optional int32 reboot_count = 7;
7970}
Alec Mourie088e762019-07-02 13:10:55 -07007971
7972/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007973 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7974 * key to indicate whether it was successful or not.
7975 *
7976 * Logged from:
7977 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7978 */
7979message RebootEscrowRecoveryReported {
7980 optional bool successful = 1;
7981}
7982
7983/**
Alec Mourie088e762019-07-02 13:10:55 -07007984 * Global display pipeline metrics reported by SurfaceFlinger.
7985 * Pulled from:
7986 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7987 */
7988message SurfaceflingerStatsGlobalInfo {
7989 // Total number of frames presented during the tracing period
7990 optional int64 total_frames = 1;
7991 // Total number of frames missed
7992 optional int64 missed_frames = 2;
7993 // Total number of frames that fell back to client composition
7994 optional int64 client_composition_frames = 3;
7995 // Total time the display was turned on
7996 optional int64 display_on_millis = 4;
7997 // Total time that was spent performing animations.
7998 // This is derived from the present-to-present layer histogram
7999 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008000 // Total number of event connections tracked by SurfaceFlinger at the time
8001 // of this pull. If this number grows prohibitively large, then this can
8002 // cause jank due to resource contention.
8003 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008004 // Set of timings measured from when SurfaceFlinger began compositing a
8005 // frame, until the frame was requested to be presented to the display. This
8006 // measures SurfaceFlinger's total CPU walltime on the critical path per
8007 // frame.
8008 optional FrameTimingHistogram frame_duration = 7
8009 [(android.os.statsd.log_mode) = MODE_BYTES];
8010 // Set of timings measured from when SurfaceFlinger first began using the
8011 // GPU to composite a frame, until the GPU has finished compositing that
8012 // frame. This measures the total additional time SurfaceFlinger needed to
8013 // perform due to falling back into GPU composition.
8014 optional FrameTimingHistogram render_engine_timing = 8
8015 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008016}
8017
8018/**
8019 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8020 * The number of layers uploaded will be restricted due to size limitations.
8021 * Pulled from:
8022 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8023 */
8024message SurfaceflingerStatsLayerInfo {
8025 // The layer for this set of metrics
8026 // For now we can infer that the package name is included in the layer
8027 // name.
8028 optional string layer_name = 1;
8029 // Total number of frames presented
8030 optional int64 total_frames = 2;
8031 // Total number of dropped frames while latching a buffer for this layer.
8032 optional int64 dropped_frames = 3;
8033 // Set of timings measured between successive presentation timestamps.
8034 optional FrameTimingHistogram present_to_present = 4
8035 [(android.os.statsd.log_mode) = MODE_BYTES];
8036 // Set of timings measured from when an app queued a buffer for
8037 // presentation, until the buffer was actually presented to the
8038 // display.
8039 optional FrameTimingHistogram post_to_present = 5
8040 [(android.os.statsd.log_mode) = MODE_BYTES];
8041 // Set of timings measured from when a buffer is ready to be presented,
8042 // until the buffer was actually presented to the display.
8043 optional FrameTimingHistogram acquire_to_present = 6
8044 [(android.os.statsd.log_mode) = MODE_BYTES];
8045 // Set of timings measured from when a buffer was latched by
8046 // SurfaceFlinger, until the buffer was presented to the display
8047 optional FrameTimingHistogram latch_to_present = 7
8048 [(android.os.statsd.log_mode) = MODE_BYTES];
8049 // Set of timings measured from the desired presentation to the actual
8050 // presentation time
8051 optional FrameTimingHistogram desired_to_present = 8
8052 [(android.os.statsd.log_mode) = MODE_BYTES];
8053 // Set of timings measured from when an app queued a buffer for
8054 // presentation, until the buffer was ready to be presented.
8055 optional FrameTimingHistogram post_to_acquire = 9
8056 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008057 // Frames missed latch because the acquire fence didn't fire
8058 optional int64 late_acquire_frames = 10;
8059 // Frames latched early because the desired present time was bad
8060 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008061}
8062
8063/**
8064 * Histogram of frame counts bucketed by time in milliseconds.
8065 * Because of size limitations, we hard-cap the number of buckets, with
8066 * buckets for corresponding to larger milliseconds being less precise.
8067 */
8068message FrameTimingHistogram {
8069 // Timings in milliseconds that describes a set of histogram buckets
8070 repeated int32 time_millis_buckets = 1;
8071 // Number of frames that match to each time_millis, i.e. the bucket
8072 // contents
8073 // It's required that len(time_millis) == len(frame_count)
8074 repeated int64 frame_counts = 2;
8075}
Emilian Peev6729f372019-08-29 09:14:09 -07008076
Emilian Peev6729f372019-08-29 09:14:09 -07008077/**
8078 * Information about camera facing and API level usage.
8079 * Logged from:
8080 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8081 */
8082message CameraActionEvent {
8083 // Camera session duration
8084 optional int64 duration = 1;
8085
8086 // Camera API level used
8087 optional int32 api_level = 2;
8088
8089 // Name of client package
8090 optional string package_name = 3;
8091
8092 // Camera facing
8093 enum Facing {
8094 UNKNOWN = 0;
8095 BACK = 1;
8096 FRONT = 2;
8097 EXTERNAL = 3;
8098 }
8099 optional Facing facing = 4;
8100}
atrost01a20932019-08-28 15:40:37 +01008101
8102/**
8103 * Logs when a compatibility change is affecting an app.
8104 *
8105 * Logged from:
8106 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8107 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8108 */
8109message AppCompatibilityChangeReported {
8110 // The UID of the app being affected by the compatibilty change.
8111 optional int32 uid = 1 [(is_uid) = true];
8112
8113 // The ID of the change affecting the app.
8114 optional int64 change_id = 2;
8115
8116 enum State {
8117 UNKNOWN_STATE = 0;
8118 ENABLED = 1;
8119 DISABLED = 2;
8120 LOGGED = 3;
8121 }
8122
8123 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8124 // logged otherwise.
8125 optional State state = 3;
8126
8127 enum Source {
8128 UNKNOWN_SOURCE = 0;
8129 APP_PROCESS = 1;
8130 SYSTEM_SERVER = 2;
8131 }
8132
8133 // Where it was logged from.
8134 optional Source source = 4;
8135
8136}
Hector Dearman40579f62019-11-01 13:19:30 +00008137
8138/**
8139 * Logged from
8140 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8141 */
8142message PerfettoUploaded {
8143 enum Event {
8144 PERFETTO_UNDEFINED = 0;
8145 PERFETTO_TRACE_BEGIN = 1;
8146 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8147 PERFETTO_ON_CONNECT = 3;
8148 PERFETTO_ON_TRACING_DISABLED = 4;
8149 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8150 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8151 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8152 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8153 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8154 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8155 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8156 PERFETTO_TRIGGER_BEGIN = 12;
8157 PERFETTO_TRIGGER_SUCCESS = 13;
8158 PERFETTO_TRIGGER_FAILURE = 14;
8159 PERFETTO_HIT_GUARDRAILS = 15;
8160 PERFETTO_ON_TIMEOUT = 16;
8161 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8162 }
8163
8164 // Which stage of the pipeline we are reporting from.
8165 optional Event event = 1;
8166
8167 // UUID matching the one set inside the SystemInfo trace packet.
8168 optional int64 trace_uuid_lsb = 2;
8169 optional int64 trace_uuid_msb = 3;
8170}
Mark Tabrya824a642019-11-05 12:26:12 -08008171
8172/**
8173 * Pulls client metrics on data transferred via Vehicle Maps Service.
8174 * Metrics are keyed by uid + layer.
8175 *
8176 * Pulled from:
8177 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8178 */
8179message VmsClientStats {
8180 // UID of the VMS client app
8181 optional int32 uid = 1 [(is_uid) = true];
8182
8183 // VMS layer definition
8184 optional int32 layer_type = 2;
8185 optional int32 layer_channel = 3;
8186 optional int32 layer_version = 4;
8187
8188 // Bytes and packets sent by the client for the layer
8189 optional int64 tx_bytes = 5;
8190 optional int64 tx_packets = 6;
8191
8192 // Bytes and packets received by the client for the layer
8193 optional int64 rx_bytes = 7;
8194 optional int64 rx_packets = 8;
8195
8196 // Bytes and packets dropped due to client error
8197 optional int64 dropped_bytes = 9;
8198 optional int64 dropped_packets = 10;
8199}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008200
8201/**
8202 * State of a dangerous permission requested by a package - sampled
8203 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8204*/
8205message DangerousPermissionStateSampled {
8206 // Name of the permission
8207 optional string permission_name = 1;
8208
8209 // Uid of the package
8210 optional int32 uid = 2 [(is_uid) = true];
8211
8212 // If the permission is granted to the uid
8213 optional bool is_granted = 3;
8214
8215 // Permission flags as per android.content.pm.PermissionFlags
8216 optional int32 permission_flags = 4;
8217}
8218
Stan Iliev637ba5e2019-08-16 13:43:08 -04008219/**
8220 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8221 */
8222enum PipelineType {
8223 GL = 0;
8224 VULKAN = 1;
8225}
8226
8227/**
8228 * HWUI stats for a given app.
8229 */
8230message GraphicsStats {
8231 // The package name of the app
8232 optional string package_name = 1;
8233
8234 // The version code of the app
8235 optional int64 version_code = 2;
8236
8237 // The start & end timestamps in UTC as
8238 // milliseconds since January 1, 1970
8239 // Compatible with java.util.Date#setTime()
8240 optional int64 stats_start = 3;
8241
8242 optional int64 stats_end = 4;
8243
8244 // HWUI renders pipeline type: GL or Vulkan.
8245 optional PipelineType pipeline = 5;
8246
8247 // Distinct frame count.
8248 optional int32 total_frames = 6;
8249
8250 // Number of "missed vsync" events.
8251 optional int32 missed_vsync_count = 7;
8252
8253 // Number of frames in triple-buffering scenario (high input latency)
8254 optional int32 high_input_latency_count = 8;
8255
8256 // Number of "slow UI thread" events.
8257 optional int32 slow_ui_thread_count = 9;
8258
8259 // Number of "slow bitmap upload" events.
8260 optional int32 slow_bitmap_upload_count = 10;
8261
8262 // Number of "slow draw" events.
8263 optional int32 slow_draw_count = 11;
8264
8265 // Number of frames that missed their deadline (aka, visibly janked)
8266 optional int32 missed_deadline_count = 12;
8267
8268 // The frame time histogram for the package
8269 optional FrameTimingHistogram cpu_histogram = 13
8270 [(android.os.statsd.log_mode) = MODE_BYTES];
8271
8272 // The gpu frame time histogram for the package
8273 optional FrameTimingHistogram gpu_histogram = 14
8274 [(android.os.statsd.log_mode) = MODE_BYTES];
8275
8276 // UI mainline module version.
8277 optional int64 version_ui_module = 15;
8278
8279 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8280 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8281 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8282 // more apps are running / rendering.
8283 optional bool is_today = 16;
8284}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008285
8286/**
8287 * Message related to dangerous (runtime) app ops access
8288 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008289message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008290 // Uid of the package accessing app op
8291 optional int32 uid = 1 [(is_uid) = true];
8292
8293 // Name of the package accessing app op
8294 optional string package_name = 2;
8295
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008296 // operation string id per OPSTR_ constants in AppOpsManager.java
8297 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008298
8299 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8300 // Features must be provided through manifest using <feature> tag available in R and above.
8301 optional string feature_id = 4;
8302
8303 // message related to app op access, limited to 600 chars by API
8304 optional string message = 5;
8305
8306 enum SamplingStrategy {
8307 DEFAULT = 0;
8308 UNIFORM = 1;
8309 RARELY_USED = 2;
8310 }
8311
8312 // sampling strategy used to collect this message
8313 optional SamplingStrategy sampling_strategy = 6;
8314}
8315
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008316/*
8317 * Logs userspace reboot outcome and duration.
8318 *
8319 * Logged from:
8320 * frameworks/base/core/java/com/android/server/BootReceiver.java
8321 */
8322message UserspaceRebootReported {
8323 // Possible outcomes of userspace reboot.
8324 enum Outcome {
8325 // Default value in case platform failed to determine the outcome.
8326 OUTCOME_UNKNOWN = 0;
8327 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8328 SUCCESS = 1;
8329 // Userspace reboot shutdown sequence was aborted.
8330 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8331 // Remounting userdata into checkpointing mode failed.
8332 FAILED_USERDATA_REMOUNT = 3;
8333 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8334 // reboot.
8335 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8336 }
8337 // Outcome of userspace reboot. Always set.
8338 optional Outcome outcome = 1;
8339 // Duration of userspace reboot in case it has a successful outcome.
8340 // Duration is measured as time between userspace reboot was initiated and until boot completed
8341 // (e.g. sys.boot_completed=1).
8342 optional int64 duration_millis = 2;
8343 // State of primary user's (user0) credential encryption storage.
8344 enum UserEncryptionState {
8345 // Default value.
8346 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8347 // Credential encrypted storage is unlocked.
8348 UNLOCKED = 1;
8349 // Credential encrypted storage is locked.
8350 LOCKED = 2;
8351 }
8352 // State of primary user's encryption storage at the moment boot completed. Always set.
8353 optional UserEncryptionState user_encryption_state = 3;
8354}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008355
8356/*
8357 * Logs integrity check information during each install.
8358 *
8359 * Logged from:
8360 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8361 */
8362message IntegrityCheckResultReported {
8363 optional string package_name = 1;
8364 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008365 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008366 optional string installer_package_name = 4;
8367 enum Response {
8368 UNKNOWN = 0;
8369 ALLOWED = 1;
8370 REJECTED = 2;
8371 FORCE_ALLOWED = 3;
8372 }
8373 optional Response response = 5;
8374 // An estimate on the cause of the response. This will only be populated for
8375 // REJECTED and FORCE_ALLOWED
8376 optional bool caused_by_app_cert_rule = 6;
8377 optional bool caused_by_installer_rule = 7;
8378}
8379
8380/**
8381 * Logs the information about the rules and the provider whenever rules are
8382 * pushed into AppIntegrityManager.
8383 *
8384 * Logged from:
8385 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8386 */
8387message IntegrityRulesPushed {
8388 optional bool success = 1;
8389 // Package name of the app that pushed the rules.
8390 optional string rule_provider = 2;
8391 // Version string of arbitrary format provided by the rule provider to
8392 // identify the rules.
8393 optional string rule_version = 3;
8394}
Jordan Liubedfa702019-12-20 15:08:45 -08008395
8396/**
8397 * Logs when a cell broadcast message is received on the device.
8398 *
8399 * Logged from CellBroadcastService module:
8400 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8401 */
8402message CellBroadcastMessageReported {
8403 // The type of Cell Broadcast message
8404 enum CbType {
8405 UNKNOWN_TYPE = 0;
8406 GSM = 1;
8407 CDMA = 2;
8408 CDMA_SPC = 3;
8409 }
8410
8411 // GSM, CDMA, CDMA-SCP
8412 optional CbType type = 1;
8413}
8414
8415/**
8416 * Logs when an error occurs while handling a cell broadcast message;
8417 *
8418 * Logged from CellBroadcastService module:
8419 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8420 */
8421message CellBroadcastMessageError {
8422 // The type of error raised when trying to handle a cell broadcast message
8423 enum ErrorType {
8424 UNKNOWN_TYPE = 0;
8425 CDMA_DECODING_ERROR = 1;
8426 CDMA_SCP_EMPTY = 2;
8427 CDMA_SCP_HANDLING_ERROR = 3;
8428 GSM_INVALID_HEADER_LENGTH = 4;
8429 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8430 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8431 GSM_INVALID_PDU = 7;
8432 GSM_INVALID_GEO_FENCING_DATA = 8;
8433 GSM_UMTS_INVALID_WAC = 9;
8434 FAILED_TO_INSERT_TO_DB = 10;
8435 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8436 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8437 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8438 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8439 }
8440
8441 // What kind of error occurred
8442 optional ErrorType type = 1;
8443
8444 // Exception message (or log message) associated with the error (max 1000 chars)
8445 optional string exception_message = 2;
8446}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008447
8448/**
8449 * Logs when the SDK Extensions test app has polled the current version.
8450 * This is atom ID 354.
8451 *
8452 * Logged from:
8453 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8454 */
8455message SdkExtensionStatus {
8456 enum ApiCallStatus {
8457 CALL_NOT_ATTEMPTED = 0;
8458 CALL_SUCCESSFUL = 1;
8459 CALL_FAILED = 2;
8460 }
8461
8462 optional ApiCallStatus result = 1;
8463
8464 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8465 optional int32 r_extension_version = 2;
8466
8467 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8468 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8469 optional int32 failed_call_symbol = 3;
8470}
Marco Ballesio497aff42020-01-24 08:39:42 -08008471
8472/**
8473 * Logs when an app is frozen or unfrozen.
8474 *
8475 * Logged from:
8476 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8477 */
8478message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008479 // The type of event.
8480 enum Action {
8481 UNKNOWN = 0;
8482 FREEZE_APP = 1;
8483 UNFREEZE_APP = 2;
8484 }
8485 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008486
Blake Kragten6ce382a2020-01-16 20:20:46 -08008487 // Pid of the process being frozen.
8488 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008489
Blake Kragten6ce382a2020-01-16 20:20:46 -08008490 // Name of the process being frozen.
8491 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008492
Blake Kragten6ce382a2020-01-16 20:20:46 -08008493 // Time since last unfrozen.
8494 optional int64 time_unfrozen_millis = 4;
8495}
8496
8497/**
8498 * Logs gnss stats from location service provider
8499 *
8500 * Pulled from:
8501 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8502 */
8503
8504message GnssStats {
8505 // Number of location reports since boot
8506 optional int64 location_reports = 1;
8507
8508 // Total pulled reports of Location failures since boot
8509 optional int64 location_failure_reports = 2;
8510
8511 // Number of time to first fix reports since boot
8512 optional int64 time_to_first_fix_reports = 3;
8513
8514 // Total pulled reported time to first fix (in milli-seconds) since boot
8515 optional int64 time_to_first_fix_milli_s = 4;
8516
8517 // Number of position accuracy reports since boot
8518 optional int64 position_accuracy_reports = 5;
8519
8520 // Total pulled reported position accuracy (in meters) since boot
8521 optional int64 position_accuracy_meters = 6;
8522
8523 // Number of top 4 average CN0 reports since boot
8524 optional int64 top_four_average_cn0_reports = 7;
8525
8526 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8527 optional int64 top_four_average_cn0_db_mhz = 8;
8528
8529 // Number of l5 top 4 average CN0 reports since boot
8530 optional int64 l5_top_four_average_cn0_reports = 9;
8531
8532 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8533 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8534
8535 // Total number of sv status messages reports since boot
8536 optional int64 sv_status_reports = 11;
8537
8538 // Total number of sv status messages reports, where sv is used in fix since boot
8539 optional int64 sv_status_reports_used_in_fix = 12;
8540
8541 // Total number of L5 sv status messages reports since boot
8542 optional int64 l5_sv_status_reports = 13;
8543
8544 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8545 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008546}