blob: 6e80ffd1d9db7873676ee1fa8f953730a86d8c70 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080081 BleScanStateChanged ble_scan_state_changed = 2 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080082 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080083 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080084 SensorStateChanged sensor_state_changed = 5 [(module) = "framework"];
85 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
86 SyncStateChanged sync_state_changed = 7 [(module) = "framework"];
87 ScheduledJobStateChanged scheduled_job_state_changed = 8 [(module) = "framework"];
88 ScreenBrightnessChanged screen_brightness_changed = 9 [(module) = "framework"];
89 WakelockStateChanged wakelock_state_changed = 10 [(module) = "framework"];
90 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
91 11 [(module) = "framework"];
92 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
93 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
94 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
95 14 [(module) = "framework"];
96 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
97 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
98 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
99 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800100 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800101 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20 [(module) = "framework"];
102 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
103 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
104 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
105 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
106 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
107 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
108 UidProcessStateChanged uid_process_state_changed = 27 [(module) = "framework"];
109 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28 [(module) = "framework"];
110 ScreenStateChanged screen_state_changed = 29 [(module) = "framework"];
111 BatteryLevelChanged battery_level_changed = 30 [(module) = "framework"];
112 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
113 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
114 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800115 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800116 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
117 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800118 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
119 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
120 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
122 SettingChanged setting_changed = 41 [(module) = "framework"];
123 ActivityForegroundStateChanged activity_foreground_state_changed =
124 42 [(module) = "framework"];
125 IsolatedUidChanged isolated_uid_changed = 43 [(module) = "framework"];
126 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
127 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Bookatz8fcd09a2017-12-18 13:01:10 -0800128 AnomalyDetected anomaly_detected = 46;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800129 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800130 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800131 AppStartOccurred app_start_occurred = 48 [(module) = "framework"];
132 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
133 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800134 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800136 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800137 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800138 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
139 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800140 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000141 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 OverlayStateChanged overlay_state_changed = 59 [(module) = "framework"];
143 ForegroundServiceStateChanged foreground_service_state_changed
144 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800145 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800146 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
147 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
148 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 AppDied app_died = 65 [(module) = "framework"];
150 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
151 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800152 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
153 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
155 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800156 SpeakerImpedanceReported speaker_impedance_reported = 71;
157 HardwareFailed hardware_failed = 72;
158 PhysicalDropDetected physical_drop_detected = 73;
159 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800160 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
161 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800162 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
163 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework"];
164 ANROccurred anr_occurred = 79 [(module) = "framework"];
165 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
166 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700167 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800168 KeyValuePairsAtom key_value_pairs_atom =
169 83 [(allow_from_any_uid) = true, (module) = "framework"];
170 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
171 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700172 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
174 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
175 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
176 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700177 BatteryHealthSnapshot battery_health_snapshot = 91;
178 SlowIo slow_io = 92;
179 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
181 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100182 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800183 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700185 // TODO: service state change is very noisy shortly after boot, as well
186 // as at other transitions - coming out of doze, device plugged in, etc.
187 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800188 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
189 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
190 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800191 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800192 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800193 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
194 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
195 105 [(module) = "docsui"];
196 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
197 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
198 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
199 108 [(module) = "docsui"];
200 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
201 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
202 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800205 WifiRunningStateChanged wifi_running_state_changed = 114
206 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800207 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800210 117 [(module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
214 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
216 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
217 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
219 125 [(module) = "bluetooth"];
220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
221 126 [(module) = "bluetooth"];
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
223 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800224 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
228 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800230 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
231 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
232 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
234 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800236 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
237 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
239 142 [(module) = "framework"];
240 AttentionManagerServiceResultReported attention_manager_service_result_reported =
241 143 [(module) = "framework"];
242 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800243 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800244 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
245 WatchdogRollbackOccurred watchdog_rollback_occurred = 147 [(module) = "framework"];
246 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
247 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800248 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800249 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
250 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800251 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
252 151 [(module) = "bluetooth"];
253 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
254 152 [(module) = "bluetooth"];
255 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
256 153 [(module) = "bluetooth"];
257 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
258 154 [(module) = "bluetooth"];
259 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
260 155 [(module) = "bluetooth"];
261 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
262 156 [(module) = "bluetooth"];
263 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
264 157 [(module) = "bluetooth"];
265 BluetoothDeviceFailedContactCounterReported
266 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
267 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
268 159 [(module) = "bluetooth"];
269 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
270 160 [(module) = "bluetooth"];
271 BluetoothQualityReportReported bluetooth_quality_report_reported =
272 161 [(module) = "bluetooth"];
273 BluetoothDeviceInfoReported bluetooth_device_info_reported =
274 162 [(module) = "bluetooth"];
275 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
276 163 [(module) = "bluetooth"];
277 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
278 164 [(module) = "bluetooth"];
279 BluetoothBondStateChanged bluetooth_bond_state_changed =
280 165 [(module) = "bluetooth"];
281 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
282 166 [(module) = "bluetooth"];
283 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
284 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800285 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
286 168 [(module) = "framework"];
287 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700288 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800289 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800290 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800291 DeviceIdentifierAccessDenied device_identifier_access_denied =
292 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800293 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800294 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
295 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
296 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800297 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
298 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800299 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700300 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800301 180 [(module) = "permissioncontroller"];
302 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
303 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
306 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
307 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
308 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800309 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
310 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700311 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800312 188 [(module) = "intelligence"];
313 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
314 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800315 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800316 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800317 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
318 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
319 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
320 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
321 MediametricsCodecReported mediametrics_codec_reported = 195;
322 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
323 MediametricsExtractorReported mediametrics_extractor_reported = 197;
324 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
325 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
326 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700327 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800328 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
329 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800330 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800331 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
332 206 [(module) = "framework"];
333 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
334 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
335 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
336 LocationManagerApiUsageReported location_manager_api_usage_reported =
337 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100338 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800339 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100340 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800341 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100342 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800343 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100344 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800345 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100346 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800347 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100348 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800349 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100350 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100352 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800354 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
355 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
356 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
357 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800359 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700360 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
361 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100363 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800365 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800366 VmsClientConnectionStateChanged vms_client_connection_state_changed =
367 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800368 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
369 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700370 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 235 [(module) = "mediaprovider"];
372 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700373 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800374 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
376 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
377 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
378 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800379 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800380 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000381 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800382 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman079fdaa2020-01-12 16:45:03 -0500383 NotificationPanelReported notification_panel_reported = 245;
Will Brockman492be332020-02-12 16:46:04 -0500384 NotificationChannelModified notification_channel_modified = 246;
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800385 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
386 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800387 CellBroadcastMessageReported cb_message_reported =
388 249 [(module) = "cellbroadcast"];
389 CellBroadcastMessageError cb_message_error =
390 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700391 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
392 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
393 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800394 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000395 SnapshotMergeReported snapshot_merge_reported = 255;
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000396 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000397 }
David Chenc8a43242017-10-17 16:23:28 -0700398
David Chen6e3e6cb2018-01-03 16:14:06 -0800399 // Pulled events will start at field 10000.
Yotam Aron74299972020-01-16 16:20:58 +0200400 // Next: 10074
David Chenc8a43242017-10-17 16:23:28 -0700401 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800402 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
403 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
404 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
405 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
406 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
407 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800408 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800409 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
410 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
411 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
412 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
413 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
414 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
415 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
416 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
417 SystemUptime system_uptime = 10015 [(module) = "framework"];
418 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
419 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000420 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800421 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
422 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800423 Temperature temperature = 10021 [(module) = "framework"];
424 BinderCalls binder_calls = 10022 [(module) = "framework"];
425 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
426 LooperStats looper_stats = 10024 [(module) = "framework"];
427 DiskStats disk_stats = 10025 [(module) = "framework"];
428 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
429 AppSize app_size = 10027 [(module) = "framework"];
430 CategorySize category_size = 10028 [(module) = "framework"];
431 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800432 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800433 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
434 DiskIo disk_io = 10032 [(module) = "framework"];
435 PowerProfile power_profile = 10033 [(module) = "framework"];
436 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
437 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
438 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700439 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800440 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
441 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
442 10040 [(module) = "framework"];
443 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
444 10041 [(module) = "framework"];
445 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800446 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800447 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800448 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800449 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
450 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
451 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
452 RoleHolder role_holder = 10049 [(module) = "framework"];
453 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800454 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800455 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
456 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800457 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
458 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
460 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
461 FaceSettings face_settings = 10058 [(module) = "framework"];
462 CoolingDevice cooling_device = 10059 [(module) = "framework"];
463 AppOps app_ops = 10060 [(module) = "framework"];
464 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700465 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
466 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800467 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800468 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800469 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
470 DangerousPermissionStateSampled dangerous_permission_state_sampled =
471 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400472 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000473 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000474 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200475 PackageNotificationPreferences package_notification_preferences =
476 10071 [(module) = "framework"];
477 PackageNotificationChannelPreferences package_notification_channel_preferences =
478 10072 [(module) = "framework"];
479 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
480 10073 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700481 }
yroa1fe77c2018-02-26 14:22:54 -0800482
Bookatz76aafcf2018-09-17 16:17:10 -0700483 // DO NOT USE field numbers above 100,000 in AOSP.
484 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
485 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100486
487 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700488}
489
Yao Chend54f9dd2017-10-17 17:37:48 +0000490/**
Yangster-mac20877162017-12-22 17:19:39 -0800491 * This proto represents a node of an attribution chain.
492 * Note: All attribution chains are represented as a repeated field of type
493 * AttributionNode. It is understood that in such arrays, the order is that
494 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000495 */
Yangster-mac20877162017-12-22 17:19:39 -0800496message AttributionNode {
497 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800498 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800499
Yangster-mac20877162017-12-22 17:19:39 -0800500 // The (optional) string tag for an element in the attribution chain. If the
501 // element has no tag, it is encoded as an empty string.
502 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700503}
504
Yangster-mac48b3d622018-08-18 12:38:11 -0700505message KeyValuePair {
506 optional int32 key = 1;
507 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700508 int32 value_int = 2;
509 int64 value_long = 3;
510 string value_str = 4;
511 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700512 }
513}
514
515message KeyValuePairsAtom {
516 optional int32 uid = 1;
517 repeated KeyValuePair pairs = 2;
518}
519
Yao Chend54f9dd2017-10-17 17:37:48 +0000520/*
521 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800522 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000523 *
524 * RULES:
525 * - The field ids for each atom must start at 1, and count upwards by 1.
526 * Skipping field ids is not allowed.
527 * - These form an API, so renaming, renumbering or removing fields is
528 * not allowed between android releases. (This is not currently enforced,
529 * but there will be a tool to enforce this restriction).
530 * - The types must be built-in protocol buffer types, namely, no sub-messages
531 * are allowed (yet). The bytes type is also not allowed.
532 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800533 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000534 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800535 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000536 * - A field that is a uid should be a string field, tagged with the [xxx]
537 * annotation. The generated code on android will be represented by UIDs,
538 * and those UIDs will be translated in xxx to those strings.
539 *
540 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700541 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000542 * - If there is a UID, it goes first. Think in an object-oriented fashion.
543 * *****************************************************************************
544 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700545
Yao Chend54f9dd2017-10-17 17:37:48 +0000546/**
Tej Singha72344992019-04-17 18:55:08 -0700547 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700548 * Logs when the Thermal service HAL notifies the throttling start/stop events.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
552 */
553message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700554 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700555 optional android.os.TemperatureTypeEnum sensor_type = 1;
556
Maggie White442b6312019-04-05 16:26:44 -0700557 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700558 enum State {
559 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700560 START = 1; // START indicated that throttling was triggered.
561 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700562 }
Yangster-mace16189a2018-08-26 12:20:16 -0700563 optional State state = 2;
564
565 optional float temperature = 3;
566}
567
568/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * Logs when the screen state changes.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
573 */
574message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800575 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800576 optional android.view.DisplayStateEnum state = 1
577 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578}
Yao Chend54f9dd2017-10-17 17:37:48 +0000579
580/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700581 * Logs that the process state of the uid, as determined by ActivityManager
582 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000583 *
584 * Logged from:
585 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
586 */
Bookatzc1a050a2017-10-10 15:49:28 -0700587message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800588 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000589
Bookatzdb026a22018-01-10 19:01:56 -0800590 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800591 optional android.app.ProcessStateEnum state = 2
592 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000593}
594
595/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700596 * Logs process state change of a process, as per the activity manager.
597 *
598 * Logged from:
599 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
600 */
601message ProcessStateChanged {
602 optional int32 uid = 1;
603 optional string process_name = 2;
604 optional string package_name = 3;
605 // TODO: remove this when validation is done
606 optional int64 version = 5;
607 // The state, from frameworks/base/core/proto/android/app/enums.proto.
608 optional android.app.ProcessStateEnum state = 4;
609}
610
611/**
612 * Logs when ActivityManagerService sleep state is changed.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
616 */
617message ActivityManagerSleepStateChanged {
618 // TODO: import frameworks proto
619 enum State {
620 UNKNOWN = 0;
621 ASLEEP = 1;
622 AWAKE = 2;
623 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700625}
626
627/**
628 * Logs when system memory state changes.
629 *
630 * Logged from:
631 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
632 */
633message MemoryFactorStateChanged {
634 // TODO: import frameworks proto
635 enum State {
636 MEMORY_UNKNOWN = 0;
637 NORMAL = 1; // normal.
638 MODERATE = 2; // moderate memory pressure.
639 LOW = 3; // low memory.
640 CRITICAL = 4; // critical memory.
641
642 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800643 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700644}
645
646/**
647 * Logs when app is using too much cpu, according to ActivityManagerService.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
651 */
652message ExcessiveCpuUsageReported {
653 optional int32 uid = 1;
654 optional string process_name = 2;
655 optional string package_name = 3;
656 // package version. TODO: remove this when validation is done
657 optional int64 version = 4;
658}
659
660/**
661 * Logs when a cached process is killed, along with its pss.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message CachedKillReported {
667 optional int32 uid = 1;
668 optional string process_name = 2;
669 optional string package_name = 3;
670 // TODO: remove this when validation is done
671 optional int64 version = 5;
672 optional int64 pss = 4;
673}
674
675/**
xshu2c3d9e42019-09-26 17:54:02 -0700676 * Logs the change in wifi health.
677 *
678 * Logged from:
679 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
680 */
681message WifiHealthStatReported {
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
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004407/**
4408 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4409 * after an OTA.
4410 *
4411 * Logged from:
4412 * - system/core/fs_mgr/libsnapshot/snapshot.cpp
4413 * - system/core/fs_mgr/libsnapshot/snapshotctl.cpp
4414 */
4415message SnapshotMergeReported {
4416 // Keep in sync with
4417 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4418 enum UpdateState {
4419 // No update or merge is in progress.
4420 NONE = 0;
4421 // An update is applying; snapshots may already exist.
4422 INITIATED = 1;
4423 // An update is pending, but has not been successfully booted yet.
4424 UNVERIFIED = 2;
4425 // The kernel is merging in the background.
4426 MERGING = 3;
4427 // Post-merge cleanup steps could not be completed due to a transient
4428 // error, but the next reboot will finish any pending operations.
4429 MERGE_NEEDS_REBOOT = 4;
4430 // Merging is complete, and needs to be acknowledged.
4431 MERGE_COMPLETED = 5;
4432 // Merging failed due to an unrecoverable error.
4433 MERGE_FAILED = 6;
4434 // The update was implicitly cancelled, either by a rollback or a flash
4435 // operation via fastboot. This state can only be returned by WaitForMerge.
4436 CANCELLED = 7;
4437 };
4438
4439 // Status of the update after the merge attempts.
4440 optional UpdateState final_state = 1;
4441
4442 // Time to complete a merge operation in milliseconds.
4443 // A negative value corresponds to the case in which the merge operation
4444 // was interrupted and resumed (e.g. in case of a system reboot during the
4445 // merge).
4446 optional int64 duration_millis = 2;
4447
4448 // Number of reboots that occurred after issuing and before completing the
4449 // merge of all the snapshot devices.
4450 optional int32 intermediate_reboots = 3;
4451}
4452
Chenjie Yubbcbc602018-02-05 16:51:52 -08004453//////////////////////////////////////////////////////////////////////
4454// Pulled atoms below this line //
4455//////////////////////////////////////////////////////////////////////
4456
4457/**
David Chenc8a43242017-10-17 16:23:28 -07004458 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4459 *
4460 * Pulled from:
4461 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4462 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004463message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004464 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004465
4466 optional int64 rx_bytes = 2;
4467
4468 optional int64 rx_packets = 3;
4469
4470 optional int64 tx_bytes = 4;
4471
4472 optional int64 tx_packets = 5;
4473}
4474
4475/**
4476 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4477 *
4478 * Pulled from:
4479 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4480 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004481message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004482 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004483
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004484 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4485 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004486
4487 optional int64 rx_bytes = 3;
4488
4489 optional int64 rx_packets = 4;
4490
4491 optional int64 tx_bytes = 5;
4492
4493 optional int64 tx_packets = 6;
4494}
4495
4496/**
4497 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4498 *
4499 * Pulled from:
4500 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4501 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004502message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004503 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004504
4505 optional int64 rx_bytes = 2;
4506
4507 optional int64 rx_packets = 3;
4508
4509 optional int64 tx_bytes = 4;
4510
4511 optional int64 tx_packets = 5;
4512}
4513
4514/**
4515 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4516 *
4517 * Pulled from:
4518 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4519 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004520message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004521 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004522
Yao Chenc40a19d2018-03-15 16:48:25 -07004523 // 1 denotes foreground and 0 denotes background. This is called Set in
4524 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004525 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004526
4527 optional int64 rx_bytes = 3;
4528
4529 optional int64 rx_packets = 4;
4530
4531 optional int64 tx_bytes = 5;
4532
4533 optional int64 tx_packets = 6;
4534}
4535
4536/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004537 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4538 *
4539 * Pulled from:
4540 * StatsCompanionService
4541 */
4542message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004543 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004544
4545 optional int64 rx_bytes = 2;
4546
4547 optional int64 tx_bytes = 3;
4548}
4549
4550/**
David Chenc8a43242017-10-17 16:23:28 -07004551 * Pulls the kernel wakelock durations. This atom is adapted from
4552 * android/internal/os/KernelWakelockStats.java
4553 *
4554 * Pulled from:
4555 * StatsCompanionService using KernelWakelockReader.
4556 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004557message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004558 optional string name = 1;
4559
4560 optional int32 count = 2;
4561
4562 optional int32 version = 3;
4563
Yangster-maca8a30442018-10-13 23:46:34 -07004564 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004565}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004566
Chenjie Yu05013b32017-11-21 10:21:41 -08004567/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004568 * Pulls low power state information. If power.stats HAL is not available, this
4569 * includes platform and subsystem sleep state information,
4570 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4571 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004572 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004573 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004574 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4575 * as defined in:
4576 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004577 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004578message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004579 // Subsystem name
4580 optional string subsystem_name = 1;
4581 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4582 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004583 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4584 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004585 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004586 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004587 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004588 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004589 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004590}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004591
Chenjie Yu05013b32017-11-21 10:21:41 -08004592/**
Bookatz92da2832018-11-01 18:10:03 -07004593 * Pulls on-device power measurement information.
4594 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4595 * Pulled from:
4596 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4597 */
4598message OnDevicePowerMeasurement {
4599 // Name of the subsystem (to which the rail belongs).
4600 optional string subsystem_name = 1;
4601
4602 // Rail name. The rail lies within the subsystem.
4603 optional string rail_name = 2;
4604
4605 // Time (in ms since boot) at which the rail energy value was measured.
4606 // This may differ slightly from the time that statsd logs this information.
4607 optional uint64 measurement_timestamp_millis = 3;
4608
4609 // Accumulated energy used via the rail since device boot in uWs.
4610 optional uint64 energy_microwatt_secs = 4;
4611}
4612
4613/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004614 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004615 * Pulls the time the cpu spend on the frequency index. Frequency index
4616 * starts from highest to lowest. The value should be monotonically
4617 * increasing since boot. However, if there is a cpu
4618 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004619 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004620message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004621 optional uint32 cluster = 1;
4622 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004623 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004624}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004625
Chenjie Yu05013b32017-11-21 10:21:41 -08004626/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004627 * Pulls Cpu Time Per Uid.
4628 * Note that isolated process uid time should be attributed to host uids.
4629 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004630message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004631 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004632 optional uint64 user_time_micros = 2;
4633 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004634}
4635
4636/**
4637 * Pulls Cpu Time Per Uid per frequency.
4638 * Note that isolated process uid time should be attributed to host uids.
4639 * For each uid, we order the time by descending frequencies.
4640 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004641message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004642 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004643 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004644 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004645}
Hugo Benichi884970e2017-11-14 22:42:46 +09004646
Chenjie Yu05013b32017-11-21 10:21:41 -08004647/**
4648 * Pulls Wifi Controller Activity Energy Info
4649 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004650message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004651 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004652 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004653 // stack reported state
4654 // TODO: replace this with proto enum
4655 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004656 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004657 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004658 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004659 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004660 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004661 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004662 // product of current(mA), voltage(V) and time(ms)
4663 optional uint64 controller_energy_used = 6;
4664}
4665
4666/**
4667 * Pulls Modem Activity Energy Info
4668 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004669message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004670 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004671 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004672 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004673 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004674 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004675 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004676 /**
4677 * Tx power index
4678 * index 0 = tx_power < 0dBm
4679 * index 1 = 0dBm < tx_power < 5dBm
4680 * index 2 = 5dBm < tx_power < 15dBm
4681 * index 3 = 15dBm < tx_power < 20dBm
4682 * index 4 = tx_power > 20dBm
4683 */
4684 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004685 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004686 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004687 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004688 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004689 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004690 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004691 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004692 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004693 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004694 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004695 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004696 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004697 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004698}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004699
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004700/**
4701 * Pulls Bluetooth Activity Energy Info
4702 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4703 */
4704message BluetoothActivityInfo {
4705 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004706 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004707 // bluetooth stack state
4708 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004709 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004710 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004711 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004712 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004713 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004714 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004715 // product of current(mA), voltage(V) and time(ms)
4716 optional uint64 energy_used = 6;
4717}
4718
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004719/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004720 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004721 *
4722 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004723 */
4724message ProcessMemoryState {
4725 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004726 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004727
4728 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004729 // Usually package name, "system" for system server.
4730 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004731 optional string process_name = 2;
4732
Rafal Slawikda51b932018-12-13 16:31:33 +00004733 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004734 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004735
4736 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004737 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004738
4739 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004740 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004741
Rajeev Kumar90235992018-01-29 11:06:48 -08004742 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004743 // Value is read from memory.stat, field total_rss if per-app memory
4744 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004745 optional int64 rss_in_bytes = 6;
4746
4747 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004748 // Value is read from memory.stat, field total_cache if per-app memory
4749 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004750 optional int64 cache_in_bytes = 7;
4751
4752 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004753 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004754 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004755 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004756
Rafal Slawik203c3db2019-09-25 19:53:01 +01004757 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004758 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004759
Rafal Slawik203c3db2019-09-25 19:53:01 +01004760 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4761 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004762
Rafal Slawik203c3db2019-09-25 19:53:01 +01004763 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4764 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004765}
4766
4767/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004768 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004769 *
4770 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4771 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004772 *
4773 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004774 */
4775message ProcessMemoryHighWaterMark {
4776 // The uid if available. -1 means not available.
4777 optional int32 uid = 1 [(is_uid) = true];
4778
Rafal Slawikda51b932018-12-13 16:31:33 +00004779 // The process name.
4780 // Usually package name or process cmdline.
4781 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004782 optional string process_name = 2;
4783
Rafal Slawik239b6802019-09-09 18:46:01 +01004784 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4785 // computed by converting kilobytes to bytes.
4786 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4787
Rafal Slawik3bea8952018-11-15 12:39:33 +00004788 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4789 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004790 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004791}
4792
4793/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004794 * Logs the memory stats for a process.
4795 *
4796 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4797 * and for selected native processes.
4798 */
4799message ProcessMemorySnapshot {
4800 // The uid if available. -1 means not available.
4801 optional int32 uid = 1 [(is_uid) = true];
4802
4803 // The process name.
4804 // Usually package name or process cmdline.
4805 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4806 optional string process_name = 2;
4807
4808 // The pid of the process.
4809 // Allows to disambiguate instances of the process.
4810 optional int32 pid = 3;
4811
4812 // The current OOM score adjustment value.
4813 // Read from ProcessRecord for managed processes.
4814 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4815 optional int32 oom_score_adj = 4;
4816
4817 // The current RSS of the process.
4818 // VmRSS from /proc/pid/status.
4819 optional int32 rss_in_kilobytes = 5;
4820
4821 // The current anon RSS of the process.
4822 // RssAnon from /proc/pid/status.
4823 optional int32 anon_rss_in_kilobytes = 6;
4824
4825 // The current swap size of the process.
4826 // VmSwap from /proc/pid/status.
4827 optional int32 swap_in_kilobytes = 7;
4828
4829 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4830 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4831}
4832
4833/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004834 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004835 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004836message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004837 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004838}
4839
4840/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004841 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004842 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004843message SystemUptime {
4844 // Milliseconds since the system was booted.
4845 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4846 // for external input).
4847 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004848 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004849}
4850
4851/*
4852 * Reads from /proc/uid_concurrent_active_time which has the format:
4853 * active: X (X is # cores)
4854 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4855 * [uid1]: [time-0] [time-1] [time-2] ... ...
4856 * ...
4857 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4858 * The file contains a monotonically increasing count of time for a single boot.
4859 */
4860message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004861 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004862 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004863}
4864
4865/**
4866 * Reads from /proc/uid_concurrent_policy_time which has the format:
4867 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4868 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4869 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4870 * ...
4871 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4872 * The file contains a monotonically increasing count of time for a single boot.
4873 */
4874message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004875 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004876 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004877 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004878}
4879
4880/*
4881 * Pulls free disk space, for data, system partition and temporary directory.
4882 */
4883message DiskSpace {
4884 // available bytes in data partition
4885 optional uint64 data_available_bytes = 1;
4886 // available bytes in system partition
4887 optional uint64 system_available_bytes = 2;
4888 // available bytes in download cache or temp directories
4889 optional uint64 temp_available_bytes = 3;
4890}
Tej Singhbf972d92018-01-10 20:51:13 -08004891
4892/**
4893 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004894 *
4895 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004896 */
4897message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004898 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004899}
4900
4901/**
4902 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004903 * Pulled from:
4904 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004905 */
4906message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004907 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004908}
4909
4910/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004911 * Pulls battery voltage.
4912 * Pulled from:
4913 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4914 */
4915message BatteryVoltage {
4916 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004917 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004918}
4919
4920/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004921 * Pulls battery level (percent full, from 0 to 100).
4922 *
4923 * Pulled from:
4924 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4925 */
4926message BatteryLevel {
4927 // Battery level. Should be in [0, 100].
4928 optional int32 battery_level = 1;
4929}
4930
4931/**
Tej Singhd89137e2018-03-26 14:51:40 -07004932 * Pulls the temperature of various parts of the device.
4933 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004934 *
Maggie White442b6312019-04-05 16:26:44 -07004935 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004936 */
4937message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004938 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004939 optional android.os.TemperatureTypeEnum sensor_location = 1;
4940
4941 // The name of the temperature source. Eg. CPU0
4942 optional string sensor_name = 2;
4943
Tej Singhd89137e2018-03-26 14:51:40 -07004944 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004945 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004946 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004947
4948 // Relative severity of the throttling, see enum definition.
4949 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004950}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004951
4952/**
4953 * Pulls the statistics of calls to Binder.
4954 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004955 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4956 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004957 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004958 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004959 */
4960message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004961 // UID of the process responsible for the binder transaction. It will be set if the process
4962 // executing the binder transaction attribute the transaction to another uid using
4963 // Binder.setThreadWorkSource().
4964 //
4965 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004966 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004967 // UID of the process executing the binder transaction.
4968 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004969 // Fully qualified class name of the API call.
4970 //
4971 // This is a system server class name.
4972 //
4973 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4974 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4975 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4976 // commonly used APIs.
4977 optional string service_class_name = 2;
4978 // Method name of the API call. It can also be a transaction code if we cannot
4979 // resolve it to a name. See Binder#getTransactionName.
4980 //
4981 // This is a system server method name.
4982 optional string service_method_name = 3;
4983 // Total number of API calls.
4984 optional int64 call_count = 4;
4985 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4986 optional bool screen_interactive = 13;
4987 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4988 // call_count will be equal to recorded_call_count.
4989 //
4990 // If recorded_call_count is different than call_count, it means data collection has been
4991 // sampled. All the fields below will be sampled in this case.
4992 optional int64 recorded_call_count = 12;
4993 // Number of exceptions thrown by the API.
4994 optional int64 recorded_exception_count = 5;
4995 // Total latency of all API calls.
4996 // Average can be computed using total_latency_micros / recorded_call_count.
4997 optional int64 recorded_total_latency_micros = 6;
4998 // Maximum latency of one API call.
4999 optional int64 recorded_max_latency_micros = 7;
5000 // Total CPU usage of all API calls.
5001 // Average can be computed using total_cpu_micros / recorded_call_count.
5002 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5003 optional int64 recorded_total_cpu_micros = 8;
5004 // Maximum CPU usage of one API call.
5005 optional int64 recorded_max_cpu_micros = 9;
5006 // Maximum parcel reply size of one API call.
5007 optional int64 recorded_max_reply_size_bytes = 10;
5008 // Maximum parcel request size of one API call.
5009 optional int64 recorded_max_request_size_bytes = 11;
5010}
5011
5012/**
5013 * Pulls the statistics of exceptions during calls to Binder.
5014 *
5015 * Binder stats are cumulative from boot unless somebody reset the data using
5016 * > adb shell dumpsys binder_calls_stats --reset
5017 */
5018message BinderCallsExceptions {
5019 // Exception class name, e.g. java.lang.IllegalArgumentException.
5020 //
5021 // This is an exception class name thrown by the system server.
5022 optional string exception_class_name = 1;
5023 // Total number of exceptions.
5024 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005025}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005026
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005027/**
5028 * Pulls the statistics of message dispatching on HandlerThreads.
5029 *
5030 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5031 * config on the device.
5032 *
5033 * Next tag: 11
5034 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005035message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005036 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005037 optional int32 uid = 1 [(is_uid) = true];
5038
5039 // Fully qualified class name of the handler target class.
5040 //
5041 // This field does not contain PII. This is a system server class name.
5042 optional string handler_class_name = 2;
5043
5044 // The name of the thread that runs the Looper.
5045 //
5046 // This field does not contain PII. This is a system server thread name.
5047 optional string looper_thread_name = 3;
5048
5049 // The name of the dispatched message.
5050 //
5051 // This field does not contain PII. This is a system server constant or class
5052 // name.
5053 optional string message_name = 4;
5054
5055 // Total number of successfully dispatched messages.
5056 optional int64 message_count = 5;
5057
5058 // Total number of messages that failed dispatching.
5059 optional int64 exception_count = 6;
5060
5061 // Total number of processed messages we have data recorded for. If we
5062 // collected data for all the messages, message_count will be equal to
5063 // recorded_message_count.
5064 //
5065 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005066 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005067 optional int64 recorded_message_count = 7;
5068
5069 // Total latency of all processed messages.
5070 // Average can be computed using recorded_total_latency_micros /
5071 // recorded_message_count.
5072 optional int64 recorded_total_latency_micros = 8;
5073
5074 // Total CPU usage of all processed message.
5075 // Average can be computed using recorded_total_cpu_micros /
5076 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005077 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005078 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005079
5080 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5081 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005082
5083 // Max recorded CPU usage of all processed messages.
5084 optional int64 recorded_max_cpu_micros = 11;
5085
5086 // Max recorded latency of all processed messages.
5087 optional int64 recorded_max_latency_micros = 12;
5088
5089 // Total number of messages we tracked the dispatching delay for. If we
5090 // collected data for all the messages, message_count will be equal to
5091 // recorded_delay_message_count.
5092 //
5093 // If recorded_delay_message_count is different than message_count, it means data
5094 // collection has been sampled or/and not all messages specified the target dispatch time.
5095 // The fields below will be sampled in this case.
5096 optional int64 recorded_delay_message_count = 13;
5097
5098 // Total dispatching delay of all processed messages.
5099 // Calculated as a difference between the target dispatching time (Message.when)
5100 // and the actual dispatching time.
5101 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5102 optional int64 recorded_total_delay_millis = 14;
5103
5104 // Max dispatching delay of all processed messages.
5105 // Calculated as a difference between the target dispatching time (Message.when)
5106 // and the actual dispatching time.
5107 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005108}
Tej Singh86dc9db2018-09-06 00:39:57 +00005109
5110/**
5111 * Pulls disk information, such as write speed and latency.
5112 */
5113message DiskStats {
5114 // Time taken to open, write 512B to, and close a file.
5115 // -1 if error performing the check.
5116 optional int64 data_write_latency_millis = 1;
5117
5118 optional bool file_based_encryption = 2;
5119
5120 // Recent disk write speed in kB/s.
5121 // -1 if error querying storageed.
5122 // 0 if data is unavailable.
5123 optional int32 recent_disk_write_speed = 3;
5124}
5125
5126
5127/**
5128 * Free and total bytes of the Data, Cache, and System partition.
5129 */
5130message DirectoryUsage {
5131 enum Directory {
5132 UNKNOWN = 0;
5133 DATA = 1;
5134 CACHE = 2;
5135 SYSTEM = 3;
5136 }
5137 optional Directory directory = 1;
5138 optional int64 free_bytes = 2;
5139 optional int64 total_bytes = 3;
5140}
5141
5142
5143/**
5144 * Size of an application: apk size, data size, and cache size.
5145 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5146 * Information is only reported for apps with the primary user (user 0).
5147 * Sizes are aggregated by package name.
5148 */
5149message AppSize {
5150 // Including uids will involve modifying diskstats logic.
5151 optional string package_name = 1;
5152 // App size in bytes. -1 if unavailable.
5153 optional int64 app_size_bytes = 2;
5154 // App data size in bytes. -1 if unavailable.
5155 optional int64 app_data_size_bytes = 3;
5156 // App cache size in bytes. -1 if unavailable.
5157 optional int64 app_cache_size_bytes = 4;
5158 // Time that the cache file was produced.
5159 // Uses System.currentTimeMillis(), which is wall clock time.
5160 optional int64 cache_time_millis = 5;
5161}
5162
5163
5164/**
5165 * Size of a particular category. Eg: photos, videos.
5166 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5167 */
5168message CategorySize {
5169 enum Category {
5170 UNKNOWN = 0;
5171 APP_SIZE = 1;
5172 APP_DATA_SIZE = 2;
5173 APP_CACHE_SIZE = 3;
5174 PHOTOS = 4;
5175 VIDEOS = 5;
5176 AUDIO = 6;
5177 DOWNLOADS = 7;
5178 SYSTEM = 8;
5179 OTHER = 9;
5180 }
5181 optional Category category = 1;
5182 // Category size in bytes.
5183 optional int64 size_bytes = 2;
5184 // Time that the cache file was produced.
5185 // Uses System.currentTimeMillis(), which is wall clock time.
5186 optional int64 cache_time_millis = 3;
5187}
Tej Singhd6d6d772018-09-05 17:41:25 -07005188
5189/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005190 * Pulls per uid I/O stats. The stats are cumulative since boot.
5191 *
5192 * Read/write bytes are I/O events from a storage device
5193 * Read/write chars are data requested by read/write syscalls, and can be
5194 * satisfied by caching.
5195 *
5196 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5197 */
5198message DiskIo {
5199 optional int32 uid = 1 [(is_uid) = true];
5200 optional int64 fg_chars_read = 2;
5201 optional int64 fg_chars_write = 3;
5202 optional int64 fg_bytes_read = 4;
5203 optional int64 fg_bytes_write = 5;
5204 optional int64 bg_chars_read = 6;
5205 optional int64 bg_chars_write = 7;
5206 optional int64 bg_bytes_read = 8;
5207 optional int64 bg_bytes_write = 9;
5208 optional int64 fg_fsync = 10;
5209 optional int64 bg_fsync= 11;
5210}
5211
5212
5213/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005214 * Pulls the number of fingerprints for each user.
5215 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005216 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005217 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005218message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005219 // The associated user. Eg: 0 for owners, 10+ for others.
5220 // Defined in android/os/UserHandle.java
5221 optional int32 user = 1;
5222 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005223 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005224}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005225
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005226/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005227 * Pulls the number of faces for each user.
5228 *
5229 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5230 */
5231message NumFacesEnrolled {
5232 // The associated user. Eg: 0 for owners, 10+ for others.
5233 // Defined in android/os/UserHandle.java
5234 optional int32 user = 1;
5235 // Number of faces registered to that user.
5236 optional int32 num_faces_enrolled = 2;
5237}
5238/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005239 * A mapping of role holder -> role
5240 */
5241message RoleHolder {
5242 // uid of the role holder
5243 optional int32 uid = 1 [(is_uid) = true];
5244
5245 // package name of the role holder
5246 optional string package_name = 2;
5247
5248 // the role held
5249 optional string role = 3;
5250}
5251
Yangsteraf9aee72018-10-12 09:26:16 -07005252message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005253 // These are all in byte resolution.
5254 optional int64 min = 1 [deprecated = true];
5255 optional int64 average = 2 [deprecated = true];
5256 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005257
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005258 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5259 // int64 fields.
5260 optional int32 mean_kb = 4;
5261 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005262}
5263
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005264// A reduced subset of process states; reducing the number of possible states allows more
5265// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5266enum ProcessStateAggregated {
5267 PROCESS_STATE_UNKNOWN = 0;
5268 // Persistent system process.
5269 PROCESS_STATE_PERSISTENT = 1;
5270 // Top activity; actually any visible activity.
5271 PROCESS_STATE_TOP = 2;
5272 // Process binding to top or a foreground service.
5273 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5274 // Processing running a foreground service.
5275 PROCESS_STATE_FGS = 4;
5276 // Important foreground process (ime, wallpaper, etc).
5277 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5278 // Important background process.
5279 PROCESS_STATE_BACKGROUND = 6;
5280 // Process running a receiver.
5281 PROCESS_STATE_RECEIVER = 7;
5282 // All kinds of cached processes.
5283 PROCESS_STATE_CACHED = 8;
5284}
5285
5286// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005287message ProcessStatsStateProto {
5288 optional android.service.procstats.ScreenState screen_state = 1;
5289
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005290 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005291
5292 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5293 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005294 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5295
5296 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005297
5298 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005299 optional int64 duration_millis = 4 [deprecated = true];
5300 // Same as above, but with minute resolution so it fits into an int32.
5301 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005302
5303 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005304 optional int64 realtime_duration_millis = 9 [deprecated = true];
5305 // Same as above, but with minute resolution so it fits into an int32.
5306 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005307
5308 // # of samples taken
5309 optional int32 sample_size = 5;
5310
5311 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005312 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005313
5314 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005315 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005316
5317 // RSS is memory resident for this process
5318 optional AggStats rss = 8;
5319}
5320
5321// Next Tag: 7
5322message ProcessStatsProto {
5323 // Name of process.
5324 optional string process = 1;
5325
5326 // Uid of the process.
5327 optional int32 uid = 2;
5328
5329 // Information about how often kills occurred
5330 message Kill {
5331 // Count of excessive CPU kills
5332 optional int32 cpu = 1;
5333
5334 // Count of kills when cached
5335 optional int32 cached = 2;
5336
5337 // PSS stats during cached kill
5338 optional AggStats cached_pss = 3;
5339 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005340 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005341
5342 // Time and memory spent in various states.
5343 repeated ProcessStatsStateProto states = 5;
5344
5345 // Total time process has been running... screen_state, memory_state, and process_state
5346 // will not be set.
5347 optional ProcessStatsStateProto total_running_state = 6;
5348}
5349
5350message PackageServiceOperationStatsProto {
5351 // Operate enum: Started, Foreground, Bound, Executing
5352 optional android.service.procstats.ServiceOperationState operation = 1;
5353
5354 // Number of times the service was in this operation.
5355 optional int32 count = 2;
5356
5357 // Information about a state the service can be in.
5358 message StateStats {
5359 // Screen state enum.
5360 optional android.service.procstats.ScreenState screen_state = 1;
5361 // Memory state enum.
5362 optional android.service.procstats.MemoryState memory_state = 2;
5363
5364 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005365 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005366 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005367 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005368 }
5369 repeated StateStats state_stats = 3;
5370}
5371
5372message PackageServiceStatsProto {
5373 // Name of service component.
5374 optional string service_name = 1;
5375
5376 // The operation stats.
5377 // The package_name, package_uid, package_version, service_name will not be set to save space.
5378 repeated PackageServiceOperationStatsProto operation_stats = 2;
5379}
5380
5381message PackageAssociationSourceProcessStatsProto {
5382 // Uid of the process.
5383 optional int32 process_uid = 1;
5384 // Process name.
5385 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005386 // Package name.
5387 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005388 // Total count of the times this association appeared.
5389 optional int32 total_count = 3;
5390
5391 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005392 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005393
5394 // Total count of the times this association became actively impacting its target process.
5395 optional int32 active_count = 5;
5396
5397 // Information on one source in this association.
5398 message StateStats {
5399 // Process state enum.
5400 optional android.service.procstats.ProcessState process_state = 1;
5401 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005402 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005403 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005404 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005405 }
5406 repeated StateStats active_state_stats = 6;
5407}
5408
5409message PackageAssociationProcessStatsProto {
5410 // Name of the target component.
5411 optional string component_name = 1;
5412 // Information on one source in this association.
5413 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5414}
5415
5416
5417message ProcessStatsPackageProto {
5418 // Name of package.
5419 optional string package = 1;
5420
5421 // Uid of the package.
5422 optional int32 uid = 2;
5423
5424 // Version of the package.
5425 optional int64 version = 3;
5426
5427 // Stats for each process running with the package loaded in to it.
5428 repeated ProcessStatsProto process_stats = 4;
5429
5430 // Stats for each of the package's services.
5431 repeated PackageServiceStatsProto service_stats = 5;
5432
5433 // Stats for each association with the package.
5434 repeated PackageAssociationProcessStatsProto association_stats = 6;
5435}
5436
5437message ProcessStatsSectionProto {
5438 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005439 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005440
5441 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005442 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005443
5444 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005445 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005446
5447 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005448 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005449
5450 // System runtime library. e.g. "libdvm.so", "libart.so".
5451 optional string runtime = 5;
5452
5453 // whether kernel reports swapped pss.
5454 optional bool has_swapped_pss = 6;
5455
5456 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5457 enum Status {
5458 STATUS_UNKNOWN = 0;
5459 STATUS_COMPLETE = 1;
5460 STATUS_PARTIAL = 2;
5461 STATUS_SHUTDOWN = 3;
5462 STATUS_SYSPROPS = 4;
5463 }
5464 repeated Status status = 7;
5465
Chenjie Yub2ecc792019-01-17 10:27:26 -08005466 // Number of pages available of various types and sizes, representation fragmentation.
5467 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5468
Yangsteraf9aee72018-10-12 09:26:16 -07005469 // Stats for each process.
5470 repeated ProcessStatsProto process_stats = 8;
5471
5472 // Stats for each package.
5473 repeated ProcessStatsPackageProto package_stats = 9;
5474}
5475
Chenjie Yub2ecc792019-01-17 10:27:26 -08005476message ProcessStatsAvailablePagesProto {
5477 // Node these pages are in (as per /proc/pagetypeinfo)
5478 optional int32 node = 1;
5479
5480 // Zone these pages are in (as per /proc/pagetypeinfo)
5481 optional string zone = 2;
5482
5483 // Label for the type of these pages (as per /proc/pagetypeinfo)
5484 optional string label = 3;
5485
5486 // Distribution of number of pages available by order size. First entry in array is
5487 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5488 repeated int32 pages_per_order = 4;
5489}
5490
Chenjie Yu12e5e672018-09-14 15:54:59 -07005491/**
5492 * Pulled from ProcessStatsService.java
5493 */
5494message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005495 optional ProcessStatsSectionProto proc_stats_section = 1;
5496}
5497
Chenjie Yuf910b7802019-01-11 16:08:20 -08005498/**
5499 * Pulled from ProcessStatsService.java
5500 */
5501message ProcStatsPkgProc {
5502 optional ProcessStatsSectionProto proc_stats_section = 1;
5503}
5504
Chris Wrencdea3b72019-11-22 16:58:17 -05005505// Next Tag: 2
5506message PackageRemoteViewInfoProto {
5507 optional string package_name = 1;
5508 // add per-package additional info here (like channels)
5509}
5510
5511// Next Tag: 2
5512message NotificationRemoteViewsProto {
5513 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5514}
5515
5516/**
5517 * Pulled from NotificationManagerService.java
5518 */
5519message NotificationRemoteViews {
5520 optional NotificationRemoteViewsProto notification_remote_views = 1;
5521}
5522
Yotam Aron74299972020-01-16 16:20:58 +02005523/**
5524 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5525 */
5526message PackageNotificationPreferences {
5527 // Uid under which the package is installed.
5528 optional int32 uid = 1;
5529 // Notification importance, which specifies when and how a notification is displayed.
5530 // Specified under core/java/android/app/NotificationManager.java.
5531 optional int32 importance = 2;
5532 // Lockscreen visibility as set by the user.
5533 optional int32 visibility = 3;
5534 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5535 // PreferencesHelper.java)
5536 optional int32 user_locked_fields = 4;
5537}
5538
5539/**
5540 * Atom that contains a list of a package's channel preferences, pulled from
5541 * NotificationManagerService.java.
5542 */
5543message PackageNotificationChannelPreferences {
5544 // Uid under which the package is installed.
5545 optional int32 uid = 1;
5546 // Channel's ID. Should always be available.
5547 optional string channel_id = 2;
5548 // Channel's name. Should always be available.
5549 optional string channel_name = 3;
5550 // Channel's description. Optionally set by the channel creator.
5551 optional string description = 4;
5552 // Notification importance, which specifies when and how a notification is displayed. Specified
5553 // under core/java/android/app/NotificationManager.java.
5554 optional int32 importance = 5;
5555 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5556 // at core/java/android/app/NotificationChannel.java
5557 optional int32 user_locked_fields = 6;
5558 // Indicates if the channel was deleted by the app.
5559 optional bool is_deleted = 7;
5560}
5561
5562/**
5563 * Atom that contains a list of a package's channel group preferences, pulled from
5564 * NotificationManagerService.java.
5565 */
5566message PackageNotificationChannelGroupPreferences {
5567 // Uid under which the package is installed.
5568 optional int32 uid = 1;
5569 // Channel Group's ID. Should always be available.
5570 optional string group_id = 2;
5571 // Channel Group's name. Should always be available.
5572 optional string group_name = 3;
5573 // Channel Group's description. Optionally set by group creator.
5574 optional string description = 4;
5575 // Indicates if notifications from this channel group are blocked.
5576 optional bool is_blocked = 5;
5577 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5578 // at core/java/android/app/NotificationChannelGroup.java
5579 optional int32 user_locked_fields = 6;
5580}
5581
Yangsteraf9aee72018-10-12 09:26:16 -07005582message PowerProfileProto {
5583 optional double cpu_suspend = 1;
5584
5585 optional double cpu_idle = 2;
5586
5587 optional double cpu_active = 3;
5588
5589 message CpuCluster {
5590 optional int32 id = 1;
5591 optional double cluster_power = 2;
5592 optional int32 cores = 3;
5593 repeated int64 speed = 4;
5594 repeated double core_power = 5;
5595 }
5596
5597 repeated CpuCluster cpu_cluster = 40;
5598
5599 optional double wifi_scan = 4;
5600
5601 optional double wifi_on = 5;
5602
5603 optional double wifi_active = 6;
5604
5605 optional double wifi_controller_idle = 7;
5606
5607 optional double wifi_controller_rx = 8;
5608
5609 optional double wifi_controller_tx = 9;
5610
5611 repeated double wifi_controller_tx_levels = 10;
5612
5613 optional double wifi_controller_operating_voltage = 11;
5614
5615 optional double bluetooth_controller_idle = 12;
5616
5617 optional double bluetooth_controller_rx = 13;
5618
5619 optional double bluetooth_controller_tx = 14;
5620
5621 optional double bluetooth_controller_operating_voltage = 15;
5622
5623 optional double modem_controller_sleep = 16;
5624
5625 optional double modem_controller_idle = 17;
5626
5627 optional double modem_controller_rx = 18;
5628
5629 repeated double modem_controller_tx = 19;
5630
5631 optional double modem_controller_operating_voltage = 20;
5632
5633 optional double gps_on = 21;
5634
5635 repeated double gps_signal_quality_based = 22;
5636
5637 optional double gps_operating_voltage = 23;
5638
5639 optional double bluetooth_on = 24;
5640
5641 optional double bluetooth_active = 25;
5642
5643 optional double bluetooth_at_cmd = 26;
5644
5645 optional double ambient_display = 27;
5646
5647 optional double screen_on = 28;
5648
5649 optional double radio_on = 29;
5650
5651 optional double radio_scanning = 30;
5652
5653 optional double radio_active = 31;
5654
5655 optional double screen_full = 32;
5656
5657 optional double audio = 33;
5658
5659 optional double video = 34;
5660
5661 optional double flashlight = 35;
5662
5663 optional double memory = 36;
5664
5665 optional double camera = 37;
5666
5667 optional double wifi_batched_scan = 38;
5668
5669 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005670}
Chenjie Yuab530202018-09-26 12:39:20 -07005671
5672/**
5673 * power_profile.xml and other constants for power model calculations.
5674 * Pulled from PowerProfile.java
5675 */
5676message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005677 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005678}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005679
5680/**
arangelovd5db50e2018-10-12 20:24:39 +01005681 * Logs when a user restriction was added or removed.
5682 *
5683 * Logged from:
5684 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5685 */
5686message UserRestrictionChanged {
5687 // The raw string of the user restriction as defined in UserManager.
5688 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5689 optional string restriction = 1;
5690 // Whether the restriction is enabled or disabled.
5691 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005692}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005693
5694/**
5695 * Pulls process user time and system time. Puller takes a snapshot of all pids
5696 * in the system and returns cpu stats for those that are working at the time.
5697 * Dead pids will be dropped. Kernel processes are excluded.
5698 * Min cool-down is 5 sec.
5699 */
5700message ProcessCpuTime {
5701 optional int32 uid = 1 [(is_uid) = true];
5702
5703 optional string process_name = 2;
5704 // Process cpu time in user space, cumulative from boot/process start
5705 optional int64 user_time_millis = 3;
5706 // Process cpu time in system space, cumulative from boot/process start
5707 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005708}
Misha Wagner5a51e002018-10-03 15:04:09 +01005709
5710/**
5711 * Pulls the CPU usage for each thread.
5712 *
5713 * Read from /proc/$PID/task/$TID/time_in_state files.
5714 *
5715 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5716 * time_in_state files not being present on some phones, have not been addressed. These should be
5717 * considered before a public release.
5718 */
5719message CpuTimePerThreadFreq {
5720 // UID that owns the process.
5721 optional int32 uid = 1 [(is_uid) = true];
5722 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005723 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005724 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005725 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005726 // Name of the process taken from `/proc/$PID/cmdline`.
5727 optional string process_name = 4;
5728 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5729 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005730
5731 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5732 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5733 // frequencies are given here as the alternative is sending eight separate atoms. This method
5734 // significantly reduces the amount of data created
5735 optional int32 frequency1_khz = 6;
5736 optional int32 time1_millis = 7;
5737 optional int32 frequency2_khz = 8;
5738 optional int32 time2_millis = 9;
5739 optional int32 frequency3_khz = 10;
5740 optional int32 time3_millis = 11;
5741 optional int32 frequency4_khz = 12;
5742 optional int32 time4_millis = 13;
5743 optional int32 frequency5_khz = 14;
5744 optional int32 time5_millis = 15;
5745 optional int32 frequency6_khz = 16;
5746 optional int32 time6_millis = 17;
5747 optional int32 frequency7_khz = 18;
5748 optional int32 time7_millis = 19;
5749 optional int32 frequency8_khz = 20;
5750 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005751}
Bookatz75ee60422018-11-09 12:27:37 -08005752
5753/**
Bookatz366a4432018-11-20 09:42:33 -08005754 * Pulls information about the device's build.
5755 */
5756message BuildInformation {
5757 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5758 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5759 optional string fingerprint = 1;
5760
5761 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5762 optional string brand = 2;
5763
5764 // Build.PRODUCT. The name of the overall product.
5765 optional string product = 3;
5766
5767 // Build.DEVICE. The name of the industrial design.
5768 optional string device = 4;
5769
5770 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5771 optional string version_release = 5;
5772
5773 // Build.ID. E.g. a label like "M4-rc20".
5774 optional string id = 6;
5775
5776 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5777 // represent this build.
5778 optional string version_incremental = 7;
5779
5780 // Build.TYPE. The type of build, like "user" or "eng".
5781 optional string type = 8;
5782
5783 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5784 optional string tags = 9;
5785}
5786
5787/**
Adam He420947c2019-01-23 15:59:09 -08005788 * Logs information about mismatched caller for content capture.
5789 *
5790 * Logged from:
5791 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5792 */
5793message ContentCaptureCallerMismatchReported {
5794 optional string intended_package = 1;
5795 optional string calling_package = 2;
5796}
5797
5798/**
5799 * Logs information about content capture service events.
5800 *
5801 * Logged from:
5802 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5803 */
5804message ContentCaptureServiceEvents {
5805 // The type of event.
5806 enum Event {
5807 UNKNOWN = 0;
5808 ON_CONNECTED = 1;
5809 ON_DISCONNECTED = 2;
5810 SET_WHITELIST = 3;
5811 SET_DISABLED = 4;
5812 ON_USER_DATA_REMOVED = 5;
5813 }
5814 optional Event event = 1;
5815 // component/package of content capture service.
5816 optional string service_info = 2;
5817 // component/package of target.
5818 // it's a concatenated list of component/package for SET_WHITELIST event
5819 // separated by " ".
5820 optional string target_info = 3;
5821}
5822
5823/**
5824 * Logs information about content capture session events.
5825 *
5826 * Logged from:
5827 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5828 */
5829message ContentCaptureSessionEvents {
5830 // The type of event.
5831 enum Event {
5832 UNKNOWN = 0;
5833 ON_SESSION_STARTED = 1;
5834 ON_SESSION_FINISHED = 2;
5835 SESSION_NOT_CREATED = 3;
5836 }
5837 optional int32 session_id = 1;
5838 optional Event event = 2;
5839 // (n/a on session finished)
5840 optional int32 state_flags = 3;
5841 // component/package of content capture service.
5842 optional string service_info = 4;
5843 // component/package of app.
5844 // (n/a on session finished)
5845 optional string app_info = 5;
5846 optional bool is_child_session = 6;
5847}
5848
5849/**
5850 * Logs information about session being flushed.
5851 *
5852 * Logged from:
5853 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5854 */
5855message ContentCaptureFlushed {
5856 optional int32 session_id = 1;
5857 // component/package of content capture service.
5858 optional string service_info = 2;
5859 // component/package of app.
5860 optional string app_info = 3;
5861 // session start/finish events
5862 optional int32 child_session_started = 4;
5863 optional int32 child_session_finished = 5;
5864 // count of view events.
5865 optional int32 view_appeared_count = 6;
5866 optional int32 view_disappeared_count = 7;
5867 optional int32 view_text_changed_count = 8;
5868
5869 // Flush stats.
5870 optional int32 max_events = 9;
5871 optional int32 idle_flush_freq = 10;
5872 optional int32 text_flush_freq = 11;
5873 optional int32 flush_reason = 12;
5874}
5875
5876/**
Bookatz75ee60422018-11-09 12:27:37 -08005877 * Pulls on-device BatteryStats power use calculations for the overall device.
5878 */
5879message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005880 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5881 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5882 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5883 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005884}
5885
5886/**
5887 * Pulls on-device BatteryStats power use calculations broken down by uid.
5888 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5889 * that is attributed to non-uid items. They must all be included to get the total power use.
5890 */
5891message DeviceCalculatedPowerBlameUid {
5892 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5893 optional int32 uid = 1 [(is_uid) = true];
5894
Bookatz3dbc13a2018-12-21 12:16:51 -08005895 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5896 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5897 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005898}
5899
5900/**
5901 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5902 * drain type.
5903 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5904 * is attributed uids. They must all be included to get the total power use.
5905 */
5906message DeviceCalculatedPowerBlameOther {
5907 // The type of item whose power use is being reported.
5908 enum DrainType {
5909 AMBIENT_DISPLAY = 0;
5910 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5911 BLUETOOTH = 2;
5912 CAMERA = 3;
5913 // Cell-standby
5914 CELL = 4;
5915 FLASHLIGHT = 5;
5916 IDLE = 6;
5917 MEMORY = 7;
5918 // Amount that total computed drain exceeded the drain estimated using the
5919 // battery level changes and capacity.
5920 OVERCOUNTED = 8;
5921 PHONE = 9;
5922 SCREEN = 10;
5923 // Amount that total computed drain was below the drain estimated using the
5924 // battery level changes and capacity.
5925 UNACCOUNTED = 11;
5926 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5927 WIFI = 13;
5928 }
5929 optional DrainType drain_type = 1;
5930
Bookatz3dbc13a2018-12-21 12:16:51 -08005931 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5932 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5933 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005934}
arangelov4e994062018-11-13 16:12:38 +00005935
5936/**
5937 * Logs device policy features.
5938 *
5939 * Logged from:
5940 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5941 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5942 */
5943message DevicePolicyEvent {
5944 // The event id - unique for each event.
5945 optional android.stats.devicepolicy.EventId event_id = 1;
5946 // The admin package name.
5947 optional string admin_package_name = 2;
5948 // A generic integer parameter.
5949 optional int32 integer_value = 3;
5950 // A generic boolean parameter.
5951 optional bool boolean_value = 4;
5952 // A parameter specifying a time period in milliseconds.
5953 optional uint64 time_period_millis = 5;
5954 // A parameter specifying a list of package names, bundle extras or string parameters.
5955 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5956}
shawnlinea5b66b2018-11-13 15:05:29 +08005957
5958/**
5959 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5960 *
5961 * Logged from:
5962 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5963 */
5964message DocsUILaunchReported {
5965 optional android.stats.docsui.LaunchAction launch_action = 1;
5966 optional bool has_initial_uri = 2;
5967 optional android.stats.docsui.MimeType mime_type = 3;
5968 optional android.stats.docsui.Root initial_root = 4;
5969}
5970
5971/**
5972 * Logs root/app visited event in file managers/picker. Call this when the user
5973 * taps on root/app in hamburger menu.
5974 *
5975 * Logged from:
5976 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5977 */
5978message DocsUIRootVisitedReported {
5979 optional android.stats.docsui.ContextScope scope = 1;
5980 optional android.stats.docsui.Root root = 2;
5981}
5982
5983/**
5984 * Logs file operation stats. Call this when a file operation has completed.
5985 *
5986 * Logged from:
5987 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5988 */
5989message DocsUIFileOperationReported {
5990 optional android.stats.docsui.Provider provider = 1;
5991 optional android.stats.docsui.FileOperation file_op = 2;
5992}
5993
5994/**
5995 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5996 * mode.
5997 *
5998 * Logged from:
5999 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6000 */
6001message DocsUIFileOperationCopyMoveModeReported {
6002 optional android.stats.docsui.FileOperation file_op = 1;
6003 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6004}
6005
6006
6007/**
6008 * Logs file sub operation stats. Call this when a file operation has failed.
6009 *
6010 * Logged from:
6011 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6012 */
6013message DocsUIFileOperationFailureReported {
6014 optional android.stats.docsui.Authority authority = 1;
6015 optional android.stats.docsui.SubFileOperation sub_op = 2;
6016}
6017
6018/**
6019* Logs the cancellation of a file operation. Call this when a job is canceled
6020*
6021* Logged from:
6022* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6023*/
6024message DocsUIFileOperationCanceledReported {
6025 optional android.stats.docsui.FileOperation file_op = 1;
6026}
6027
6028/**
6029 * Logs startup time in milliseconds.
6030 *
6031 * Logged from:
6032 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6033 */
6034message DocsUIStartupMsReported {
6035 optional int32 startup_millis = 1;
6036}
6037
6038/**
6039 * Logs the action that was started by user.
6040 *
6041 * Logged from:
6042 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6043 */
6044message DocsUIUserActionReported {
6045 optional android.stats.docsui.UserAction action = 1;
6046}
6047
6048/**
6049 * Logs the invalid type when invalid scoped access is requested.
6050 *
6051 * Logged from:
6052 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6053 */
6054message DocsUIInvalidScopedAccessRequestReported {
6055 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006056}
Ben Murdochbab399f62018-12-06 11:01:38 +00006057
6058/**
shawnlina75e82d2019-01-07 10:31:12 +08006059 * Logs the package name that launches docsui picker mode.
6060 *
6061 * Logged from:
6062 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6063 */
6064message DocsUIPickerLaunchedFromReported {
6065 optional string package_name = 1;
6066}
6067
6068/**
6069 * Logs the search type.
6070 *
6071 * Logged from:
6072 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6073 */
6074message DocsUISearchTypeReported {
6075 optional android.stats.docsui.SearchType search_type = 1;
6076}
6077
6078/**
6079 * Logs the search mode.
6080 *
6081 * Logged from:
6082 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6083 */
6084message DocsUISearchModeReported {
6085 optional android.stats.docsui.SearchMode search_mode = 1;
6086}
6087
6088/**
6089 * Logs the pick result information.
6090 *
6091 * Logged from:
6092 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6093 */
6094message DocsUIPickResultReported {
6095 optional int32 total_action_count = 1;
6096 optional int64 duration_millis = 2;
6097 optional int32 file_count= 3;
6098 optional bool is_searching = 4;
6099 optional android.stats.docsui.Root picked_from = 5;
6100 optional android.stats.docsui.MimeType mime_type = 6;
6101 optional int32 repeatedly_pick_times = 7;
6102}
6103
6104/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006105 * Logs when an app's memory is compacted.
6106 *
6107 * Logged from:
6108 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6109 */
6110message AppCompacted {
6111 // The pid of the process being compacted.
6112 optional int32 pid = 1;
6113
6114 // The name of the process being compacted.
6115 optional string process_name = 2;
6116
6117 // The type of compaction.
6118 enum Action {
6119 UNKNOWN = 0;
6120 SOME = 1;
6121 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006122 PERSISTENT = 3;
6123 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006124 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006125 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006126
6127 // Total RSS in kilobytes consumed by the process prior to compaction.
6128 optional int64 before_rss_total_kilobytes = 4;
6129
6130 // File RSS in kilobytes consumed by the process prior to compaction.
6131 optional int64 before_rss_file_kilobytes = 5;
6132
6133 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6134 optional int64 before_rss_anon_kilobytes = 6;
6135
6136 // Swap in kilobytes consumed by the process prior to compaction.
6137 optional int64 before_swap_kilobytes = 7;
6138
6139 // Total RSS in kilobytes consumed by the process after compaction.
6140 optional int64 after_rss_total_kilobytes = 8;
6141
6142 // File RSS in kilobytes consumed by the process after compaction.
6143 optional int64 after_rss_file_kilobytes = 9;
6144
6145 // Anonymous RSS in kilobytes consumed by the process after compaction.
6146 optional int64 after_rss_anon_kilobytes = 10;
6147
6148 // Swap in kilobytes consumed by the process after compaction.
6149 optional int64 after_swap_kilobytes = 11;
6150
6151 // The time taken to perform compaction in milliseconds.
6152 optional int64 time_to_compact_millis = 12;
6153
6154 // The last compaction action performed for this app.
6155 optional Action last_action = 13;
6156
Ben Murdoch01720b82018-12-19 18:03:44 +00006157 // The last time that compaction was attempted on this process in milliseconds
6158 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6159 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006160
Ben Murdoch885c21b2019-03-15 18:02:04 +00006161 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006162 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006163
6164 // The process state at the time of compaction.
6165 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006166
6167 // Free ZRAM in kilobytes before compaction.
6168 optional int64 before_zram_free_kilobytes = 17;
6169
6170 // Free ZRAM in kilobytes after compaction.
6171 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006172}
lifr157fc552018-12-12 16:38:04 +08006173
6174/**
lifrb6b90b62019-03-29 00:40:17 +08006175 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6176 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6177 *
lifr1f74b052019-04-16 22:16:30 +08006178 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6179 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6180 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6181 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006182 */
6183message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006184 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006185
lifr1f74b052019-04-16 22:16:30 +08006186 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006187
6188 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006189 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006190
lifr1f74b052019-04-16 22:16:30 +08006191 // Only valid for event_type = EVENT_GETADDRINFO.
6192 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006193
lifr1f74b052019-04-16 22:16:30 +08006194 // Flags passed to android_res_nsend() defined in multinetwork.h
6195 // Only valid for event_type = EVENT_RESNSEND.
6196 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006197
lifrad9becc2019-05-20 11:04:41 +08006198 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006199
6200 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006201 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006202
6203 // Additional pass-through fields opaque to statsd.
6204 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006205 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006206
6207 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6208 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006209}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006210
6211/**
6212 * Logs when a data stall event occurs.
6213 *
6214 * Log from:
6215 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6216 */
6217message DataStallEvent {
6218 // Data stall evaluation type.
6219 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6220 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6221 optional int32 evaluation_type = 1;
6222 // See definition in data_stall_event.proto.
6223 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6224 // See definition in data_stall_event.proto.
6225 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6226 // See definition in data_stall_event.proto.
6227 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6228 // See definition in data_stall_event.proto.
6229 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6230 // See definition in data_stall_event.proto.
6231 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6232}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006233
6234/*
6235 * Logs when RescueParty resets some set of experiment flags.
6236 *
6237 * Logged from:
6238 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6239 */
6240message RescuePartyResetReported {
6241 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6242 optional int32 rescue_level = 1;
6243}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006244
6245/**
6246 * Logs when signed config is received from an APK, and if that config was applied successfully.
6247 * Logged from:
6248 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6249 */
6250message SignedConfigReported {
6251 enum Type {
6252 UNKNOWN_TYPE = 0;
6253 GLOBAL_SETTINGS = 1;
6254 }
6255 optional Type type = 1;
6256
6257 // The final status of the signed config received.
6258 enum Status {
6259 UNKNOWN_STATUS = 0;
6260 APPLIED = 1;
6261 BASE64_FAILURE_CONFIG = 2;
6262 BASE64_FAILURE_SIGNATURE = 3;
6263 SECURITY_EXCEPTION = 4;
6264 INVALID_CONFIG = 5;
6265 OLD_CONFIG = 6;
6266 SIGNATURE_CHECK_FAILED = 7;
6267 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006268 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006269 }
6270 optional Status status = 2;
6271
6272 // The version of the signed config processed.
6273 optional int32 version = 3;
6274
6275 // The package name that the config was extracted from.
6276 optional string from_package = 4;
6277
6278 enum Key {
6279 NO_KEY = 0;
6280 DEBUG = 1;
6281 PRODUCTION = 2;
6282 }
6283 // Which key was used to verify the config.
6284 optional Key verified_with = 5;
6285}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006286
6287/*
6288 * Logs GNSS Network-Initiated (NI) location events.
6289 *
6290 * Logged from:
6291 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6292 */
6293message GnssNiEventReported {
6294 // The type of GnssNiEvent.
6295 enum EventType {
6296 UNKNOWN = 0;
6297 NI_REQUEST = 1;
6298 NI_RESPONSE = 2;
6299 }
6300 optional EventType event_type = 1;
6301
6302 // An ID generated by HAL to associate NI notifications and UI responses.
6303 optional int32 notification_id = 2;
6304
6305 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006306 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006307
6308 // NI requires notification.
6309 optional bool need_notify = 4;
6310
6311 // NI requires verification.
6312 optional bool need_verify = 5;
6313
6314 // NI requires privacy override, no notification/minimal trace.
6315 optional bool privacy_override = 6;
6316
6317 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6318 // seconds.
6319 optional int32 timeout = 7;
6320
6321 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006322 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006323
6324 // String representing the requester of the network inititated location request.
6325 optional string requestor_id = 9;
6326
6327 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6328 // network initiated location request.
6329 optional string text = 10;
6330
6331 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006332 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006333
6334 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006335 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006336
6337 // True if SUPL ES is enabled.
6338 optional bool is_supl_es_enabled = 13;
6339
6340 // True if GNSS location is enabled.
6341 optional bool is_location_enabled = 14;
6342
6343 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006344 optional android.server.location.GnssUserResponseType user_response = 15;
6345}
6346
6347/**
6348 * Logs GNSS non-framework (NFW) location notification.
6349 *
6350 * Logged from:
6351 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6352 */
6353message GnssNfwNotificationReported {
6354 // Package name of the Android proxy application representing the non-framework entity that
6355 // requested location. Set to empty string if unknown.
6356 optional string proxy_app_package_name = 1;
6357
6358 // Protocol stack that initiated the non-framework location request.
6359 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6360
6361 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6362 // set to empty string. This field is opaque to the framework and used for logging purposes.
6363 optional string other_protocol_stack_name = 3;
6364
6365 // Source initiating/receiving the location information.
6366 optional android.server.location.NfwRequestor requestor = 4;
6367
6368 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6369 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6370 // and used for logging purposes.
6371 optional string requestor_id = 5;
6372
6373 // Indicates whether location information was provided for this request.
6374 optional android.server.location.NfwResponseType response_type = 6;
6375
6376 // True if the device is in user initiated emergency session.
6377 optional bool in_emergency_mode = 7;
6378
6379 // True if cached location is provided.
6380 optional bool is_cached_location = 8;
6381
6382 // True if proxy app permission mismatch between framework and GNSS HAL.
6383 optional bool is_permission_mismatched = 9;
6384}
6385
6386/**
6387 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6388 *
6389 * Logged from:
6390 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6391 */
6392message GnssConfigurationReported {
6393 // SUPL host name.
6394 optional string supl_host = 1;
6395
6396 // SUPL port number.
6397 optional int32 supl_port = 2;
6398
6399 // C2K host name.
6400 optional string c2k_host = 3;
6401
6402 // C2K port number.
6403 optional int32 c2k_port = 4;
6404
6405 // The SUPL version requested by Carrier.
6406 optional int32 supl_ver = 5;
6407
6408 // The SUPL mode.
6409 optional android.server.location.SuplMode supl_mode = 6;
6410
6411 // True if NI emergency SUPL restrictions is enabled.
6412 optional bool supl_es = 7;
6413
6414 // LTE Positioning Profile settings
6415 optional android.server.location.LppProfile lpp_profile = 8;
6416
6417 // Positioning protocol on A-Glonass system.
6418 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6419
6420 // True if emergency PDN is used. Otherwise, regular PDN is used.
6421 optional bool use_emergency_pdn_for_emergency_supl= 10;
6422
6423 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6424 optional android.server.location.GpsLock gps_lock = 11;
6425
6426 // Number of seconds to extend the emergency session duration post emergency call.
6427 optional int32 es_extension_sec = 12;
6428
6429 // The full list of package names of proxy Android applications representing the non-framework
6430 // location access entities (on/off the device) for which the framework user has granted
6431 // non-framework location access permission. The package names are concatenated in one string
6432 // with spaces as separators.
6433 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006434}
Jack Yu95b64f32018-12-13 18:26:11 +08006435
6436/**
6437 * Logs when a NFC device's error occurred.
6438 * Logged from:
6439 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6440 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6441 */
6442message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006443 enum Type {
6444 UNKNOWN = 0;
6445 CMD_TIMEOUT = 1;
6446 ERROR_NOTIFICATION = 2;
6447 AID_OVERFLOW = 3;
6448 }
6449 optional Type type = 1;
6450 // If it's nci cmd timeout, log the timeout command.
6451 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006452
Alex Salod7c3eef2019-01-25 14:43:27 -08006453 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006454}
6455
6456/**
6457 * Logs when a NFC device's state changed event
6458 * Logged from:
6459 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6460 */
6461message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006462 enum State {
6463 UNKNOWN = 0;
6464 OFF = 1;
6465 ON = 2;
6466 ON_LOCKED = 3; // Secure Nfc enabled.
6467 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6468 }
6469 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006470}
6471
6472/**
6473 * Logs when a NFC Beam Transaction occurred.
6474 * Logged from:
6475 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6476 */
6477message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006478 enum Operation {
6479 UNKNOWN = 0;
6480 SEND = 1;
6481 RECEIVE = 2;
6482 }
6483 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006484}
6485
6486/**
6487 * Logs when a NFC Card Emulation Transaction occurred.
6488 * Logged from:
6489 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6490 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6491 */
6492message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006493 enum Category {
6494 UNKNOWN = 0;
6495 HCE_PAYMENT = 1;
6496 HCE_OTHER = 2;
6497 OFFHOST = 3;
6498 }
6499 // Transaction belongs to HCE payment or HCE other category, or offhost.
6500 optional Category category = 1;
6501 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6502 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006503}
6504
6505/**
6506 * Logs when a NFC Tag event occurred.
6507 * Logged from:
6508 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6509 */
6510message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006511 enum Type {
6512 UNKNOWN = 0;
6513 URL = 1;
6514 BT_PAIRING = 2;
6515 PROVISION = 3;
6516 WIFI_CONNECT = 4;
6517 APP_LAUNCH = 5;
6518 OTHERS = 6;
6519 }
6520 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006521}
6522
6523/**
6524 * Logs when Hce transaction triggered
6525 * Logged from:
6526 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6527 */
6528message NfcHceTransactionOccurred {
6529 // The latency period(in microseconds) it took for the first HCE data
6530 // exchange.
6531 optional uint32 latency_micros = 1;
6532}
6533
6534/**
6535 * Logs when SecureElement state event changed
6536 * Logged from:
6537 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6538 */
6539message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006540 enum State {
6541 UNKNOWN = 0;
6542 INITIALIZED = 1;
6543 DISCONNECTED = 2;
6544 CONNECTED = 3;
6545 HALCRASH = 4;
6546 }
6547 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006548
Alex Salod7c3eef2019-01-25 14:43:27 -08006549 optional string state_change_reason = 2;
6550 // SIMx or eSEx.
6551 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006552}
6553
6554/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006555 * Information about a permission grant request
6556 */
6557message PermissionGrantRequestResultReported {
6558 // unique value identifying an API call. A API call might result in multiple of these atoms
6559 optional int64 request_id = 1;
6560
6561 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006562 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006563
6564 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006565 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006566
6567 // The permission to be granted
6568 optional string permission_name = 4;
6569
6570 // If the permission was explicitly requested via the API or added by the system
6571 optional bool is_implicit = 5;
6572
6573 enum Result {
6574 UNDEFINED = 0;
6575 // permission request was ignored
6576 IGNORED = 1;
6577 // permission request was ignored because it was user fixed
6578 IGNORED_USER_FIXED = 2;
6579 // permission request was ignored because it was policy fixed
6580 IGNORED_POLICY_FIXED = 3;
6581 // permission was granted by user action
6582 USER_GRANTED = 4;
6583 // permission was automatically granted
6584 AUTO_GRANTED = 5;
6585 // permission was denied by user action
6586 USER_DENIED = 6;
6587 // permission was denied with prejudice by the user
6588 USER_DENIED_WITH_PREJUDICE = 7;
6589 // permission was automatically denied
6590 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006591 // permission request was ignored because permission is restricted
6592 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006593 // one time permission was granted by user action
6594 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006595 // user ignored request by leaving the request screen without choosing any option
6596 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006597 // user granted the permission after being linked to settings
6598 USER_GRANTED_IN_SETTINGS = 12;
6599 // user denied the permission after being linked to settings
6600 USER_DENIED_IN_SETTINGS = 13;
6601 // user denied the permission with prejudice after being linked to settings
6602 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6603 // permission was automatically revoked after one-time permission expired
6604 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006605 // permission was automatically revoked for unused app
6606 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006607 }
6608 // The result of the permission grant
6609 optional Result result = 6;
6610}
6611
6612/**
Jack Yu95b64f32018-12-13 18:26:11 +08006613 * Logs when Omapi API used
6614 * Logged from:
6615 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6616 */
6617message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006618 enum Operation {
6619 UNKNOWN = 0;
6620 OPEN_CHANNEL = 1;
6621 }
6622 optional Operation operation = 1;
6623 // SIMx or eSEx.
6624 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006625
Alex Salod7c3eef2019-01-25 14:43:27 -08006626 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006627}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006628
6629/**
Alex Saloa060aee2019-01-21 14:36:41 -08006630 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6631 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006632 * Logged from:
6633 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6634 */
6635message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006636 optional int64 dispatch_latency_millis = 1;
6637}
6638
6639/**
6640 * Logs AttentionManagerService attention check result.
6641 *
6642 * Logged from:
6643 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6644 */
6645message AttentionManagerServiceResultReported {
6646 // See core/java/android/service/attention/AttentionService.java
6647 enum AttentionCheckResult {
6648 UNKNOWN = 20;
6649 ATTENTION_SUCCESS_ABSENT = 0;
6650 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006651 ATTENTION_FAILURE_UNKNOWN = 2;
6652 ATTENTION_FAILURE_CANCELLED = 3;
6653 ATTENTION_FAILURE_PREEMPTED = 4;
6654 ATTENTION_FAILURE_TIMED_OUT = 5;
6655 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006656 }
6657 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006658}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006659
6660/**
6661 * Logs when an adb connection changes state.
6662 *
6663 * Logged from:
6664 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6665 */
6666message AdbConnectionChanged {
6667 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6668 // previously selected for this system.
6669 optional int64 last_connection_time_millis = 1;
6670
6671 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6672 // to reconnect via adb without user interaction.
6673 optional int64 auth_window_millis = 2;
6674
6675 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6676 optional android.debug.AdbConnectionStateEnum state = 3;
6677
6678 // True if the 'always allow' option was selected for this system.
6679 optional bool always_allow = 4;
6680}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006681
6682/*
6683 * Logs the reported speech DSP status.
6684 *
6685 * Logged from:
6686 * Vendor audio implementation.
6687 */
6688message SpeechDspStatReported {
6689 // The total Speech DSP uptime in milliseconds.
6690 optional int32 total_uptime_millis = 1;
6691 // The total Speech DSP downtime in milliseconds.
6692 optional int32 total_downtime_millis = 2;
6693 optional int32 total_crash_count = 3;
6694 optional int32 total_recover_count = 4;
6695}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006696
6697/**
6698 * Logs USB connector contaminant status.
6699 *
6700 * Logged from: USB Service.
6701 */
6702message UsbContaminantReported {
6703 optional string id = 1;
6704 optional android.service.usb.ContaminantPresenceStatus status = 2;
6705}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006706
6707/**
6708 * This atom is for debugging purpose.
6709 */
6710message DebugElapsedClock {
6711 // Monotically increasing value for each pull.
6712 optional int64 pull_count = 1;
6713 // Time from System.elapsedRealtime.
6714 optional int64 elapsed_clock_millis = 2;
6715 // Time from System.elapsedRealtime.
6716 optional int64 same_elapsed_clock_millis = 3;
6717 // Diff between current elapsed time and elapsed time from previous pull.
6718 optional int64 elapsed_clock_diff_millis = 4;
6719
6720 enum Type {
6721 TYPE_UNKNOWN = 0;
6722 ALWAYS_PRESENT = 1;
6723 PRESENT_ON_ODD_PULLS = 2;
6724 }
6725 // Type of behavior for the pulled data.
6726 optional Type type = 5;
6727}
6728
6729/**
6730 * This atom is for debugging purpose.
6731 */
6732message DebugFailingElapsedClock {
6733 // Monotically increasing value for each pull.
6734 optional int64 pull_count = 1;
6735 // Time from System.elapsedRealtime.
6736 optional int64 elapsed_clock_millis = 2;
6737 // Time from System.elapsedRealtime.
6738 optional int64 same_elapsed_clock_millis = 3;
6739 // Diff between current elapsed time and elapsed time from previous pull.
6740 optional int64 elapsed_clock_diff_millis = 4;
6741}
Steven Wuacef6bb2019-01-23 14:21:17 -05006742
6743/** Logs System UI bubbles event changed.
6744 *
6745 * Logged from:
6746 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6747 */
6748message BubbleUIChanged {
6749
6750 // The app package that is posting the bubble.
6751 optional string package_name = 1;
6752
6753 // The notification channel that is posting the bubble.
6754 optional string notification_channel = 2;
6755
6756 // The notification id associated with the posted bubble.
6757 optional int32 notification_id = 3;
6758
6759 // The position of the bubble within the bubble stack.
6760 optional int32 position = 4;
6761
6762 // The total number of bubbles within the bubble stack.
6763 optional int32 total_number = 5;
6764
6765 // User interactions with the bubble.
6766 enum Action {
6767 UNKNOWN = 0;
6768 POSTED = 1;
6769 UPDATED = 2;
6770 EXPANDED = 3;
6771 COLLAPSED = 4;
6772 DISMISSED = 5;
6773 STACK_DISMISSED = 6;
6774 STACK_MOVED = 7;
6775 HEADER_GO_TO_APP = 8;
6776 HEADER_GO_TO_SETTINGS = 9;
6777 PERMISSION_OPT_IN = 10;
6778 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006779 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006780 SWIPE_LEFT = 13;
6781 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006782 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006783 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006784 }
6785 optional Action action = 6;
6786
6787 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6788 optional float normalized_x_position = 7;
6789 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006790
6791 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6792 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006793
6794 // Whether the bubble is an on-going one.
6795 optional bool is_ongoing = 10;
6796
6797 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006798 // This is deprecated and the value should be ignored.
6799 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006800}
Kweku Adams8845d012018-12-11 20:06:45 -08006801
6802/**
Steven Wu552f63f2019-02-05 13:41:36 -05006803 * Logs System UI bubbles developer errors.
6804 *
6805 * Logged from:
6806 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6807 */
6808message BubbleDeveloperErrorReported {
6809
6810 // The app package that is posting the bubble.
6811 optional string package_name = 1;
6812
6813 // Bubble developer error type enums.
6814 enum Error {
6815 UNKNOWN = 0;
6816 ACTIVITY_INFO_MISSING = 1;
6817 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6818 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6819 }
6820 optional Error error = 2 [default = UNKNOWN];
6821}
6822
6823/**
Kweku Adams8845d012018-12-11 20:06:45 -08006824 * Logs that a constraint for a scheduled job has changed.
6825 *
6826 * Logged from:
6827 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6828 */
6829message ScheduledJobConstraintChanged {
6830 repeated AttributionNode attribution_node = 1;
6831
6832 // Name of the job.
6833 optional string job_name = 2;
6834
6835 optional com.android.server.job.ConstraintEnum constraint = 3;
6836
6837 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006838 UNKNOWN = 0;
6839 UNSATISFIED = 1;
6840 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006841 }
6842 optional State state = 4;
6843}
Alex Salod7c3eef2019-01-25 14:43:27 -08006844
6845/**
6846 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6847 * returns true.
6848 *
6849 * Logged from:
6850 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6851 */
6852message ScreenTimeoutExtensionReported {
6853 // Describes how many times in a row did the power manager reset the screen off timeout.
6854 optional uint32 consecutive_timeout_extended_count = 1;
6855}
Hui Yu885aca12019-01-10 17:11:34 -08006856
6857/*
6858* Logs number of milliseconds it takes to start a process.
6859* The definition of app process start time is from the app launch time to
6860* the time that Zygote finished forking the app process and loaded the
6861* application package's java classes.
6862
6863* This metric is different from AppStartOccurred which is for foreground
6864* activity only.
6865
6866* ProcessStartTime can report all processes (both foreground and background)
6867* start time.
6868*
6869* Logged from:
6870* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6871*/
6872message ProcessStartTime {
6873 // The uid of the ProcessRecord.
6874 optional int32 uid = 1 [(is_uid) = true];
6875
6876 // The process pid.
6877 optional int32 pid = 2;
6878
6879 // The process name.
6880 // Usually package name, "system" for system server.
6881 // Provided by ActivityManagerService.
6882 optional string process_name = 3;
6883
6884 enum StartType {
6885 UNKNOWN = 0;
6886 WARM = 1;
6887 HOT = 2;
6888 COLD = 3;
6889 }
6890
6891 // The start type.
6892 optional StartType type = 4;
6893
6894 // The elapsed realtime at the start of the process.
6895 optional int64 process_start_time_millis = 5;
6896
6897 // Number of milliseconds it takes to reach bind application.
6898 optional int32 bind_application_delay_millis = 6;
6899
6900 // Number of milliseconds it takes to finish start of the process.
6901 optional int32 process_start_delay_millis = 7;
6902
6903 // hostingType field in ProcessRecord, the component type such as "activity",
6904 // "service", "content provider", "broadcast" or other strings.
6905 optional string hosting_type = 8;
6906
6907 // hostingNameStr field in ProcessRecord. The component class name that runs
6908 // in this process.
6909 optional string hosting_name = 9;
6910}
6911
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006912/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006913 * Track Media Codec usage
6914 * Logged from:
6915 * frameworks/av/media/libstagefright/MediaCodec.cpp
6916 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6917 */
6918message MediametricsCodecReported {
6919 optional int64 timestamp_nanos = 1;
6920 optional string package_name = 2;
6921 optional int64 package_version_code = 3;
6922 optional int64 media_apex_version = 4;
6923
6924 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6925}
6926
6927/**
6928 * Track Media Extractor (pulling video/audio streams out of containers) usage
6929 * Logged from:
6930 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6931 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6932 */
6933message MediametricsExtractorReported {
6934 optional int64 timestamp_nanos = 1;
6935 optional string package_name = 2;
6936 optional int64 package_version_code = 3;
6937 optional int64 media_apex_version = 4;
6938
6939 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6940}
6941
6942/**
6943 * Track how we arbitrate between microphone/input requests.
6944 * Logged from
6945 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6946 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6947 */
6948message MediametricsAudiopolicyReported {
6949 optional int64 timestamp_nanos = 1;
6950 optional string package_name = 2;
6951 optional int64 package_version_code = 3;
6952 optional int64 media_apex_version = 4;
6953
6954 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6955}
6956
6957/**
6958 * Track how we arbitrate between microphone requests.
6959 * Logged from
6960 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6961 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6962 */
6963message MediametricsAudiorecordReported {
6964 optional int64 timestamp_nanos = 1;
6965 optional string package_name = 2;
6966 optional int64 package_version_code = 3;
6967 optional int64 media_apex_version = 4;
6968
6969 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6970}
6971
6972/**
6973 * Track how we arbitrate between microphone/input requests.
6974 * Logged from
6975 * frameworks/av/media/libnblog/ReportPerformance.cpp
6976 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6977 */
6978message MediametricsAudiothreadReported {
6979 optional int64 timestamp_nanos = 1;
6980 optional string package_name = 2;
6981 optional int64 package_version_code = 3;
6982 optional int64 media_apex_version = 4;
6983
6984 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6985}
6986
6987/**
6988 * Track how we arbitrate between microphone/input requests.
6989 * Logged from
6990 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6991 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6992 */
6993message MediametricsAudiotrackReported {
6994 optional int64 timestamp_nanos = 1;
6995 optional string package_name = 2;
6996 optional int64 package_version_code = 3;
6997 optional int64 media_apex_version = 4;
6998
6999 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7000}
7001
7002/**
7003 * Track information about DRM framework performance
7004 * Logged from
7005 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7006 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7007 */
7008message MediametricsMediadrmReported {
7009 optional int64 timestamp_nanos = 1;
7010 optional string package_name = 2;
7011 optional int64 package_version_code = 3;
7012 optional int64 media_apex_version = 4;
7013
7014 // vendor+description tell about which DRM plugin is in use on this device
7015 optional string vendor = 5;
7016 optional string description = 6;
7017 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7018 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7019}
7020
7021/**
7022 * Track information about the widevine DRM plugin performance
7023 * Logged from
7024 * vendor/widevine/libwvdrmengine/cdm/metrics
7025 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7026 */
7027message MediametricsDrmWidevineReported {
7028 optional int64 timestamp_nanos = 1;
7029 optional string package_name = 2;
7030 optional int64 package_version_code = 3;
7031 optional int64 media_apex_version = 4;
7032
7033 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7034}
7035
7036/**
7037 * Track information about recordings (e.g. camcorder)
7038 * Logged from
7039 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7040 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7041 */
7042message MediametricsRecorderReported {
7043 optional int64 timestamp_nanos = 1;
7044 optional string package_name = 2;
7045 optional int64 package_version_code = 3;
7046 optional int64 media_apex_version = 4;
7047
7048 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7049}
7050
7051/**
7052 * Track Media Player usage
7053 * Logged from:
7054 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7055 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7056 */
7057message MediametricsNuPlayerReported {
7058 optional int64 timestamp_nanos = 1;
7059 optional string package_name = 2;
7060 optional int64 package_version_code = 3;
7061 optional int64 media_apex_version = 4;
7062
7063 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7064}
7065
7066/**
Robert Shiha4beed32019-08-19 14:15:23 -07007067 * Track Legacy DRM usage
7068 * Logged from
7069 * frameworks/av/drm/drmserver/DrmManager.cpp
7070 */
7071message MediametricsDrmManagerReported {
7072 optional int64 timestamp_nanos = 1;
7073 optional string package_name = 2;
7074 optional int64 package_version_code = 3;
7075 optional int64 media_apex_version = 4;
7076
7077 enum Method {
7078 METHOD_NOT_FOUND = -1;
7079 GET_CONSTRAINTS = 0;
7080 GET_METADATA = 1;
7081 CAN_HANDLE = 2;
7082 PROCESS_DRM_INFO = 3;
7083 ACQUIRE_DRM_INFO = 4;
7084 SAVE_RIGHTS = 5;
7085 GET_ORIGINAL_MIME_TYPE = 6;
7086 GET_DRM_OBJECT_TYPE = 7;
7087 CHECK_RIGHTS_STATUS = 8;
7088 REMOVE_RIGHTS = 9;
7089 REMOVE_ALL_RIGHTS = 10;
7090 OPEN_CONVERT_SESSION = 11;
7091 OPEN_DECRYPT_SESSION = 12;
7092 }
7093
7094 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7095 optional string plugin_id = 5;
7096 optional string description = 6;
7097 optional Method method = 7;
7098 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007099
7100 optional int64 get_constraints_count = 9;
7101 optional int64 get_metadata_count = 10;
7102 optional int64 can_handle_count = 11;
7103 optional int64 process_drm_info_count = 12;
7104 optional int64 acquire_drm_info_count = 13;
7105 optional int64 save_rights_count = 14;
7106 optional int64 get_original_mime_type_count = 15;
7107 optional int64 get_drm_object_type_count = 16;
7108 optional int64 check_rights_status_count = 17;
7109 optional int64 remove_rights_count = 18;
7110 optional int64 remove_all_rights_count = 19;
7111 optional int64 open_convert_session_count = 20;
7112 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007113}
7114
7115/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007116 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007117 * Pulled from: StatsCompanionService
7118*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007119message DangerousPermissionState {
7120 // Name of the permission
7121 optional string permission_name = 1;
7122
7123 // Uid of the package
7124 optional int32 uid = 2 [(is_uid) = true];
7125
7126 // Package requesting the permission
7127 optional string package_name = 3;
7128
7129 // If the permission is granted to the uid
7130 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007131
7132 // Permission flags as per android.content.pm.PermissionFlags
7133 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007134}
7135
Michael Groover4a0ca942019-01-24 17:41:25 -08007136/**
7137 * Logs when a package is denied access to a device identifier based on the new access requirements.
7138 *
7139 * Logged from:
7140 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7141 */
7142message DeviceIdentifierAccessDenied {
7143 // The name of the package denied access to the requested device identifier.
7144 optional string package_name = 1;
7145
7146 // The name of the device identifier method the package attempted to invoke.
7147 optional string method_name = 2;
7148
7149 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007150 // Starting from Android 11, this boolean is not set and will always be false.
7151 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007152
7153 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007154 // Starting from Android 11, this boolean is not set and will always be false.
7155 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007156}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007157
7158/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007159 * Pulls the ongoing mainline install train version code.
7160 * Pulled from StatsCompanionService
7161 */
7162message TrainInfo {
7163 optional int64 train_version_code = 1;
7164
7165 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007166
7167 optional string train_name = 3;
7168
7169 enum Status {
7170 UNKNOWN = 0;
7171 INSTALL_REQUESTED = 1;
7172 INSTALL_STARTED = 2;
7173 INSTALL_STAGED_NOT_READY = 3;
7174 INSTALL_STAGED_READY = 4;
7175 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007176 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7177 // and INSTALL_FAILURE_COMMIT.
7178 INSTALL_FAILURE = 6 [deprecated = true];
7179 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007180 INSTALL_CANCELLED = 7;
7181 INSTALLER_ROLLBACK_REQUESTED = 8;
7182 INSTALLER_ROLLBACK_INITIATED = 9;
7183 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7184 INSTALLER_ROLLBACK_STAGED = 11;
7185 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7186 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7187 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7188 INSTALLER_ROLLBACK_SUCCESS = 15;
7189 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007190 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7191 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7192 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7193 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7194 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7195 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007196 INSTALL_FAILURE_DOWNLOAD = 23;
7197 INSTALL_FAILURE_STATE_MISMATCH = 24;
7198 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007199 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007200 }
7201 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007202}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007203
7204/**
7205 * Logs the gesture stage changed event.
7206 *
7207 * Logged from:
7208 * frameworks/base/packages/SystemUI/
7209 */
7210message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007211 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007212}
7213
7214/**
7215 * Logs the feedback type.
7216 *
7217 * Logged from:
7218 * frameworks/base/packages/SystemUI/
7219 */
7220message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007221 // Whether or not the gesture was used.
7222 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007223}
7224
7225/**
7226 * Logs the progress.
7227 *
7228 * Logged from:
7229 * frameworks/base/packages/SystemUI/
7230 */
7231message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007232 // [0,100] progress for the assist gesture.
7233 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007234}
Neil Fullerdb14b482019-02-05 19:44:44 +00007235
7236/*
7237 * Information about the time zone data on a device.
7238 */
7239message TimeZoneDataInfo {
7240 // A version identifier for the data set on device. e.g. "2018i"
7241 optional string tzdb_version = 1;
7242}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007243
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007244/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007245 * Logs the GPU stats global health information.
7246 *
7247 * Logged from:
7248 * frameworks/native/services/gpuservice/gpustats/
7249 */
7250message GpuStatsGlobalInfo {
7251 // Package name of the gpu driver.
7252 optional string driver_package_name = 1;
7253
7254 // Version name of the gpu driver.
7255 optional string driver_version_name = 2;
7256
7257 // Version code of the gpu driver.
7258 optional int64 driver_version_code = 3;
7259
7260 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7261 optional int64 driver_build_time = 4;
7262
7263 // Total count of the gl driver gets loaded.
7264 optional int64 gl_loading_count = 5;
7265
7266 // Total count of the gl driver fails to be loaded.
7267 optional int64 gl_loading_failure_count = 6;
7268
7269 // Total count of the Vulkan driver gets loaded.
7270 optional int64 vk_loading_count = 7;
7271
7272 // Total count of the Vulkan driver fails to be loaded.
7273 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007274
7275 // Api version of the system Vulkan driver.
7276 optional int32 vulkan_version = 9;
7277
7278 // Api version of the system CPU Vulkan driver.
7279 optional int32 cpu_vulkan_version = 10;
7280
7281 // Api version of the system GLES driver.
7282 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007283
7284 // Total count of the angle driver gets loaded.
7285 optional int64 angle_loading_count = 12;
7286
7287 // Total count of the angle driver fails to be loaded.
7288 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007289}
7290
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007291/**
7292 * GPU driver loading time info.
7293 */
7294message GpuDriverLoadingTime {
7295 // List of all the driver loading times for this app. The list size is
7296 // capped at 50.
7297 repeated int64 driver_loading_time = 1;
7298}
7299
7300/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007301 * Logs the GPU stats per app health information.
7302 *
7303 * Logged from:
7304 * frameworks/native/services/gpuservice/gpustats/
7305 */
7306message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007307 // Package name of the application that loads the gpu driver. Total number
7308 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007309 optional string app_package_name = 1;
7310
7311 // Version code of the gpu driver this app loads.
7312 optional int64 driver_version_code = 2;
7313
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007314 // gl driver loading time info.
7315 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7316 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007317
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007318 // Vulkan driver loading time info.
7319 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7320 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007321
7322 // Angle driver loading time info.
7323 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7324 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007325
7326 // CPU Vulkan implementation is in use.
7327 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007328
7329 // App is not doing pre-rotation correctly.
7330 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007331
7332 // App creates GLESv1 context.
7333 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007334}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007335
7336/*
7337 * Logs the size of the system ion heap.
7338 *
7339 * Pulled from StatsCompanionService.
7340 */
7341message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007342 // Deprecated due to limited support of ion stats in debugfs.
7343 // Use `IonHeapSize` instead.
7344 option deprecated = true;
7345
Rafal Slawikd4e87572019-03-12 13:08:38 +00007346 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007347 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007348 optional int64 size_in_bytes = 1;
7349}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007350
Rafal Slawik77987ed2019-06-17 12:28:23 +01007351/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007352 * Logs the total size of the ion heap.
7353 *
7354 * Pulled from StatsCompanionService.
7355 */
7356message IonHeapSize {
7357 // Total size of all ion heaps in kilobytes.
7358 // Read from: /sys/kernel/ion/total_heaps_kb.
7359 optional int32 total_size_kb = 1;
7360}
7361
7362/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007363 * Logs the per-process size of the system ion heap.
7364 *
7365 * Pulled from StatsCompanionService.
7366 */
7367message ProcessSystemIonHeapSize {
7368 // The uid if available. -1 means not available.
7369 optional int32 uid = 1 [(is_uid) = true];
7370
7371 // The process name (from /proc/PID/cmdline).
7372 optional string process_name = 2;
7373
7374 // Sum of sizes of all allocations.
7375 optional int32 total_size_in_kilobytes = 3;
7376
7377 // Number of allocations.
7378 optional int32 allocation_count = 4;
7379
7380 // Size of the largest allocation.
7381 optional int32 max_size_in_kilobytes = 5;
7382}
7383
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007384/**
7385 * Push network stack events.
7386 *
7387 * Log from:
7388 * frameworks/base/packages/NetworkStack/
7389 */
7390message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007391 // The id that indicates the event reported from NetworkStack.
7392 optional int32 event_id = 1;
7393 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007394 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7395}
Carmen Agimofa769c152019-03-04 14:39:14 +00007396
7397/**
7398 * Logs the apps that are installed on the external storage.
7399 * Pulled from:
7400 * StatsCompanionService
7401 */
7402message AppsOnExternalStorageInfo {
7403 // The type of the external storage.
7404 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7405 // The name of the package that is installed on the external storage.
7406 optional string package_name = 2;
7407}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007408
7409/**
7410 * Logs the settings related to Face.
7411 * Logged from:
7412 * frameworks/base/services/core/java/com/android/server/stats
7413 */
7414message FaceSettings {
7415 // Whether or not face unlock is allowed on Keyguard.
7416 optional bool unlock_keyguard_enabled = 1;
7417 // Whether or not face unlock dismisses the Keyguard.
7418 optional bool unlock_dismisses_keyguard = 2;
7419 // Whether or not face unlock requires attention.
7420 optional bool unlock_attention_required = 3;
7421 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7422 optional bool unlock_app_enabled = 4;
7423 // Whether or not face unlock always requires user confirmation.
7424 optional bool unlock_always_require_confirmation = 5;
7425 // Whether or not a diverse set of poses are required during enrollment.
7426 optional bool unlock_diversity_required = 6;
7427}
Maggie White442b6312019-04-05 16:26:44 -07007428
7429/**
7430 * Logs cooling devices maintained by the kernel.
7431 *
7432 * Pulled from StatsCompanionService.java
7433 */
7434message CoolingDevice {
7435 // The type of cooling device being reported. Eg. CPU, GPU...
7436 optional android.os.CoolingTypeEnum device_location = 1;
7437 // The name of the cooling device source. Eg. CPU0
7438 optional string device_name = 2;
7439 // Current throttle state of the cooling device. The value can any unsigned
7440 // integer between 0 and max_state defined in its driver. 0 means device is
7441 // not in throttling, higher value means deeper throttling.
7442 optional int32 state = 3;
7443}
Ben Blount763a5d52019-04-10 11:48:58 -07007444
7445/**
7446 * Intelligence has several counter-type events that don't warrant a
7447 * full separate atom. These are primarily API call counters but also include
7448 * counters for feature usage and specific failure modes.
7449 *
7450 * Logged from the Intelligence mainline module.
7451 */
7452message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007453 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007454 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007455 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007456 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007457 // How many times the event occured (to report a batch of high frequency events).
7458 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007459 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007460 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007461}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007462
7463/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007464 * Logs when Car Power state changed.
7465 *
7466 * Logged from:
7467 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7468 */
7469message CarPowerStateChanged {
7470 // States come from CpmsState in CarPowerManagementService.java.
7471 enum State {
7472 WAIT_FOR_VHAL = 0;
7473 ON = 1;
7474 SHUTDOWN_PREPARE = 2;
7475 WAIT_FOR_FINISH = 3;
7476 SUSPEND = 4;
7477 SIMULATE_SLEEP = 5;
7478 }
7479 optional State state = 1;
7480}
7481
7482/**
7483 * Logs whether GarageMode is entered.
7484 *
7485 * Logged from:
7486 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7487 */
7488message GarageModeInfo {
7489 // Whether GarageMode is entered.
7490 optional bool is_garage_mode = 1;
7491}
Martijn Coenencd95d462019-04-25 17:09:45 +02007492
7493/**
7494 * Historical app ops data per package.
7495 */
7496message AppOps {
7497 // Uid of the package requesting the op
7498 optional int32 uid = 1 [(is_uid) = true];
7499
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007500 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007501 optional string package_name = 2;
7502
7503 // operation id; maps to the OP_* constants in AppOpsManager.java
7504 optional int32 op_id = 3;
7505
7506 // The number of times the op was granted while the app was in the
7507 // foreground (only for trusted requests)
7508 optional int64 trusted_foreground_granted_count = 4;
7509
7510 // The number of times the op was granted while the app was in the
7511 // background (only for trusted requests)
7512 optional int64 trusted_background_granted_count = 5;
7513
7514 // The number of times the op was rejected while the app was in the
7515 // foreground (only for trusted requests)
7516 optional int64 trusted_foreground_rejected_count = 6;
7517
7518 // The number of times the op was rejected while the app was in the
7519 // background (only for trusted requests)
7520 optional int64 trusted_background_rejected_count = 7;
7521
7522 // For long-running operations, total duration of the operation
7523 // while the app was in the foreground (only for trusted requests)
7524 optional int64 trusted_foreground_duration_millis = 8;
7525
7526 // For long-running operations, total duration of the operation
7527 // while the app was in the background (only for trusted requests)
7528 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007529
7530 // Whether AppOps is guarded by Runtime permission
7531 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007532}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007533
7534/**
7535 * Location Manager API Usage information(e.g. API under usage,
7536 * API call's parameters).
7537 * Logged from:
7538 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7539 */
7540message LocationManagerApiUsageReported {
7541
7542 // Indicating if usage starts or usage ends.
7543 optional android.stats.location.UsageState state = 1;
7544
7545 // LocationManagerService's API in use.
7546 // We can identify which API from LocationManager is
7547 // invoking current LMS API by the combination of
7548 // API parameter(e.g. is_listener_null, is_intent_null,
7549 // is_location_request_null)
7550 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7551
7552 // Name of the package calling the API.
7553 optional string calling_package_name = 3;
7554
7555 // Type of the location provider.
7556 optional android.stats.location.ProviderType provider = 4;
7557
7558 // Quality of the location request
7559 optional android.stats.location.LocationRequestQuality quality = 5;
7560
7561 // The desired interval for active location updates, in milliseconds.
7562 // Bucketized to reduce cardinality.
7563 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7564
7565 // Minimum distance between location updates, in meters.
7566 // Bucketized to reduce cardinality.
7567 optional android.stats.location.SmallestDisplacementBucket
7568 bucketized_smallest_displacement = 7;
7569
7570 // The number of location updates.
7571 optional int64 num_updates = 8;
7572
7573 // The request expiration time, in millisecond since boot.
7574 // Bucketized to reduce cardinality.
7575 optional android.stats.location.ExpirationBucket
7576 bucketized_expire_in = 9;
7577
7578 // Type of Callback passed in for this API.
7579 optional android.stats.location.CallbackType callback_type = 10;
7580
7581 // The radius of the central point of the alert
7582 // region, in meters. Only for API REQUEST_GEOFENCE.
7583 // Bucketized to reduce cardinality.
7584 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7585
7586 // Activity Importance of API caller.
7587 // Categorized to 3 types that are interesting from location's perspective.
7588 optional android.stats.location.ActivityImportance activiy_importance = 12;
7589}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007590
7591/**
7592 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7593 */
7594message ReviewPermissionsFragmentResultReported {
7595 // unique value identifying a permission group change. A permission group change might result
7596 // in multiple of these atoms
7597 optional int64 change_id = 1;
7598
7599 // UID of package the permission belongs to
7600 optional int32 uid = 2 [(is_uid) = true];
7601
7602 // Name of package the permission belongs to
7603 optional string package_name = 3;
7604
7605 // The permission to be granted
7606 optional string permission_name = 4;
7607
7608 // The result of the permission grant
7609 optional bool permission_granted = 5;
7610}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007611
7612/**
7613* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7614* Logged from: RuntimePermissionUpdgradeController
7615*/
7616message RuntimePermissionsUpgradeResult {
7617 // Permission granted as result of upgrade
7618 optional string permission_name = 1;
7619
7620 // UID of package granted permission
7621 optional int32 uid = 2 [(is_uid) = true];
7622
7623 // Name of package granted permission
7624 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007625}
7626
7627/**
7628* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7629*/
7630message GrantPermissionsActivityButtonActions {
7631 // Permission granted as result of upgrade
7632 optional string permission_group_name = 1;
7633
7634 // UID of package granted permission
7635 optional int32 uid = 2 [(is_uid) = true];
7636
7637 // Name of package requesting permission
7638 optional string package_name = 3;
7639
7640 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7641 // LABEL_ constants in GrantPermissionActivity.java
7642 optional int32 buttons_presented = 4;
7643
7644 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7645 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007646
7647 // id which identifies single session of user interacting with permission controller
7648 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007649}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007650
7651/**
7652 * Information about LocationAccessCheck notification presented to user
7653 */
7654message LocationAccessCheckNotificationAction {
7655
7656 // id which identifies single session of user interacting with permission controller
7657 optional int64 session_id = 1;
7658
7659 // Uid of package for which location access check is presented
7660 optional int32 package_uid = 2;
7661
7662 // Name of package for which location access check is presented
7663 optional string package_name = 3;
7664
7665 enum Result {
7666 UNDEFINED = 0;
7667 // notification was presented to the user
7668 NOTIFICATION_PRESENTED = 1;
7669 // notification was declined by the user
7670 NOTIFICATION_DECLINED = 2;
7671 // notification was clicked by the user
7672 NOTIFICATION_CLICKED = 3;
7673 }
7674
7675 // View / interaction recorded
7676 optional Result result = 4;
7677}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007678
7679/**
7680 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7681 */
7682message AppPermissionFragmentActionReported {
7683 // id which identifies single session of user interacting with permission controller
7684 optional int64 session_id = 1;
7685
7686 // unique value identifying a permission group change. A permission group change might result
7687 // in multiple of these atoms
7688 optional int64 change_id = 2;
7689
7690 // UID of package the permission belongs to
7691 optional int32 uid = 3 [(is_uid) = true];
7692
7693 // Name of package the permission belongs to
7694 optional string package_name = 4;
7695
7696 // The permission to be granted
7697 optional string permission_name = 5;
7698
7699 // The result of the permission grant
7700 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007701
7702 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7703 optional int32 permission_flags = 7;
7704
7705 enum Button {
7706 UNDEFINED = 0;
7707 // Allow button
7708 ALLOW = 1;
7709 // Deny button
7710 DENY = 2;
7711 // Ask every time button
7712 ASK_EVERY_TIME = 3;
7713 // Allow all the time button
7714 ALLOW_ALWAYS = 4;
7715 // Allow only while using the app button
7716 ALLOW_FOREGROUND = 5;
7717 // Same is Deny button but shown in while in use dialog
7718 DENY_FOREGROUND = 6;
7719 }
7720
7721 // Button pressed in the dialog
7722 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007723}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007724
7725/**
7726* Information about a AppPermissionFragment viewed by user
7727*/
7728message AppPermissionFragmentViewed {
7729 // id which identifies single session of user interacting with permission controller
7730 optional int64 session_id = 1;
7731
7732 // UID of package for which permissions are viewed
7733 optional int32 uid = 2 [(is_uid) = true];
7734
7735 // Name of package for which permissions are viewed
7736 optional string package_name = 3;
7737
7738 // Permission group viewed
7739 optional string permission_group_name = 4;
7740}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007741
7742/**
7743* Information about a AppPermissionsFragment viewed by user
7744*/
7745message AppPermissionsFragmentViewed {
7746 // id which identifies single session of user interacting with permission controller
7747 optional int64 session_id = 1;
7748
7749 // id which identifies single view as every view might have several logging records
7750 // with different package information attached
7751 optional int64 view_id = 2;
7752
7753 // Permission group viewed
7754 optional string permission_group_name = 3;
7755
7756 // UID of package for which permissions are viewed
7757 optional int32 uid = 4 [(is_uid) = true];
7758
7759 // Name of package for which permissions are viewed
7760 optional string package_name = 5;
7761
7762 // Category in which permission is included
7763 enum Category {
7764 UNDEFINED = 0;
7765 ALLOWED = 1;
7766 ALLOWED_FOREGROUND = 2;
7767 DENIED = 3;
7768 }
7769 optional Category category = 6;
7770}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007771
7772/**
7773* Information about a PermissionAppsFragment viewed by user.
7774* Logged from ui/handheld/PermissionAppsFragment.java
7775*/
7776message PermissionAppsFragmentViewed {
7777 // id which identifies single session of user interacting with permission controller
7778 optional int64 session_id = 1;
7779
7780 // id which identifies single view as every view might have several logging records
7781 // with different package information attached
7782 optional int64 view_id = 2;
7783
7784 // Permission group viewed
7785 optional string permission_group_name = 3;
7786
7787 // UID of package for which permissions are viewed
7788 optional int32 uid = 4 [(is_uid) = true];
7789
7790 // Name of package for which permissions are viewed
7791 optional string package_name = 5;
7792
7793 // Category in which app is included
7794 enum Category {
7795 UNDEFINED = 0;
7796 ALLOWED = 1;
7797 ALLOWED_FOREGROUND = 2;
7798 DENIED = 3;
7799 }
7800 optional Category category = 6;
7801}
Tony Make2b1b672019-07-29 16:59:47 +01007802
7803/**
7804 * Logs when there is a smart selection related event.
7805 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7806 * Logged from: TextClassifierEventLogger.java
7807 */
7808message TextSelectionEvent {
7809 // A session ID.
7810 optional string session_id = 1;
7811
7812 // Event type of this event.
7813 optional android.stats.textclassifier.EventType event_type = 2;
7814
Tony Mak9c84bd22019-12-09 07:27:25 +00007815 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007816 optional string model_name = 3;
7817
7818 // Type of widget that was involved in triggering this event.
7819 optional android.stats.textclassifier.WidgetType widget_type = 4;
7820
7821 // Index of this event in a session.
7822 optional int32 event_index = 5;
7823
7824 // Entity type that is involved.
7825 optional string entity_type = 6;
7826
7827 // Relative word index of the start of the selection.
7828 optional int32 relative_word_start_index = 7;
7829
7830 // Relative word (exclusive) index of the end of the selection.
7831 optional int32 relative_word_end_index = 8;
7832
7833 // Relative word index of the start of the smart selection.
7834 optional int32 relative_suggested_word_start_index = 9;
7835
7836 // Relative word (exclusive) index of the end of the smart selection.
7837 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007838
7839 // Name of source package.
7840 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007841}
7842
7843/**
7844 * Logs when there is a smart linkify related event.
7845 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7846 * Logged from: TextClassifierEventLogger.java
7847 */
7848message TextLinkifyEvent {
7849 // A session ID.
7850 optional string session_id = 1;
7851
7852 // Event type of this event.
7853 optional android.stats.textclassifier.EventType event_type = 2;
7854
Tony Mak9c84bd22019-12-09 07:27:25 +00007855 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007856 optional string model_name = 3;
7857
7858 // Type of widget that was involved in triggering this event.
7859 optional android.stats.textclassifier.WidgetType widget_type = 4;
7860
7861 // Index of this event in a session.
7862 optional int32 event_index = 5;
7863
7864 // Entity type that is involved.
7865 optional string entity_type = 6;
7866
7867 // Number of links detected.
7868 optional int32 num_links = 7;
7869
7870 // The total length of all links.
7871 optional int32 linked_text_length = 8;
7872
7873 // Length of input text.
7874 optional int32 text_length = 9;
7875
7876 // Time spent on generating links in ms.
7877 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007878
7879 // Name of source package.
7880 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007881}
7882
7883/**
7884 * Logs when there is a conversation actions related event.
7885 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7886 * Logged from: TextClassifierEventLogger.java
7887 */
7888message ConversationActionsEvent {
7889 // A session ID.
7890 optional string session_id = 1;
7891
7892 // Event type of this event.
7893 optional android.stats.textclassifier.EventType event_type = 2;
7894
Tony Mak9c84bd22019-12-09 07:27:25 +00007895 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007896 optional string model_name = 3;
7897
7898 // Type of widget that was involved in triggering this event.
7899 optional android.stats.textclassifier.WidgetType widget_type = 4;
7900
7901 // The first entity type that is involved.
7902 optional string first_entity_type = 5;
7903
7904 // The second entity type that is involved.
7905 optional string second_entity_type = 6;
7906
7907 // The third entity type that is involved.
7908 optional string third_entity_type = 7;
7909
7910 // The score of the first entity type.
7911 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007912
7913 // Name of source package.
7914 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007915
7916 // Name of the annotator model that is involved in this event.
7917 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007918}
7919
7920/**
7921 * Logs when there is a language detection related event.
7922 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7923 * Logged from: TextClassifierEventLogger.java
7924 */
7925message LanguageDetectionEvent {
7926 // A session ID.
7927 optional string session_id = 1;
7928
7929 // Event type of this event.
7930 optional android.stats.textclassifier.EventType event_type = 2;
7931
Tony Mak9c84bd22019-12-09 07:27:25 +00007932 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007933 optional string model_name = 3;
7934
7935 // Type of widget that was involved in triggering this event.
7936 optional android.stats.textclassifier.WidgetType widget_type = 4;
7937
7938 // Detected language.
7939 optional string language_tag = 5;
7940
7941 // Score of the detected language.
7942 optional float score = 6;
7943
7944 // Position of this action.
7945 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007946
7947 // Name of source package.
7948 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007949}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007950
7951/**
7952 * Information about an OTA update attempt by update_engine.
7953 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7954 */
7955message UpdateEngineUpdateAttemptReported {
7956 // The number of attempts for the update engine to apply a given payload.
7957 optional int32 attempt_number = 1;
7958
7959 optional android.stats.otaupdate.PayloadType payload_type = 2;
7960
7961 // The total time in minutes for the update engine to apply a given payload.
7962 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7963 // it's increased when the system is sleeping.
7964 optional int32 duration_boottime_in_minutes = 3;
7965
7966 // The total time in minutes for the update engine to apply a given payload.
7967 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7968 // and it's not increased when the system is sleeping.
7969 optional int32 duration_monotonic_in_minutes = 4;
7970
7971 // The size of the payload in MiBs.
7972 optional int32 payload_size_mib = 5;
7973
7974 // The attempt result reported by the update engine for an OTA update.
7975 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7976
7977 // The error code reported by the update engine after an OTA update attempt
7978 // on A/B devices.
7979 optional android.stats.otaupdate.ErrorCode error_code = 7;
7980
7981 // The build fingerprint of the source system. The value is read from a
7982 // system property when the device takes the update. e.g.
7983 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7984 optional string source_fingerprint = 8;
7985}
7986
7987/**
7988 * Information about all the attempts the device make before finishing the
7989 * successful update.
7990 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7991 */
7992message UpdateEngineSuccessfulUpdateReported {
7993 // The number of attempts for the update engine to apply the payload for a
7994 // successful update.
7995 optional int32 attempt_count = 1;
7996
7997 optional android.stats.otaupdate.PayloadType payload_type = 2;
7998
7999 optional int32 payload_size_mib = 3;
8000
8001 // The total number of bytes downloaded by update_engine since the last
8002 // successful update.
8003 optional int32 total_bytes_downloaded_mib = 4;
8004
8005 // The ratio in percentage of the over-downloaded bytes compared to the
8006 // total bytes needed to successfully install the update. e.g. 200 if we
8007 // download 200MiB in total for a 100MiB package.
8008 optional int32 download_overhead_percentage = 5;
8009
8010 // The total time in minutes for the update engine to apply the payload for a
8011 // successful update.
8012 optional int32 total_duration_minutes = 6;
8013
8014 // The number of reboot of the device during a successful update.
8015 optional int32 reboot_count = 7;
8016}
Alec Mourie088e762019-07-02 13:10:55 -07008017
8018/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008019 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8020 * key to indicate whether it was successful or not.
8021 *
8022 * Logged from:
8023 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8024 */
8025message RebootEscrowRecoveryReported {
8026 optional bool successful = 1;
8027}
8028
8029/**
Alec Mourie088e762019-07-02 13:10:55 -07008030 * Global display pipeline metrics reported by SurfaceFlinger.
8031 * Pulled from:
8032 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8033 */
8034message SurfaceflingerStatsGlobalInfo {
8035 // Total number of frames presented during the tracing period
8036 optional int64 total_frames = 1;
8037 // Total number of frames missed
8038 optional int64 missed_frames = 2;
8039 // Total number of frames that fell back to client composition
8040 optional int64 client_composition_frames = 3;
8041 // Total time the display was turned on
8042 optional int64 display_on_millis = 4;
8043 // Total time that was spent performing animations.
8044 // This is derived from the present-to-present layer histogram
8045 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008046 // Total number of event connections tracked by SurfaceFlinger at the time
8047 // of this pull. If this number grows prohibitively large, then this can
8048 // cause jank due to resource contention.
8049 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008050 // Set of timings measured from when SurfaceFlinger began compositing a
8051 // frame, until the frame was requested to be presented to the display. This
8052 // measures SurfaceFlinger's total CPU walltime on the critical path per
8053 // frame.
8054 optional FrameTimingHistogram frame_duration = 7
8055 [(android.os.statsd.log_mode) = MODE_BYTES];
8056 // Set of timings measured from when SurfaceFlinger first began using the
8057 // GPU to composite a frame, until the GPU has finished compositing that
8058 // frame. This measures the total additional time SurfaceFlinger needed to
8059 // perform due to falling back into GPU composition.
8060 optional FrameTimingHistogram render_engine_timing = 8
8061 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008062}
8063
8064/**
8065 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8066 * The number of layers uploaded will be restricted due to size limitations.
8067 * Pulled from:
8068 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8069 */
8070message SurfaceflingerStatsLayerInfo {
8071 // The layer for this set of metrics
8072 // For now we can infer that the package name is included in the layer
8073 // name.
8074 optional string layer_name = 1;
8075 // Total number of frames presented
8076 optional int64 total_frames = 2;
8077 // Total number of dropped frames while latching a buffer for this layer.
8078 optional int64 dropped_frames = 3;
8079 // Set of timings measured between successive presentation timestamps.
8080 optional FrameTimingHistogram present_to_present = 4
8081 [(android.os.statsd.log_mode) = MODE_BYTES];
8082 // Set of timings measured from when an app queued a buffer for
8083 // presentation, until the buffer was actually presented to the
8084 // display.
8085 optional FrameTimingHistogram post_to_present = 5
8086 [(android.os.statsd.log_mode) = MODE_BYTES];
8087 // Set of timings measured from when a buffer is ready to be presented,
8088 // until the buffer was actually presented to the display.
8089 optional FrameTimingHistogram acquire_to_present = 6
8090 [(android.os.statsd.log_mode) = MODE_BYTES];
8091 // Set of timings measured from when a buffer was latched by
8092 // SurfaceFlinger, until the buffer was presented to the display
8093 optional FrameTimingHistogram latch_to_present = 7
8094 [(android.os.statsd.log_mode) = MODE_BYTES];
8095 // Set of timings measured from the desired presentation to the actual
8096 // presentation time
8097 optional FrameTimingHistogram desired_to_present = 8
8098 [(android.os.statsd.log_mode) = MODE_BYTES];
8099 // Set of timings measured from when an app queued a buffer for
8100 // presentation, until the buffer was ready to be presented.
8101 optional FrameTimingHistogram post_to_acquire = 9
8102 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008103 // Frames missed latch because the acquire fence didn't fire
8104 optional int64 late_acquire_frames = 10;
8105 // Frames latched early because the desired present time was bad
8106 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008107}
8108
8109/**
8110 * Histogram of frame counts bucketed by time in milliseconds.
8111 * Because of size limitations, we hard-cap the number of buckets, with
8112 * buckets for corresponding to larger milliseconds being less precise.
8113 */
8114message FrameTimingHistogram {
8115 // Timings in milliseconds that describes a set of histogram buckets
8116 repeated int32 time_millis_buckets = 1;
8117 // Number of frames that match to each time_millis, i.e. the bucket
8118 // contents
8119 // It's required that len(time_millis) == len(frame_count)
8120 repeated int64 frame_counts = 2;
8121}
Emilian Peev6729f372019-08-29 09:14:09 -07008122
Emilian Peev6729f372019-08-29 09:14:09 -07008123/**
8124 * Information about camera facing and API level usage.
8125 * Logged from:
8126 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8127 */
8128message CameraActionEvent {
8129 // Camera session duration
8130 optional int64 duration = 1;
8131
8132 // Camera API level used
8133 optional int32 api_level = 2;
8134
8135 // Name of client package
8136 optional string package_name = 3;
8137
8138 // Camera facing
8139 enum Facing {
8140 UNKNOWN = 0;
8141 BACK = 1;
8142 FRONT = 2;
8143 EXTERNAL = 3;
8144 }
8145 optional Facing facing = 4;
8146}
atrost01a20932019-08-28 15:40:37 +01008147
8148/**
8149 * Logs when a compatibility change is affecting an app.
8150 *
8151 * Logged from:
8152 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8153 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8154 */
8155message AppCompatibilityChangeReported {
8156 // The UID of the app being affected by the compatibilty change.
8157 optional int32 uid = 1 [(is_uid) = true];
8158
8159 // The ID of the change affecting the app.
8160 optional int64 change_id = 2;
8161
8162 enum State {
8163 UNKNOWN_STATE = 0;
8164 ENABLED = 1;
8165 DISABLED = 2;
8166 LOGGED = 3;
8167 }
8168
8169 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8170 // logged otherwise.
8171 optional State state = 3;
8172
8173 enum Source {
8174 UNKNOWN_SOURCE = 0;
8175 APP_PROCESS = 1;
8176 SYSTEM_SERVER = 2;
8177 }
8178
8179 // Where it was logged from.
8180 optional Source source = 4;
8181
8182}
Hector Dearman40579f62019-11-01 13:19:30 +00008183
8184/**
8185 * Logged from
8186 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8187 */
8188message PerfettoUploaded {
8189 enum Event {
8190 PERFETTO_UNDEFINED = 0;
8191 PERFETTO_TRACE_BEGIN = 1;
8192 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8193 PERFETTO_ON_CONNECT = 3;
8194 PERFETTO_ON_TRACING_DISABLED = 4;
8195 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8196 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8197 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8198 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8199 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8200 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8201 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8202 PERFETTO_TRIGGER_BEGIN = 12;
8203 PERFETTO_TRIGGER_SUCCESS = 13;
8204 PERFETTO_TRIGGER_FAILURE = 14;
8205 PERFETTO_HIT_GUARDRAILS = 15;
8206 PERFETTO_ON_TIMEOUT = 16;
8207 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8208 }
8209
8210 // Which stage of the pipeline we are reporting from.
8211 optional Event event = 1;
8212
8213 // UUID matching the one set inside the SystemInfo trace packet.
8214 optional int64 trace_uuid_lsb = 2;
8215 optional int64 trace_uuid_msb = 3;
8216}
Mark Tabrya824a642019-11-05 12:26:12 -08008217
8218/**
8219 * Pulls client metrics on data transferred via Vehicle Maps Service.
8220 * Metrics are keyed by uid + layer.
8221 *
8222 * Pulled from:
8223 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8224 */
8225message VmsClientStats {
8226 // UID of the VMS client app
8227 optional int32 uid = 1 [(is_uid) = true];
8228
8229 // VMS layer definition
8230 optional int32 layer_type = 2;
8231 optional int32 layer_channel = 3;
8232 optional int32 layer_version = 4;
8233
8234 // Bytes and packets sent by the client for the layer
8235 optional int64 tx_bytes = 5;
8236 optional int64 tx_packets = 6;
8237
8238 // Bytes and packets received by the client for the layer
8239 optional int64 rx_bytes = 7;
8240 optional int64 rx_packets = 8;
8241
8242 // Bytes and packets dropped due to client error
8243 optional int64 dropped_bytes = 9;
8244 optional int64 dropped_packets = 10;
8245}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008246
8247/**
8248 * State of a dangerous permission requested by a package - sampled
8249 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8250*/
8251message DangerousPermissionStateSampled {
8252 // Name of the permission
8253 optional string permission_name = 1;
8254
8255 // Uid of the package
8256 optional int32 uid = 2 [(is_uid) = true];
8257
8258 // If the permission is granted to the uid
8259 optional bool is_granted = 3;
8260
8261 // Permission flags as per android.content.pm.PermissionFlags
8262 optional int32 permission_flags = 4;
8263}
8264
Stan Iliev637ba5e2019-08-16 13:43:08 -04008265/**
8266 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8267 */
8268enum PipelineType {
8269 GL = 0;
8270 VULKAN = 1;
8271}
8272
8273/**
8274 * HWUI stats for a given app.
8275 */
8276message GraphicsStats {
8277 // The package name of the app
8278 optional string package_name = 1;
8279
8280 // The version code of the app
8281 optional int64 version_code = 2;
8282
8283 // The start & end timestamps in UTC as
8284 // milliseconds since January 1, 1970
8285 // Compatible with java.util.Date#setTime()
8286 optional int64 stats_start = 3;
8287
8288 optional int64 stats_end = 4;
8289
8290 // HWUI renders pipeline type: GL or Vulkan.
8291 optional PipelineType pipeline = 5;
8292
8293 // Distinct frame count.
8294 optional int32 total_frames = 6;
8295
8296 // Number of "missed vsync" events.
8297 optional int32 missed_vsync_count = 7;
8298
8299 // Number of frames in triple-buffering scenario (high input latency)
8300 optional int32 high_input_latency_count = 8;
8301
8302 // Number of "slow UI thread" events.
8303 optional int32 slow_ui_thread_count = 9;
8304
8305 // Number of "slow bitmap upload" events.
8306 optional int32 slow_bitmap_upload_count = 10;
8307
8308 // Number of "slow draw" events.
8309 optional int32 slow_draw_count = 11;
8310
8311 // Number of frames that missed their deadline (aka, visibly janked)
8312 optional int32 missed_deadline_count = 12;
8313
8314 // The frame time histogram for the package
8315 optional FrameTimingHistogram cpu_histogram = 13
8316 [(android.os.statsd.log_mode) = MODE_BYTES];
8317
8318 // The gpu frame time histogram for the package
8319 optional FrameTimingHistogram gpu_histogram = 14
8320 [(android.os.statsd.log_mode) = MODE_BYTES];
8321
8322 // UI mainline module version.
8323 optional int64 version_ui_module = 15;
8324
8325 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8326 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8327 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8328 // more apps are running / rendering.
8329 optional bool is_today = 16;
8330}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008331
8332/**
8333 * Message related to dangerous (runtime) app ops access
8334 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008335message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008336 // Uid of the package accessing app op
8337 optional int32 uid = 1 [(is_uid) = true];
8338
8339 // Name of the package accessing app op
8340 optional string package_name = 2;
8341
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008342 // operation string id per OPSTR_ constants in AppOpsManager.java
8343 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008344
8345 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8346 // Features must be provided through manifest using <feature> tag available in R and above.
8347 optional string feature_id = 4;
8348
8349 // message related to app op access, limited to 600 chars by API
8350 optional string message = 5;
8351
8352 enum SamplingStrategy {
8353 DEFAULT = 0;
8354 UNIFORM = 1;
8355 RARELY_USED = 2;
8356 }
8357
8358 // sampling strategy used to collect this message
8359 optional SamplingStrategy sampling_strategy = 6;
8360}
8361
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008362/*
8363 * Logs userspace reboot outcome and duration.
8364 *
8365 * Logged from:
8366 * frameworks/base/core/java/com/android/server/BootReceiver.java
8367 */
8368message UserspaceRebootReported {
8369 // Possible outcomes of userspace reboot.
8370 enum Outcome {
8371 // Default value in case platform failed to determine the outcome.
8372 OUTCOME_UNKNOWN = 0;
8373 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8374 SUCCESS = 1;
8375 // Userspace reboot shutdown sequence was aborted.
8376 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8377 // Remounting userdata into checkpointing mode failed.
8378 FAILED_USERDATA_REMOUNT = 3;
8379 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8380 // reboot.
8381 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8382 }
8383 // Outcome of userspace reboot. Always set.
8384 optional Outcome outcome = 1;
8385 // Duration of userspace reboot in case it has a successful outcome.
8386 // Duration is measured as time between userspace reboot was initiated and until boot completed
8387 // (e.g. sys.boot_completed=1).
8388 optional int64 duration_millis = 2;
8389 // State of primary user's (user0) credential encryption storage.
8390 enum UserEncryptionState {
8391 // Default value.
8392 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8393 // Credential encrypted storage is unlocked.
8394 UNLOCKED = 1;
8395 // Credential encrypted storage is locked.
8396 LOCKED = 2;
8397 }
8398 // State of primary user's encryption storage at the moment boot completed. Always set.
8399 optional UserEncryptionState user_encryption_state = 3;
8400}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008401
8402/*
8403 * Logs integrity check information during each install.
8404 *
8405 * Logged from:
8406 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8407 */
8408message IntegrityCheckResultReported {
8409 optional string package_name = 1;
8410 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008411 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008412 optional string installer_package_name = 4;
8413 enum Response {
8414 UNKNOWN = 0;
8415 ALLOWED = 1;
8416 REJECTED = 2;
8417 FORCE_ALLOWED = 3;
8418 }
8419 optional Response response = 5;
8420 // An estimate on the cause of the response. This will only be populated for
8421 // REJECTED and FORCE_ALLOWED
8422 optional bool caused_by_app_cert_rule = 6;
8423 optional bool caused_by_installer_rule = 7;
8424}
8425
8426/**
8427 * Logs the information about the rules and the provider whenever rules are
8428 * pushed into AppIntegrityManager.
8429 *
8430 * Logged from:
8431 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8432 */
8433message IntegrityRulesPushed {
8434 optional bool success = 1;
8435 // Package name of the app that pushed the rules.
8436 optional string rule_provider = 2;
8437 // Version string of arbitrary format provided by the rule provider to
8438 // identify the rules.
8439 optional string rule_version = 3;
8440}
Jordan Liubedfa702019-12-20 15:08:45 -08008441
8442/**
8443 * Logs when a cell broadcast message is received on the device.
8444 *
8445 * Logged from CellBroadcastService module:
8446 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8447 */
8448message CellBroadcastMessageReported {
8449 // The type of Cell Broadcast message
8450 enum CbType {
8451 UNKNOWN_TYPE = 0;
8452 GSM = 1;
8453 CDMA = 2;
8454 CDMA_SPC = 3;
8455 }
8456
8457 // GSM, CDMA, CDMA-SCP
8458 optional CbType type = 1;
8459}
8460
8461/**
8462 * Logs when an error occurs while handling a cell broadcast message;
8463 *
8464 * Logged from CellBroadcastService module:
8465 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8466 */
8467message CellBroadcastMessageError {
8468 // The type of error raised when trying to handle a cell broadcast message
8469 enum ErrorType {
8470 UNKNOWN_TYPE = 0;
8471 CDMA_DECODING_ERROR = 1;
8472 CDMA_SCP_EMPTY = 2;
8473 CDMA_SCP_HANDLING_ERROR = 3;
8474 GSM_INVALID_HEADER_LENGTH = 4;
8475 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8476 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8477 GSM_INVALID_PDU = 7;
8478 GSM_INVALID_GEO_FENCING_DATA = 8;
8479 GSM_UMTS_INVALID_WAC = 9;
8480 FAILED_TO_INSERT_TO_DB = 10;
8481 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8482 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8483 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8484 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8485 }
8486
8487 // What kind of error occurred
8488 optional ErrorType type = 1;
8489
8490 // Exception message (or log message) associated with the error (max 1000 chars)
8491 optional string exception_message = 2;
8492}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008493
8494/**
8495 * Logs when the SDK Extensions test app has polled the current version.
8496 * This is atom ID 354.
8497 *
8498 * Logged from:
8499 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8500 */
8501message SdkExtensionStatus {
8502 enum ApiCallStatus {
8503 CALL_NOT_ATTEMPTED = 0;
8504 CALL_SUCCESSFUL = 1;
8505 CALL_FAILED = 2;
8506 }
8507
8508 optional ApiCallStatus result = 1;
8509
8510 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8511 optional int32 r_extension_version = 2;
8512
8513 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8514 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8515 optional int32 failed_call_symbol = 3;
8516}
Marco Ballesio497aff42020-01-24 08:39:42 -08008517
8518/**
8519 * Logs when an app is frozen or unfrozen.
8520 *
8521 * Logged from:
8522 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8523 */
8524message AppFreezeChanged {
8525 // The type of event.
8526 enum Action {
8527 UNKNOWN = 0;
8528 FREEZE_APP = 1;
8529 UNFREEZE_APP = 2;
8530 }
8531 optional Action action = 1;
8532
8533 // Pid of the process being frozen.
8534 optional int32 pid = 2;
8535
8536 // Name of the process being frozen.
8537 optional string process_name = 3;
8538
8539 // Time since last unfrozen.
8540 optional int64 time_unfrozen_millis = 4;
8541}