blob: 26287a738bedaf5ef06a733ff2705c3645d1d2a1 [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 Ioffe41dd57e2020-01-10 16:05:08 +0000381 UserspaceRebootReported userspace_reboot_reported = 243;
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800382 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman079fdaa2020-01-12 16:45:03 -0500383 NotificationPanelReported notification_panel_reported = 245;
384 NotificationChannelModified notification_panel_modified = 246;
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800385 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
386 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800387 CellBroadcastMessageReported cb_message_reported =
388 249 [(module) = "cellbroadcast"];
389 CellBroadcastMessageError cb_message_error =
390 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700391 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
392 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
393 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800394 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000395 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000396 }
David Chenc8a43242017-10-17 16:23:28 -0700397
David Chen6e3e6cb2018-01-03 16:14:06 -0800398 // Pulled events will start at field 10000.
Yotam Aron74299972020-01-16 16:20:58 +0200399 // Next: 10074
David Chenc8a43242017-10-17 16:23:28 -0700400 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800401 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
402 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
403 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
404 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
405 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
406 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800407 SubsystemSleepState subsystem_sleep_state = 10005;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800408 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
409 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework"];
410 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010 [(module) = "framework"];
411 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
412 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
413 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
414 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
415 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
416 SystemUptime system_uptime = 10015 [(module) = "framework"];
417 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
418 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework"];
Tej Singh86dc9db2018-09-06 00:39:57 +0000419 DiskSpace disk_space = 10018 [deprecated=true];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800420 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
421 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800422 Temperature temperature = 10021 [(module) = "framework"];
423 BinderCalls binder_calls = 10022 [(module) = "framework"];
424 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
425 LooperStats looper_stats = 10024 [(module) = "framework"];
426 DiskStats disk_stats = 10025 [(module) = "framework"];
427 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
428 AppSize app_size = 10027 [(module) = "framework"];
429 CategorySize category_size = 10028 [(module) = "framework"];
430 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800431 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800432 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
433 DiskIo disk_io = 10032 [(module) = "framework"];
434 PowerProfile power_profile = 10033 [(module) = "framework"];
435 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
436 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
437 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700438 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800439 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
440 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
441 10040 [(module) = "framework"];
442 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
443 10041 [(module) = "framework"];
444 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800445 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800448 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
449 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
450 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
451 RoleHolder role_holder = 10049 [(module) = "framework"];
452 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Chenjie Yue13f44a2019-02-07 17:51:38 -0800453 TrainInfo train_info = 10051;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800454 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
455 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800456 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
457 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800458 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
459 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
460 FaceSettings face_settings = 10058 [(module) = "framework"];
461 CoolingDevice cooling_device = 10059 [(module) = "framework"];
462 AppOps app_ops = 10060 [(module) = "framework"];
463 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700464 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
465 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800467 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
469 DangerousPermissionStateSampled dangerous_permission_state_sampled =
470 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400471 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000472 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000473 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200474 PackageNotificationPreferences package_notification_preferences =
475 10071 [(module) = "framework"];
476 PackageNotificationChannelPreferences package_notification_channel_preferences =
477 10072 [(module) = "framework"];
478 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
479 10073 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700480 }
yroa1fe77c2018-02-26 14:22:54 -0800481
Bookatz76aafcf2018-09-17 16:17:10 -0700482 // DO NOT USE field numbers above 100,000 in AOSP.
483 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
484 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100485
486 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700487}
488
Yao Chend54f9dd2017-10-17 17:37:48 +0000489/**
Yangster-mac20877162017-12-22 17:19:39 -0800490 * This proto represents a node of an attribution chain.
491 * Note: All attribution chains are represented as a repeated field of type
492 * AttributionNode. It is understood that in such arrays, the order is that
493 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000494 */
Yangster-mac20877162017-12-22 17:19:39 -0800495message AttributionNode {
496 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800497 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800498
Yangster-mac20877162017-12-22 17:19:39 -0800499 // The (optional) string tag for an element in the attribution chain. If the
500 // element has no tag, it is encoded as an empty string.
501 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700502}
503
Yangster-mac48b3d622018-08-18 12:38:11 -0700504message KeyValuePair {
505 optional int32 key = 1;
506 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700507 int32 value_int = 2;
508 int64 value_long = 3;
509 string value_str = 4;
510 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700511 }
512}
513
514message KeyValuePairsAtom {
515 optional int32 uid = 1;
516 repeated KeyValuePair pairs = 2;
517}
518
Yao Chend54f9dd2017-10-17 17:37:48 +0000519/*
520 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800521 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000522 *
523 * RULES:
524 * - The field ids for each atom must start at 1, and count upwards by 1.
525 * Skipping field ids is not allowed.
526 * - These form an API, so renaming, renumbering or removing fields is
527 * not allowed between android releases. (This is not currently enforced,
528 * but there will be a tool to enforce this restriction).
529 * - The types must be built-in protocol buffer types, namely, no sub-messages
530 * are allowed (yet). The bytes type is also not allowed.
531 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800532 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000533 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800534 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000535 * - A field that is a uid should be a string field, tagged with the [xxx]
536 * annotation. The generated code on android will be represented by UIDs,
537 * and those UIDs will be translated in xxx to those strings.
538 *
539 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700540 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000541 * - If there is a UID, it goes first. Think in an object-oriented fashion.
542 * *****************************************************************************
543 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700544
Yao Chend54f9dd2017-10-17 17:37:48 +0000545/**
Tej Singha72344992019-04-17 18:55:08 -0700546 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700547 * Logs when the Thermal service HAL notifies the throttling start/stop events.
548 *
549 * Logged from:
550 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
551 */
552message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700553 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700554 optional android.os.TemperatureTypeEnum sensor_type = 1;
555
Maggie White442b6312019-04-05 16:26:44 -0700556 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700557 enum State {
558 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700559 START = 1; // START indicated that throttling was triggered.
560 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700561 }
Yangster-mace16189a2018-08-26 12:20:16 -0700562 optional State state = 2;
563
564 optional float temperature = 3;
565}
566
567/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000568 * Logs when the screen state changes.
569 *
570 * Logged from:
571 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
572 */
573message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800574 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800575 optional android.view.DisplayStateEnum state = 1
576 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700577}
Yao Chend54f9dd2017-10-17 17:37:48 +0000578
579/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700580 * Logs that the process state of the uid, as determined by ActivityManager
581 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
585 */
Bookatzc1a050a2017-10-10 15:49:28 -0700586message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800587 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000588
Bookatzdb026a22018-01-10 19:01:56 -0800589 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800590 optional android.app.ProcessStateEnum state = 2
591 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000592}
593
594/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700595 * Logs process state change of a process, as per the activity manager.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
599 */
600message ProcessStateChanged {
601 optional int32 uid = 1;
602 optional string process_name = 2;
603 optional string package_name = 3;
604 // TODO: remove this when validation is done
605 optional int64 version = 5;
606 // The state, from frameworks/base/core/proto/android/app/enums.proto.
607 optional android.app.ProcessStateEnum state = 4;
608}
609
610/**
611 * Logs when ActivityManagerService sleep state is changed.
612 *
613 * Logged from:
614 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
615 */
616message ActivityManagerSleepStateChanged {
617 // TODO: import frameworks proto
618 enum State {
619 UNKNOWN = 0;
620 ASLEEP = 1;
621 AWAKE = 2;
622 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800623 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700624}
625
626/**
627 * Logs when system memory state changes.
628 *
629 * Logged from:
630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
631 */
632message MemoryFactorStateChanged {
633 // TODO: import frameworks proto
634 enum State {
635 MEMORY_UNKNOWN = 0;
636 NORMAL = 1; // normal.
637 MODERATE = 2; // moderate memory pressure.
638 LOW = 3; // low memory.
639 CRITICAL = 4; // critical memory.
640
641 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800642 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700643}
644
645/**
646 * Logs when app is using too much cpu, according to ActivityManagerService.
647 *
648 * Logged from:
649 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
650 */
651message ExcessiveCpuUsageReported {
652 optional int32 uid = 1;
653 optional string process_name = 2;
654 optional string package_name = 3;
655 // package version. TODO: remove this when validation is done
656 optional int64 version = 4;
657}
658
659/**
660 * Logs when a cached process is killed, along with its pss.
661 *
662 * Logged from:
663 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
664 */
665message CachedKillReported {
666 optional int32 uid = 1;
667 optional string process_name = 2;
668 optional string package_name = 3;
669 // TODO: remove this when validation is done
670 optional int64 version = 5;
671 optional int64 pss = 4;
672}
673
674/**
xshu2c3d9e42019-09-26 17:54:02 -0700675 * Logs the change in wifi health.
676 *
677 * Logged from:
678 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
679 */
680message WifiHealthStatReported {
681 // duration this stat is obtained over in milliseconds
682 optional int32 duration_millis = 1;
683 // whether wifi is classified as sufficient for the user's data traffic, determined
684 // by whether the calculated throughput exceeds the average demand within |duration_millis|
685 optional bool is_sufficient = 2;
686 // whether the calculated throughput is exceeds the minimum required for typical usage
687 optional bool is_throughput_good = 3;
688 // whether cellular data is available
689 optional bool is_cell_data_available = 4;
690 // the WLAN channel the connected network is on (ie. 2412)
691 optional int32 frequency = 5;
692}
693
694/**
695 * Logged when wifi detects a significant change in connection failure rate.
696 *
697 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
698 *
699 */
700message WifiFailureStatReported {
701 enum AbnormalityType {
702 UNKNOWN = 0;
703 SIGNIFICANT_INCREASE = 1;
704 SIGNIFICANT_DECREASE = 2;
705 SIMPLY_HIGH = 3;
706 }
707 enum FailureType {
708 FAILURE_UNKNOWN = 0;
709 FAILURE_CONNECTION = 1;
710 FAILURE_ASSOCIATION_REJECTION = 2;
711 FAILURE_ASSOCIATION_TIMEOUT = 3;
712 FAILURE_AUTHENTICATION = 4;
713 FAILURE_NON_LOCAL_DISCONNECTION = 5;
714 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
715 }
716 // Reason for uploading this stat
717 optional AbnormalityType abnormality_type = 1;
718 // The particular type of failure
719 optional FailureType failure_type = 2;
720 // How many times we have encountered this combination of AbnormalityType and FailureType
721 optional int32 failure_count = 3;
722}
723
724/**
725 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
726 *
727 * Logged from:
728 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
729 */
730message WifiConnectionResultReported {
731 enum FailureCode {
732 FAILURE_UNKNOWN = 0;
733 FAILURE_ASSOCIATION_TIMEOUT = 1;
734 FAILURE_ASSOCIATION_REJECTION = 2;
735 FAILURE_AUTHENTICATION_GENERAL = 3;
736 FAILURE_AUTHENTICATION_EAP = 4;
737 FAILURE_DHCP = 5;
738 FAILURE_NETWORK_DISCONNECTION = 6;
739 FAILURE_ROAM_TIMEOUT = 7;
740 }
741 // true represents a successful connection
742 optional bool connection_result = 1;
743 // reason for the connection failure
744 optional FailureCode failure_code = 2;
745 // scan rssi before the connection attempt
746 optional int32 rssi = 3;
747}
748
749/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700750 * Logs when memory stats of a process is reported.
751 *
752 * Logged from:
753 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
754 */
755message ProcessMemoryStatReported {
756 optional int32 uid = 1;
757 optional string process_name = 2;
758 optional string package_name = 3;
759 //TODO: remove this when validation is done
760 optional int64 version = 9;
761 optional int64 pss = 4;
762 optional int64 uss = 5;
763 optional int64 rss = 6;
764 enum Type {
765 ADD_PSS_INTERNAL_SINGLE = 0;
766 ADD_PSS_INTERNAL_ALL_MEM = 1;
767 ADD_PSS_INTERNAL_ALL_POLL = 2;
768 ADD_PSS_EXTERNAL = 3;
769 ADD_PSS_EXTERNAL_SLOW = 4;
770 }
771 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800772 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700773}
774
775/**
Bookatzc1a050a2017-10-10 15:49:28 -0700776 * Logs that a process started, finished, crashed, or ANRed.
777 *
778 * Logged from:
779 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
780 */
781message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700782 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700783
David Chen0b5c90c2018-01-25 16:51:49 -0800784 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800785 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700786
Bookatzddccf0a2017-11-28 16:48:14 -0800787 // What lifecycle state the process changed to.
788 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800789 enum State {
790 FINISHED = 0;
791 STARTED = 1;
792 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800793 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800794 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700795}
796
Bookatzc1a050a2017-10-10 15:49:28 -0700797/**
798 * Logs when the ble scan state changes.
799 *
800 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700801 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700802 */
803message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800804 repeated AttributionNode attribution_node = 1
805 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700806
807 enum State {
808 OFF = 0;
809 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700810 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
811 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700812 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800813 optional State state = 2 [
814 (state_field_option).option = EXCLUSIVE_STATE,
815 (state_field_option).default_state_value = 0 /* State.OFF */,
816 (state_field_option).reset_state_value = 2 /* State.RESET */,
817 (state_field_option).nested = true
818 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700819
Bookatze5ec0b42018-03-26 13:34:56 -0700820 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800821 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700822 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800823 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700824 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800825 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700826}
827
828/**
829 * Logs reporting of a ble scan finding results.
830 *
831 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700832 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700833 */
Bookatzae6738e2018-09-13 11:38:56 -0700834// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700835message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800836 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700837
838 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800839 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700840}
841
842/**
843 * Logs when a sensor state changes.
844 *
845 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700846 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700847 */
848message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800849 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700850
Bookatzc1a050a2017-10-10 15:49:28 -0700851 // The id (int) of the sensor.
852 optional int32 sensor_id = 2;
853
854 enum State {
855 OFF = 0;
856 ON = 1;
857 }
858 optional State state = 3;
859}
860
Bookatzc1a050a2017-10-10 15:49:28 -0700861/**
862 * Logs when GPS state changes.
863 *
864 * Logged from:
865 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
866 */
867message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800868 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700869
870 enum State {
871 OFF = 0;
872 ON = 1;
873 }
874 optional State state = 2;
875}
876
Bookatz48d362e2018-11-06 15:49:08 -0800877/**
878 * Logs when GPS signal quality.
879 *
880 * Logged from:
881 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
882 */
883message GpsSignalQualityChanged {
884 optional android.server.location.GpsSignalQualityEnum level = 1;
885}
886
Bookatzc1a050a2017-10-10 15:49:28 -0700887
888/**
889 * Logs when a sync manager sync state changes.
890 *
891 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700892 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700893 */
894message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800895 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700896
David Chen0b5c90c2018-01-25 16:51:49 -0800897 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800898 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
900 enum State {
901 OFF = 0;
902 ON = 1;
903 }
904 optional State state = 3;
905}
906
Yangster-mac96353002018-09-05 11:18:55 -0700907/*
908 * Deferred job stats.
909 *
910 * Logged from:
911 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
912*/
913message DeferredJobStatsReported {
914 repeated AttributionNode attribution_node = 1;
915
916 // Number of jobs deferred.
917 optional int32 num_jobs_deferred = 2;
918
919 // Time since the last job runs.
920 optional int64 time_since_last_job_millis = 3;
921}
922
Bookatzc1a050a2017-10-10 15:49:28 -0700923/**
924 * Logs when a job scheduler job state changes.
925 *
926 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700927 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700928 */
929message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800930 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700931
932 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800933 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700934
935 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800936 FINISHED = 0;
937 STARTED = 1;
938 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700939 }
940 optional State state = 3;
941
Tej Singh33a412b2018-03-16 18:43:59 -0700942 // The reason a job has stopped.
943 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700944 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700945 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100946
947 // The standby bucket of the app that scheduled the job. These match the framework constants
948 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
949 // already assigned 0.
950 enum Bucket {
951 UNKNOWN = -1;
952 ACTIVE = 0;
953 WORKING_SET = 1;
954 FREQUENT = 2;
955 RARE = 3;
956 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800957 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100958 }
959 optional Bucket standby_bucket = 5 [default = UNKNOWN];
960
961 // The job id (as assigned by the app).
962 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700963}
964
965/**
966 * Logs when the audio state changes.
967 *
968 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700969 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700970 */
971message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800972 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700973
974 enum State {
975 OFF = 0;
976 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700977 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
978 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700979 }
980 optional State state = 2;
981}
982
983/**
984 * Logs when the video codec state changes.
985 *
986 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700987 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700988 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800989message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800990 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700991
992 enum State {
993 OFF = 0;
994 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700995 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
996 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700997 }
998 optional State state = 2;
999}
1000
1001/**
1002 * Logs when the flashlight state changes.
1003 *
1004 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001005 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001006 */
1007message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001008 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001009
1010 enum State {
1011 OFF = 0;
1012 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001013 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1014 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001015 }
1016 optional State state = 2;
1017}
1018
1019/**
1020 * Logs when the camera state changes.
1021 *
1022 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001023 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001024 */
1025message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001026 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001027
1028 enum State {
1029 OFF = 0;
1030 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001031 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1032 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001033 }
1034 optional State state = 2;
1035}
1036
1037/**
1038 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001039 *
1040 * Logged from:
1041 * TODO
1042 */
Bookatzd6746242017-10-24 18:39:35 -07001043message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001044 repeated AttributionNode attribution_node = 1
1045 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001046
Bookatz1a1b0462018-01-12 11:47:03 -08001047 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1048 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001049 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001050 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001051
1052 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001053 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001054
1055 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001056 RELEASE = 0;
1057 ACQUIRE = 1;
1058 CHANGE_RELEASE = 2;
1059 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001060 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001061 optional State state = 4 [
1062 (state_field_option).option = EXCLUSIVE_STATE,
1063 (state_field_option).default_state_value = 0,
1064 (state_field_option).nested = true
1065 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001066}
1067
1068/**
Bookatzc1a050a2017-10-10 15:49:28 -07001069 * Logs when a partial wakelock is considered 'long' (over 1 min).
1070 *
1071 * Logged from:
1072 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1073 */
1074message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001075 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001076
Yao Chend54f9dd2017-10-17 17:37:48 +00001077 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1078 optional string tag = 2;
1079
Bookatzc1a050a2017-10-10 15:49:28 -07001080 // TODO: I have no idea what this is.
1081 optional string history_tag = 3;
1082
1083 enum State {
1084 OFF = 0;
1085 ON = 1;
1086 }
1087 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001088}
1089
Bookatzc1a050a2017-10-10 15:49:28 -07001090/**
Bookatza66083f2018-09-20 17:24:00 -07001091 * Logs when the device is interactive, according to the PowerManager Notifier.
1092 *
1093 * Logged from:
1094 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1095 */
1096message InteractiveStateChanged {
1097 enum State {
1098 OFF = 0;
1099 ON = 1;
1100 }
1101 optional State state = 1;
1102}
1103
1104/**
Bookatzc1a050a2017-10-10 15:49:28 -07001105 * Logs Battery Saver state change.
1106 *
1107 * Logged from:
1108 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1109 */
1110message BatterySaverModeStateChanged {
1111 enum State {
1112 OFF = 0;
1113 ON = 1;
1114 }
1115 optional State state = 1;
1116}
1117
1118/**
1119 * Logs Doze mode state change.
1120 *
1121 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001122 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001123 */
1124message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001125 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001126}
1127
1128
1129/**
1130 * Logs state change of Doze mode including maintenance windows.
1131 *
1132 * Logged from:
1133 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1134 */
1135message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001136 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001137}
1138
1139/**
1140 * Logs screen brightness level.
1141 *
1142 * Logged from:
1143 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1144 */
1145message ScreenBrightnessChanged {
1146 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1147 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001148}
1149
1150/**
1151 * Logs battery level (percent full, from 0 to 100).
1152 *
1153 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001154 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001155 */
1156message BatteryLevelChanged {
1157 // Battery level. Should be in [0, 100].
1158 optional int32 battery_level = 1;
1159}
1160
1161/**
1162 * Logs change in charging status of the device.
1163 *
1164 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001165 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001166 */
1167message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001168 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1169 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001170}
1171
1172/**
1173 * Logs whether the device is plugged in, and what power source it is using.
1174 *
1175 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001176 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001177 */
1178message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001179 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1180 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001181}
1182
Bookatz8c6571b2017-10-24 15:04:41 -07001183/**
1184 * Logs when an app's wakeup alarm fires.
1185 *
1186 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001187 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001188 */
1189message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001190 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001191
1192 // Name of the wakeup alarm.
1193 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001194
1195 // Name of source package (for historical reasons, since BatteryStats tracked it).
1196 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001197
1198 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1199 enum Bucket {
1200 UNKNOWN = 0;
1201 EXEMPTED = 5;
1202 ACTIVE = 10;
1203 WORKING_SET = 20;
1204 FREQUENT = 30;
1205 RARE = 40;
1206 NEVER = 50;
1207 }
1208 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1209 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001210}
1211
1212/**
1213 * Logs when an an app causes the mobile radio to change state.
1214 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1215 *
1216 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001217 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001218 */
1219message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001220 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001221
Bookatz1a1b0462018-01-12 11:47:03 -08001222 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1223 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001224}
1225
1226/**
1227 * Logs when an an app causes the wifi radio to change state.
1228 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1229 *
1230 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001231 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001232 */
1233message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001234 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001235
Bookatz1a1b0462018-01-12 11:47:03 -08001236 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1237 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001238}
1239
1240/**
1241 * Logs kernel wakeup reasons and aborts.
1242 *
1243 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001244 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001245 */
1246message KernelWakeupReported {
1247 // Name of the kernel wakeup reason (or abort).
1248 optional string wakeup_reason_name = 1;
1249
1250 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001251 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001252}
1253
1254/**
Bookatzda1798c2018-12-13 14:16:00 -08001255 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001256 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001257 *
1258 * Logged from:
1259 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1260 */
1261message WifiEnabledStateChanged {
1262 enum State {
1263 OFF = 0;
1264 ON = 1;
1265 }
1266 optional State state = 1;
1267}
1268
1269/**
tsaichristinececebdc2020-02-04 14:05:56 -08001270 * This atom is deprecated starting in R.
1271 *
Bookatzda1798c2018-12-13 14:16:00 -08001272 * 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 -08001273 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1274 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001275 *
1276 * Logged from:
1277 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1278 */
1279message WifiRunningStateChanged {
1280 repeated AttributionNode attribution_node = 1;
1281
1282 enum State {
1283 OFF = 0;
1284 ON = 1;
1285 }
1286 optional State state = 2;
1287}
1288
1289/**
Bookatze5885242017-10-24 20:10:31 -07001290 * Logs wifi locks held by an app.
1291 *
1292 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001293 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001294 */
1295message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001296 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001297
1298 enum State {
1299 OFF = 0;
1300 ON = 1;
1301 }
1302 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001303
1304 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1305 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001306}
1307
1308/**
1309 * Logs wifi signal strength changes.
1310 *
1311 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001312 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001313 */
1314message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001315 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1316 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001317}
1318
1319/**
1320 * Logs wifi scans performed by an app.
1321 *
1322 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001323 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001324 */
1325message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001326 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001327
1328 enum State {
1329 OFF = 0;
1330 ON = 1;
1331 }
1332 optional State state = 2;
1333}
1334
1335/**
Tej Singh4503e102018-01-04 14:35:01 -08001336 * Logs wifi multicast locks held by an app
1337 *
1338 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001339 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001340 */
1341message WifiMulticastLockStateChanged {
1342 repeated AttributionNode attribution_node = 1;
1343
1344 enum State {
1345 OFF = 0;
1346 ON = 1;
1347 }
1348 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001349
1350 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001351}
1352
1353/**
Tej Singh1ea42892018-01-19 09:27:00 -08001354 * Logs shutdown reason and duration on next boot.
1355 *
1356 * Logged from:
1357 * frameworks/base/core/java/com/android/server/BootReceiver.java
1358 */
1359message ShutdownSequenceReported {
1360 // True if shutdown is for a reboot. Default: false if we do not know.
1361 optional bool reboot = 1;
1362
1363 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1364 optional string reason = 2;
1365
1366 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1367 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001368 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001369
1370 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001371 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001372}
1373
Tej Singh6483ea42018-01-25 17:45:49 -08001374
1375/**
1376 * Logs boot reason and duration.
1377 *
1378 * Logged from:
1379 * system/core/bootstat/bootstat.cpp
1380 */
1381message BootSequenceReported {
1382 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1383 // Default: "<EMPTY>" if not available.
1384 optional string bootloader_reason = 1;
1385
1386 // Reason for system boot. Eg. bootloader, reboot,userrequested
1387 // Default: "<EMPTY>" if not available.
1388 optional string system_reason = 2;
1389
1390 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001391 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001392
1393 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001394 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001395
1396 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001397 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001398
1399 // Time since last boot in ms. Default: 0 if not available.
1400 optional int64 time_since_last_boot = 6;
1401}
1402
Tej Singhc477d9c2018-02-05 18:31:39 -08001403
1404/**
1405 * Logs call state and disconnect cause (if applicable).
1406 *
1407 * Logged from:
1408 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1409 */
1410message CallStateChanged {
1411 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1412 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1413 optional android.telecom.CallStateEnum call_state = 1;
1414
1415 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1416 // This value is only applicable when the call_state is DISCONNECTED, and
1417 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1418 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1419 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1420
1421 // True if the call is self-managed, which are apps that use the
1422 // telecom infrastructure to make their own calls.
1423 optional bool self_managed = 3;
1424
1425 // True if call is external. External calls are calls on connected Wear
1426 // devices but show up in Telecom so the user can pull them onto the device.
1427 optional bool external_call = 4;
1428}
1429
Tej Singh1ea42892018-01-19 09:27:00 -08001430/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001431 * Logs keyguard state. The keyguard is the lock screen.
1432 *
1433 * Logged from:
1434 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1435 */
1436message KeyguardStateChanged {
1437 enum State {
1438 UNKNOWN = 0;
1439 // The keyguard is hidden when the phone is unlocked.
1440 HIDDEN = 1;
1441 // The keyguard is shown when the phone is locked (screen turns off).
1442 SHOWN= 2;
1443 // The keyguard is occluded when something is overlaying the keyguard.
1444 // Eg. Opening the camera while on the lock screen.
1445 OCCLUDED = 3;
1446 }
1447 optional State state = 1;
1448}
1449
1450/**
1451 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1452 * prompts the user to enter a password (pattern, pin, etc).
1453 *
1454 * Logged from:
1455 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1456 */
1457
1458message KeyguardBouncerStateChanged {
1459 enum State {
1460 UNKNOWN = 0;
1461 // Bouncer is hidden, either as a result of successfully entering the
1462 // password, screen timing out, or user going back to lock screen.
1463 HIDDEN = 1;
1464 // This is when the user is being prompted to enter the password.
1465 SHOWN = 2;
1466 }
1467 optional State state = 1;
1468}
1469
1470/**
1471 * Logs the result of entering a password into the keyguard bouncer.
1472 *
1473 * Logged from:
1474 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1475 */
1476message KeyguardBouncerPasswordEntered {
1477 enum BouncerResult {
1478 UNKNOWN = 0;
1479 // The password entered was incorrect.
1480 FAILURE = 1;
1481 // The password entered was correct.
1482 SUCCESS = 2;
1483 }
1484 optional BouncerResult result = 1;
1485}
1486
Tej Singha883b372018-02-15 11:30:01 -08001487/*
1488 * Logs changes to the configuration of the device. The configuration is defined
1489 * in frameworks/base/core/java/android/content/res/Configuration.java
1490 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1491 * Please go there to interpret the possible values each field can be.
1492 *
1493 * Logged from:
1494 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1495 */
1496message ResourceConfigurationChanged {
1497 // Bit mask of color capabilities of the screen.
1498 // Contains information about the color gamut and hdr mode of the screen.
1499 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001500 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001501
1502 // The target screen density being rendered to.
1503 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001504 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001505
1506 // Current user preference for the scaling factor for fonts,
1507 // relative to the base density scaling.
1508 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001509 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001510
1511 // Flag indicating whether the hard keyboard is hidden.
1512 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001513 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001514
1515 // The type of keyboard attached to the device.
1516 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1517 optional int32 keyboard = 5;
1518
1519 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1520 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001521 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001522
1523 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1524 // 0 if undefined.
1525 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1526 optional int32 mcc = 7;
1527
1528 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1529 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1530 // MNC_ZERO symbol defined in Configuration.java.
1531 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1532 optional int32 mnc = 8;
1533
1534 // The kind of navigation available on the device.
1535 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1536 optional int32 navigation = 9;
1537
1538 // Flag indicating whether the navigation is available.
1539 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001540 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001541
1542 // Overall orientation of the screen.
1543 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1544 optional int32 orientation = 11;
1545
1546 // The current height of the available screen space, in dp units.
1547 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001548 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001549
1550 // Bit mask of overall layout of the screen.
1551 // Contains information about screen size, whether the screen is wider/taller
1552 // than normal, whether the screen layout is right-tl-left or left-to-right,
1553 // and whether the screen has a rounded shape.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001555 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001556
1557 // Current width of the available screen space, in dp units.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // The smallest screen size an application will see in normal operation.
1562 // This is the smallest value of both screenWidthDp and screenHeightDp
1563 // in portrait and landscape.
1564 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001565 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001566
1567 // The type of touch screen attached to the device.
1568 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1569 optional int32 touchscreen = 16;
1570
1571 // Bit mask of the ui mode.
1572 // Contains information about the overall ui mode of the device.
1573 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1574 // Also contains information about whether the device is in night mode.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001576 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001577}
1578
Tej Singheee317b2018-03-07 19:28:05 -08001579
1580/**
1581 * Logs changes in the connection state of the mobile radio.
1582 *
1583 * Logged from:
1584 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1585 */
1586message MobileConnectionStateChanged {
1587 // States are from the state machine DataConnection.java.
1588 enum State {
1589 UNKNOWN = 0;
1590 // The connection is inactive, or disconnected.
1591 INACTIVE = 1;
1592 // The connection is being activated, or connecting.
1593 ACTIVATING = 2;
1594 // The connection is active, or connected.
1595 ACTIVE = 3;
1596 // The connection is disconnecting.
1597 DISCONNECTING = 4;
1598 // The connection is disconnecting after creating a connection.
1599 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1600 }
1601 optional State state = 1;
1602 // For multi-sim phones, this distinguishes between the sim cards.
1603 optional int32 sim_slot_index = 2;
1604 // Used to identify the connection. Starts at 0 and increments by 1 for
1605 // every new network created. Resets whenever the device reboots.
1606 optional int32 data_connection_id = 3;
1607 // A bitmask for the capabilities of this connection.
1608 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1609 // Default value (if we have no information): 0
1610 optional int64 capabilities = 4;
1611 // If this connection has internet.
1612 // This just checks if the DEFAULT bit of capabilities is set.
1613 optional bool has_internet = 5;
1614}
1615
1616/**
1617 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1618 *
1619 * Logged from:
1620 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1621 */
1622message MobileRadioTechnologyChanged {
1623 optional android.telephony.NetworkTypeEnum state = 1;
1624 // For multi-sim phones, this distinguishes between the sim cards.
1625 optional int32 sim_slot_index = 2;
1626}
1627
Andrew Chantb56388b2018-03-22 21:07:33 -07001628/**
1629 * Logs the VID and PID of any connected USB devices.
1630 *
1631 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1632 *
1633 * Logged by Vendor.
1634 */
1635message UsbDeviceAttached {
1636 optional int32 vid = 1;
1637 optional int32 pid = 2;
1638 optional bool has_audio = 3;
1639 optional bool has_hid = 4;
1640 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001641 enum State {
1642 STATE_DISCONNECTED = 0;
1643 STATE_CONNECTED = 1;
1644 }
1645 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001646 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001647}
1648
Tej Singheee317b2018-03-07 19:28:05 -08001649
Tej Singhdd7bd352018-02-09 19:33:15 -08001650/**
Tej Singh5d991e12018-03-09 19:48:11 -08001651 * Logs when Bluetooth is enabled and disabled.
1652 *
1653 * Logged from:
1654 * services/core/java/com/android/server/BluetoothManagerService.java
1655 */
1656message BluetoothEnabledStateChanged {
1657 repeated AttributionNode attribution_node = 1;
1658 // Whether or not bluetooth is enabled on the device.
1659 enum State {
1660 UNKNOWN = 0;
1661 ENABLED = 1;
1662 DISABLED = 2;
1663 }
1664 optional State state = 2;
1665 // The reason for being enabled/disabled.
1666 // Eg. Airplane mode, crash, application request.
1667 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1668 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001669 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001670}
1671
1672/**
Jack Hed9837c82019-01-09 01:19:13 -08001673 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001674 *
1675 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001676 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1677 *
1678 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001679 */
1680message BluetoothConnectionStateChanged {
1681 // The state of the connection.
1682 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1683 optional android.bluetooth.ConnectionStateEnum state = 1;
1684 // An identifier that can be used to match connect and disconnect events.
1685 // Currently is last two bytes of a hash of a device level ID and
1686 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001687 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001688 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001689 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1690 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001691 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001692 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001693 // An identifier that can be used to match events for this device.
1694 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1695 // Salt: Randomly generated 256 bit value
1696 // Hash algorithm: HMAC-SHA256
1697 // Size: 32 byte
1698 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001699 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001700}
1701
1702/**
1703 * Logs when a Bluetooth device connects and disconnects over ACL
1704 *
1705 * Logged from:
1706 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1707 *
1708 * Next Tag: 3
1709 */
1710message BluetoothAclConnectionStateChanged {
1711 // An identifier that can be used to match events for this device.
1712 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1713 // Salt: Randomly generated 256 bit value
1714 // Hash algorithm: HMAC-SHA256
1715 // Size: 32 byte
1716 // Default: null or empty if the device identifier is not known
1717 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1718 // The state of the connection.
1719 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1720 optional android.bluetooth.ConnectionStateEnum state = 2;
1721}
1722
1723/**
1724 * Logs when a Bluetooth device connects and disconnects over SCO
1725 *
1726 * Logged from:
1727 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1728 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1729 *
1730 * Next Tag: 4
1731 */
1732message BluetoothScoConnectionStateChanged {
1733 // An identifier that can be used to match events for this device.
1734 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1735 // Salt: Randomly generated 256 bit value
1736 // Hash algorithm: HMAC-SHA256
1737 // Size: 32 byte
1738 // Default: null or empty if the device identifier is not known
1739 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1740 // The state of the connection.
1741 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1742 optional android.bluetooth.ConnectionStateEnum state = 2;
1743 // Codec used for this SCO connection
1744 // Default: UNKNOWN
1745 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001746}
1747
Jack Hec27040a2019-01-09 20:54:41 -08001748/**
1749 * Logged when active device of a profile changes
1750 *
1751 * Logged from:
1752 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1753 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1754 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1755 */
1756message BluetoothActiveDeviceChanged {
1757 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1758 // From android.bluetooth.BluetoothProfile
1759 optional int32 bt_profile = 1;
1760 // An identifier that can be used to match events for this new active device.
1761 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1762 // Salt: Randomly generated 256 bit value
1763 // Hash algorithm: HMAC-SHA256
1764 // Size: 32 byte
1765 // Default: null or empty if there is no active device for this profile
1766 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1767}
1768
Jack Heab86dbd22018-12-18 15:43:27 -08001769// Logs when there is an event affecting Bluetooth device's link layer connection.
1770// - This event is triggered when there is a related HCI command or event
1771// - Users of this metrics can deduce Bluetooth device's connection state from these events
1772// - HCI commands are logged before the command is sent, after receiving command status, and after
1773// receiving command complete
1774// - HCI events are logged when they arrive
1775//
1776// Low level log from system/bt
1777//
1778// Bluetooth classic commands:
1779// - CMD_CREATE_CONNECTION
1780// - CMD_DISCONNECT
1781// - CMD_CREATE_CONNECTION_CANCEL
1782// - CMD_ACCEPT_CONNECTION_REQUEST
1783// - CMD_REJECT_CONNECTION_REQUEST
1784// - CMD_SETUP_ESCO_CONNECTION
1785// - CMD_ACCEPT_ESCO_CONNECTION
1786// - CMD_REJECT_ESCO_CONNECTION
1787// - CMD_ENH_SETUP_ESCO_CONNECTION
1788// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1789//
1790// Bluetooth low energy commands:
1791// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1792// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1793// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1794// - CMD_BLE_CLEAR_WHITE_LIST
1795// - CMD_BLE_ADD_WHITE_LIST
1796// - CMD_BLE_REMOVE_WHITE_LIST
1797//
1798// Bluetooth classic events:
1799// - EVT_CONNECTION_COMP
1800// - EVT_CONNECTION_REQUEST
1801// - EVT_DISCONNECTION_COMP
1802// - EVT_ESCO_CONNECTION_COMP
1803// - EVT_ESCO_CONNECTION_CHANGED
1804//
1805// Bluetooth low energy meta events:
1806// - BLE_EVT_CONN_COMPLETE_EVT
1807// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1808//
1809// Next tag: 10
1810message BluetoothLinkLayerConnectionEvent {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // Connection handle of this connection if available
1819 // Range: 0x0000 - 0x0EFF (12 bits)
1820 // Default: 0xFFFF if the handle is unknown
1821 optional int32 connection_handle = 2;
1822 // Direction of the link
1823 // Default: DIRECTION_UNKNOWN
1824 optional android.bluetooth.DirectionEnum direction = 3;
1825 // Type of this link
1826 // Default: LINK_TYPE_UNKNOWN
1827 optional android.bluetooth.LinkTypeEnum type = 4;
1828
1829 // Reason metadata for this link layer connection event, rules for interpretation:
1830 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1831 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1832 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1833 // set and valid, ignore hci_ble_event
1834
1835 // HCI command associated with this event
1836 // Default: CMD_UNKNOWN
1837 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1838 // HCI event associated with this event
1839 // Default: EVT_UNKNOWN
1840 optional android.bluetooth.hci.EventEnum hci_event = 6;
1841 // HCI BLE meta event associated with this event
1842 // Default: BLE_EVT_UNKNOWN
1843 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1844 // HCI command status code if this is triggerred by hci_cmd
1845 // Default: STATUS_UNKNOWN
1846 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1847 // HCI reason code associated with this event
1848 // Default: STATUS_UNKNOWN
1849 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1850}
1851
Howard Roe103fe22019-01-17 16:52:16 -08001852/**
1853 * Logs when a module is rolled back by Watchdog.
1854 *
1855 * Logged from: Rollback Manager
1856 */
1857message WatchdogRollbackOccurred {
1858 enum RollbackType {
1859 UNKNOWN = 0;
1860 ROLLBACK_INITIATE = 1;
1861 ROLLBACK_SUCCESS = 2;
1862 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001863 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001864 }
1865 optional RollbackType rollback_type = 1;
1866
1867 optional string package_name = 2;
1868
1869 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001870
1871 enum RollbackReasonType {
1872 REASON_UNKNOWN = 0;
1873 REASON_NATIVE_CRASH = 1;
1874 REASON_EXPLICIT_HEALTH_CHECK = 2;
1875 REASON_APP_CRASH = 3;
1876 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001877 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001878 }
1879 optional RollbackReasonType rollback_reason = 4;
1880
1881 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1882 // is initiated. Empty if the package is unknown.
1883 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001884
1885 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001886}
1887
Jack Hec27040a2019-01-09 20:54:41 -08001888/**
1889 * Logs when there is a change in Bluetooth A2DP playback state
1890 *
1891 * Logged from:
1892 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1893 */
1894message BluetoothA2dpPlaybackStateChanged {
1895 // An identifier that can be used to match events for this device.
1896 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1897 // Salt: Randomly generated 256 bit value
1898 // Hash algorithm: HMAC-SHA256
1899 // Size: 32 byte
1900 // Default: null or empty if the device identifier is not known
1901 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1902 // Current playback state
1903 // Default: PLAYBACK_STATE_UNKNOWN
1904 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1905 // Current audio coding mode
1906 // Default: AUDIO_CODING_MODE_UNKNOWN
1907 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1908}
1909
1910/**
1911 * Logs when there is a change in A2DP codec config for a particular remote device
1912 *
1913 * Logged from:
1914 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1915 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1916 */
1917message BluetoothA2dpCodecConfigChanged {
1918 // An identifier that can be used to match events for this device.
1919 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1920 // Salt: Randomly generated 256 bit value
1921 // Hash algorithm: HMAC-SHA256
1922 // Size: 32 byte
1923 // Default: null or empty if the device identifier is not known
1924 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1925 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1926 // Default SOURCE_CODEC_TYPE_INVALID
1927 optional int32 codec_type = 2;
1928 // Codec priroity, the higher the more preferred, -1 for disabled
1929 // Default: CODEC_PRIORITY_DEFAULT
1930 optional int32 codec_priority = 3;
1931 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1932 // Default: SAMPLE_RATE_NONE
1933 optional int32 sample_rate = 4;
1934 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1935 // Default: BITS_PER_SAMPLE_NONE
1936 optional int32 bits_per_sample = 5;
1937 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1938 // Default: CHANNEL_MODE_NONE
1939 optional int32 channel_mode = 6;
1940 // Codec specific values
1941 // Default 0
1942 optional int64 codec_specific_1 = 7;
1943 optional int64 codec_specific_2 = 8;
1944 optional int64 codec_specific_3 = 9;
1945 optional int64 codec_specific_4 = 10;
1946}
1947
1948/**
1949 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1950 * Each codec's capability is logged separately due to statsd restriction
1951 *
1952 * Logged from:
1953 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1954 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1955 */
1956message BluetoothA2dpCodecCapabilityChanged {
1957 // An identifier that can be used to match events for this device.
1958 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1959 // Salt: Randomly generated 256 bit value
1960 // Hash algorithm: HMAC-SHA256
1961 // Size: 32 byte
1962 // Default: null or empty if the device identifier is not known
1963 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1964 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1965 // Default SOURCE_CODEC_TYPE_INVALID
1966 optional int32 codec_type = 2;
1967 // Codec priroity, the higher the more preferred, -1 for disabled
1968 // Default: CODEC_PRIORITY_DEFAULT
1969 optional int32 codec_priority = 3;
1970 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1971 // in BluetoothCodecConfig
1972 // Default: empty and SAMPLE_RATE_NONE for individual item
1973 optional int32 sample_rate = 4;
1974 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1975 // in BluetoothCodecConfig
1976 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1977 optional int32 bits_per_sample = 5;
1978 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1979 // BluetoothCodecConfig
1980 // Default: empty and CHANNEL_MODE_NONE for individual item
1981 optional int32 channel_mode = 6;
1982 // Codec specific values
1983 // Default 0
1984 optional int64 codec_specific_1 = 7;
1985 optional int64 codec_specific_2 = 8;
1986 optional int64 codec_specific_3 = 9;
1987 optional int64 codec_specific_4 = 10;
1988}
1989
1990/**
1991 * Logs when A2DP failed to read from PCM source.
1992 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1993 *
1994 * Logged from:
1995 * system/bt
1996 */
1997message BluetoothA2dpAudioUnderrunReported {
1998 // An identifier that can be used to match events for this device.
1999 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2000 // Salt: Randomly generated 256 bit value
2001 // Hash algorithm: HMAC-SHA256
2002 // Size: 32 byte
2003 // Default: null or empty if the device identifier is not known
2004 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2005 // Encoding interval in nanoseconds
2006 // Default: 0
2007 optional int64 encoding_interval_nanos = 2;
2008 // Number of bytes of PCM data that could not be read from the source
2009 // Default: 0
2010 optional int32 num_missing_pcm_bytes = 3;
2011}
2012
2013/**
2014 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2015 * buffer queue is full and we have to drop data
2016 *
2017 * Logged from:
2018 * system/bt
2019 */
2020message BluetoothA2dpAudioOverrunReported {
2021 // An identifier that can be used to match events for this device.
2022 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2023 // Salt: Randomly generated 256 bit value
2024 // Hash algorithm: HMAC-SHA256
2025 // Size: 32 byte
2026 // Default: null or empty if the device identifier is not known
2027 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2028 // Encoding interval in nanoseconds
2029 // Default: 0
2030 optional int64 encoding_interval_nanos = 2;
2031 // Number of buffers dropped in this event
2032 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2033 // Default: 0
2034 optional int32 num_dropped_buffers = 3;
2035 // Number of encoded buffers dropped in this event
2036 // Default 0
2037 optional int32 num_dropped_encoded_frames = 4;
2038 // Number of encoded bytes dropped in this event
2039 // Default: 0
2040 optional int32 num_dropped_encoded_bytes = 5;
2041}
2042
2043/**
2044 * Logs when we receive reports regarding a device's RSSI value
2045 *
2046 * Logged from:
2047 * system/bt
2048 */
2049message BluetoothDeviceRssiReported {
2050 // An identifier that can be used to match events for this device.
2051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2052 // Salt: Randomly generated 256 bit value
2053 // Hash algorithm: HMAC-SHA256
2054 // Size: 32 byte
2055 // Default: null or empty if the device identifier is not known
2056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2057 // Connection handle of this connection if available
2058 // Range: 0x0000 - 0x0EFF (12 bits)
2059 // Default: 0xFFFF if the handle is unknown
2060 optional int32 connection_handle = 2;
2061 // HCI command status code if this is triggerred by hci_cmd
2062 // Default: STATUS_UNKNOWN
2063 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2064 // BR/EDR
2065 // Range: -128 ≤ N ≤ 127 (signed integer)
2066 // Units: dB
2067 // LE:
2068 // Range: -127 to 20, 127 (signed integer)
2069 // Units: dBm
2070 // Invalid when an out of range value is reported
2071 optional int32 rssi = 4;
2072}
2073
2074/**
2075 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2076 *
2077 * Logged from:
2078 * system/bt
2079 */
2080message BluetoothDeviceFailedContactCounterReported {
2081 // An identifier that can be used to match events for this device.
2082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2083 // Salt: Randomly generated 256 bit value
2084 // Hash algorithm: HMAC-SHA256
2085 // Size: 32 byte
2086 // Default: null or empty if the device identifier is not known
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Connection handle of this connection if available
2089 // Range: 0x0000 - 0x0EFF (12 bits)
2090 // Default: 0xFFFF if the handle is unknown
2091 optional int32 connection_handle = 2;
2092 // HCI command status code if this is triggerred by hci_cmd
2093 // Default: STATUS_UNKNOWN
2094 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2095 // Number of consecutive failed contacts for a connection corresponding to the Handle
2096 // Range: uint16_t, 0-0xFFFF
2097 // Default: 0xFFFFF
2098 optional int32 failed_contact_counter = 4;
2099}
2100
2101/**
2102 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2103 *
2104 * Logged from:
2105 * system/bt
2106 */
2107message BluetoothDeviceTxPowerLevelReported {
2108 // An identifier that can be used to match events for this device.
2109 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2110 // Salt: Randomly generated 256 bit value
2111 // Hash algorithm: HMAC-SHA256
2112 // Size: 32 byte
2113 // Default: null or empty if the device identifier is not known
2114 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2115 // Connection handle of this connection if available
2116 // Range: 0x0000 - 0x0EFF (12 bits)
2117 // Default: 0xFFFF if the handle is unknown
2118 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002119 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002120 // Default: STATUS_UNKNOWN
2121 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2122 // Range: -30 ≤ N ≤ 20
2123 // Units: dBm
2124 // Invalid when an out of range value is reported
2125 optional int32 transmit_power_level = 4;
2126}
Jack Heab86dbd22018-12-18 15:43:27 -08002127
Tej Singh5d991e12018-03-09 19:48:11 -08002128/**
Jack He1021a612019-01-20 21:22:46 -08002129 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2130 * receiving an HCI command from the host
2131 *
2132 * Logged from: system/bt
2133 */
2134message BluetoothHciTimeoutReported {
2135 // HCI command associated with this event
2136 // Default: CMD_UNKNOWN
2137 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2138}
2139
2140/**
2141 * Logs when we receive Bluetooth Link Quality Report event from the controller
2142 * See Android Bluetooth HCI specification for more details
2143 *
2144 * Note: all count and bytes field are counted since last event
2145 *
2146 * Logged from: system/bt
2147 */
2148message BluetoothQualityReportReported {
2149 // Quality report ID
2150 // Original type: uint8_t
2151 // Default: BQR_ID_UNKNOWN
2152 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2153 // Packet type of the connection
2154 // Original type: uint8_t
2155 // Default: BQR_PACKET_TYPE_UNKNOWN
2156 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2157 // Connection handle of the connection
2158 // Original type: uint16_t
2159 optional int32 connection_handle = 3;
2160 // Performing Role for the connection
2161 // Original type: uint8_t
2162 optional int32 connection_role = 4;
2163 // Current Transmit Power Level for the connection. This value is the same as the controller's
2164 // response to the HCI_Read_Transmit_Power_Level HCI command
2165 // Original type: uint8_t
2166 optional int32 tx_power_level = 5;
2167 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2168 // absolute receiver signal strength value
2169 // Original type: int8_t
2170 optional int32 rssi = 6;
2171 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2172 // channels used by the link currently
2173 // Original type: uint8_t
2174 optional int32 snr = 7;
2175 // Indicates the number of unused channels in AFH_channel_map
2176 // Original type: uint8_t
2177 optional int32 unused_afh_channel_count = 8;
2178 // Indicates the number of the channels which are interfered and quality is bad but are still
2179 // selected for AFH
2180 // Original type: uint8_t
2181 optional int32 afh_select_unideal_channel_count = 9;
2182 // Current Link Supervision Timeout Setting
2183 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2184 // Original type: uint16_t
2185 optional int32 lsto = 10;
2186 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2187 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2188 // 0x01 (Piconet Clock)
2189 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2190 // Original type: uint32_t
2191 optional int64 connection_piconet_clock = 11;
2192 // The count of retransmission
2193 // Original type: uint32_t
2194 optional int64 retransmission_count = 12;
2195 // The count of no RX
2196 // Original type: uint32_t
2197 optional int64 no_rx_count = 13;
2198 // The count of NAK (Negative Acknowledge)
2199 // Original type: uint32_t
2200 optional int64 nak_count = 14;
2201 // Controller timestamp of last TX ACK
2202 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2203 // Original type: uint32_t
2204 optional int64 last_tx_ack_timestamp = 15;
2205 // The count of Flow-off (STOP)
2206 // Original type: uint32_t
2207 optional int64 flow_off_count = 16;
2208 // Controller timestamp of last Flow-on (GO)
2209 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2210 // Original type: uint32_t
2211 optional int64 last_flow_on_timestamp = 17;
2212 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2213 // Original type: uint32_t
2214 optional int64 buffer_overflow_bytes = 18;
2215 // Buffer underflow count (in byte) since last event
2216 // Original type: uint32_t
2217 optional int64 buffer_underflow_bytes = 19;
2218}
2219
2220/**
2221 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2222 *
2223 * Notes:
2224 * - Each event can be partially filled as we might learn different pieces of device
2225 * information at different time
2226 * - Multiple device info events can be combined to give more complete picture
2227 * - When multiple device info events tries to describe the same information, the
2228 * later one wins
2229 *
2230 * Logged from:
2231 * packages/apps/Bluetooth
2232 */
Jack Heaea26982019-04-04 11:19:48 -07002233message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
2239 // Default: null or empty if the device identifier is not known
2240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2241 // Where is this device info obtained from
2242 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2243 // Name of the data source
2244 // For EXTERNAL: package name of the data source
2245 // For INTERNAL: null for general case, component name otherwise
2246 optional string source_name = 3;
2247 // Name of the manufacturer of this device
2248 optional string manufacturer = 4;
2249 // Model of this device
2250 optional string model = 5;
2251 // Hardware version of this device
2252 optional string hardware_version = 6;
2253 // Software version of this device
2254 optional string software_version = 7;
2255}
2256
2257/**
2258 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2259 * device, as documented by the Bluetooth Core HCI specification
2260 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2261 * Vol 2, Part E, Page 1118
2262 *
2263 * Logged from:
2264 * system/bt
2265 */
2266message BluetoothRemoteVersionInfoReported {
2267 // Connection handle of the connection
2268 // Original type: uint16_t
2269 optional int32 connection_handle = 1;
2270 // HCI command status code
2271 // Default: STATUS_UNKNOWN
2272 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2273 // 1 byte Version of current LMP in the remote controller
2274 optional int32 lmp_version = 3;
2275 // 2 bytes LMP manufacturer code of the remote controller
2276 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2277 optional int32 lmp_manufacturer_code = 4;
2278 // 4 bytes subversion of the LMP in the remote controller
2279 optional int32 lmp_subversion = 5;
2280}
2281
2282/**
2283 * Logs when certain Bluetooth SDP attributes are discovered
2284 * Constant definitions are from:
2285 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2286 *
2287 * Current logged attributes:
2288 * - BluetoothProfileDescriptorList
2289 * - Supported Features Bitmask
2290 *
2291 * Logged from:
2292 * system/bt
2293 */
2294message BluetoothSdpAttributeReported {
2295 // An identifier that can be used to match events for this device.
2296 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2297 // Salt: Randomly generated 256 bit value
2298 // Hash algorithm: HMAC-SHA256
2299 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2300 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2301 // Original type: uint16_t
2302 optional int32 protocol_uuid = 2;
2303 // Short form UUIDs used to identify Bluetooth SDP attribute types
2304 // Original type: uint16_t
2305 optional int32 attribute_id = 3;
2306 // Attribute value for the particular attribute
2307 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2308}
2309
2310/**
2311 * Logs when bond state of a Bluetooth device changes
2312 *
2313 * Logged from:
2314 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2315 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2316 */
2317message BluetoothBondStateChanged {
2318 // An identifier that can be used to match events for this device.
2319 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2320 // Salt: Randomly generated 256 bit value
2321 // Hash algorithm: HMAC-SHA256
2322 // Size: 32 byte
2323 // Default: null or empty if the device identifier is not known
2324 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2325 // Preferred transport type to remote dual mode device
2326 // Default: TRANSPORT_AUTO means no preference
2327 optional android.bluetooth.TransportTypeEnum transport = 2;
2328 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2329 // Default: UNKNOWN
2330 optional android.bluetooth.DeviceTypeEnum type = 3;
2331 // Current bond state (NONE, BONDING, BONDED)
2332 // Default: BOND_STATE_UNKNOWN
2333 optional android.bluetooth.BondStateEnum bond_state = 4;
2334 // Bonding sub state
2335 // Default: BOND_SUB_STATE_UNKNOWN
2336 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2337 // Unbond Reason
2338 // Default: UNBOND_REASON_UNKNOWN
2339 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2340}
2341
2342/**
2343 * Logs there is an event related Bluetooth classic pairing
2344 *
2345 * Logged from:
2346 * system/bt
2347 */
2348message BluetoothClassicPairingEventReported {
2349 // An identifier that can be used to match events for this device.
2350 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2351 // Salt: Randomly generated 256 bit value
2352 // Hash algorithm: HMAC-SHA256
2353 // Size: 32 byte
2354 // Default: null or empty if the device identifier is not known
2355 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2356 // Connection handle of this connection if available
2357 // Range: 0x0000 - 0x0EFF (12 bits)
2358 // Default: 0xFFFF if the handle is unknown
2359 optional int32 connection_handle = 2;
2360 // HCI command associated with this event
2361 // Default: CMD_UNKNOWN
2362 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2363 // HCI event associated with this event
2364 // Default: EVT_UNKNOWN
2365 optional android.bluetooth.hci.EventEnum hci_event = 4;
2366 // HCI command status code if this is triggerred by hci_cmd
2367 // Default: STATUS_UNKNOWN
2368 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2369 // HCI reason code associated with this event
2370 // Default: STATUS_UNKNOWN
2371 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002372 // A status value related to this specific event
2373 // Default: 0
2374 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002375}
2376
2377/**
2378 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2379 *
2380 * Logged from:
2381 * system/bt
2382 */
2383message BluetoothSmpPairingEventReported {
2384 // An identifier that can be used to match events for this device.
2385 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2386 // Salt: Randomly generated 256 bit value
2387 // Hash algorithm: HMAC-SHA256
2388 // Size: 32 byte
2389 // Default: null or empty if the device identifier is not known
2390 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2391 // SMP command sent or received over L2CAP
2392 // Default: CMD_UNKNOWN
2393 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2394 // Whether this command is sent or received
2395 // Default: DIRECTION_UNKNOWN
2396 optional android.bluetooth.DirectionEnum direction = 3;
2397 // SMP failure reason code
2398 // Default: PAIRING_FAIL_REASON_DEFAULT
2399 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2400}
2401
2402/**
Jack He815cdba2019-01-30 17:24:55 -08002403 * Logs when a Bluetooth socket’s connection state changed
2404 *
2405 * Logged from:
2406 * system/bt
2407 */
2408message BluetoothSocketConnectionStateChanged {
2409 // An identifier that can be used to match events for this device.
2410 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2411 // Salt: Randomly generated 256 bit value
2412 // Hash algorithm: HMAC-SHA256
2413 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002414 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002415 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002416 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002417 // Default 0 when unknown or don't care
2418 optional int32 port = 2;
2419 // Socket type as mentioned in
2420 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2421 // Default: SOCKET_TYPE_UNKNOWN
2422 optional android.bluetooth.SocketTypeEnum type = 3;
2423 // Socket connection state
2424 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2425 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2426 // Number of bytes sent to remote device during this connection
2427 optional int64 tx_bytes = 5;
2428 // Number of bytes received from remote device during this connection
2429 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002430 // Socket owner's UID
2431 optional int32 uid = 7 [(is_uid) = true];
2432 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2433 // |port| must be spawned by |server_port|
2434 // Default 0 when unknown or don't care
2435 optional int32 server_port = 8;
2436 // Whether this is a server listener socket
2437 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002438}
2439
2440/**
Jack He71426802019-04-02 13:32:52 -07002441 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2442 *
2443 * Logged from:
2444 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2445 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2446 *
2447 */
2448message BluetoothClassOfDeviceReported {
2449 // An identifier that can be used to match events for this device.
2450 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2451 // Salt: Randomly generated 256 bit value
2452 // Hash algorithm: HMAC-SHA256
2453 // Size: 32 byte
2454 // Default: null or empty if this is a server listener socket
2455 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2456 // Class of Device (CoD) value including both Major, Minor device class and service class
2457 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2458 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2459 // Default: 0
2460 optional int32 class_of_device = 2;
2461}
2462
2463/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002464 * Logs when something is plugged into or removed from the USB-C connector.
2465 *
2466 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002467 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002468 */
2469message UsbConnectorStateChanged {
2470 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002471 STATE_DISCONNECTED = 0;
2472 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002473 }
2474 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002475 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002476 // Last active session in ms.
2477 // 0 when the port is in connected state.
2478 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002479}
2480
2481/**
2482 * Logs the reported speaker impedance.
2483 *
2484 * Logged from:
2485 * Vendor audio implementation.
2486 */
2487message SpeakerImpedanceReported {
2488 optional int32 speaker_location = 1;
2489 optional int32 impedance = 2;
2490}
2491
2492/**
2493 * Logs the report of a failed hardware.
2494 *
2495 * Logged from:
2496 * Vendor HALs.
2497 *
2498 */
2499message HardwareFailed {
2500 enum HardwareType {
2501 HARDWARE_FAILED_UNKNOWN = 0;
2502 HARDWARE_FAILED_MICROPHONE = 1;
2503 HARDWARE_FAILED_CODEC = 2;
2504 HARDWARE_FAILED_SPEAKER = 3;
2505 HARDWARE_FAILED_FINGERPRINT = 4;
2506 }
2507 optional HardwareType hardware_type = 1;
2508
Maggie White6dcd8572019-01-31 14:11:50 -08002509 /**
2510 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002511 * the same hardware_type. The specific locations are vendor defined integers,
2512 * referring to board-specific numbering schemes.
2513 */
2514 optional int32 hardware_location = 2;
2515
Maggie White6dcd8572019-01-31 14:11:50 -08002516 /**
2517 * failure_code is specific to the HardwareType of the failed hardware.
2518 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002519 */
Maggie White6dcd8572019-01-31 14:11:50 -08002520 enum HardwareErrorCode {
2521 UNKNOWN = 0;
2522 COMPLETE = 1;
2523 SPEAKER_HIGH_Z = 2;
2524 SPEAKER_SHORT = 3;
2525 FINGERPRINT_SENSOR_BROKEN = 4;
2526 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002527 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002528 }
2529 optional int32 failure_code = 3;
2530}
2531
2532/**
2533 * Log an event when the device has been physically dropped.
2534 * Reported from the /vendor partition.
2535 */
2536message PhysicalDropDetected {
2537 // Confidence that the event was actually a drop, 0 -> 100
2538 optional int32 confidence_pctg = 1;
2539 // Peak acceleration of the drop, in 1/1000s of a g.
2540 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002541 // Duration of freefall in ms
2542 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002543}
2544
2545/**
2546 * Log bucketed battery charge cycles.
2547 *
2548 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002549 * a given charge point. For example, if 10 cycle buckets are
2550 * initialized, bucket 1 is the lowest 1/10th of the battery,
2551 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002552 *
2553 * Logged from:
2554 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2555 */
2556message ChargeCyclesReported {
2557 optional int32 cycle_bucket_1 = 1;
2558 optional int32 cycle_bucket_2 = 2;
2559 optional int32 cycle_bucket_3 = 3;
2560 optional int32 cycle_bucket_4 = 4;
2561 optional int32 cycle_bucket_5 = 5;
2562 optional int32 cycle_bucket_6 = 6;
2563 optional int32 cycle_bucket_7 = 7;
2564 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002565 optional int32 cycle_bucket_9 = 9;
2566 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002567}
2568
2569/**
Howard Roa46b6582018-09-18 16:45:02 -07002570 * Log battery health snapshot.
2571 *
2572 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2573 * are snapshotted periodically over 24hrs.
2574 */
2575message BatteryHealthSnapshot {
2576 enum BatterySnapshotType {
2577 UNKNOWN = 0;
2578 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2579 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2580 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2581 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2582 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2583 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2584 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2585 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2586 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2587 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2588 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2589 }
2590 optional BatterySnapshotType type = 1;
2591 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002592 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002593 // Voltage Battery Voltage, in microVolts.
2594 optional int32 voltage_micro_volt = 3;
2595 // Current Battery current, in microAmps.
2596 optional int32 current_micro_amps = 4;
2597 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2598 optional int32 open_circuit_micro_volt = 5;
2599 // Resistance Battery Resistance, in microOhms.
2600 optional int32 resistance_micro_ohm = 6;
2601 // Level Battery Level, as % of full.
2602 optional int32 level_percent = 7;
2603}
2604
2605/**
2606 * Log slow I/O operations on the primary storage.
2607 */
2608message SlowIo {
2609 // Classifications of IO Operations.
2610 enum IoOperation {
2611 UNKNOWN = 0;
2612 READ = 1;
2613 WRITE = 2;
2614 UNMAP = 3;
2615 SYNC = 4;
2616 }
2617 optional IoOperation operation = 1;
2618
2619 // The number of slow IO operations of this type over 24 hours.
2620 optional int32 count = 2;
2621}
2622
2623/**
2624 * Log battery caused shutdown with the last recorded voltage.
2625 */
2626message BatteryCausedShutdown {
2627 // The last recorded battery voltage prior to shutdown.
2628 optional int32 last_recorded_micro_volt = 1;
2629}
2630
2631/**
Tej Singha72344992019-04-17 18:55:08 -07002632 * Logs when ThermalService receives throttling events.
2633 *
2634 * Logged from:
2635 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2636 */
2637message ThermalThrottlingSeverityStateChanged {
2638 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2639 optional android.os.TemperatureTypeEnum sensor_type = 1;
2640
2641 // The name of the temperature source. Eg. CPU0
2642 optional string sensor_name = 2;
2643
2644 // Temperature in tenths of a degree C.
2645 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2646 optional int32 temperature_deci_celsius = 3;
2647
2648 // Relative severity of the throttling, see enum definition.
2649 optional android.os.ThrottlingSeverityEnum severity = 4;
2650}
2651
2652/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002653 * Logs the duration of a davey (jank of >=700ms) when it occurs
2654 *
2655 * Logged from:
2656 * frameworks/base/libs/hwui/JankTracker.cpp
2657 */
2658message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002659 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002660 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002661
Tej Singhbb8554a2018-01-26 11:59:14 -08002662 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002663 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002664}
2665
2666/**
Bookatze5885242017-10-24 20:10:31 -07002667 * Logs phone signal strength changes.
2668 *
2669 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002670 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002671 */
2672message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002673 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2674 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002675}
2676
Yangster4ccebea2018-10-09 17:09:02 -07002677
2678/**
2679 * Logs when the phone state, sim state or signal strength changes
2680 *
2681 * Logged from:
2682 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2683 */
2684message PhoneServiceStateChanged {
2685 optional android.telephony.ServiceStateEnum state = 1;
2686 optional android.telephony.SimStateEnum sim_state = 2;
2687 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2688}
2689
2690/**
2691 * Logs when the phone becomes on or off.
2692 *
2693 * Logged from:
2694 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2695 */
2696message PhoneStateChanged {
2697 enum State {
2698 OFF = 0;
2699 ON = 1;
2700 }
2701 optional State state = 1;
2702}
2703
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002704message BackGesture {
2705 enum BackType {
2706 DEFAULT_BACK_TYPE = 0;
2707 COMPLETED = 1;
2708 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2709 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2710 INCOMPLETE = 4;
2711 }
2712 optional BackType type = 1;
2713
2714 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2715 enum WindowHorizontalLocation {
2716 DEFAULT_LOCATION = 0;
2717 LEFT = 1;
2718 RIGHT = 2;
2719 }
2720 optional WindowHorizontalLocation x_location = 3;
2721}
2722
2723message ExclusionRectStateChanged {
2724 optional string component_name = 1; // if not available, simply packageName
2725 optional int32 requested_height = 2; // px
2726 optional int32 rejected_height = 3; // px
2727
2728 enum WindowHorizontalLocation {
2729 DEFAULT_LOCATION = 0;
2730 LEFT = 1;
2731 RIGHT = 2;
2732 }
2733 optional WindowHorizontalLocation x_location = 4;
2734 optional bool landscape = 5;
2735 optional bool splitscreen = 6;
2736 optional int32 duration_millis = 7;
2737}
2738
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002739message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002740 optional android.stats.launcher.LauncherAction action = 1;
2741 optional android.stats.launcher.LauncherState src_state = 2;
2742 optional android.stats.launcher.LauncherState dst_state = 3;
2743 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002744 optional bool is_swipe_up_enabled = 5;
2745}
2746
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002747message StyleUIChanged {
2748 optional android.stats.style.Action action = 1;
2749 optional int32 color_package_hash = 2;
2750 optional int32 font_package_hash = 3;
2751 optional int32 shape_package_hash = 4;
2752 optional int32 clock_package_hash = 5;
2753 optional int32 launcher_grid = 6;
2754 optional int32 wallpaper_category_hash = 7;
2755 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002756 optional int32 color_preference = 9;
2757 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002758}
2759
David Chenc28b2bb2017-10-24 12:52:52 -07002760/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002761 * Logs when Settings UI has changed.
2762 *
2763 * Logged from:
2764 * packages/apps/Settings
2765 */
2766message SettingsUIChanged {
2767 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002768 * Where this SettingsUIChange event comes from. For example, if
2769 * it's a PAGE_VISIBLE event, where the page is opened from.
2770 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002771 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002772
2773 /**
2774 * What the UI action is.
2775 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002776 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002777
2778 /**
2779 * Where the action is happening
2780 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002781 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002782
2783 /**
2784 * What preference changed in this event.
2785 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002786 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002787
2788 /**
2789 * The new value of the changed preference.
2790 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002791 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002792}
2793
2794/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002795 * Logs basic timing information about touch events.
2796 * Reported at most every 5 minutes while device is being interacted with.
2797 *
2798 * Logged from:
2799 * frameworks/native/services/inputflinger
2800 */
2801message TouchEventReported {
2802 /**
2803 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002804 * and the standard deviation of the time spent processing touchscreen events
2805 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002806 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002807 * On supported devices, the starting point is taken during the hard interrupt inside the
2808 * kernel touch driver. On all other devices, the starting point is taken inside
2809 * the kernel's input event subsystem upon receipt of the input event.
2810 * The ending point is taken inside InputDispatcher, just after the input event
2811 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002812 */
2813 // Minimum value
2814 optional float latency_min_micros = 1;
2815 // Maximum value
2816 optional float latency_max_micros = 2;
2817 // Average value
2818 optional float latency_mean_micros = 3;
2819 // Standard deviation
2820 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002821 // Number of touch events (input_event) in this report
2822 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002823}
2824
2825/**
Philip Quinn0eded622019-01-29 12:46:28 -08002826 * Logs gesture classification and timing information for touch events.
2827 *
2828 * Logged from:
2829 * frameworks/base/core/java/android/view/GestureDetector.java
2830 * frameworks/base/core/java/android/view/View.java
2831 */
2832message TouchGestureClassified {
2833 // The source of the classification (e.g. Java class name).
2834 optional string source = 1;
2835
2836 enum Classification {
2837 UNKNOWN_CLASSIFICATION = 0;
2838 SINGLE_TAP = 1;
2839 DOUBLE_TAP = 2;
2840 LONG_PRESS = 3;
2841 DEEP_PRESS = 4;
2842 SCROLL = 5;
2843 }
2844 // The classification of the gesture.
2845 optional Classification classification = 2;
2846
2847 // The interval from the start of a touch event stream until the
2848 // classification was made.
2849 optional int32 latency_millis = 3;
2850
2851 // The distance from the location of the first touch event to the
2852 // location of the touch event when the classification was made.
2853 optional float displacement_px = 4;
2854}
2855
2856/**
David Chenc28b2bb2017-10-24 12:52:52 -07002857 * Logs that a setting was updated.
2858 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002859 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002860 * The tag and is_default allow resetting of settings to default values based on the specified
2861 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2862 */
2863message SettingChanged {
2864 // The name of the setting.
2865 optional string setting = 1;
2866
2867 // The change being imposed on this setting. May represent a number, eg "3".
2868 optional string value = 2;
2869
2870 // The new value of this setting. For most settings, this is same as value. For some settings,
2871 // value is +X or -X where X represents an element in a set. For example, if the previous value
2872 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2873 // The +/- feature is currently only used for location_providers_allowed.
2874 optional string new_value = 3;
2875
2876 // The previous value of this setting.
2877 optional string prev_value = 4;
2878
2879 // The tag used with the is_default for resetting sets of settings. This is generally null.
2880 optional string tag = 5;
2881
Bookatz90867622018-01-31 15:05:57 -08002882 // True if this setting with tag should be resettable.
2883 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002884
David Chenbd789912018-03-16 17:19:55 -07002885 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002886 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002887
2888 enum ChangeReason {
2889 UPDATED = 1; // Updated can be an insertion or an update.
2890 DELETED = 2;
2891 }
2892 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002893}
Chenjie Yub3dda412017-10-24 13:41:59 -07002894
Chenjie Yu05013b32017-11-21 10:21:41 -08002895/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002896 * Logs activity going to foreground or background
2897 *
2898 * Logged from:
2899 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2900 */
2901message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002902 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002903 optional string pkg_name = 2;
2904 optional string class_name = 3;
2905
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002906 enum State {
2907 BACKGROUND = 0;
2908 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002909 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002910 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002911}
David Chenc8a43242017-10-17 16:23:28 -07002912
2913/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002914 * Logs when a volume entered low Storage state.
2915 * Logged from:
2916 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2917 */
2918message LowStorageStateChanged {
2919 // Volume that ran out of storage.
2920 optional string volume_description = 1;
2921
2922 enum State {
2923 UNKNOWN = 0;
2924 OFF = 1;
2925 ON = 2;
2926 }
2927 optional State state = 2;
2928}
2929
2930/**
2931 * Logs when an app is downgraded.
2932 * Logged from:
2933 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2934 */
2935message AppDowngraded {
2936 optional string package_name = 1;
2937 // Size of the package (all data) before being downgraded.
2938 optional int64 size_in_bytes_before = 2;
2939 // Size of the package (all data) after being downgraded.
2940 optional int64 size_in_bytes_after = 3;
2941
2942 optional bool aggressive = 4;
2943}
2944
2945/**
2946 * Logs when an app is optimized after being downgraded.
2947 * Logged from:
2948 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2949 */
2950message AppOptimizedAfterDowngraded {
2951 optional string package_name = 1;
2952}
2953
2954/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002955 * Logs whenever an app is installed on external storage.
2956 * Logged from:
2957 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2958 */
2959message AppInstallOnExternalStorageReported {
2960 // The type of external storage.
2961 optional android.stats.storage.ExternalStorageType storage_type = 1;
2962 // The name of the package that is installed on the sd card.
2963 optional string package_name = 2;
2964}
2965
2966/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002967 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002968 * Logged from:
2969 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2970 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002971message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002972 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002973
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002974 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002975
2976 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002977 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002978 optional string process_name = 3;
2979
2980 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002981 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002982
2983 optional string package_name = 5;
2984
2985 enum InstantApp {
2986 UNAVAILABLE = 0;
2987 FALSE = 1;
2988 TRUE = 2;
2989 }
2990 optional InstantApp is_instant_app = 6;
2991
2992 enum ForegroundState {
2993 UNKNOWN = 0;
2994 BACKGROUND = 1;
2995 FOREGROUND = 2;
2996 }
2997 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002998
2999 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003000}
David Chen9e3808c2017-11-20 17:25:34 -08003001
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003002/**
3003 * Logs when a WTF (What a Terrible Failure) happened.
3004 * Logged from:
3005 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3006 */
3007message WTFOccurred {
3008 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003009
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003010 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003011
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003012 // The name of the process.
3013 // system_server if it is not by an app
3014 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003015
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003016 // The pid if available. -1 means not available.
3017 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003018
3019 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020}
3021
3022/**
3023 * Logs when system server reports low memory.
3024 * Logged from:
3025 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3026 */
3027message LowMemReported {
3028}
3029
3030/**
3031 * Logs when an app ANR (App Not Responding) occurs.
3032 * Logged from:
3033 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3034 */
3035message ANROccurred {
3036 optional int32 uid = 1 [(is_uid) = true];
3037
3038 optional string process_name = 2;
3039
3040 optional string short_component_name = 3;
3041
3042 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07003043
3044 enum InstantApp {
3045 UNAVAILABLE = 0;
3046 FALSE = 1;
3047 TRUE = 2;
3048 }
3049 optional InstantApp is_instant_app = 5;
3050
3051 enum ForegroundState {
3052 UNKNOWN = 0;
3053 BACKGROUND = 1;
3054 FOREGROUND = 2;
3055 }
3056 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003057
3058 optional android.server.ErrorSource error_source = 7;
3059
3060 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003061}
3062
Bookatza7020bd2018-08-28 16:29:35 -07003063/**
3064 * Logs when the vibrator state changes.
3065 * Logged from:
3066 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3067 */
3068message VibratorStateChanged {
3069 repeated AttributionNode attribution_node = 1;
3070
3071 enum State {
3072 OFF = 0;
3073 ON = 1;
3074 }
3075 optional State state = 2;
3076
3077 // Duration (in milliseconds) requested to keep the vibrator on.
3078 // Only applicable for State == ON.
3079 optional int64 duration_millis = 3;
3080}
3081
David Chen0a368b22017-12-06 16:28:16 -08003082/*
3083 * Allows other apps to push events into statsd.
3084 * Logged from:
3085 * frameworks/base/core/java/android/util/StatsLog.java
3086 */
David Chen0b5c90c2018-01-25 16:51:49 -08003087message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003088 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003089 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003090
3091 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3092 optional int32 label = 2;
3093
3094 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3095 // predicates for the metrics).
3096 enum State {
3097 UNKNOWN = 0;
3098 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3099 STOP = 2;
3100 START = 3;
3101 }
3102 optional State state = 3;
3103}
3104
David Chen9e3808c2017-11-20 17:25:34 -08003105/**
Bookatz7948c872018-09-04 12:58:33 -07003106 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3107 * For example, this could be due to the user manually changing the time.
3108 *
3109 * Logged from:
3110 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3111 */
3112message WallClockTimeShifted {
3113 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3114 optional int64 wall_clock_timestamp_millis = 1;
3115}
3116
3117/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003118 * Logs when statsd detects an anomaly.
3119 *
3120 * Logged from:
3121 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3122 */
3123message AnomalyDetected {
3124 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003125 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003126
Yangster-mac94e197c2018-01-02 16:03:03 -08003127 // Id of the config whose anomaly detection alert fired.
3128 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003129
Yangster-mac94e197c2018-01-02 16:03:03 -08003130 // Id of the alert (i.e. name of the anomaly that was detected).
3131 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003132}
3133
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003134message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003135 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003136 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003137
3138 // The app package name.
3139 optional string pkg_name = 2;
3140
3141 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003142 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003143 WARM = 1;
3144 HOT = 2;
3145 COLD = 3;
3146 }
3147 // The transition type.
3148 optional TransitionType type = 3;
3149
3150 // The activity name.
3151 optional string activity_name = 4;
3152
3153 // The name of the calling app. Empty if not set.
3154 optional string calling_pkg_name = 5;
3155
3156 // Whether the app is an instant app.
3157 optional bool is_instant_app = 6;
3158
3159 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003160 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003161
Bookatz80d11a02018-01-16 10:46:35 -08003162 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003163
David Chen0b5c90c2018-01-25 16:51:49 -08003164 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003165 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003166 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003167 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003168 optional int32 bind_application_delay_millis = 11;
3169 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003170
3171 // Empty if not set.
3172 optional string launch_token = 13;
3173
Calin Juravle759fbda2018-02-20 19:52:30 +00003174 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003175 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003176
3177 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003178 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003179}
3180
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003181message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003182 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003183 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003184
3185 // The app package name.
3186 optional string pkg_name = 2;
3187
3188 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003189 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003190 WARM = 1;
3191 HOT = 2;
3192 COLD = 3;
3193 }
3194 // The transition type.
3195 optional TransitionType type = 3;
3196
3197 // The activity name.
3198 optional string activity_name = 4;
3199}
3200
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003201message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003202 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003203 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204
3205 // The app package name.
3206 optional string pkg_name = 2;
3207
3208 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003209 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210 WITH_BUNDLE = 1;
3211 WITHOUT_BUNDLE = 2;
3212 }
3213 // The transition type.
3214 optional TransitionType type = 3;
3215
3216 // The activity name.
3217 optional string activity_name = 4;
3218
3219 optional bool transition_process_running = 5;
3220
3221 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003222 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003223}
3224
Bookatz8fcd09a2017-12-18 13:01:10 -08003225/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003226 * Logs a picture-in-picture action
3227 * Logged from:
3228 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3229 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3230 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3231 */
3232message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003233 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003234 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003235
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003236 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003237
Chenjie Yu52cacc62017-12-08 18:11:45 -08003238 enum State {
3239 ENTERED = 1;
3240 EXPANDED_TO_FULL_SCREEN = 2;
3241 MINIMIZED = 3;
3242 DISMISSED = 4;
3243 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003244 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003245}
3246
3247/**
Chenjie Yue8904192017-12-08 19:12:57 -08003248 * Logs overlay action
3249 * Logged from:
3250 * services/core/java/com/android/server/wm/Session.java
3251 */
3252message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003253 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003254
tsaichristine5adc7e02020-01-14 17:07:39 -08003255 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003256
3257 optional bool using_alert_window = 3;
3258
3259 enum State {
3260 ENTERED = 1;
3261 EXITED = 2;
3262 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003263 optional State state = 4 [
3264 (state_field_option).option = EXCLUSIVE_STATE,
3265 (state_field_option).nested = false,
3266 (state_field_option).default_state_value = 2
3267 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003268}
3269
Chenjie Yuccfe6452018-01-30 11:33:21 -08003270/*
3271 * Logs foreground service starts and stops.
3272 * Note that this is not when a service starts or stops, but when it is
3273 * considered foreground.
3274 * Logged from
3275 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3276 */
3277message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003278 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003279 // package_name + "/" + class_name
3280 optional string short_name = 2;
3281
3282 enum State {
3283 ENTER = 1;
3284 EXIT = 2;
3285 }
3286 optional State state = 3;
3287}
3288
Chenjie Yue8904192017-12-08 19:12:57 -08003289/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003290 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3291 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3292 * attributed back to the parent (host) uid. One example is Chrome.
3293 *
3294 * Logged from:
3295 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3296 */
3297message IsolatedUidChanged {
3298 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003299 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003300 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003301 optional int32 parent_uid = 1;
3302
3303 optional int32 isolated_uid = 2;
3304
3305 // We expect an isolated uid to be removed before if it's used for another parent uid.
3306 enum Event {
3307 REMOVED = 0;
3308 CREATED = 1;
3309 }
3310 optional Event event = 3;
3311}
3312
3313/*
3314 * Logs the reception of an incoming network packet causing the main system to wake up for
3315 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3316 * and processed by WakeupController.cpp.
3317 */
3318message PacketWakeupOccurred {
3319 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3320 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003321 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003322 // The interface name on which the packet was received.
3323 optional string iface = 2;
3324 // The ethertype value of the packet.
3325 optional int32 ethertype = 3;
3326 // String representation of the destination MAC address of the packet.
3327 optional string destination_hardware_address = 4;
3328 // String representation of the source address of the packet if this was an IP packet.
3329 optional string source_ip = 5;
3330 // String representation of the destination address of the packet if this was an IP packet.
3331 optional string destination_ip = 6;
3332 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3333 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3334 // families.
3335 optional int32 ip_next_header = 7;
3336 // The source port if this was a TCP or UDP packet.
3337 optional int32 source_port = 8;
3338 // The destination port if this was a TCP or UDP packet.
3339 optional int32 destination_port = 9;
3340}
3341
3342/*
3343 * Logs the memory stats for an app on startup.
3344 * Logged from:
3345 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3346 */
3347message AppStartMemoryStateCaptured {
3348 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003349 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003350
3351 // The process name.
3352 optional string process_name = 2;
3353
3354 // The activity name.
3355 optional string activity_name = 3;
3356
3357 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003358 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003359
3360 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003361 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003362
3363 // RSS
3364 optional int64 rss_in_bytes = 6;
3365
3366 // CACHE
3367 optional int64 cache_in_bytes = 7;
3368
3369 // SWAP
3370 optional int64 swap_in_bytes = 8;
3371}
3372
3373/*
3374 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3375 * for LMK event.
3376 * Logged from:
3377 * system/core/lmkd/lmkd.c
3378 */
3379message LmkStateChanged {
3380 enum State {
3381 UNKNOWN = 0;
3382 START = 1;
3383 STOP = 2;
3384 }
3385 optional State state = 1;
3386}
3387
3388/*
3389 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3390 * Logged from:
3391 * system/core/lmkd/lmkd.c
3392 */
3393message LmkKillOccurred {
3394 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003395 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003396
3397 // The process name.
3398 optional string process_name = 2;
3399
3400 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003401 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003402
3403 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003404 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003405
3406 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003407 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003408
3409 // RSS
3410 optional int64 rss_in_bytes = 6;
3411
3412 // CACHE
3413 optional int64 cache_in_bytes = 7;
3414
3415 // SWAP
3416 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003417
3418 // The elapsed real time of start of the process.
3419 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003420
3421 // Min oom adj score considered by lmkd.
3422 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003423}
3424
Rajeev Kumar51b54602018-03-01 12:18:26 -08003425/*
3426 * Logs when the ActivityManagerService detects that an app died.
3427 *
3428 * Logged from:
3429 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3430 */
3431message AppDied {
3432 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003433 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003434}
3435
Howard Ro21a039c2018-08-06 14:55:47 -07003436/**
3437 * An atom for generic metrics logging. Available from Android Q.
3438 */
3439message GenericAtom {
3440 // The uid of the application that sent this custom atom.
3441 optional int32 uid = 1 [(is_uid) = true];
3442
3443 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003444 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003445}
3446
Tej Singhd6d6d772018-09-05 17:41:25 -07003447/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003448 * Atom for simple logging of user interaction and impression events, such as "the user touched
3449 * this button" or "this dialog was displayed".
3450 * Keep the UI event stream clean: don't use for system or background events.
3451 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003452 *
3453 * Logged from:
3454 * frameworks/base/services/core/java/com/android/server/
3455 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003456 */
3457message UiEventReported {
3458 // The event_id.
3459 optional int32 event_id = 1;
3460 // The event's source or target uid and package, if applicable.
3461 // For example, the package posting a notification, or the destination package of a share.
3462 optional int32 uid = 2 [(is_uid) = true];
3463 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003464 // An identifier used to disambiguate which logs refer to a particular instance of some
3465 // UI element. Useful when there might be multiple instances simultaneously active.
3466 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003467}
3468
3469/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003470 * Reports a notification was created or updated.
3471 *
3472 * Logged from:
3473 * frameworks/base/services/core/java/com/android/server/notification/
3474 */
3475message NotificationReported {
3476 // The event_id (as for UiEventReported).
3477 optional int32 event_id = 1;
3478 // The notifying app's uid and package.
3479 optional int32 uid = 2 [(is_uid) = true];
3480 optional string package_name = 3;
3481 // A small system-assigned identifier for the notification.
3482 // Locally probably-unique, but expect collisions across users and/or days.
3483 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003484 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3485 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003486
3487 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003488 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3489 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3490 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003491
3492 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003493 optional string category = 10; // App-assigned notification category (API-defined strings)
3494 optional int32 style = 11; // App-assigned notification style
3495 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003496
3497 // Ordering, importance and interruptiveness
3498
Will Brockman7614f6962020-02-10 19:43:03 -05003499 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003500
Will Brockman7614f6962020-02-10 19:43:03 -05003501 optional android.stats.sysui.NotificationImportance importance = 14;
3502 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003503
3504 enum NotificationImportanceExplanation {
3505 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3506 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3507 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3508 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3509 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3510 // Like _APP, but based on pre-channels priority signal.
3511 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3512 }
3513
Will Brockman7614f6962020-02-10 19:43:03 -05003514 optional NotificationImportanceExplanation importance_source = 16;
3515 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3516 optional NotificationImportanceExplanation importance_initial_source = 18;
3517 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3518 optional int32 assistant_hash = 20;
3519 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003520}
3521
3522message Notification {
3523 // The notifying app's uid and package.
3524 optional int32 uid = 1 [(is_uid) = true];
3525 optional string package_name = 2;
3526 // A small system-assigned identifier for the notification.
3527 optional int32 instance_id = 3;
3528
3529 // Grouping information.
3530 optional int32 group_instance_id = 4;
3531 optional bool is_group_summary = 5;
3532
3533 // The section of the shade that the notification is in.
3534 // See NotificationSectionsManager.PriorityBucket.
3535 enum NotificationSection {
3536 SECTION_UNKNOWN = 0;
3537 SECTION_PEOPLE = 1;
3538 SECTION_ALERTING = 2;
3539 SECTION_SILENT = 3;
3540 }
3541 optional NotificationSection section = 6;
3542}
3543
3544message NotificationList {
3545 repeated Notification notifications = 1; // An ordered sequence of notifications.
3546}
3547
3548/**
3549 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3550 *
3551 * Logged from:
3552 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3553 */
3554message NotificationPanelReported {
3555 // The event_id (as for UiEventReported).
3556 optional int32 event_id = 1;
3557 optional int32 num_notifications = 2;
3558 // The notifications in the panel, in the order that they appear there.
3559 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3560}
3561
3562/**
3563 * Reports a notification channel, or channel group, was created, updated, or deleted.
3564 *
3565 * Logged from:
3566 * frameworks/base/services/core/java/com/android/server/notification/
3567 */
3568message NotificationChannelModified {
3569 // The event_id (as for UiEventReported).
3570 optional int32 event_id = 1;
3571 // The notifying app's uid and package.
3572 optional int32 uid = 2 [(is_uid) = true];
3573 optional string package_name = 3;
3574 // App-assigned notification channel ID or channel-group ID
3575 optional string channel_id = 4;
3576 // Previous importance setting, if applicable
3577 optional android.stats.sysui.NotificationImportance old_importance = 5;
3578 // New importance setting
3579 optional android.stats.sysui.NotificationImportance importance = 6;
3580}
3581
3582
3583/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003584 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003585 *
3586 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003587 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003588 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003589message BiometricAcquired {
3590 // Biometric modality that was acquired.
3591 optional android.hardware.biometrics.ModalityEnum modality = 1;
3592 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3593 optional int32 user = 2;
3594 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3595 optional bool is_crypto = 3;
3596 // Action that the device is performing. Acquired messages are only expected for enroll and
3597 // authenticate. Other actions may indicate an error.
3598 optional android.hardware.biometrics.ActionEnum action = 4;
3599 // The client that this acquisition was received for.
3600 optional android.hardware.biometrics.ClientEnum client = 5;
3601 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3602 optional int32 acquire_info = 6;
3603 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3604 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003605 // Dictates if this message should trigger additional debugging.
3606 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003607}
3608
3609/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003610 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003611 *
3612 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003613 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003614 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003615message BiometricAuthenticated {
3616 // Biometric modality that was used.
3617 optional android.hardware.biometrics.ModalityEnum modality = 1;
3618 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3619 optional int32 user = 2;
3620 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3621 // storage.
3622 optional bool is_crypto = 3;
3623 // The client that this acquisition was received for.
3624 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003625 // If authentication requires user confirmation. See BiometricPrompt's
3626 // setRequireConfirmation(bool) method.
3627 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003628
Kevin Chyn1741a072019-01-17 11:54:40 -08003629 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003630 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003631 REJECTED = 1;
3632 PENDING_CONFIRMATION = 2;
3633 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003634 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003635
3636 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003637 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003638 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3639 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3640 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3641 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003642 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003643 // Dictates if this message should trigger additional debugging.
3644 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003645}
3646
3647/**
3648 * Logs when a biometric error occurs.
3649 *
3650 * Logged from:
3651 * frameworks/base/services/core/java/com/android/server/biometrics
3652 */
3653message BiometricErrorOccurred {
3654 // Biometric modality that was used.
3655 optional android.hardware.biometrics.ModalityEnum modality = 1;
3656 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3657 optional int32 user = 2;
3658 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3659 optional bool is_crypto = 3;
3660 // Action that the device is performing.
3661 optional android.hardware.biometrics.ActionEnum action = 4;
3662 // The client that this acquisition was received for.
3663 optional android.hardware.biometrics.ClientEnum client = 5;
3664 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3665 // are unique to modality.
3666 optional int32 error_info = 6;
3667 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3668 // by the vendor and not specified by the HIDL interface.
3669 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003670 // Dictates if this message should trigger additional debugging.
3671 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003672 // Time spent during the authentication attempt.
3673 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003674}
3675
3676/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003677 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003678 * Logged from:
3679 * frameworks/base/services/core/java/com/android/server/biometrics
3680 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003681message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003682 // Biometric modality.
3683 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003684 // Type of issue detected.
3685 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003686 // Dictates if this message should trigger additional debugging.
3687 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003688}
Howard Ro688ae182018-09-25 00:09:36 -07003689
joshmccloskey6f952b22019-03-25 20:59:35 -07003690/**
3691 * Logs when a biometric enrollment occurs.
3692 *
3693 * Logged from:
3694 * frameworks/base/services/core/java/com/android/server/biometrics
3695 */
3696message BiometricEnrolled {
3697 // Biometric modality that was used.
3698 optional android.hardware.biometrics.ModalityEnum modality = 1;
3699 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3700 optional int32 user = 2;
3701 // The amount of time the enrollment took in milliseconds.
3702 optional int64 latency_millis = 3;
3703 // Whether or not the enrollment was successful.
3704 optional bool success = 4;
3705}
3706
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003707/*
Tej Singh0d176952019-01-16 19:10:54 -08003708 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003709 */
Tej Singh0d176952019-01-16 19:10:54 -08003710message FlagFlipUpdateOccurred {
3711 // If the event is from a flag config package, specify the package name.
3712 optional string flag_flip_package_name = 1;
3713
3714 // The order id of the package
3715 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003716}
3717
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003718/**
3719 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003720 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003721 */
3722message TrainExperimentIds {
3723 repeated int64 experiment_id = 1;
3724}
3725
Yangster-macb89807e2018-11-15 21:10:57 -08003726/*
3727 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003728 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003729 */
3730message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003731 // Name of the train.
3732 optional string train_name = 1;
3733 // Version code for a "train" of packages that need to be installed atomically
3734 optional int64 train_version_code = 2;
3735 // After installation of this package, device requires a restart.
3736 optional bool requires_staging = 3;
3737 // Rollback should be enabled for this install.
3738 optional bool rollback_enabled = 4;
3739 // Requires low latency monitoring if possible.
3740 optional bool requires_low_latency_monitor = 5;
3741
Yangster-macb89807e2018-11-15 21:10:57 -08003742 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003743 UNKNOWN = 0;
3744 INSTALL_REQUESTED = 1;
3745 INSTALL_STARTED = 2;
3746 INSTALL_STAGED_NOT_READY = 3;
3747 INSTALL_STAGED_READY = 4;
3748 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003749 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3750 // and INSTALL_FAILURE_COMMIT.
3751 INSTALL_FAILURE = 6 [deprecated = true];
3752 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003753 INSTALL_CANCELLED = 7;
3754 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003755 INSTALLER_ROLLBACK_INITIATED = 9;
3756 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3757 INSTALLER_ROLLBACK_STAGED = 11;
3758 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3759 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3760 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3761 INSTALLER_ROLLBACK_SUCCESS = 15;
3762 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003763 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3764 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3765 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3766 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3767 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3768 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003769 INSTALL_FAILURE_DOWNLOAD = 23;
3770 INSTALL_FAILURE_STATE_MISMATCH = 24;
3771 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003772 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003773 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003774 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003775 // Possible experiment ids for monitoring this push.
3776 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3777 // user id
3778 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003779 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003780 // Whether or not this is a rollback event
3781 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003782}
3783
Tej Singhc9203082019-05-03 13:42:23 -07003784/* Test atom, is not logged anywhere */
3785message TestAtomReported {
3786 repeated AttributionNode attribution_node = 1;
3787 optional int32 int_field = 2;
3788 optional int64 long_field = 3;
3789 optional float float_field = 4;
3790 optional string string_field = 5;
3791 optional bool boolean_field = 6;
3792 enum State {
3793 UNKNOWN = 0;
3794 OFF = 1;
3795 ON = 2;
3796 }
3797 optional State state = 7;
3798 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3799}
3800
Maggie Whitefc1aa592018-11-28 21:55:23 -08003801/** Represents USB port overheat event. */
3802message UsbPortOverheatEvent {
3803 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3804 optional int32 plug_temperature_deci_c = 1;
3805
3806 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3807 optional int32 max_temperature_deci_c = 2;
3808
3809 /* Time between USB plug event and overheat threshold trip, in seconds. */
3810 optional int32 time_to_overheat_secs = 3;
3811
3812 /* Time between overheat threshold trip and hysteresis, in seconds. */
3813 optional int32 time_to_hysteresis_secs = 4;
3814
3815 /* Time between hysteresis and active mitigation ending, in seconds. */
3816 optional int32 time_to_inactive_secs = 5;
3817};
3818
Maggie White8735b852019-01-18 11:40:49 -08003819/**
3820 * Logs total effective full charge and discharge cycles on a battery.
3821 * Here are some examples of one effective cycle:
3822 * 1) the battery charges from 0% to 100% and drains back to 0%,
3823 * 2) charging from 50% to 100% and draining back to 50% twice.
3824 * Pulled from:
3825 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3826 */
3827message BatteryCycleCount {
3828 /* Number of total charge and discharge cycles on the system battery. */
3829 optional int32 cycle_count = 1;
3830}
3831
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003832/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003833 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3834 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003835 * Pulled from:
3836 * StatsCompanionService
3837 */
3838
Carmen Agimof12dec122019-03-06 16:14:38 +00003839message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003840
Carmen Agimof12dec122019-03-06 16:14:38 +00003841 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003842 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003843 PUBLIC = 1;
3844 PRIVATE = 2;
3845 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003846 }
3847
Carmen Agimof12dec122019-03-06 16:14:38 +00003848 // The type of external storage.
3849 optional android.stats.storage.ExternalStorageType storage_type = 1;
3850 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3851 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003852 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003853 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003854}
3855
Yangster-macb89807e2018-11-15 21:10:57 -08003856/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003857 * Logs when a connection becomes available and lost.
3858 * Logged in StatsCompanionService.java
3859 */
3860message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003861 // Id of the network.
3862 optional int32 net_id = 1;
3863
3864 enum State {
3865 UNKNOWN = 0;
3866 CONNECTED = 1;
3867 DISCONNECTED = 2;
3868 }
3869 // Connected state of a network.
3870 optional State state = 2;
3871}
3872
3873/**
3874 * Logs when a service starts and stops.
3875 * Logged from:
3876 * services/core/java/com/android/server/am/ActiveServices.java
3877 */
3878message ServiceStateChanged {
3879
3880 optional int32 uid = 1 [(is_uid) = true];
3881
3882 optional string package_name = 2;
3883
3884 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003885
3886 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003887 START = 1;
3888 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003889 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003890
3891 optional State state = 4;
3892}
3893
3894/**
3895 * Logs when a service is launched.
3896 * Logged from:
3897 * services/core/java/com/android/server/am/ActiveServices.java
3898 */
3899message ServiceLaunchReported {
3900
3901 optional int32 uid = 1 [(is_uid) = true];
3902
3903 optional string package_name = 2;
3904
3905 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003906}
Howard Ro688ae182018-09-25 00:09:36 -07003907
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003908/**
3909 * Logs when a hidden API is used.
3910 *
3911 * Logged from:
3912 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3913 */
3914message HiddenApiUsed {
3915 // The uid of the app making the hidden access.
3916 optional int32 uid = 1 [(is_uid) = true];
3917
3918 // Signature of the method or field accessed.
3919 optional string signature = 2;
3920
3921 enum AccessMethod {
3922 NONE = 0;
3923 REFLECTION = 1;
3924 JNI = 2;
3925 LINKING = 3;
3926 }
3927
3928 // Type of access.
3929 optional AccessMethod access_method = 3;
3930
3931 // Whether the access was prevented or not.
3932 optional bool access_denied = 4;
3933}
3934
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003935/**
3936 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3937 * - When user sees privacy chip
3938 * - When user clicks privacy chip
3939 * - How does the user exit the Privacy Dialog
3940 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003941 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3942 */
3943message PrivacyIndicatorsInteracted {
3944
3945 enum Type {
3946 UNKNOWN = 0;
3947 CHIP_VIEWED = 1;
3948 CHIP_CLICKED = 2;
3949 DIALOG_PRIVACY_SETTINGS = 3;
3950 DIALOG_DISMISS = 4;
3951 DIALOG_LINE_ITEM = 5;
3952 }
3953
tsaichristine5adc7e02020-01-14 17:07:39 -08003954 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003955
3956 // Used if the type is LINE_ITEM
3957 optional string package_name = 2;
3958}
3959
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003960/**
3961 * Logs information about a package that is moved from the internal to external storage and vice
3962 * versa.
3963 * It logs the package name, the type of the external storage where the package is installed
3964 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3965 * and the move type: if it's from internal to external or the other way around.
3966 *
3967 * Logged from:
3968 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3969 */
3970message AppMovedStorageReported {
3971 enum MoveType {
3972 UNKNOWN = 0;
3973 TO_EXTERNAL = 1;
3974 TO_INTERNAL = 2;
3975 }
3976 // The type of the external storage.
3977 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3978 // The type of move.
3979 optional MoveType move_type = 2;
3980 // The name of the package that was moved.
3981 optional string package_name = 3;
3982}
3983
jianjin8f2dee02019-03-29 14:03:08 -07003984/**
3985 * Logs when system server watchdog occurs.
3986 * Logged from:
3987 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3988 */
3989message SystemServerWatchdogOccurred {
3990 optional string subject = 1;
3991}
3992
3993/**
3994 * Logs when new file added to tombstones.
3995 * Logged from:
3996 * frameworks/base/core/java/com/android/server/BootReceiver.java
3997 */
3998message TombStoneOccurred {
3999}
4000
Hai Zhang5d3328d2019-04-13 21:25:06 +08004001/*
4002 * Information about a role request
4003 *
4004 * Logged from:
4005 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4006 */
4007message RoleRequestResultReported {
4008 // UID of application requesting the role
4009 optional int32 requesting_uid = 1;
4010
4011 // Package name of application requesting the role
4012 optional string requesting_package_name = 2;
4013
4014 // The role to be granted
4015 optional string role_name = 3;
4016
4017 // The count of applications qualifying for the role
4018 optional int32 qualifying_count = 4;
4019
4020 // UID of application current granted the role
4021 optional int32 current_uid = 5;
4022
4023 // Package name of application current granted the role
4024 optional string current_package_name = 6;
4025
4026 // UID of another application that user chose to grant the role to, instead of the requesting
4027 // application
4028 optional int32 granted_another_uid = 7;
4029
4030 // Package name of another application that user chose to grant the role to, instead of the
4031 // requesting application
4032 optional string granted_another_package_name = 8;
4033
4034 enum Result {
4035 UNDEFINED = 0;
4036 // role request was ignored
4037 IGNORED = 1;
4038 // role request was ignored because it's already granted
4039 IGNORED_ALREADY_GRANTED = 2;
4040 // role request was ignored because the application isn't qualified
4041 IGNORED_NOT_QUALIFIED = 3;
4042 // role request was ignored because user said it should be always denied
4043 IGNORED_USER_ALWAYS_DENIED = 4;
4044 // role was granted by user action
4045 USER_GRANTED = 5;
4046 // role was denied by user action
4047 USER_DENIED = 6;
4048 // role was denied by user granting another application the role
4049 USER_DENIED_GRANTED_ANOTHER = 7;
4050 // role was denied and set to be always denied by the user
4051 USER_DENIED_WITH_ALWAYS = 8;
4052 }
4053 // The result of the role request
4054 optional Result result = 9;
4055}
4056
Mark Tabrya824a642019-11-05 12:26:12 -08004057/**
4058 * Logs when a Vehicle Maps Service client's connection state has changed
4059 *
4060 * Logged from:
4061 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4062 */
4063message VmsClientConnectionStateChanged {
4064 // The UID of the VMS client app
4065 optional int32 uid = 1 [(is_uid) = true];
4066
4067 enum State {
4068 UNKNOWN = 0;
4069 // Attempting to connect to the client
4070 CONNECTING = 1;
4071 // Client connection established
4072 CONNECTED = 2;
4073 // Client connection closed unexpectedly
4074 DISCONNECTED = 3;
4075 // Client connection closed by VMS
4076 TERMINATED = 4;
4077 // Error establishing the client connection
4078 CONNECTION_ERROR = 5;
4079 }
4080
4081 optional State state = 2;
4082}
4083
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004084/**
4085 * Logs when MediaProvider has successfully finished scanning a storage volume.
4086 *
4087 * Logged from:
4088 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4089 */
4090message MediaProviderScanEvent {
4091 enum Reason {
4092 // Scan triggered due to unknown reason
4093 UNKNOWN = 0;
4094 // Scan triggered due to storage volume being mounted
4095 MOUNTED = 1;
4096 // Scan triggered due to explicit user action or app request
4097 DEMAND = 2;
4098 // Scan triggered due to idle maintenance
4099 IDLE = 3;
4100 }
4101
4102 // Volume type that this event pertains to
4103 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4104 // Reason why this scan was triggered
4105 optional Reason reason = 2;
4106 // Total number of files scanned
4107 optional int64 item_count = 3;
4108 // Duration of scan, normalized per file
4109 optional float normalized_duration_millis = 4;
4110 // Number of database inserts, normalized per file
4111 optional float normalized_insert_count = 5;
4112 // Number of database updates, normalized per file
4113 optional float normalized_update_count = 6;
4114 // Number of database deletes, normalized per file
4115 optional float normalized_delete_count = 7;
4116}
4117
4118/**
4119 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4120 *
4121 * Logged from:
4122 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4123 */
4124message MediaProviderDeletionEvent {
4125 // Volume type that this event pertains to
4126 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4127 // Device timestamp when this deletion event occurred
4128 optional int64 timestamp_millis = 2;
4129 // App that requested deletion
4130 optional string package_name = 3;
4131 // Number of items that were deleted
4132 optional int32 item_count = 4;
4133}
4134
4135/**
4136 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4137 *
4138 * Logged from:
4139 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4140 */
4141message MediaProviderPermissionEvent {
4142 enum Result {
4143 UNKNOWN = 0;
4144 USER_GRANTED = 1;
4145 AUTO_GRANTED = 2;
4146 USER_DENIED = 3;
4147 USER_DENIED_WITH_PREJUDICE = 4;
4148 AUTO_DENIED = 5;
4149 }
4150
4151 // Volume type that this event pertains to
4152 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4153 // Device timestamp when this permission event occurred
4154 optional int64 timestamp_millis = 2;
4155 // App that requested permission
4156 optional string package_name = 3;
4157 // Number of items that were requested
4158 optional int32 item_count = 4;
4159 // Result of this request
4160 optional Result result = 5;
4161}
4162
4163/**
4164 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4165 *
4166 * Logged from:
4167 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4168 */
4169message MediaProviderSchemaChange {
4170 // Volume type that this event pertains to
4171 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4172 // Old database version code
4173 optional int32 version_from = 2;
4174 // New database version code
4175 optional int32 version_to = 3;
4176 // Total number of files in database
4177 optional int64 item_count = 4;
4178 // Duration of schema change, normalized per file
4179 optional float normalized_duration_millis = 5;
4180}
4181
4182/**
4183 * Logs when MediaProvider has finished an idle maintenance job.
4184 *
4185 * Logged from:
4186 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4187 */
4188message MediaProviderIdleMaintenance {
4189 // Volume type that this event pertains to
4190 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4191
4192 // Total number of files in database
4193 optional int64 item_count = 2;
4194 // Duration of idle maintenance, normalized per file
4195 optional float normalized_duration_millis = 3;
4196 // Number of thumbnails found to be stale, normalized per file
4197 optional float normalized_stale_thumbnails = 4;
4198 // Number of items found to be expired, normalized per file
4199 optional float normalized_expired_media = 5;
4200}
4201
Keun young Park3e033cb2019-12-18 11:27:35 -08004202/**
4203 * Represents boot time event with duration in ms.
4204 *
4205 * Logged from: bootstat and various system server components. Check each enums for details.
4206 */
4207message BootTimeEventDuration {
4208 enum DurationEvent {
4209 UNKNOWN = 0;
4210 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4211 ABSOLUTE_BOOT_TIME = 1;
4212 // Bootloader's 1st stage execution time.
4213 // Logged from bootstat.
4214 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4215 // Bootloader's 1st stage loading time.
4216 // Logged from bootstat.
4217 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4218 // Bootloader's kernel loading time.
4219 // Logged from bootstat.
4220 BOOTLOADER_KERNEL_LOAD = 4;
4221 // Bootloader's 2nd stage execution time.
4222 // Logged from bootstat.
4223 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4224 // Bootloader's 2nd stage loading time.
4225 // Logged from bootstat.
4226 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4227 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4228 // for locked device.
4229 // Logged from bootstat.
4230 BOOTLOADER_UI_WAIT = 7;
4231 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4232 // Logged from bootstat.
4233 BOOTLOADER_TOTAL = 8;
4234 // Shutdown duration inside init for the reboot before the current boot up.
4235 // Logged from f/b/services/.../BootReceiver.java.
4236 SHUTDOWN_DURATION = 9;
4237 // Total time for mounting of disk devices during bootup.
4238 // Logged from f/b/services/.../BootReceiver.java.
4239 MOUNT_DEFAULT_DURATION = 10;
4240 // Total time for early stage mounting of disk devices during bootup.
4241 // Logged from f/b/services/.../BootReceiver.java.
4242 MOUNT_EARLY_DURATION = 11;
4243 // Total time for late stage mounting of disk devices during bootup.
4244 // Logged from f/b/services/.../BootReceiver.java.
4245 MOUNT_LATE_DURATION = 12;
4246 // Average time to scan non-system app after OTA
4247 // Logged from f/b/services/.../PackageManagerService.java
4248 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4249 // Time to initialize Package manager after OTA
4250 // Logged from f/b/services/.../PackageManagerService.java
4251 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4252 // Time to scan all system app from Package manager after OTA
4253 // Logged from f/b/services/.../PackageManagerService.java
4254 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4255 // Init's total time for cold boot stage.
4256 // Logged from bootstat.
4257 COLDBOOT_WAIT = 16;
4258 // Init's total time for initializing selinux.
4259 // Logged from bootstat.
4260 SELINUX_INIT = 17;
4261 // Time since last factory reset.
4262 // Logged from bootstat.
4263 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004264 // Init's total time spent for completing the 1st stage.
4265 // Logged from bootstat.
4266 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004267 }
4268
4269 // Type of the event.
4270 optional DurationEvent event = 1;
4271 // Duration of the event in ms.
4272 optional int64 duration_millis = 2;
4273}
4274
4275/**
4276 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4277 * since boot-up.
4278 *
4279 * Logged from: bootstat and various system server components. Check each enums for details.
4280 */
4281message BootTimeEventElapsedTime {
4282 enum ElapsedTimeEvent {
4283 UNKNOWN = 0;
4284 // Time when init starts 1st stage. Logged from bootstat.
4285 ANDROID_INIT_STAGE_1 = 1;
4286 // Time when sys.boot_completed prop is set.
4287 // Logged from bootstat.
4288 BOOT_COMPLETE = 2;
4289 // BOOT_COMPLETE for encrypted device.
4290 BOOT_COMPLETE_ENCRYPTION = 3;
4291 // BOOT_COMPLETE for device with no encryption.
4292 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4293 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004294 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004295 // BOOT_COMPLETE after factory reset.
4296 FACTORY_RESET_BOOT_COMPLETE = 6;
4297 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4298 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004299 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4300 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004301 // BOOT_COMPLETE after OTA.
4302 OTA_BOOT_COMPLETE = 9;
4303 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4304 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004305 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4306 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004307 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4308 // Logged from f/b/services/.../UserController.java
4309 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4310 // Time when the system starts sending BOOT_COMPLETED broadcast.
4311 // Logged from f/b/services/.../UserController.java
4312 FRAMEWORK_BOOT_COMPLETED = 13;
4313 // Time when the package manager starts init.
4314 // Logged from f/b/services/.../SystemServer.java
4315 PACKAGE_MANAGER_INIT_START = 14;
4316 // Time when package manager is ready
4317 // Logged from f/b/services/.../SystemServer.java
4318 PACKAGE_MANAGER_INIT_READY = 15;
4319 // Represents the time when user has entered unlock credential for system with user pin.
4320 // Logged from bootstat.
4321 POST_DECRYPT = 16;
4322 // Represents the start of zygote's init.
4323 // Logged from zygote itself.
4324 ZYGOTE_INIT_START = 17;
4325 // Represents the start of secondary zygote's init.
4326 // TODO: add logging to zygote
4327 SECONDARY_ZYGOTE_INIT_START = 18;
4328 // Represents the start of system server's init.
4329 // Logged from f/b/services/.../SystemServer.java
4330 SYSTEM_SERVER_INIT_START = 19;
4331 // Represents the completion of system server's init.
4332 // Logged from f/b/services/.../SystemServer.java
4333 SYSTEM_SERVER_READY = 20;
4334 // Represents the start of launcher during boot-up.
4335 // TODO: add logging
4336 LAUNCHER_START = 21;
4337 // Represents the completion of launcher's initial rendering. User can use other apps from
4338 // launcher from this point.
4339 // TODO: add logging
4340 LAUNCHER_SHOWN = 22;
4341 }
4342
4343 // Type of the event.
4344 optional ElapsedTimeEvent event = 1;
4345 // Time since bootup for the event.
4346 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4347 optional int64 time_millis = 2;
4348}
4349
4350/**
4351 * Boot time events with UTC time.
4352 *
4353 * Logged from: bootstat and various system server components. Check each enums for details.
4354 */
4355message BootTimeEventUtcTime {
4356 enum UtcTimeEvent {
4357 UNKNOWN = 0;
4358 // Time of the bootstat's marking of 1st boot after the last factory reset.
4359 // Logged from bootstat.
4360 FACTORY_RESET_RESET_TIME = 1;
4361 // The time when bootstat records FACTORY_RESET_* events. This is close to
4362 // BOOT_COMPLETE time for the current bootup.
4363 // Logged from bootstat.
4364 FACTORY_RESET_CURRENT_TIME = 2;
4365 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4366 // Logged from bootstat.
4367 FACTORY_RESET_RECORD_VALUE = 3;
4368 }
4369
4370 // Type of the event.
4371 optional UtcTimeEvent event = 1;
4372 // UTC time for the event.
4373 optional int64 utc_time_secs = 2;
4374}
4375
4376/**
4377 * Boot time events representing specific error code during bootup.
4378 * Meaning of error code can be different per each event type.
4379 *
4380 * Logged from: bootstat and various system server components. Check each enums for details.
4381 */
4382message BootTimeEventErrorCode {
4383 enum ErrorCodeEvent {
4384 UNKNOWN = 0;
4385 // Linux error code for time() call to get the current UTC time.
4386 // Logged from bootstat.
4387 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4388 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4389 // as UMOUNT_STAT_* from init/reboot.cpp.
4390 // Logged from f/b/services/.../BootReceiver.java.
4391 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004392 // Reprepsents fie system mounting error code of /data partition for the current boot.
4393 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004394 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004395 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004396 }
4397
4398 // Type of the event.
4399 optional ErrorCodeEvent event = 1;
4400 // error code defined per each event type.
4401 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4402 // FS_MGR_FS_STAT.
4403 optional int32 error_code = 2;
4404}
4405
Chenjie Yubbcbc602018-02-05 16:51:52 -08004406//////////////////////////////////////////////////////////////////////
4407// Pulled atoms below this line //
4408//////////////////////////////////////////////////////////////////////
4409
4410/**
David Chenc8a43242017-10-17 16:23:28 -07004411 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4412 *
4413 * Pulled from:
4414 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4415 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004416message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004417 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004418
4419 optional int64 rx_bytes = 2;
4420
4421 optional int64 rx_packets = 3;
4422
4423 optional int64 tx_bytes = 4;
4424
4425 optional int64 tx_packets = 5;
4426}
4427
4428/**
4429 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4430 *
4431 * Pulled from:
4432 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4433 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004434message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004435 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004436
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004437 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4438 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004439
4440 optional int64 rx_bytes = 3;
4441
4442 optional int64 rx_packets = 4;
4443
4444 optional int64 tx_bytes = 5;
4445
4446 optional int64 tx_packets = 6;
4447}
4448
4449/**
4450 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4451 *
4452 * Pulled from:
4453 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4454 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004455message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004456 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004457
4458 optional int64 rx_bytes = 2;
4459
4460 optional int64 rx_packets = 3;
4461
4462 optional int64 tx_bytes = 4;
4463
4464 optional int64 tx_packets = 5;
4465}
4466
4467/**
4468 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4469 *
4470 * Pulled from:
4471 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4472 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004473message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004474 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004475
Yao Chenc40a19d2018-03-15 16:48:25 -07004476 // 1 denotes foreground and 0 denotes background. This is called Set in
4477 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004478 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004479
4480 optional int64 rx_bytes = 3;
4481
4482 optional int64 rx_packets = 4;
4483
4484 optional int64 tx_bytes = 5;
4485
4486 optional int64 tx_packets = 6;
4487}
4488
4489/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004490 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4491 *
4492 * Pulled from:
4493 * StatsCompanionService
4494 */
4495message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004496 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004497
4498 optional int64 rx_bytes = 2;
4499
4500 optional int64 tx_bytes = 3;
4501}
4502
4503/**
David Chenc8a43242017-10-17 16:23:28 -07004504 * Pulls the kernel wakelock durations. This atom is adapted from
4505 * android/internal/os/KernelWakelockStats.java
4506 *
4507 * Pulled from:
4508 * StatsCompanionService using KernelWakelockReader.
4509 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004510message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004511 optional string name = 1;
4512
4513 optional int32 count = 2;
4514
4515 optional int32 version = 3;
4516
Yangster-maca8a30442018-10-13 23:46:34 -07004517 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004518}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004519
Chenjie Yu05013b32017-11-21 10:21:41 -08004520/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004521 * Pulls low power state information. If power.stats HAL is not available, this
4522 * includes platform and subsystem sleep state information,
4523 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4524 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004525 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004526 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004527 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4528 * as defined in:
4529 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004530 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004531message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004532 // Subsystem name
4533 optional string subsystem_name = 1;
4534 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4535 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004536 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4537 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004538 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004539 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004540 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004541 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004542 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004543}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004544
Chenjie Yu05013b32017-11-21 10:21:41 -08004545/**
Bookatz92da2832018-11-01 18:10:03 -07004546 * Pulls on-device power measurement information.
4547 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4548 * Pulled from:
4549 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4550 */
4551message OnDevicePowerMeasurement {
4552 // Name of the subsystem (to which the rail belongs).
4553 optional string subsystem_name = 1;
4554
4555 // Rail name. The rail lies within the subsystem.
4556 optional string rail_name = 2;
4557
4558 // Time (in ms since boot) at which the rail energy value was measured.
4559 // This may differ slightly from the time that statsd logs this information.
4560 optional uint64 measurement_timestamp_millis = 3;
4561
4562 // Accumulated energy used via the rail since device boot in uWs.
4563 optional uint64 energy_microwatt_secs = 4;
4564}
4565
4566/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004567 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004568 * Pulls the time the cpu spend on the frequency index. Frequency index
4569 * starts from highest to lowest. The value should be monotonically
4570 * increasing since boot. However, if there is a cpu
4571 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004572 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004573message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004574 optional uint32 cluster = 1;
4575 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004576 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004577}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004578
Chenjie Yu05013b32017-11-21 10:21:41 -08004579/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004580 * Pulls Cpu Time Per Uid.
4581 * Note that isolated process uid time should be attributed to host uids.
4582 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004583message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004584 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004585 optional uint64 user_time_micros = 2;
4586 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004587}
4588
4589/**
4590 * Pulls Cpu Time Per Uid per frequency.
4591 * Note that isolated process uid time should be attributed to host uids.
4592 * For each uid, we order the time by descending frequencies.
4593 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004594message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004595 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004596 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004597 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004598}
Hugo Benichi884970e2017-11-14 22:42:46 +09004599
Chenjie Yu05013b32017-11-21 10:21:41 -08004600/**
4601 * Pulls Wifi Controller Activity Energy Info
4602 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004603message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004604 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004605 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004606 // stack reported state
4607 // TODO: replace this with proto enum
4608 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004609 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004610 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004611 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004612 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004613 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004614 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004615 // product of current(mA), voltage(V) and time(ms)
4616 optional uint64 controller_energy_used = 6;
4617}
4618
4619/**
4620 * Pulls Modem Activity Energy Info
4621 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004622message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004623 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004624 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004625 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004626 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004627 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004628 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004629 /**
4630 * Tx power index
4631 * index 0 = tx_power < 0dBm
4632 * index 1 = 0dBm < tx_power < 5dBm
4633 * index 2 = 5dBm < tx_power < 15dBm
4634 * index 3 = 15dBm < tx_power < 20dBm
4635 * index 4 = tx_power > 20dBm
4636 */
4637 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004638 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004639 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004640 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004641 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004642 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004643 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004644 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004645 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004646 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004647 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004648 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004649 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004650 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004651}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004652
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004653/**
4654 * Pulls Bluetooth Activity Energy Info
4655 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4656 */
4657message BluetoothActivityInfo {
4658 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004659 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004660 // bluetooth stack state
4661 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004662 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004663 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004664 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004665 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004666 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004667 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004668 // product of current(mA), voltage(V) and time(ms)
4669 optional uint64 energy_used = 6;
4670}
4671
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004672/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004673 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004674 *
4675 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004676 */
4677message ProcessMemoryState {
4678 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004679 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004680
4681 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004682 // Usually package name, "system" for system server.
4683 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004684 optional string process_name = 2;
4685
Rafal Slawikda51b932018-12-13 16:31:33 +00004686 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004687 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004688
4689 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004690 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004691
4692 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004693 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004694
Rajeev Kumar90235992018-01-29 11:06:48 -08004695 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004696 // Value is read from memory.stat, field total_rss if per-app memory
4697 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004698 optional int64 rss_in_bytes = 6;
4699
4700 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004701 // Value is read from memory.stat, field total_cache if per-app memory
4702 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004703 optional int64 cache_in_bytes = 7;
4704
4705 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004706 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004707 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004708 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004709
Rafal Slawik203c3db2019-09-25 19:53:01 +01004710 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004711 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004712
Rafal Slawik203c3db2019-09-25 19:53:01 +01004713 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4714 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004715
Rafal Slawik203c3db2019-09-25 19:53:01 +01004716 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4717 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004718}
4719
4720/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004721 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004722 *
4723 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4724 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004725 *
4726 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004727 */
4728message ProcessMemoryHighWaterMark {
4729 // The uid if available. -1 means not available.
4730 optional int32 uid = 1 [(is_uid) = true];
4731
Rafal Slawikda51b932018-12-13 16:31:33 +00004732 // The process name.
4733 // Usually package name or process cmdline.
4734 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004735 optional string process_name = 2;
4736
Rafal Slawik239b6802019-09-09 18:46:01 +01004737 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4738 // computed by converting kilobytes to bytes.
4739 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4740
Rafal Slawik3bea8952018-11-15 12:39:33 +00004741 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4742 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004743 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004744}
4745
4746/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004747 * Logs the memory stats for a process.
4748 *
4749 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4750 * and for selected native processes.
4751 */
4752message ProcessMemorySnapshot {
4753 // The uid if available. -1 means not available.
4754 optional int32 uid = 1 [(is_uid) = true];
4755
4756 // The process name.
4757 // Usually package name or process cmdline.
4758 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4759 optional string process_name = 2;
4760
4761 // The pid of the process.
4762 // Allows to disambiguate instances of the process.
4763 optional int32 pid = 3;
4764
4765 // The current OOM score adjustment value.
4766 // Read from ProcessRecord for managed processes.
4767 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4768 optional int32 oom_score_adj = 4;
4769
4770 // The current RSS of the process.
4771 // VmRSS from /proc/pid/status.
4772 optional int32 rss_in_kilobytes = 5;
4773
4774 // The current anon RSS of the process.
4775 // RssAnon from /proc/pid/status.
4776 optional int32 anon_rss_in_kilobytes = 6;
4777
4778 // The current swap size of the process.
4779 // VmSwap from /proc/pid/status.
4780 optional int32 swap_in_kilobytes = 7;
4781
4782 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4783 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4784}
4785
4786/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004787 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004788 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004789message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004790 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004791}
4792
4793/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004794 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004795 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004796message SystemUptime {
4797 // Milliseconds since the system was booted.
4798 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4799 // for external input).
4800 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004801 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004802}
4803
4804/*
4805 * Reads from /proc/uid_concurrent_active_time which has the format:
4806 * active: X (X is # cores)
4807 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4808 * [uid1]: [time-0] [time-1] [time-2] ... ...
4809 * ...
4810 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4811 * The file contains a monotonically increasing count of time for a single boot.
4812 */
4813message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004814 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004815 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004816}
4817
4818/**
4819 * Reads from /proc/uid_concurrent_policy_time which has the format:
4820 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4821 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4822 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4823 * ...
4824 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4825 * The file contains a monotonically increasing count of time for a single boot.
4826 */
4827message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004828 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004829 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004830 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004831}
4832
4833/*
4834 * Pulls free disk space, for data, system partition and temporary directory.
4835 */
4836message DiskSpace {
4837 // available bytes in data partition
4838 optional uint64 data_available_bytes = 1;
4839 // available bytes in system partition
4840 optional uint64 system_available_bytes = 2;
4841 // available bytes in download cache or temp directories
4842 optional uint64 temp_available_bytes = 3;
4843}
Tej Singhbf972d92018-01-10 20:51:13 -08004844
4845/**
4846 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004847 *
4848 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004849 */
4850message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004851 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004852}
4853
4854/**
4855 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004856 * Pulled from:
4857 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004858 */
4859message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004860 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004861}
4862
4863/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004864 * Pulls battery voltage.
4865 * Pulled from:
4866 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4867 */
4868message BatteryVoltage {
4869 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004870 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004871}
4872
4873/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004874 * Pulls battery level (percent full, from 0 to 100).
4875 *
4876 * Pulled from:
4877 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4878 */
4879message BatteryLevel {
4880 // Battery level. Should be in [0, 100].
4881 optional int32 battery_level = 1;
4882}
4883
4884/**
Tej Singhd89137e2018-03-26 14:51:40 -07004885 * Pulls the temperature of various parts of the device.
4886 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004887 *
Maggie White442b6312019-04-05 16:26:44 -07004888 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004889 */
4890message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004891 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004892 optional android.os.TemperatureTypeEnum sensor_location = 1;
4893
4894 // The name of the temperature source. Eg. CPU0
4895 optional string sensor_name = 2;
4896
Tej Singhd89137e2018-03-26 14:51:40 -07004897 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004898 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004899 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004900
4901 // Relative severity of the throttling, see enum definition.
4902 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004903}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004904
4905/**
4906 * Pulls the statistics of calls to Binder.
4907 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004908 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4909 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004910 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004911 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004912 */
4913message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004914 // UID of the process responsible for the binder transaction. It will be set if the process
4915 // executing the binder transaction attribute the transaction to another uid using
4916 // Binder.setThreadWorkSource().
4917 //
4918 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004919 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004920 // UID of the process executing the binder transaction.
4921 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004922 // Fully qualified class name of the API call.
4923 //
4924 // This is a system server class name.
4925 //
4926 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4927 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4928 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4929 // commonly used APIs.
4930 optional string service_class_name = 2;
4931 // Method name of the API call. It can also be a transaction code if we cannot
4932 // resolve it to a name. See Binder#getTransactionName.
4933 //
4934 // This is a system server method name.
4935 optional string service_method_name = 3;
4936 // Total number of API calls.
4937 optional int64 call_count = 4;
4938 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4939 optional bool screen_interactive = 13;
4940 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4941 // call_count will be equal to recorded_call_count.
4942 //
4943 // If recorded_call_count is different than call_count, it means data collection has been
4944 // sampled. All the fields below will be sampled in this case.
4945 optional int64 recorded_call_count = 12;
4946 // Number of exceptions thrown by the API.
4947 optional int64 recorded_exception_count = 5;
4948 // Total latency of all API calls.
4949 // Average can be computed using total_latency_micros / recorded_call_count.
4950 optional int64 recorded_total_latency_micros = 6;
4951 // Maximum latency of one API call.
4952 optional int64 recorded_max_latency_micros = 7;
4953 // Total CPU usage of all API calls.
4954 // Average can be computed using total_cpu_micros / recorded_call_count.
4955 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4956 optional int64 recorded_total_cpu_micros = 8;
4957 // Maximum CPU usage of one API call.
4958 optional int64 recorded_max_cpu_micros = 9;
4959 // Maximum parcel reply size of one API call.
4960 optional int64 recorded_max_reply_size_bytes = 10;
4961 // Maximum parcel request size of one API call.
4962 optional int64 recorded_max_request_size_bytes = 11;
4963}
4964
4965/**
4966 * Pulls the statistics of exceptions during calls to Binder.
4967 *
4968 * Binder stats are cumulative from boot unless somebody reset the data using
4969 * > adb shell dumpsys binder_calls_stats --reset
4970 */
4971message BinderCallsExceptions {
4972 // Exception class name, e.g. java.lang.IllegalArgumentException.
4973 //
4974 // This is an exception class name thrown by the system server.
4975 optional string exception_class_name = 1;
4976 // Total number of exceptions.
4977 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004978}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004979
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004980/**
4981 * Pulls the statistics of message dispatching on HandlerThreads.
4982 *
4983 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4984 * config on the device.
4985 *
4986 * Next tag: 11
4987 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004988message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004989 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004990 optional int32 uid = 1 [(is_uid) = true];
4991
4992 // Fully qualified class name of the handler target class.
4993 //
4994 // This field does not contain PII. This is a system server class name.
4995 optional string handler_class_name = 2;
4996
4997 // The name of the thread that runs the Looper.
4998 //
4999 // This field does not contain PII. This is a system server thread name.
5000 optional string looper_thread_name = 3;
5001
5002 // The name of the dispatched message.
5003 //
5004 // This field does not contain PII. This is a system server constant or class
5005 // name.
5006 optional string message_name = 4;
5007
5008 // Total number of successfully dispatched messages.
5009 optional int64 message_count = 5;
5010
5011 // Total number of messages that failed dispatching.
5012 optional int64 exception_count = 6;
5013
5014 // Total number of processed messages we have data recorded for. If we
5015 // collected data for all the messages, message_count will be equal to
5016 // recorded_message_count.
5017 //
5018 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005019 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005020 optional int64 recorded_message_count = 7;
5021
5022 // Total latency of all processed messages.
5023 // Average can be computed using recorded_total_latency_micros /
5024 // recorded_message_count.
5025 optional int64 recorded_total_latency_micros = 8;
5026
5027 // Total CPU usage of all processed message.
5028 // Average can be computed using recorded_total_cpu_micros /
5029 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005030 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005031 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005032
5033 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5034 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005035
5036 // Max recorded CPU usage of all processed messages.
5037 optional int64 recorded_max_cpu_micros = 11;
5038
5039 // Max recorded latency of all processed messages.
5040 optional int64 recorded_max_latency_micros = 12;
5041
5042 // Total number of messages we tracked the dispatching delay for. If we
5043 // collected data for all the messages, message_count will be equal to
5044 // recorded_delay_message_count.
5045 //
5046 // If recorded_delay_message_count is different than message_count, it means data
5047 // collection has been sampled or/and not all messages specified the target dispatch time.
5048 // The fields below will be sampled in this case.
5049 optional int64 recorded_delay_message_count = 13;
5050
5051 // Total dispatching delay of all processed messages.
5052 // Calculated as a difference between the target dispatching time (Message.when)
5053 // and the actual dispatching time.
5054 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5055 optional int64 recorded_total_delay_millis = 14;
5056
5057 // Max dispatching delay of all processed messages.
5058 // Calculated as a difference between the target dispatching time (Message.when)
5059 // and the actual dispatching time.
5060 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005061}
Tej Singh86dc9db2018-09-06 00:39:57 +00005062
5063/**
5064 * Pulls disk information, such as write speed and latency.
5065 */
5066message DiskStats {
5067 // Time taken to open, write 512B to, and close a file.
5068 // -1 if error performing the check.
5069 optional int64 data_write_latency_millis = 1;
5070
5071 optional bool file_based_encryption = 2;
5072
5073 // Recent disk write speed in kB/s.
5074 // -1 if error querying storageed.
5075 // 0 if data is unavailable.
5076 optional int32 recent_disk_write_speed = 3;
5077}
5078
5079
5080/**
5081 * Free and total bytes of the Data, Cache, and System partition.
5082 */
5083message DirectoryUsage {
5084 enum Directory {
5085 UNKNOWN = 0;
5086 DATA = 1;
5087 CACHE = 2;
5088 SYSTEM = 3;
5089 }
5090 optional Directory directory = 1;
5091 optional int64 free_bytes = 2;
5092 optional int64 total_bytes = 3;
5093}
5094
5095
5096/**
5097 * Size of an application: apk size, data size, and cache size.
5098 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5099 * Information is only reported for apps with the primary user (user 0).
5100 * Sizes are aggregated by package name.
5101 */
5102message AppSize {
5103 // Including uids will involve modifying diskstats logic.
5104 optional string package_name = 1;
5105 // App size in bytes. -1 if unavailable.
5106 optional int64 app_size_bytes = 2;
5107 // App data size in bytes. -1 if unavailable.
5108 optional int64 app_data_size_bytes = 3;
5109 // App cache size in bytes. -1 if unavailable.
5110 optional int64 app_cache_size_bytes = 4;
5111 // Time that the cache file was produced.
5112 // Uses System.currentTimeMillis(), which is wall clock time.
5113 optional int64 cache_time_millis = 5;
5114}
5115
5116
5117/**
5118 * Size of a particular category. Eg: photos, videos.
5119 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5120 */
5121message CategorySize {
5122 enum Category {
5123 UNKNOWN = 0;
5124 APP_SIZE = 1;
5125 APP_DATA_SIZE = 2;
5126 APP_CACHE_SIZE = 3;
5127 PHOTOS = 4;
5128 VIDEOS = 5;
5129 AUDIO = 6;
5130 DOWNLOADS = 7;
5131 SYSTEM = 8;
5132 OTHER = 9;
5133 }
5134 optional Category category = 1;
5135 // Category size in bytes.
5136 optional int64 size_bytes = 2;
5137 // Time that the cache file was produced.
5138 // Uses System.currentTimeMillis(), which is wall clock time.
5139 optional int64 cache_time_millis = 3;
5140}
Tej Singhd6d6d772018-09-05 17:41:25 -07005141
5142/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005143 * Pulls per uid I/O stats. The stats are cumulative since boot.
5144 *
5145 * Read/write bytes are I/O events from a storage device
5146 * Read/write chars are data requested by read/write syscalls, and can be
5147 * satisfied by caching.
5148 *
5149 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5150 */
5151message DiskIo {
5152 optional int32 uid = 1 [(is_uid) = true];
5153 optional int64 fg_chars_read = 2;
5154 optional int64 fg_chars_write = 3;
5155 optional int64 fg_bytes_read = 4;
5156 optional int64 fg_bytes_write = 5;
5157 optional int64 bg_chars_read = 6;
5158 optional int64 bg_chars_write = 7;
5159 optional int64 bg_bytes_read = 8;
5160 optional int64 bg_bytes_write = 9;
5161 optional int64 fg_fsync = 10;
5162 optional int64 bg_fsync= 11;
5163}
5164
5165
5166/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005167 * Pulls the number of fingerprints for each user.
5168 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005169 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005170 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005171message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005172 // The associated user. Eg: 0 for owners, 10+ for others.
5173 // Defined in android/os/UserHandle.java
5174 optional int32 user = 1;
5175 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005176 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005177}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005178
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005179/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005180 * Pulls the number of faces for each user.
5181 *
5182 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5183 */
5184message NumFacesEnrolled {
5185 // The associated user. Eg: 0 for owners, 10+ for others.
5186 // Defined in android/os/UserHandle.java
5187 optional int32 user = 1;
5188 // Number of faces registered to that user.
5189 optional int32 num_faces_enrolled = 2;
5190}
5191/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005192 * A mapping of role holder -> role
5193 */
5194message RoleHolder {
5195 // uid of the role holder
5196 optional int32 uid = 1 [(is_uid) = true];
5197
5198 // package name of the role holder
5199 optional string package_name = 2;
5200
5201 // the role held
5202 optional string role = 3;
5203}
5204
Yangsteraf9aee72018-10-12 09:26:16 -07005205message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005206 // These are all in byte resolution.
5207 optional int64 min = 1 [deprecated = true];
5208 optional int64 average = 2 [deprecated = true];
5209 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005210
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005211 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5212 // int64 fields.
5213 optional int32 mean_kb = 4;
5214 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005215}
5216
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005217// A reduced subset of process states; reducing the number of possible states allows more
5218// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5219enum ProcessStateAggregated {
5220 PROCESS_STATE_UNKNOWN = 0;
5221 // Persistent system process.
5222 PROCESS_STATE_PERSISTENT = 1;
5223 // Top activity; actually any visible activity.
5224 PROCESS_STATE_TOP = 2;
5225 // Process binding to top or a foreground service.
5226 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5227 // Processing running a foreground service.
5228 PROCESS_STATE_FGS = 4;
5229 // Important foreground process (ime, wallpaper, etc).
5230 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5231 // Important background process.
5232 PROCESS_STATE_BACKGROUND = 6;
5233 // Process running a receiver.
5234 PROCESS_STATE_RECEIVER = 7;
5235 // All kinds of cached processes.
5236 PROCESS_STATE_CACHED = 8;
5237}
5238
5239// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005240message ProcessStatsStateProto {
5241 optional android.service.procstats.ScreenState screen_state = 1;
5242
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005243 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005244
5245 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5246 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005247 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5248
5249 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005250
5251 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005252 optional int64 duration_millis = 4 [deprecated = true];
5253 // Same as above, but with minute resolution so it fits into an int32.
5254 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005255
5256 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005257 optional int64 realtime_duration_millis = 9 [deprecated = true];
5258 // Same as above, but with minute resolution so it fits into an int32.
5259 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005260
5261 // # of samples taken
5262 optional int32 sample_size = 5;
5263
5264 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005265 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005266
5267 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005268 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005269
5270 // RSS is memory resident for this process
5271 optional AggStats rss = 8;
5272}
5273
5274// Next Tag: 7
5275message ProcessStatsProto {
5276 // Name of process.
5277 optional string process = 1;
5278
5279 // Uid of the process.
5280 optional int32 uid = 2;
5281
5282 // Information about how often kills occurred
5283 message Kill {
5284 // Count of excessive CPU kills
5285 optional int32 cpu = 1;
5286
5287 // Count of kills when cached
5288 optional int32 cached = 2;
5289
5290 // PSS stats during cached kill
5291 optional AggStats cached_pss = 3;
5292 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005293 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005294
5295 // Time and memory spent in various states.
5296 repeated ProcessStatsStateProto states = 5;
5297
5298 // Total time process has been running... screen_state, memory_state, and process_state
5299 // will not be set.
5300 optional ProcessStatsStateProto total_running_state = 6;
5301}
5302
5303message PackageServiceOperationStatsProto {
5304 // Operate enum: Started, Foreground, Bound, Executing
5305 optional android.service.procstats.ServiceOperationState operation = 1;
5306
5307 // Number of times the service was in this operation.
5308 optional int32 count = 2;
5309
5310 // Information about a state the service can be in.
5311 message StateStats {
5312 // Screen state enum.
5313 optional android.service.procstats.ScreenState screen_state = 1;
5314 // Memory state enum.
5315 optional android.service.procstats.MemoryState memory_state = 2;
5316
5317 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005318 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005319 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005320 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005321 }
5322 repeated StateStats state_stats = 3;
5323}
5324
5325message PackageServiceStatsProto {
5326 // Name of service component.
5327 optional string service_name = 1;
5328
5329 // The operation stats.
5330 // The package_name, package_uid, package_version, service_name will not be set to save space.
5331 repeated PackageServiceOperationStatsProto operation_stats = 2;
5332}
5333
5334message PackageAssociationSourceProcessStatsProto {
5335 // Uid of the process.
5336 optional int32 process_uid = 1;
5337 // Process name.
5338 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005339 // Package name.
5340 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005341 // Total count of the times this association appeared.
5342 optional int32 total_count = 3;
5343
5344 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005345 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005346
5347 // Total count of the times this association became actively impacting its target process.
5348 optional int32 active_count = 5;
5349
5350 // Information on one source in this association.
5351 message StateStats {
5352 // Process state enum.
5353 optional android.service.procstats.ProcessState process_state = 1;
5354 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005355 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005356 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005357 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005358 }
5359 repeated StateStats active_state_stats = 6;
5360}
5361
5362message PackageAssociationProcessStatsProto {
5363 // Name of the target component.
5364 optional string component_name = 1;
5365 // Information on one source in this association.
5366 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5367}
5368
5369
5370message ProcessStatsPackageProto {
5371 // Name of package.
5372 optional string package = 1;
5373
5374 // Uid of the package.
5375 optional int32 uid = 2;
5376
5377 // Version of the package.
5378 optional int64 version = 3;
5379
5380 // Stats for each process running with the package loaded in to it.
5381 repeated ProcessStatsProto process_stats = 4;
5382
5383 // Stats for each of the package's services.
5384 repeated PackageServiceStatsProto service_stats = 5;
5385
5386 // Stats for each association with the package.
5387 repeated PackageAssociationProcessStatsProto association_stats = 6;
5388}
5389
5390message ProcessStatsSectionProto {
5391 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005392 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005393
5394 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005395 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005396
5397 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005398 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005399
5400 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005401 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005402
5403 // System runtime library. e.g. "libdvm.so", "libart.so".
5404 optional string runtime = 5;
5405
5406 // whether kernel reports swapped pss.
5407 optional bool has_swapped_pss = 6;
5408
5409 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5410 enum Status {
5411 STATUS_UNKNOWN = 0;
5412 STATUS_COMPLETE = 1;
5413 STATUS_PARTIAL = 2;
5414 STATUS_SHUTDOWN = 3;
5415 STATUS_SYSPROPS = 4;
5416 }
5417 repeated Status status = 7;
5418
Chenjie Yub2ecc792019-01-17 10:27:26 -08005419 // Number of pages available of various types and sizes, representation fragmentation.
5420 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5421
Yangsteraf9aee72018-10-12 09:26:16 -07005422 // Stats for each process.
5423 repeated ProcessStatsProto process_stats = 8;
5424
5425 // Stats for each package.
5426 repeated ProcessStatsPackageProto package_stats = 9;
5427}
5428
Chenjie Yub2ecc792019-01-17 10:27:26 -08005429message ProcessStatsAvailablePagesProto {
5430 // Node these pages are in (as per /proc/pagetypeinfo)
5431 optional int32 node = 1;
5432
5433 // Zone these pages are in (as per /proc/pagetypeinfo)
5434 optional string zone = 2;
5435
5436 // Label for the type of these pages (as per /proc/pagetypeinfo)
5437 optional string label = 3;
5438
5439 // Distribution of number of pages available by order size. First entry in array is
5440 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5441 repeated int32 pages_per_order = 4;
5442}
5443
Chenjie Yu12e5e672018-09-14 15:54:59 -07005444/**
5445 * Pulled from ProcessStatsService.java
5446 */
5447message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005448 optional ProcessStatsSectionProto proc_stats_section = 1;
5449}
5450
Chenjie Yuf910b7802019-01-11 16:08:20 -08005451/**
5452 * Pulled from ProcessStatsService.java
5453 */
5454message ProcStatsPkgProc {
5455 optional ProcessStatsSectionProto proc_stats_section = 1;
5456}
5457
Chris Wrencdea3b72019-11-22 16:58:17 -05005458// Next Tag: 2
5459message PackageRemoteViewInfoProto {
5460 optional string package_name = 1;
5461 // add per-package additional info here (like channels)
5462}
5463
5464// Next Tag: 2
5465message NotificationRemoteViewsProto {
5466 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5467}
5468
5469/**
5470 * Pulled from NotificationManagerService.java
5471 */
5472message NotificationRemoteViews {
5473 optional NotificationRemoteViewsProto notification_remote_views = 1;
5474}
5475
Yotam Aron74299972020-01-16 16:20:58 +02005476/**
5477 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5478 */
5479message PackageNotificationPreferences {
5480 // Uid under which the package is installed.
5481 optional int32 uid = 1;
5482 // Notification importance, which specifies when and how a notification is displayed.
5483 // Specified under core/java/android/app/NotificationManager.java.
5484 optional int32 importance = 2;
5485 // Lockscreen visibility as set by the user.
5486 optional int32 visibility = 3;
5487 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5488 // PreferencesHelper.java)
5489 optional int32 user_locked_fields = 4;
5490}
5491
5492/**
5493 * Atom that contains a list of a package's channel preferences, pulled from
5494 * NotificationManagerService.java.
5495 */
5496message PackageNotificationChannelPreferences {
5497 // Uid under which the package is installed.
5498 optional int32 uid = 1;
5499 // Channel's ID. Should always be available.
5500 optional string channel_id = 2;
5501 // Channel's name. Should always be available.
5502 optional string channel_name = 3;
5503 // Channel's description. Optionally set by the channel creator.
5504 optional string description = 4;
5505 // Notification importance, which specifies when and how a notification is displayed. Specified
5506 // under core/java/android/app/NotificationManager.java.
5507 optional int32 importance = 5;
5508 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5509 // at core/java/android/app/NotificationChannel.java
5510 optional int32 user_locked_fields = 6;
5511 // Indicates if the channel was deleted by the app.
5512 optional bool is_deleted = 7;
5513}
5514
5515/**
5516 * Atom that contains a list of a package's channel group preferences, pulled from
5517 * NotificationManagerService.java.
5518 */
5519message PackageNotificationChannelGroupPreferences {
5520 // Uid under which the package is installed.
5521 optional int32 uid = 1;
5522 // Channel Group's ID. Should always be available.
5523 optional string group_id = 2;
5524 // Channel Group's name. Should always be available.
5525 optional string group_name = 3;
5526 // Channel Group's description. Optionally set by group creator.
5527 optional string description = 4;
5528 // Indicates if notifications from this channel group are blocked.
5529 optional bool is_blocked = 5;
5530 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5531 // at core/java/android/app/NotificationChannelGroup.java
5532 optional int32 user_locked_fields = 6;
5533}
5534
Yangsteraf9aee72018-10-12 09:26:16 -07005535message PowerProfileProto {
5536 optional double cpu_suspend = 1;
5537
5538 optional double cpu_idle = 2;
5539
5540 optional double cpu_active = 3;
5541
5542 message CpuCluster {
5543 optional int32 id = 1;
5544 optional double cluster_power = 2;
5545 optional int32 cores = 3;
5546 repeated int64 speed = 4;
5547 repeated double core_power = 5;
5548 }
5549
5550 repeated CpuCluster cpu_cluster = 40;
5551
5552 optional double wifi_scan = 4;
5553
5554 optional double wifi_on = 5;
5555
5556 optional double wifi_active = 6;
5557
5558 optional double wifi_controller_idle = 7;
5559
5560 optional double wifi_controller_rx = 8;
5561
5562 optional double wifi_controller_tx = 9;
5563
5564 repeated double wifi_controller_tx_levels = 10;
5565
5566 optional double wifi_controller_operating_voltage = 11;
5567
5568 optional double bluetooth_controller_idle = 12;
5569
5570 optional double bluetooth_controller_rx = 13;
5571
5572 optional double bluetooth_controller_tx = 14;
5573
5574 optional double bluetooth_controller_operating_voltage = 15;
5575
5576 optional double modem_controller_sleep = 16;
5577
5578 optional double modem_controller_idle = 17;
5579
5580 optional double modem_controller_rx = 18;
5581
5582 repeated double modem_controller_tx = 19;
5583
5584 optional double modem_controller_operating_voltage = 20;
5585
5586 optional double gps_on = 21;
5587
5588 repeated double gps_signal_quality_based = 22;
5589
5590 optional double gps_operating_voltage = 23;
5591
5592 optional double bluetooth_on = 24;
5593
5594 optional double bluetooth_active = 25;
5595
5596 optional double bluetooth_at_cmd = 26;
5597
5598 optional double ambient_display = 27;
5599
5600 optional double screen_on = 28;
5601
5602 optional double radio_on = 29;
5603
5604 optional double radio_scanning = 30;
5605
5606 optional double radio_active = 31;
5607
5608 optional double screen_full = 32;
5609
5610 optional double audio = 33;
5611
5612 optional double video = 34;
5613
5614 optional double flashlight = 35;
5615
5616 optional double memory = 36;
5617
5618 optional double camera = 37;
5619
5620 optional double wifi_batched_scan = 38;
5621
5622 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005623}
Chenjie Yuab530202018-09-26 12:39:20 -07005624
5625/**
5626 * power_profile.xml and other constants for power model calculations.
5627 * Pulled from PowerProfile.java
5628 */
5629message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005630 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005631}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005632
5633/**
arangelovd5db50e2018-10-12 20:24:39 +01005634 * Logs when a user restriction was added or removed.
5635 *
5636 * Logged from:
5637 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5638 */
5639message UserRestrictionChanged {
5640 // The raw string of the user restriction as defined in UserManager.
5641 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5642 optional string restriction = 1;
5643 // Whether the restriction is enabled or disabled.
5644 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005645}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005646
5647/**
5648 * Pulls process user time and system time. Puller takes a snapshot of all pids
5649 * in the system and returns cpu stats for those that are working at the time.
5650 * Dead pids will be dropped. Kernel processes are excluded.
5651 * Min cool-down is 5 sec.
5652 */
5653message ProcessCpuTime {
5654 optional int32 uid = 1 [(is_uid) = true];
5655
5656 optional string process_name = 2;
5657 // Process cpu time in user space, cumulative from boot/process start
5658 optional int64 user_time_millis = 3;
5659 // Process cpu time in system space, cumulative from boot/process start
5660 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005661}
Misha Wagner5a51e002018-10-03 15:04:09 +01005662
5663/**
5664 * Pulls the CPU usage for each thread.
5665 *
5666 * Read from /proc/$PID/task/$TID/time_in_state files.
5667 *
5668 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5669 * time_in_state files not being present on some phones, have not been addressed. These should be
5670 * considered before a public release.
5671 */
5672message CpuTimePerThreadFreq {
5673 // UID that owns the process.
5674 optional int32 uid = 1 [(is_uid) = true];
5675 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005676 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005677 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005678 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005679 // Name of the process taken from `/proc/$PID/cmdline`.
5680 optional string process_name = 4;
5681 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5682 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005683
5684 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5685 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5686 // frequencies are given here as the alternative is sending eight separate atoms. This method
5687 // significantly reduces the amount of data created
5688 optional int32 frequency1_khz = 6;
5689 optional int32 time1_millis = 7;
5690 optional int32 frequency2_khz = 8;
5691 optional int32 time2_millis = 9;
5692 optional int32 frequency3_khz = 10;
5693 optional int32 time3_millis = 11;
5694 optional int32 frequency4_khz = 12;
5695 optional int32 time4_millis = 13;
5696 optional int32 frequency5_khz = 14;
5697 optional int32 time5_millis = 15;
5698 optional int32 frequency6_khz = 16;
5699 optional int32 time6_millis = 17;
5700 optional int32 frequency7_khz = 18;
5701 optional int32 time7_millis = 19;
5702 optional int32 frequency8_khz = 20;
5703 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005704}
Bookatz75ee6042018-11-09 12:27:37 -08005705
5706/**
Bookatz366a4432018-11-20 09:42:33 -08005707 * Pulls information about the device's build.
5708 */
5709message BuildInformation {
5710 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5711 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5712 optional string fingerprint = 1;
5713
5714 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5715 optional string brand = 2;
5716
5717 // Build.PRODUCT. The name of the overall product.
5718 optional string product = 3;
5719
5720 // Build.DEVICE. The name of the industrial design.
5721 optional string device = 4;
5722
5723 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5724 optional string version_release = 5;
5725
5726 // Build.ID. E.g. a label like "M4-rc20".
5727 optional string id = 6;
5728
5729 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5730 // represent this build.
5731 optional string version_incremental = 7;
5732
5733 // Build.TYPE. The type of build, like "user" or "eng".
5734 optional string type = 8;
5735
5736 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5737 optional string tags = 9;
5738}
5739
5740/**
Adam He420947c2019-01-23 15:59:09 -08005741 * Logs information about mismatched caller for content capture.
5742 *
5743 * Logged from:
5744 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5745 */
5746message ContentCaptureCallerMismatchReported {
5747 optional string intended_package = 1;
5748 optional string calling_package = 2;
5749}
5750
5751/**
5752 * Logs information about content capture service events.
5753 *
5754 * Logged from:
5755 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5756 */
5757message ContentCaptureServiceEvents {
5758 // The type of event.
5759 enum Event {
5760 UNKNOWN = 0;
5761 ON_CONNECTED = 1;
5762 ON_DISCONNECTED = 2;
5763 SET_WHITELIST = 3;
5764 SET_DISABLED = 4;
5765 ON_USER_DATA_REMOVED = 5;
5766 }
5767 optional Event event = 1;
5768 // component/package of content capture service.
5769 optional string service_info = 2;
5770 // component/package of target.
5771 // it's a concatenated list of component/package for SET_WHITELIST event
5772 // separated by " ".
5773 optional string target_info = 3;
5774}
5775
5776/**
5777 * Logs information about content capture session events.
5778 *
5779 * Logged from:
5780 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5781 */
5782message ContentCaptureSessionEvents {
5783 // The type of event.
5784 enum Event {
5785 UNKNOWN = 0;
5786 ON_SESSION_STARTED = 1;
5787 ON_SESSION_FINISHED = 2;
5788 SESSION_NOT_CREATED = 3;
5789 }
5790 optional int32 session_id = 1;
5791 optional Event event = 2;
5792 // (n/a on session finished)
5793 optional int32 state_flags = 3;
5794 // component/package of content capture service.
5795 optional string service_info = 4;
5796 // component/package of app.
5797 // (n/a on session finished)
5798 optional string app_info = 5;
5799 optional bool is_child_session = 6;
5800}
5801
5802/**
5803 * Logs information about session being flushed.
5804 *
5805 * Logged from:
5806 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5807 */
5808message ContentCaptureFlushed {
5809 optional int32 session_id = 1;
5810 // component/package of content capture service.
5811 optional string service_info = 2;
5812 // component/package of app.
5813 optional string app_info = 3;
5814 // session start/finish events
5815 optional int32 child_session_started = 4;
5816 optional int32 child_session_finished = 5;
5817 // count of view events.
5818 optional int32 view_appeared_count = 6;
5819 optional int32 view_disappeared_count = 7;
5820 optional int32 view_text_changed_count = 8;
5821
5822 // Flush stats.
5823 optional int32 max_events = 9;
5824 optional int32 idle_flush_freq = 10;
5825 optional int32 text_flush_freq = 11;
5826 optional int32 flush_reason = 12;
5827}
5828
5829/**
Bookatz75ee6042018-11-09 12:27:37 -08005830 * Pulls on-device BatteryStats power use calculations for the overall device.
5831 */
5832message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005833 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5834 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5835 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5836 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005837}
5838
5839/**
5840 * Pulls on-device BatteryStats power use calculations broken down by uid.
5841 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5842 * that is attributed to non-uid items. They must all be included to get the total power use.
5843 */
5844message DeviceCalculatedPowerBlameUid {
5845 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5846 optional int32 uid = 1 [(is_uid) = true];
5847
Bookatz3dbc13a2018-12-21 12:16:51 -08005848 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5849 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5850 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005851}
5852
5853/**
5854 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5855 * drain type.
5856 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5857 * is attributed uids. They must all be included to get the total power use.
5858 */
5859message DeviceCalculatedPowerBlameOther {
5860 // The type of item whose power use is being reported.
5861 enum DrainType {
5862 AMBIENT_DISPLAY = 0;
5863 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5864 BLUETOOTH = 2;
5865 CAMERA = 3;
5866 // Cell-standby
5867 CELL = 4;
5868 FLASHLIGHT = 5;
5869 IDLE = 6;
5870 MEMORY = 7;
5871 // Amount that total computed drain exceeded the drain estimated using the
5872 // battery level changes and capacity.
5873 OVERCOUNTED = 8;
5874 PHONE = 9;
5875 SCREEN = 10;
5876 // Amount that total computed drain was below the drain estimated using the
5877 // battery level changes and capacity.
5878 UNACCOUNTED = 11;
5879 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5880 WIFI = 13;
5881 }
5882 optional DrainType drain_type = 1;
5883
Bookatz3dbc13a2018-12-21 12:16:51 -08005884 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5885 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5886 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005887}
arangelov4e994062018-11-13 16:12:38 +00005888
5889/**
5890 * Logs device policy features.
5891 *
5892 * Logged from:
5893 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5894 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5895 */
5896message DevicePolicyEvent {
5897 // The event id - unique for each event.
5898 optional android.stats.devicepolicy.EventId event_id = 1;
5899 // The admin package name.
5900 optional string admin_package_name = 2;
5901 // A generic integer parameter.
5902 optional int32 integer_value = 3;
5903 // A generic boolean parameter.
5904 optional bool boolean_value = 4;
5905 // A parameter specifying a time period in milliseconds.
5906 optional uint64 time_period_millis = 5;
5907 // A parameter specifying a list of package names, bundle extras or string parameters.
5908 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5909}
shawnlinea5b66b2018-11-13 15:05:29 +08005910
5911/**
5912 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5913 *
5914 * Logged from:
5915 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5916 */
5917message DocsUILaunchReported {
5918 optional android.stats.docsui.LaunchAction launch_action = 1;
5919 optional bool has_initial_uri = 2;
5920 optional android.stats.docsui.MimeType mime_type = 3;
5921 optional android.stats.docsui.Root initial_root = 4;
5922}
5923
5924/**
5925 * Logs root/app visited event in file managers/picker. Call this when the user
5926 * taps on root/app in hamburger menu.
5927 *
5928 * Logged from:
5929 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5930 */
5931message DocsUIRootVisitedReported {
5932 optional android.stats.docsui.ContextScope scope = 1;
5933 optional android.stats.docsui.Root root = 2;
5934}
5935
5936/**
5937 * Logs file operation stats. Call this when a file operation has completed.
5938 *
5939 * Logged from:
5940 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5941 */
5942message DocsUIFileOperationReported {
5943 optional android.stats.docsui.Provider provider = 1;
5944 optional android.stats.docsui.FileOperation file_op = 2;
5945}
5946
5947/**
5948 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5949 * mode.
5950 *
5951 * Logged from:
5952 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5953 */
5954message DocsUIFileOperationCopyMoveModeReported {
5955 optional android.stats.docsui.FileOperation file_op = 1;
5956 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5957}
5958
5959
5960/**
5961 * Logs file sub operation stats. Call this when a file operation has failed.
5962 *
5963 * Logged from:
5964 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5965 */
5966message DocsUIFileOperationFailureReported {
5967 optional android.stats.docsui.Authority authority = 1;
5968 optional android.stats.docsui.SubFileOperation sub_op = 2;
5969}
5970
5971/**
5972* Logs the cancellation of a file operation. Call this when a job is canceled
5973*
5974* Logged from:
5975* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5976*/
5977message DocsUIFileOperationCanceledReported {
5978 optional android.stats.docsui.FileOperation file_op = 1;
5979}
5980
5981/**
5982 * Logs startup time in milliseconds.
5983 *
5984 * Logged from:
5985 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5986 */
5987message DocsUIStartupMsReported {
5988 optional int32 startup_millis = 1;
5989}
5990
5991/**
5992 * Logs the action that was started by user.
5993 *
5994 * Logged from:
5995 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5996 */
5997message DocsUIUserActionReported {
5998 optional android.stats.docsui.UserAction action = 1;
5999}
6000
6001/**
6002 * Logs the invalid type when invalid scoped access is requested.
6003 *
6004 * Logged from:
6005 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6006 */
6007message DocsUIInvalidScopedAccessRequestReported {
6008 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006009}
Ben Murdochbab399f2018-12-06 11:01:38 +00006010
6011/**
shawnlina75e82d2019-01-07 10:31:12 +08006012 * Logs the package name that launches docsui picker mode.
6013 *
6014 * Logged from:
6015 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6016 */
6017message DocsUIPickerLaunchedFromReported {
6018 optional string package_name = 1;
6019}
6020
6021/**
6022 * Logs the search type.
6023 *
6024 * Logged from:
6025 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6026 */
6027message DocsUISearchTypeReported {
6028 optional android.stats.docsui.SearchType search_type = 1;
6029}
6030
6031/**
6032 * Logs the search mode.
6033 *
6034 * Logged from:
6035 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6036 */
6037message DocsUISearchModeReported {
6038 optional android.stats.docsui.SearchMode search_mode = 1;
6039}
6040
6041/**
6042 * Logs the pick result information.
6043 *
6044 * Logged from:
6045 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6046 */
6047message DocsUIPickResultReported {
6048 optional int32 total_action_count = 1;
6049 optional int64 duration_millis = 2;
6050 optional int32 file_count= 3;
6051 optional bool is_searching = 4;
6052 optional android.stats.docsui.Root picked_from = 5;
6053 optional android.stats.docsui.MimeType mime_type = 6;
6054 optional int32 repeatedly_pick_times = 7;
6055}
6056
6057/**
Ben Murdochbab399f2018-12-06 11:01:38 +00006058 * Logs when an app's memory is compacted.
6059 *
6060 * Logged from:
6061 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6062 */
6063message AppCompacted {
6064 // The pid of the process being compacted.
6065 optional int32 pid = 1;
6066
6067 // The name of the process being compacted.
6068 optional string process_name = 2;
6069
6070 // The type of compaction.
6071 enum Action {
6072 UNKNOWN = 0;
6073 SOME = 1;
6074 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006075 PERSISTENT = 3;
6076 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00006077 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006078 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00006079
6080 // Total RSS in kilobytes consumed by the process prior to compaction.
6081 optional int64 before_rss_total_kilobytes = 4;
6082
6083 // File RSS in kilobytes consumed by the process prior to compaction.
6084 optional int64 before_rss_file_kilobytes = 5;
6085
6086 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6087 optional int64 before_rss_anon_kilobytes = 6;
6088
6089 // Swap in kilobytes consumed by the process prior to compaction.
6090 optional int64 before_swap_kilobytes = 7;
6091
6092 // Total RSS in kilobytes consumed by the process after compaction.
6093 optional int64 after_rss_total_kilobytes = 8;
6094
6095 // File RSS in kilobytes consumed by the process after compaction.
6096 optional int64 after_rss_file_kilobytes = 9;
6097
6098 // Anonymous RSS in kilobytes consumed by the process after compaction.
6099 optional int64 after_rss_anon_kilobytes = 10;
6100
6101 // Swap in kilobytes consumed by the process after compaction.
6102 optional int64 after_swap_kilobytes = 11;
6103
6104 // The time taken to perform compaction in milliseconds.
6105 optional int64 time_to_compact_millis = 12;
6106
6107 // The last compaction action performed for this app.
6108 optional Action last_action = 13;
6109
Ben Murdoch01720b82018-12-19 18:03:44 +00006110 // The last time that compaction was attempted on this process in milliseconds
6111 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6112 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00006113
Ben Murdoch885c21b2019-03-15 18:02:04 +00006114 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006115 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00006116
6117 // The process state at the time of compaction.
6118 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006119
6120 // Free ZRAM in kilobytes before compaction.
6121 optional int64 before_zram_free_kilobytes = 17;
6122
6123 // Free ZRAM in kilobytes after compaction.
6124 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00006125}
lifr157fc552018-12-12 16:38:04 +08006126
6127/**
lifrb6b90b62019-03-29 00:40:17 +08006128 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6129 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6130 *
lifr1f74b052019-04-16 22:16:30 +08006131 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6132 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6133 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6134 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006135 */
6136message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006137 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006138
lifr1f74b052019-04-16 22:16:30 +08006139 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006140
6141 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006142 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006143
lifr1f74b052019-04-16 22:16:30 +08006144 // Only valid for event_type = EVENT_GETADDRINFO.
6145 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006146
lifr1f74b052019-04-16 22:16:30 +08006147 // Flags passed to android_res_nsend() defined in multinetwork.h
6148 // Only valid for event_type = EVENT_RESNSEND.
6149 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006150
lifrad9becc2019-05-20 11:04:41 +08006151 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006152
6153 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006154 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006155
6156 // Additional pass-through fields opaque to statsd.
6157 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006158 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006159
6160 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6161 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006162}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006163
6164/**
6165 * Logs when a data stall event occurs.
6166 *
6167 * Log from:
6168 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6169 */
6170message DataStallEvent {
6171 // Data stall evaluation type.
6172 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6173 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6174 optional int32 evaluation_type = 1;
6175 // See definition in data_stall_event.proto.
6176 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6177 // See definition in data_stall_event.proto.
6178 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6179 // See definition in data_stall_event.proto.
6180 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6181 // See definition in data_stall_event.proto.
6182 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6183 // See definition in data_stall_event.proto.
6184 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6185}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006186
6187/*
6188 * Logs when RescueParty resets some set of experiment flags.
6189 *
6190 * Logged from:
6191 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6192 */
6193message RescuePartyResetReported {
6194 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6195 optional int32 rescue_level = 1;
6196}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006197
6198/**
6199 * Logs when signed config is received from an APK, and if that config was applied successfully.
6200 * Logged from:
6201 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6202 */
6203message SignedConfigReported {
6204 enum Type {
6205 UNKNOWN_TYPE = 0;
6206 GLOBAL_SETTINGS = 1;
6207 }
6208 optional Type type = 1;
6209
6210 // The final status of the signed config received.
6211 enum Status {
6212 UNKNOWN_STATUS = 0;
6213 APPLIED = 1;
6214 BASE64_FAILURE_CONFIG = 2;
6215 BASE64_FAILURE_SIGNATURE = 3;
6216 SECURITY_EXCEPTION = 4;
6217 INVALID_CONFIG = 5;
6218 OLD_CONFIG = 6;
6219 SIGNATURE_CHECK_FAILED = 7;
6220 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006221 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006222 }
6223 optional Status status = 2;
6224
6225 // The version of the signed config processed.
6226 optional int32 version = 3;
6227
6228 // The package name that the config was extracted from.
6229 optional string from_package = 4;
6230
6231 enum Key {
6232 NO_KEY = 0;
6233 DEBUG = 1;
6234 PRODUCTION = 2;
6235 }
6236 // Which key was used to verify the config.
6237 optional Key verified_with = 5;
6238}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006239
6240/*
6241 * Logs GNSS Network-Initiated (NI) location events.
6242 *
6243 * Logged from:
6244 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6245 */
6246message GnssNiEventReported {
6247 // The type of GnssNiEvent.
6248 enum EventType {
6249 UNKNOWN = 0;
6250 NI_REQUEST = 1;
6251 NI_RESPONSE = 2;
6252 }
6253 optional EventType event_type = 1;
6254
6255 // An ID generated by HAL to associate NI notifications and UI responses.
6256 optional int32 notification_id = 2;
6257
6258 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006259 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006260
6261 // NI requires notification.
6262 optional bool need_notify = 4;
6263
6264 // NI requires verification.
6265 optional bool need_verify = 5;
6266
6267 // NI requires privacy override, no notification/minimal trace.
6268 optional bool privacy_override = 6;
6269
6270 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6271 // seconds.
6272 optional int32 timeout = 7;
6273
6274 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006275 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006276
6277 // String representing the requester of the network inititated location request.
6278 optional string requestor_id = 9;
6279
6280 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6281 // network initiated location request.
6282 optional string text = 10;
6283
6284 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006285 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006286
6287 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006288 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006289
6290 // True if SUPL ES is enabled.
6291 optional bool is_supl_es_enabled = 13;
6292
6293 // True if GNSS location is enabled.
6294 optional bool is_location_enabled = 14;
6295
6296 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006297 optional android.server.location.GnssUserResponseType user_response = 15;
6298}
6299
6300/**
6301 * Logs GNSS non-framework (NFW) location notification.
6302 *
6303 * Logged from:
6304 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6305 */
6306message GnssNfwNotificationReported {
6307 // Package name of the Android proxy application representing the non-framework entity that
6308 // requested location. Set to empty string if unknown.
6309 optional string proxy_app_package_name = 1;
6310
6311 // Protocol stack that initiated the non-framework location request.
6312 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6313
6314 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6315 // set to empty string. This field is opaque to the framework and used for logging purposes.
6316 optional string other_protocol_stack_name = 3;
6317
6318 // Source initiating/receiving the location information.
6319 optional android.server.location.NfwRequestor requestor = 4;
6320
6321 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6322 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6323 // and used for logging purposes.
6324 optional string requestor_id = 5;
6325
6326 // Indicates whether location information was provided for this request.
6327 optional android.server.location.NfwResponseType response_type = 6;
6328
6329 // True if the device is in user initiated emergency session.
6330 optional bool in_emergency_mode = 7;
6331
6332 // True if cached location is provided.
6333 optional bool is_cached_location = 8;
6334
6335 // True if proxy app permission mismatch between framework and GNSS HAL.
6336 optional bool is_permission_mismatched = 9;
6337}
6338
6339/**
6340 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6341 *
6342 * Logged from:
6343 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6344 */
6345message GnssConfigurationReported {
6346 // SUPL host name.
6347 optional string supl_host = 1;
6348
6349 // SUPL port number.
6350 optional int32 supl_port = 2;
6351
6352 // C2K host name.
6353 optional string c2k_host = 3;
6354
6355 // C2K port number.
6356 optional int32 c2k_port = 4;
6357
6358 // The SUPL version requested by Carrier.
6359 optional int32 supl_ver = 5;
6360
6361 // The SUPL mode.
6362 optional android.server.location.SuplMode supl_mode = 6;
6363
6364 // True if NI emergency SUPL restrictions is enabled.
6365 optional bool supl_es = 7;
6366
6367 // LTE Positioning Profile settings
6368 optional android.server.location.LppProfile lpp_profile = 8;
6369
6370 // Positioning protocol on A-Glonass system.
6371 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6372
6373 // True if emergency PDN is used. Otherwise, regular PDN is used.
6374 optional bool use_emergency_pdn_for_emergency_supl= 10;
6375
6376 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6377 optional android.server.location.GpsLock gps_lock = 11;
6378
6379 // Number of seconds to extend the emergency session duration post emergency call.
6380 optional int32 es_extension_sec = 12;
6381
6382 // The full list of package names of proxy Android applications representing the non-framework
6383 // location access entities (on/off the device) for which the framework user has granted
6384 // non-framework location access permission. The package names are concatenated in one string
6385 // with spaces as separators.
6386 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006387}
Jack Yu95b64f32018-12-13 18:26:11 +08006388
6389/**
6390 * Logs when a NFC device's error occurred.
6391 * Logged from:
6392 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6393 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6394 */
6395message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006396 enum Type {
6397 UNKNOWN = 0;
6398 CMD_TIMEOUT = 1;
6399 ERROR_NOTIFICATION = 2;
6400 AID_OVERFLOW = 3;
6401 }
6402 optional Type type = 1;
6403 // If it's nci cmd timeout, log the timeout command.
6404 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006405
Alex Salod7c3eef2019-01-25 14:43:27 -08006406 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006407}
6408
6409/**
6410 * Logs when a NFC device's state changed event
6411 * Logged from:
6412 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6413 */
6414message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006415 enum State {
6416 UNKNOWN = 0;
6417 OFF = 1;
6418 ON = 2;
6419 ON_LOCKED = 3; // Secure Nfc enabled.
6420 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6421 }
6422 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006423}
6424
6425/**
6426 * Logs when a NFC Beam Transaction occurred.
6427 * Logged from:
6428 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6429 */
6430message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006431 enum Operation {
6432 UNKNOWN = 0;
6433 SEND = 1;
6434 RECEIVE = 2;
6435 }
6436 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006437}
6438
6439/**
6440 * Logs when a NFC Card Emulation Transaction occurred.
6441 * Logged from:
6442 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6443 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6444 */
6445message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006446 enum Category {
6447 UNKNOWN = 0;
6448 HCE_PAYMENT = 1;
6449 HCE_OTHER = 2;
6450 OFFHOST = 3;
6451 }
6452 // Transaction belongs to HCE payment or HCE other category, or offhost.
6453 optional Category category = 1;
6454 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6455 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006456}
6457
6458/**
6459 * Logs when a NFC Tag event occurred.
6460 * Logged from:
6461 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6462 */
6463message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006464 enum Type {
6465 UNKNOWN = 0;
6466 URL = 1;
6467 BT_PAIRING = 2;
6468 PROVISION = 3;
6469 WIFI_CONNECT = 4;
6470 APP_LAUNCH = 5;
6471 OTHERS = 6;
6472 }
6473 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006474}
6475
6476/**
6477 * Logs when Hce transaction triggered
6478 * Logged from:
6479 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6480 */
6481message NfcHceTransactionOccurred {
6482 // The latency period(in microseconds) it took for the first HCE data
6483 // exchange.
6484 optional uint32 latency_micros = 1;
6485}
6486
6487/**
6488 * Logs when SecureElement state event changed
6489 * Logged from:
6490 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6491 */
6492message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006493 enum State {
6494 UNKNOWN = 0;
6495 INITIALIZED = 1;
6496 DISCONNECTED = 2;
6497 CONNECTED = 3;
6498 HALCRASH = 4;
6499 }
6500 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006501
Alex Salod7c3eef2019-01-25 14:43:27 -08006502 optional string state_change_reason = 2;
6503 // SIMx or eSEx.
6504 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006505}
6506
6507/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006508 * Information about a permission grant request
6509 */
6510message PermissionGrantRequestResultReported {
6511 // unique value identifying an API call. A API call might result in multiple of these atoms
6512 optional int64 request_id = 1;
6513
6514 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006515 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006516
6517 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006518 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006519
6520 // The permission to be granted
6521 optional string permission_name = 4;
6522
6523 // If the permission was explicitly requested via the API or added by the system
6524 optional bool is_implicit = 5;
6525
6526 enum Result {
6527 UNDEFINED = 0;
6528 // permission request was ignored
6529 IGNORED = 1;
6530 // permission request was ignored because it was user fixed
6531 IGNORED_USER_FIXED = 2;
6532 // permission request was ignored because it was policy fixed
6533 IGNORED_POLICY_FIXED = 3;
6534 // permission was granted by user action
6535 USER_GRANTED = 4;
6536 // permission was automatically granted
6537 AUTO_GRANTED = 5;
6538 // permission was denied by user action
6539 USER_DENIED = 6;
6540 // permission was denied with prejudice by the user
6541 USER_DENIED_WITH_PREJUDICE = 7;
6542 // permission was automatically denied
6543 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006544 // permission request was ignored because permission is restricted
6545 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006546 // one time permission was granted by user action
6547 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006548 // user ignored request by leaving the request screen without choosing any option
6549 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006550 // user granted the permission after being linked to settings
6551 USER_GRANTED_IN_SETTINGS = 12;
6552 // user denied the permission after being linked to settings
6553 USER_DENIED_IN_SETTINGS = 13;
6554 // user denied the permission with prejudice after being linked to settings
6555 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6556 // permission was automatically revoked after one-time permission expired
6557 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006558 // permission was automatically revoked for unused app
6559 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006560 }
6561 // The result of the permission grant
6562 optional Result result = 6;
6563}
6564
6565/**
Jack Yu95b64f32018-12-13 18:26:11 +08006566 * Logs when Omapi API used
6567 * Logged from:
6568 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6569 */
6570message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006571 enum Operation {
6572 UNKNOWN = 0;
6573 OPEN_CHANNEL = 1;
6574 }
6575 optional Operation operation = 1;
6576 // SIMx or eSEx.
6577 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006578
Alex Salod7c3eef2019-01-25 14:43:27 -08006579 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006580}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006581
6582/**
Alex Saloa060aee2019-01-21 14:36:41 -08006583 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6584 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006585 * Logged from:
6586 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6587 */
6588message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006589 optional int64 dispatch_latency_millis = 1;
6590}
6591
6592/**
6593 * Logs AttentionManagerService attention check result.
6594 *
6595 * Logged from:
6596 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6597 */
6598message AttentionManagerServiceResultReported {
6599 // See core/java/android/service/attention/AttentionService.java
6600 enum AttentionCheckResult {
6601 UNKNOWN = 20;
6602 ATTENTION_SUCCESS_ABSENT = 0;
6603 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006604 ATTENTION_FAILURE_UNKNOWN = 2;
6605 ATTENTION_FAILURE_CANCELLED = 3;
6606 ATTENTION_FAILURE_PREEMPTED = 4;
6607 ATTENTION_FAILURE_TIMED_OUT = 5;
6608 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006609 }
6610 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006611}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006612
6613/**
6614 * Logs when an adb connection changes state.
6615 *
6616 * Logged from:
6617 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6618 */
6619message AdbConnectionChanged {
6620 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6621 // previously selected for this system.
6622 optional int64 last_connection_time_millis = 1;
6623
6624 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6625 // to reconnect via adb without user interaction.
6626 optional int64 auth_window_millis = 2;
6627
6628 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6629 optional android.debug.AdbConnectionStateEnum state = 3;
6630
6631 // True if the 'always allow' option was selected for this system.
6632 optional bool always_allow = 4;
6633}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006634
6635/*
6636 * Logs the reported speech DSP status.
6637 *
6638 * Logged from:
6639 * Vendor audio implementation.
6640 */
6641message SpeechDspStatReported {
6642 // The total Speech DSP uptime in milliseconds.
6643 optional int32 total_uptime_millis = 1;
6644 // The total Speech DSP downtime in milliseconds.
6645 optional int32 total_downtime_millis = 2;
6646 optional int32 total_crash_count = 3;
6647 optional int32 total_recover_count = 4;
6648}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006649
6650/**
6651 * Logs USB connector contaminant status.
6652 *
6653 * Logged from: USB Service.
6654 */
6655message UsbContaminantReported {
6656 optional string id = 1;
6657 optional android.service.usb.ContaminantPresenceStatus status = 2;
6658}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006659
6660/**
6661 * This atom is for debugging purpose.
6662 */
6663message DebugElapsedClock {
6664 // Monotically increasing value for each pull.
6665 optional int64 pull_count = 1;
6666 // Time from System.elapsedRealtime.
6667 optional int64 elapsed_clock_millis = 2;
6668 // Time from System.elapsedRealtime.
6669 optional int64 same_elapsed_clock_millis = 3;
6670 // Diff between current elapsed time and elapsed time from previous pull.
6671 optional int64 elapsed_clock_diff_millis = 4;
6672
6673 enum Type {
6674 TYPE_UNKNOWN = 0;
6675 ALWAYS_PRESENT = 1;
6676 PRESENT_ON_ODD_PULLS = 2;
6677 }
6678 // Type of behavior for the pulled data.
6679 optional Type type = 5;
6680}
6681
6682/**
6683 * This atom is for debugging purpose.
6684 */
6685message DebugFailingElapsedClock {
6686 // Monotically increasing value for each pull.
6687 optional int64 pull_count = 1;
6688 // Time from System.elapsedRealtime.
6689 optional int64 elapsed_clock_millis = 2;
6690 // Time from System.elapsedRealtime.
6691 optional int64 same_elapsed_clock_millis = 3;
6692 // Diff between current elapsed time and elapsed time from previous pull.
6693 optional int64 elapsed_clock_diff_millis = 4;
6694}
Steven Wuacef6bb2019-01-23 14:21:17 -05006695
6696/** Logs System UI bubbles event changed.
6697 *
6698 * Logged from:
6699 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6700 */
6701message BubbleUIChanged {
6702
6703 // The app package that is posting the bubble.
6704 optional string package_name = 1;
6705
6706 // The notification channel that is posting the bubble.
6707 optional string notification_channel = 2;
6708
6709 // The notification id associated with the posted bubble.
6710 optional int32 notification_id = 3;
6711
6712 // The position of the bubble within the bubble stack.
6713 optional int32 position = 4;
6714
6715 // The total number of bubbles within the bubble stack.
6716 optional int32 total_number = 5;
6717
6718 // User interactions with the bubble.
6719 enum Action {
6720 UNKNOWN = 0;
6721 POSTED = 1;
6722 UPDATED = 2;
6723 EXPANDED = 3;
6724 COLLAPSED = 4;
6725 DISMISSED = 5;
6726 STACK_DISMISSED = 6;
6727 STACK_MOVED = 7;
6728 HEADER_GO_TO_APP = 8;
6729 HEADER_GO_TO_SETTINGS = 9;
6730 PERMISSION_OPT_IN = 10;
6731 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006732 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006733 SWIPE_LEFT = 13;
6734 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006735 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04006736 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006737 }
6738 optional Action action = 6;
6739
6740 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6741 optional float normalized_x_position = 7;
6742 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006743
6744 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6745 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006746
6747 // Whether the bubble is an on-going one.
6748 optional bool is_ongoing = 10;
6749
6750 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006751 // This is deprecated and the value should be ignored.
6752 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006753}
Kweku Adams8845d012018-12-11 20:06:45 -08006754
6755/**
Steven Wu552f63f2019-02-05 13:41:36 -05006756 * Logs System UI bubbles developer errors.
6757 *
6758 * Logged from:
6759 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6760 */
6761message BubbleDeveloperErrorReported {
6762
6763 // The app package that is posting the bubble.
6764 optional string package_name = 1;
6765
6766 // Bubble developer error type enums.
6767 enum Error {
6768 UNKNOWN = 0;
6769 ACTIVITY_INFO_MISSING = 1;
6770 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6771 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6772 }
6773 optional Error error = 2 [default = UNKNOWN];
6774}
6775
6776/**
Kweku Adams8845d012018-12-11 20:06:45 -08006777 * Logs that a constraint for a scheduled job has changed.
6778 *
6779 * Logged from:
6780 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6781 */
6782message ScheduledJobConstraintChanged {
6783 repeated AttributionNode attribution_node = 1;
6784
6785 // Name of the job.
6786 optional string job_name = 2;
6787
6788 optional com.android.server.job.ConstraintEnum constraint = 3;
6789
6790 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006791 UNKNOWN = 0;
6792 UNSATISFIED = 1;
6793 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006794 }
6795 optional State state = 4;
6796}
Alex Salod7c3eef2019-01-25 14:43:27 -08006797
6798/**
6799 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6800 * returns true.
6801 *
6802 * Logged from:
6803 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6804 */
6805message ScreenTimeoutExtensionReported {
6806 // Describes how many times in a row did the power manager reset the screen off timeout.
6807 optional uint32 consecutive_timeout_extended_count = 1;
6808}
Hui Yu885aca12019-01-10 17:11:34 -08006809
6810/*
6811* Logs number of milliseconds it takes to start a process.
6812* The definition of app process start time is from the app launch time to
6813* the time that Zygote finished forking the app process and loaded the
6814* application package's java classes.
6815
6816* This metric is different from AppStartOccurred which is for foreground
6817* activity only.
6818
6819* ProcessStartTime can report all processes (both foreground and background)
6820* start time.
6821*
6822* Logged from:
6823* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6824*/
6825message ProcessStartTime {
6826 // The uid of the ProcessRecord.
6827 optional int32 uid = 1 [(is_uid) = true];
6828
6829 // The process pid.
6830 optional int32 pid = 2;
6831
6832 // The process name.
6833 // Usually package name, "system" for system server.
6834 // Provided by ActivityManagerService.
6835 optional string process_name = 3;
6836
6837 enum StartType {
6838 UNKNOWN = 0;
6839 WARM = 1;
6840 HOT = 2;
6841 COLD = 3;
6842 }
6843
6844 // The start type.
6845 optional StartType type = 4;
6846
6847 // The elapsed realtime at the start of the process.
6848 optional int64 process_start_time_millis = 5;
6849
6850 // Number of milliseconds it takes to reach bind application.
6851 optional int32 bind_application_delay_millis = 6;
6852
6853 // Number of milliseconds it takes to finish start of the process.
6854 optional int32 process_start_delay_millis = 7;
6855
6856 // hostingType field in ProcessRecord, the component type such as "activity",
6857 // "service", "content provider", "broadcast" or other strings.
6858 optional string hosting_type = 8;
6859
6860 // hostingNameStr field in ProcessRecord. The component class name that runs
6861 // in this process.
6862 optional string hosting_name = 9;
6863}
6864
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006865/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006866 * Track Media Codec usage
6867 * Logged from:
6868 * frameworks/av/media/libstagefright/MediaCodec.cpp
6869 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6870 */
6871message MediametricsCodecReported {
6872 optional int64 timestamp_nanos = 1;
6873 optional string package_name = 2;
6874 optional int64 package_version_code = 3;
6875 optional int64 media_apex_version = 4;
6876
6877 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6878}
6879
6880/**
6881 * Track Media Extractor (pulling video/audio streams out of containers) usage
6882 * Logged from:
6883 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6884 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6885 */
6886message MediametricsExtractorReported {
6887 optional int64 timestamp_nanos = 1;
6888 optional string package_name = 2;
6889 optional int64 package_version_code = 3;
6890 optional int64 media_apex_version = 4;
6891
6892 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6893}
6894
6895/**
6896 * Track how we arbitrate between microphone/input requests.
6897 * Logged from
6898 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6899 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6900 */
6901message MediametricsAudiopolicyReported {
6902 optional int64 timestamp_nanos = 1;
6903 optional string package_name = 2;
6904 optional int64 package_version_code = 3;
6905 optional int64 media_apex_version = 4;
6906
6907 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6908}
6909
6910/**
6911 * Track how we arbitrate between microphone requests.
6912 * Logged from
6913 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6914 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6915 */
6916message MediametricsAudiorecordReported {
6917 optional int64 timestamp_nanos = 1;
6918 optional string package_name = 2;
6919 optional int64 package_version_code = 3;
6920 optional int64 media_apex_version = 4;
6921
6922 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6923}
6924
6925/**
6926 * Track how we arbitrate between microphone/input requests.
6927 * Logged from
6928 * frameworks/av/media/libnblog/ReportPerformance.cpp
6929 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6930 */
6931message MediametricsAudiothreadReported {
6932 optional int64 timestamp_nanos = 1;
6933 optional string package_name = 2;
6934 optional int64 package_version_code = 3;
6935 optional int64 media_apex_version = 4;
6936
6937 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6938}
6939
6940/**
6941 * Track how we arbitrate between microphone/input requests.
6942 * Logged from
6943 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6944 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6945 */
6946message MediametricsAudiotrackReported {
6947 optional int64 timestamp_nanos = 1;
6948 optional string package_name = 2;
6949 optional int64 package_version_code = 3;
6950 optional int64 media_apex_version = 4;
6951
6952 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6953}
6954
6955/**
6956 * Track information about DRM framework performance
6957 * Logged from
6958 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6959 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6960 */
6961message MediametricsMediadrmReported {
6962 optional int64 timestamp_nanos = 1;
6963 optional string package_name = 2;
6964 optional int64 package_version_code = 3;
6965 optional int64 media_apex_version = 4;
6966
6967 // vendor+description tell about which DRM plugin is in use on this device
6968 optional string vendor = 5;
6969 optional string description = 6;
6970 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6971 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6972}
6973
6974/**
6975 * Track information about the widevine DRM plugin performance
6976 * Logged from
6977 * vendor/widevine/libwvdrmengine/cdm/metrics
6978 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6979 */
6980message MediametricsDrmWidevineReported {
6981 optional int64 timestamp_nanos = 1;
6982 optional string package_name = 2;
6983 optional int64 package_version_code = 3;
6984 optional int64 media_apex_version = 4;
6985
6986 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6987}
6988
6989/**
6990 * Track information about recordings (e.g. camcorder)
6991 * Logged from
6992 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6993 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6994 */
6995message MediametricsRecorderReported {
6996 optional int64 timestamp_nanos = 1;
6997 optional string package_name = 2;
6998 optional int64 package_version_code = 3;
6999 optional int64 media_apex_version = 4;
7000
7001 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7002}
7003
7004/**
7005 * Track Media Player usage
7006 * Logged from:
7007 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7008 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7009 */
7010message MediametricsNuPlayerReported {
7011 optional int64 timestamp_nanos = 1;
7012 optional string package_name = 2;
7013 optional int64 package_version_code = 3;
7014 optional int64 media_apex_version = 4;
7015
7016 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7017}
7018
7019/**
Robert Shiha4beed32019-08-19 14:15:23 -07007020 * Track Legacy DRM usage
7021 * Logged from
7022 * frameworks/av/drm/drmserver/DrmManager.cpp
7023 */
7024message MediametricsDrmManagerReported {
7025 optional int64 timestamp_nanos = 1;
7026 optional string package_name = 2;
7027 optional int64 package_version_code = 3;
7028 optional int64 media_apex_version = 4;
7029
7030 enum Method {
7031 METHOD_NOT_FOUND = -1;
7032 GET_CONSTRAINTS = 0;
7033 GET_METADATA = 1;
7034 CAN_HANDLE = 2;
7035 PROCESS_DRM_INFO = 3;
7036 ACQUIRE_DRM_INFO = 4;
7037 SAVE_RIGHTS = 5;
7038 GET_ORIGINAL_MIME_TYPE = 6;
7039 GET_DRM_OBJECT_TYPE = 7;
7040 CHECK_RIGHTS_STATUS = 8;
7041 REMOVE_RIGHTS = 9;
7042 REMOVE_ALL_RIGHTS = 10;
7043 OPEN_CONVERT_SESSION = 11;
7044 OPEN_DECRYPT_SESSION = 12;
7045 }
7046
7047 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7048 optional string plugin_id = 5;
7049 optional string description = 6;
7050 optional Method method = 7;
7051 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007052
7053 optional int64 get_constraints_count = 9;
7054 optional int64 get_metadata_count = 10;
7055 optional int64 can_handle_count = 11;
7056 optional int64 process_drm_info_count = 12;
7057 optional int64 acquire_drm_info_count = 13;
7058 optional int64 save_rights_count = 14;
7059 optional int64 get_original_mime_type_count = 15;
7060 optional int64 get_drm_object_type_count = 16;
7061 optional int64 check_rights_status_count = 17;
7062 optional int64 remove_rights_count = 18;
7063 optional int64 remove_all_rights_count = 19;
7064 optional int64 open_convert_session_count = 20;
7065 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007066}
7067
7068/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007069 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007070 * Pulled from: StatsCompanionService
7071*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007072message DangerousPermissionState {
7073 // Name of the permission
7074 optional string permission_name = 1;
7075
7076 // Uid of the package
7077 optional int32 uid = 2 [(is_uid) = true];
7078
7079 // Package requesting the permission
7080 optional string package_name = 3;
7081
7082 // If the permission is granted to the uid
7083 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007084
7085 // Permission flags as per android.content.pm.PermissionFlags
7086 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007087}
7088
Michael Groover4a0ca942019-01-24 17:41:25 -08007089/**
7090 * Logs when a package is denied access to a device identifier based on the new access requirements.
7091 *
7092 * Logged from:
7093 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7094 */
7095message DeviceIdentifierAccessDenied {
7096 // The name of the package denied access to the requested device identifier.
7097 optional string package_name = 1;
7098
7099 // The name of the device identifier method the package attempted to invoke.
7100 optional string method_name = 2;
7101
7102 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007103 // Starting from Android 11, this boolean is not set and will always be false.
7104 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007105
7106 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007107 // Starting from Android 11, this boolean is not set and will always be false.
7108 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007109}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007110
7111/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007112 * Pulls the ongoing mainline install train version code.
7113 * Pulled from StatsCompanionService
7114 */
7115message TrainInfo {
7116 optional int64 train_version_code = 1;
7117
7118 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007119
7120 optional string train_name = 3;
7121
7122 enum Status {
7123 UNKNOWN = 0;
7124 INSTALL_REQUESTED = 1;
7125 INSTALL_STARTED = 2;
7126 INSTALL_STAGED_NOT_READY = 3;
7127 INSTALL_STAGED_READY = 4;
7128 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007129 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7130 // and INSTALL_FAILURE_COMMIT.
7131 INSTALL_FAILURE = 6 [deprecated = true];
7132 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007133 INSTALL_CANCELLED = 7;
7134 INSTALLER_ROLLBACK_REQUESTED = 8;
7135 INSTALLER_ROLLBACK_INITIATED = 9;
7136 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7137 INSTALLER_ROLLBACK_STAGED = 11;
7138 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7139 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7140 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7141 INSTALLER_ROLLBACK_SUCCESS = 15;
7142 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007143 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7144 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7145 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7146 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7147 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7148 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007149 INSTALL_FAILURE_DOWNLOAD = 23;
7150 INSTALL_FAILURE_STATE_MISMATCH = 24;
7151 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007152 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007153 }
7154 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007155}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007156
7157/**
7158 * Logs the gesture stage changed event.
7159 *
7160 * Logged from:
7161 * frameworks/base/packages/SystemUI/
7162 */
7163message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007164 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007165}
7166
7167/**
7168 * Logs the feedback type.
7169 *
7170 * Logged from:
7171 * frameworks/base/packages/SystemUI/
7172 */
7173message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007174 // Whether or not the gesture was used.
7175 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007176}
7177
7178/**
7179 * Logs the progress.
7180 *
7181 * Logged from:
7182 * frameworks/base/packages/SystemUI/
7183 */
7184message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007185 // [0,100] progress for the assist gesture.
7186 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007187}
Neil Fullerdb14b482019-02-05 19:44:44 +00007188
7189/*
7190 * Information about the time zone data on a device.
7191 */
7192message TimeZoneDataInfo {
7193 // A version identifier for the data set on device. e.g. "2018i"
7194 optional string tzdb_version = 1;
7195}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007196
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007197/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007198 * Logs the GPU stats global health information.
7199 *
7200 * Logged from:
7201 * frameworks/native/services/gpuservice/gpustats/
7202 */
7203message GpuStatsGlobalInfo {
7204 // Package name of the gpu driver.
7205 optional string driver_package_name = 1;
7206
7207 // Version name of the gpu driver.
7208 optional string driver_version_name = 2;
7209
7210 // Version code of the gpu driver.
7211 optional int64 driver_version_code = 3;
7212
7213 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7214 optional int64 driver_build_time = 4;
7215
7216 // Total count of the gl driver gets loaded.
7217 optional int64 gl_loading_count = 5;
7218
7219 // Total count of the gl driver fails to be loaded.
7220 optional int64 gl_loading_failure_count = 6;
7221
7222 // Total count of the Vulkan driver gets loaded.
7223 optional int64 vk_loading_count = 7;
7224
7225 // Total count of the Vulkan driver fails to be loaded.
7226 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007227
7228 // Api version of the system Vulkan driver.
7229 optional int32 vulkan_version = 9;
7230
7231 // Api version of the system CPU Vulkan driver.
7232 optional int32 cpu_vulkan_version = 10;
7233
7234 // Api version of the system GLES driver.
7235 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007236
7237 // Total count of the angle driver gets loaded.
7238 optional int64 angle_loading_count = 12;
7239
7240 // Total count of the angle driver fails to be loaded.
7241 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007242}
7243
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007244/**
7245 * GPU driver loading time info.
7246 */
7247message GpuDriverLoadingTime {
7248 // List of all the driver loading times for this app. The list size is
7249 // capped at 50.
7250 repeated int64 driver_loading_time = 1;
7251}
7252
7253/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007254 * Logs the GPU stats per app health information.
7255 *
7256 * Logged from:
7257 * frameworks/native/services/gpuservice/gpustats/
7258 */
7259message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007260 // Package name of the application that loads the gpu driver. Total number
7261 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007262 optional string app_package_name = 1;
7263
7264 // Version code of the gpu driver this app loads.
7265 optional int64 driver_version_code = 2;
7266
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007267 // gl driver loading time info.
7268 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7269 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007270
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007271 // Vulkan driver loading time info.
7272 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7273 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007274
7275 // Angle driver loading time info.
7276 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7277 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007278
7279 // CPU Vulkan implementation is in use.
7280 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007281
7282 // App is not doing pre-rotation correctly.
7283 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007284
7285 // App creates GLESv1 context.
7286 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007287}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007288
7289/*
7290 * Logs the size of the system ion heap.
7291 *
7292 * Pulled from StatsCompanionService.
7293 */
7294message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007295 // Deprecated due to limited support of ion stats in debugfs.
7296 // Use `IonHeapSize` instead.
7297 option deprecated = true;
7298
Rafal Slawikd4e87572019-03-12 13:08:38 +00007299 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007300 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007301 optional int64 size_in_bytes = 1;
7302}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007303
Rafal Slawik77987ed2019-06-17 12:28:23 +01007304/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007305 * Logs the total size of the ion heap.
7306 *
7307 * Pulled from StatsCompanionService.
7308 */
7309message IonHeapSize {
7310 // Total size of all ion heaps in kilobytes.
7311 // Read from: /sys/kernel/ion/total_heaps_kb.
7312 optional int32 total_size_kb = 1;
7313}
7314
7315/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007316 * Logs the per-process size of the system ion heap.
7317 *
7318 * Pulled from StatsCompanionService.
7319 */
7320message ProcessSystemIonHeapSize {
7321 // The uid if available. -1 means not available.
7322 optional int32 uid = 1 [(is_uid) = true];
7323
7324 // The process name (from /proc/PID/cmdline).
7325 optional string process_name = 2;
7326
7327 // Sum of sizes of all allocations.
7328 optional int32 total_size_in_kilobytes = 3;
7329
7330 // Number of allocations.
7331 optional int32 allocation_count = 4;
7332
7333 // Size of the largest allocation.
7334 optional int32 max_size_in_kilobytes = 5;
7335}
7336
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007337/**
7338 * Push network stack events.
7339 *
7340 * Log from:
7341 * frameworks/base/packages/NetworkStack/
7342 */
7343message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007344 // The id that indicates the event reported from NetworkStack.
7345 optional int32 event_id = 1;
7346 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007347 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7348}
Carmen Agimofa769c152019-03-04 14:39:14 +00007349
7350/**
7351 * Logs the apps that are installed on the external storage.
7352 * Pulled from:
7353 * StatsCompanionService
7354 */
7355message AppsOnExternalStorageInfo {
7356 // The type of the external storage.
7357 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7358 // The name of the package that is installed on the external storage.
7359 optional string package_name = 2;
7360}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007361
7362/**
7363 * Logs the settings related to Face.
7364 * Logged from:
7365 * frameworks/base/services/core/java/com/android/server/stats
7366 */
7367message FaceSettings {
7368 // Whether or not face unlock is allowed on Keyguard.
7369 optional bool unlock_keyguard_enabled = 1;
7370 // Whether or not face unlock dismisses the Keyguard.
7371 optional bool unlock_dismisses_keyguard = 2;
7372 // Whether or not face unlock requires attention.
7373 optional bool unlock_attention_required = 3;
7374 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7375 optional bool unlock_app_enabled = 4;
7376 // Whether or not face unlock always requires user confirmation.
7377 optional bool unlock_always_require_confirmation = 5;
7378 // Whether or not a diverse set of poses are required during enrollment.
7379 optional bool unlock_diversity_required = 6;
7380}
Maggie White442b6312019-04-05 16:26:44 -07007381
7382/**
7383 * Logs cooling devices maintained by the kernel.
7384 *
7385 * Pulled from StatsCompanionService.java
7386 */
7387message CoolingDevice {
7388 // The type of cooling device being reported. Eg. CPU, GPU...
7389 optional android.os.CoolingTypeEnum device_location = 1;
7390 // The name of the cooling device source. Eg. CPU0
7391 optional string device_name = 2;
7392 // Current throttle state of the cooling device. The value can any unsigned
7393 // integer between 0 and max_state defined in its driver. 0 means device is
7394 // not in throttling, higher value means deeper throttling.
7395 optional int32 state = 3;
7396}
Ben Blount763a5d52019-04-10 11:48:58 -07007397
7398/**
7399 * Intelligence has several counter-type events that don't warrant a
7400 * full separate atom. These are primarily API call counters but also include
7401 * counters for feature usage and specific failure modes.
7402 *
7403 * Logged from the Intelligence mainline module.
7404 */
7405message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007406 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007407 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007408 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007409 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007410 // How many times the event occured (to report a batch of high frequency events).
7411 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007412 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007413 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007414}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007415
7416/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007417 * Logs when Car Power state changed.
7418 *
7419 * Logged from:
7420 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7421 */
7422message CarPowerStateChanged {
7423 // States come from CpmsState in CarPowerManagementService.java.
7424 enum State {
7425 WAIT_FOR_VHAL = 0;
7426 ON = 1;
7427 SHUTDOWN_PREPARE = 2;
7428 WAIT_FOR_FINISH = 3;
7429 SUSPEND = 4;
7430 SIMULATE_SLEEP = 5;
7431 }
7432 optional State state = 1;
7433}
7434
7435/**
7436 * Logs whether GarageMode is entered.
7437 *
7438 * Logged from:
7439 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7440 */
7441message GarageModeInfo {
7442 // Whether GarageMode is entered.
7443 optional bool is_garage_mode = 1;
7444}
Martijn Coenencd95d462019-04-25 17:09:45 +02007445
7446/**
7447 * Historical app ops data per package.
7448 */
7449message AppOps {
7450 // Uid of the package requesting the op
7451 optional int32 uid = 1 [(is_uid) = true];
7452
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007453 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007454 optional string package_name = 2;
7455
7456 // operation id; maps to the OP_* constants in AppOpsManager.java
7457 optional int32 op_id = 3;
7458
7459 // The number of times the op was granted while the app was in the
7460 // foreground (only for trusted requests)
7461 optional int64 trusted_foreground_granted_count = 4;
7462
7463 // The number of times the op was granted while the app was in the
7464 // background (only for trusted requests)
7465 optional int64 trusted_background_granted_count = 5;
7466
7467 // The number of times the op was rejected while the app was in the
7468 // foreground (only for trusted requests)
7469 optional int64 trusted_foreground_rejected_count = 6;
7470
7471 // The number of times the op was rejected while the app was in the
7472 // background (only for trusted requests)
7473 optional int64 trusted_background_rejected_count = 7;
7474
7475 // For long-running operations, total duration of the operation
7476 // while the app was in the foreground (only for trusted requests)
7477 optional int64 trusted_foreground_duration_millis = 8;
7478
7479 // For long-running operations, total duration of the operation
7480 // while the app was in the background (only for trusted requests)
7481 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007482
7483 // Whether AppOps is guarded by Runtime permission
7484 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007485}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007486
7487/**
7488 * Location Manager API Usage information(e.g. API under usage,
7489 * API call's parameters).
7490 * Logged from:
7491 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7492 */
7493message LocationManagerApiUsageReported {
7494
7495 // Indicating if usage starts or usage ends.
7496 optional android.stats.location.UsageState state = 1;
7497
7498 // LocationManagerService's API in use.
7499 // We can identify which API from LocationManager is
7500 // invoking current LMS API by the combination of
7501 // API parameter(e.g. is_listener_null, is_intent_null,
7502 // is_location_request_null)
7503 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7504
7505 // Name of the package calling the API.
7506 optional string calling_package_name = 3;
7507
7508 // Type of the location provider.
7509 optional android.stats.location.ProviderType provider = 4;
7510
7511 // Quality of the location request
7512 optional android.stats.location.LocationRequestQuality quality = 5;
7513
7514 // The desired interval for active location updates, in milliseconds.
7515 // Bucketized to reduce cardinality.
7516 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7517
7518 // Minimum distance between location updates, in meters.
7519 // Bucketized to reduce cardinality.
7520 optional android.stats.location.SmallestDisplacementBucket
7521 bucketized_smallest_displacement = 7;
7522
7523 // The number of location updates.
7524 optional int64 num_updates = 8;
7525
7526 // The request expiration time, in millisecond since boot.
7527 // Bucketized to reduce cardinality.
7528 optional android.stats.location.ExpirationBucket
7529 bucketized_expire_in = 9;
7530
7531 // Type of Callback passed in for this API.
7532 optional android.stats.location.CallbackType callback_type = 10;
7533
7534 // The radius of the central point of the alert
7535 // region, in meters. Only for API REQUEST_GEOFENCE.
7536 // Bucketized to reduce cardinality.
7537 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7538
7539 // Activity Importance of API caller.
7540 // Categorized to 3 types that are interesting from location's perspective.
7541 optional android.stats.location.ActivityImportance activiy_importance = 12;
7542}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007543
7544/**
7545 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7546 */
7547message ReviewPermissionsFragmentResultReported {
7548 // unique value identifying a permission group change. A permission group change might result
7549 // in multiple of these atoms
7550 optional int64 change_id = 1;
7551
7552 // UID of package the permission belongs to
7553 optional int32 uid = 2 [(is_uid) = true];
7554
7555 // Name of package the permission belongs to
7556 optional string package_name = 3;
7557
7558 // The permission to be granted
7559 optional string permission_name = 4;
7560
7561 // The result of the permission grant
7562 optional bool permission_granted = 5;
7563}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007564
7565/**
7566* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7567* Logged from: RuntimePermissionUpdgradeController
7568*/
7569message RuntimePermissionsUpgradeResult {
7570 // Permission granted as result of upgrade
7571 optional string permission_name = 1;
7572
7573 // UID of package granted permission
7574 optional int32 uid = 2 [(is_uid) = true];
7575
7576 // Name of package granted permission
7577 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007578}
7579
7580/**
7581* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7582*/
7583message GrantPermissionsActivityButtonActions {
7584 // Permission granted as result of upgrade
7585 optional string permission_group_name = 1;
7586
7587 // UID of package granted permission
7588 optional int32 uid = 2 [(is_uid) = true];
7589
7590 // Name of package requesting permission
7591 optional string package_name = 3;
7592
7593 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7594 // LABEL_ constants in GrantPermissionActivity.java
7595 optional int32 buttons_presented = 4;
7596
7597 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7598 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007599
7600 // id which identifies single session of user interacting with permission controller
7601 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007602}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007603
7604/**
7605 * Information about LocationAccessCheck notification presented to user
7606 */
7607message LocationAccessCheckNotificationAction {
7608
7609 // id which identifies single session of user interacting with permission controller
7610 optional int64 session_id = 1;
7611
7612 // Uid of package for which location access check is presented
7613 optional int32 package_uid = 2;
7614
7615 // Name of package for which location access check is presented
7616 optional string package_name = 3;
7617
7618 enum Result {
7619 UNDEFINED = 0;
7620 // notification was presented to the user
7621 NOTIFICATION_PRESENTED = 1;
7622 // notification was declined by the user
7623 NOTIFICATION_DECLINED = 2;
7624 // notification was clicked by the user
7625 NOTIFICATION_CLICKED = 3;
7626 }
7627
7628 // View / interaction recorded
7629 optional Result result = 4;
7630}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007631
7632/**
7633 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7634 */
7635message AppPermissionFragmentActionReported {
7636 // id which identifies single session of user interacting with permission controller
7637 optional int64 session_id = 1;
7638
7639 // unique value identifying a permission group change. A permission group change might result
7640 // in multiple of these atoms
7641 optional int64 change_id = 2;
7642
7643 // UID of package the permission belongs to
7644 optional int32 uid = 3 [(is_uid) = true];
7645
7646 // Name of package the permission belongs to
7647 optional string package_name = 4;
7648
7649 // The permission to be granted
7650 optional string permission_name = 5;
7651
7652 // The result of the permission grant
7653 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007654
7655 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7656 optional int32 permission_flags = 7;
7657
7658 enum Button {
7659 UNDEFINED = 0;
7660 // Allow button
7661 ALLOW = 1;
7662 // Deny button
7663 DENY = 2;
7664 // Ask every time button
7665 ASK_EVERY_TIME = 3;
7666 // Allow all the time button
7667 ALLOW_ALWAYS = 4;
7668 // Allow only while using the app button
7669 ALLOW_FOREGROUND = 5;
7670 // Same is Deny button but shown in while in use dialog
7671 DENY_FOREGROUND = 6;
7672 }
7673
7674 // Button pressed in the dialog
7675 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007676}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007677
7678/**
7679* Information about a AppPermissionFragment viewed by user
7680*/
7681message AppPermissionFragmentViewed {
7682 // id which identifies single session of user interacting with permission controller
7683 optional int64 session_id = 1;
7684
7685 // UID of package for which permissions are viewed
7686 optional int32 uid = 2 [(is_uid) = true];
7687
7688 // Name of package for which permissions are viewed
7689 optional string package_name = 3;
7690
7691 // Permission group viewed
7692 optional string permission_group_name = 4;
7693}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007694
7695/**
7696* Information about a AppPermissionsFragment viewed by user
7697*/
7698message AppPermissionsFragmentViewed {
7699 // id which identifies single session of user interacting with permission controller
7700 optional int64 session_id = 1;
7701
7702 // id which identifies single view as every view might have several logging records
7703 // with different package information attached
7704 optional int64 view_id = 2;
7705
7706 // Permission group viewed
7707 optional string permission_group_name = 3;
7708
7709 // UID of package for which permissions are viewed
7710 optional int32 uid = 4 [(is_uid) = true];
7711
7712 // Name of package for which permissions are viewed
7713 optional string package_name = 5;
7714
7715 // Category in which permission is included
7716 enum Category {
7717 UNDEFINED = 0;
7718 ALLOWED = 1;
7719 ALLOWED_FOREGROUND = 2;
7720 DENIED = 3;
7721 }
7722 optional Category category = 6;
7723}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007724
7725/**
7726* Information about a PermissionAppsFragment viewed by user.
7727* Logged from ui/handheld/PermissionAppsFragment.java
7728*/
7729message PermissionAppsFragmentViewed {
7730 // id which identifies single session of user interacting with permission controller
7731 optional int64 session_id = 1;
7732
7733 // id which identifies single view as every view might have several logging records
7734 // with different package information attached
7735 optional int64 view_id = 2;
7736
7737 // Permission group viewed
7738 optional string permission_group_name = 3;
7739
7740 // UID of package for which permissions are viewed
7741 optional int32 uid = 4 [(is_uid) = true];
7742
7743 // Name of package for which permissions are viewed
7744 optional string package_name = 5;
7745
7746 // Category in which app is included
7747 enum Category {
7748 UNDEFINED = 0;
7749 ALLOWED = 1;
7750 ALLOWED_FOREGROUND = 2;
7751 DENIED = 3;
7752 }
7753 optional Category category = 6;
7754}
Tony Make2b1b672019-07-29 16:59:47 +01007755
7756/**
7757 * Logs when there is a smart selection related event.
7758 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7759 * Logged from: TextClassifierEventLogger.java
7760 */
7761message TextSelectionEvent {
7762 // A session ID.
7763 optional string session_id = 1;
7764
7765 // Event type of this event.
7766 optional android.stats.textclassifier.EventType event_type = 2;
7767
Tony Mak9c84bd22019-12-09 07:27:25 +00007768 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007769 optional string model_name = 3;
7770
7771 // Type of widget that was involved in triggering this event.
7772 optional android.stats.textclassifier.WidgetType widget_type = 4;
7773
7774 // Index of this event in a session.
7775 optional int32 event_index = 5;
7776
7777 // Entity type that is involved.
7778 optional string entity_type = 6;
7779
7780 // Relative word index of the start of the selection.
7781 optional int32 relative_word_start_index = 7;
7782
7783 // Relative word (exclusive) index of the end of the selection.
7784 optional int32 relative_word_end_index = 8;
7785
7786 // Relative word index of the start of the smart selection.
7787 optional int32 relative_suggested_word_start_index = 9;
7788
7789 // Relative word (exclusive) index of the end of the smart selection.
7790 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007791
7792 // Name of source package.
7793 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007794}
7795
7796/**
7797 * Logs when there is a smart linkify related event.
7798 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7799 * Logged from: TextClassifierEventLogger.java
7800 */
7801message TextLinkifyEvent {
7802 // A session ID.
7803 optional string session_id = 1;
7804
7805 // Event type of this event.
7806 optional android.stats.textclassifier.EventType event_type = 2;
7807
Tony Mak9c84bd22019-12-09 07:27:25 +00007808 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007809 optional string model_name = 3;
7810
7811 // Type of widget that was involved in triggering this event.
7812 optional android.stats.textclassifier.WidgetType widget_type = 4;
7813
7814 // Index of this event in a session.
7815 optional int32 event_index = 5;
7816
7817 // Entity type that is involved.
7818 optional string entity_type = 6;
7819
7820 // Number of links detected.
7821 optional int32 num_links = 7;
7822
7823 // The total length of all links.
7824 optional int32 linked_text_length = 8;
7825
7826 // Length of input text.
7827 optional int32 text_length = 9;
7828
7829 // Time spent on generating links in ms.
7830 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007831
7832 // Name of source package.
7833 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007834}
7835
7836/**
7837 * Logs when there is a conversation actions related event.
7838 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7839 * Logged from: TextClassifierEventLogger.java
7840 */
7841message ConversationActionsEvent {
7842 // A session ID.
7843 optional string session_id = 1;
7844
7845 // Event type of this event.
7846 optional android.stats.textclassifier.EventType event_type = 2;
7847
Tony Mak9c84bd22019-12-09 07:27:25 +00007848 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007849 optional string model_name = 3;
7850
7851 // Type of widget that was involved in triggering this event.
7852 optional android.stats.textclassifier.WidgetType widget_type = 4;
7853
7854 // The first entity type that is involved.
7855 optional string first_entity_type = 5;
7856
7857 // The second entity type that is involved.
7858 optional string second_entity_type = 6;
7859
7860 // The third entity type that is involved.
7861 optional string third_entity_type = 7;
7862
7863 // The score of the first entity type.
7864 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007865
7866 // Name of source package.
7867 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007868
7869 // Name of the annotator model that is involved in this event.
7870 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007871}
7872
7873/**
7874 * Logs when there is a language detection related event.
7875 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7876 * Logged from: TextClassifierEventLogger.java
7877 */
7878message LanguageDetectionEvent {
7879 // A session ID.
7880 optional string session_id = 1;
7881
7882 // Event type of this event.
7883 optional android.stats.textclassifier.EventType event_type = 2;
7884
Tony Mak9c84bd22019-12-09 07:27:25 +00007885 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007886 optional string model_name = 3;
7887
7888 // Type of widget that was involved in triggering this event.
7889 optional android.stats.textclassifier.WidgetType widget_type = 4;
7890
7891 // Detected language.
7892 optional string language_tag = 5;
7893
7894 // Score of the detected language.
7895 optional float score = 6;
7896
7897 // Position of this action.
7898 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007899
7900 // Name of source package.
7901 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007902}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007903
7904/**
7905 * Information about an OTA update attempt by update_engine.
7906 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7907 */
7908message UpdateEngineUpdateAttemptReported {
7909 // The number of attempts for the update engine to apply a given payload.
7910 optional int32 attempt_number = 1;
7911
7912 optional android.stats.otaupdate.PayloadType payload_type = 2;
7913
7914 // The total time in minutes for the update engine to apply a given payload.
7915 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7916 // it's increased when the system is sleeping.
7917 optional int32 duration_boottime_in_minutes = 3;
7918
7919 // The total time in minutes for the update engine to apply a given payload.
7920 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7921 // and it's not increased when the system is sleeping.
7922 optional int32 duration_monotonic_in_minutes = 4;
7923
7924 // The size of the payload in MiBs.
7925 optional int32 payload_size_mib = 5;
7926
7927 // The attempt result reported by the update engine for an OTA update.
7928 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7929
7930 // The error code reported by the update engine after an OTA update attempt
7931 // on A/B devices.
7932 optional android.stats.otaupdate.ErrorCode error_code = 7;
7933
7934 // The build fingerprint of the source system. The value is read from a
7935 // system property when the device takes the update. e.g.
7936 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7937 optional string source_fingerprint = 8;
7938}
7939
7940/**
7941 * Information about all the attempts the device make before finishing the
7942 * successful update.
7943 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7944 */
7945message UpdateEngineSuccessfulUpdateReported {
7946 // The number of attempts for the update engine to apply the payload for a
7947 // successful update.
7948 optional int32 attempt_count = 1;
7949
7950 optional android.stats.otaupdate.PayloadType payload_type = 2;
7951
7952 optional int32 payload_size_mib = 3;
7953
7954 // The total number of bytes downloaded by update_engine since the last
7955 // successful update.
7956 optional int32 total_bytes_downloaded_mib = 4;
7957
7958 // The ratio in percentage of the over-downloaded bytes compared to the
7959 // total bytes needed to successfully install the update. e.g. 200 if we
7960 // download 200MiB in total for a 100MiB package.
7961 optional int32 download_overhead_percentage = 5;
7962
7963 // The total time in minutes for the update engine to apply the payload for a
7964 // successful update.
7965 optional int32 total_duration_minutes = 6;
7966
7967 // The number of reboot of the device during a successful update.
7968 optional int32 reboot_count = 7;
7969}
Alec Mourie088e762019-07-02 13:10:55 -07007970
7971/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007972 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7973 * key to indicate whether it was successful or not.
7974 *
7975 * Logged from:
7976 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7977 */
7978message RebootEscrowRecoveryReported {
7979 optional bool successful = 1;
7980}
7981
7982/**
Alec Mourie088e762019-07-02 13:10:55 -07007983 * Global display pipeline metrics reported by SurfaceFlinger.
7984 * Pulled from:
7985 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7986 */
7987message SurfaceflingerStatsGlobalInfo {
7988 // Total number of frames presented during the tracing period
7989 optional int64 total_frames = 1;
7990 // Total number of frames missed
7991 optional int64 missed_frames = 2;
7992 // Total number of frames that fell back to client composition
7993 optional int64 client_composition_frames = 3;
7994 // Total time the display was turned on
7995 optional int64 display_on_millis = 4;
7996 // Total time that was spent performing animations.
7997 // This is derived from the present-to-present layer histogram
7998 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08007999 // Total number of event connections tracked by SurfaceFlinger at the time
8000 // of this pull. If this number grows prohibitively large, then this can
8001 // cause jank due to resource contention.
8002 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008003 // Set of timings measured from when SurfaceFlinger began compositing a
8004 // frame, until the frame was requested to be presented to the display. This
8005 // measures SurfaceFlinger's total CPU walltime on the critical path per
8006 // frame.
8007 optional FrameTimingHistogram frame_duration = 7
8008 [(android.os.statsd.log_mode) = MODE_BYTES];
8009 // Set of timings measured from when SurfaceFlinger first began using the
8010 // GPU to composite a frame, until the GPU has finished compositing that
8011 // frame. This measures the total additional time SurfaceFlinger needed to
8012 // perform due to falling back into GPU composition.
8013 optional FrameTimingHistogram render_engine_timing = 8
8014 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008015}
8016
8017/**
8018 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8019 * The number of layers uploaded will be restricted due to size limitations.
8020 * Pulled from:
8021 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8022 */
8023message SurfaceflingerStatsLayerInfo {
8024 // The layer for this set of metrics
8025 // For now we can infer that the package name is included in the layer
8026 // name.
8027 optional string layer_name = 1;
8028 // Total number of frames presented
8029 optional int64 total_frames = 2;
8030 // Total number of dropped frames while latching a buffer for this layer.
8031 optional int64 dropped_frames = 3;
8032 // Set of timings measured between successive presentation timestamps.
8033 optional FrameTimingHistogram present_to_present = 4
8034 [(android.os.statsd.log_mode) = MODE_BYTES];
8035 // Set of timings measured from when an app queued a buffer for
8036 // presentation, until the buffer was actually presented to the
8037 // display.
8038 optional FrameTimingHistogram post_to_present = 5
8039 [(android.os.statsd.log_mode) = MODE_BYTES];
8040 // Set of timings measured from when a buffer is ready to be presented,
8041 // until the buffer was actually presented to the display.
8042 optional FrameTimingHistogram acquire_to_present = 6
8043 [(android.os.statsd.log_mode) = MODE_BYTES];
8044 // Set of timings measured from when a buffer was latched by
8045 // SurfaceFlinger, until the buffer was presented to the display
8046 optional FrameTimingHistogram latch_to_present = 7
8047 [(android.os.statsd.log_mode) = MODE_BYTES];
8048 // Set of timings measured from the desired presentation to the actual
8049 // presentation time
8050 optional FrameTimingHistogram desired_to_present = 8
8051 [(android.os.statsd.log_mode) = MODE_BYTES];
8052 // Set of timings measured from when an app queued a buffer for
8053 // presentation, until the buffer was ready to be presented.
8054 optional FrameTimingHistogram post_to_acquire = 9
8055 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008056 // Frames missed latch because the acquire fence didn't fire
8057 optional int64 late_acquire_frames = 10;
8058 // Frames latched early because the desired present time was bad
8059 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008060}
8061
8062/**
8063 * Histogram of frame counts bucketed by time in milliseconds.
8064 * Because of size limitations, we hard-cap the number of buckets, with
8065 * buckets for corresponding to larger milliseconds being less precise.
8066 */
8067message FrameTimingHistogram {
8068 // Timings in milliseconds that describes a set of histogram buckets
8069 repeated int32 time_millis_buckets = 1;
8070 // Number of frames that match to each time_millis, i.e. the bucket
8071 // contents
8072 // It's required that len(time_millis) == len(frame_count)
8073 repeated int64 frame_counts = 2;
8074}
Emilian Peev6729f372019-08-29 09:14:09 -07008075
Emilian Peev6729f372019-08-29 09:14:09 -07008076/**
8077 * Information about camera facing and API level usage.
8078 * Logged from:
8079 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8080 */
8081message CameraActionEvent {
8082 // Camera session duration
8083 optional int64 duration = 1;
8084
8085 // Camera API level used
8086 optional int32 api_level = 2;
8087
8088 // Name of client package
8089 optional string package_name = 3;
8090
8091 // Camera facing
8092 enum Facing {
8093 UNKNOWN = 0;
8094 BACK = 1;
8095 FRONT = 2;
8096 EXTERNAL = 3;
8097 }
8098 optional Facing facing = 4;
8099}
atrost01a20932019-08-28 15:40:37 +01008100
8101/**
8102 * Logs when a compatibility change is affecting an app.
8103 *
8104 * Logged from:
8105 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8106 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8107 */
8108message AppCompatibilityChangeReported {
8109 // The UID of the app being affected by the compatibilty change.
8110 optional int32 uid = 1 [(is_uid) = true];
8111
8112 // The ID of the change affecting the app.
8113 optional int64 change_id = 2;
8114
8115 enum State {
8116 UNKNOWN_STATE = 0;
8117 ENABLED = 1;
8118 DISABLED = 2;
8119 LOGGED = 3;
8120 }
8121
8122 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8123 // logged otherwise.
8124 optional State state = 3;
8125
8126 enum Source {
8127 UNKNOWN_SOURCE = 0;
8128 APP_PROCESS = 1;
8129 SYSTEM_SERVER = 2;
8130 }
8131
8132 // Where it was logged from.
8133 optional Source source = 4;
8134
8135}
Hector Dearman40579f62019-11-01 13:19:30 +00008136
8137/**
8138 * Logged from
8139 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8140 */
8141message PerfettoUploaded {
8142 enum Event {
8143 PERFETTO_UNDEFINED = 0;
8144 PERFETTO_TRACE_BEGIN = 1;
8145 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8146 PERFETTO_ON_CONNECT = 3;
8147 PERFETTO_ON_TRACING_DISABLED = 4;
8148 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8149 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8150 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8151 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8152 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8153 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8154 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8155 PERFETTO_TRIGGER_BEGIN = 12;
8156 PERFETTO_TRIGGER_SUCCESS = 13;
8157 PERFETTO_TRIGGER_FAILURE = 14;
8158 PERFETTO_HIT_GUARDRAILS = 15;
8159 PERFETTO_ON_TIMEOUT = 16;
8160 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8161 }
8162
8163 // Which stage of the pipeline we are reporting from.
8164 optional Event event = 1;
8165
8166 // UUID matching the one set inside the SystemInfo trace packet.
8167 optional int64 trace_uuid_lsb = 2;
8168 optional int64 trace_uuid_msb = 3;
8169}
Mark Tabrya824a642019-11-05 12:26:12 -08008170
8171/**
8172 * Pulls client metrics on data transferred via Vehicle Maps Service.
8173 * Metrics are keyed by uid + layer.
8174 *
8175 * Pulled from:
8176 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8177 */
8178message VmsClientStats {
8179 // UID of the VMS client app
8180 optional int32 uid = 1 [(is_uid) = true];
8181
8182 // VMS layer definition
8183 optional int32 layer_type = 2;
8184 optional int32 layer_channel = 3;
8185 optional int32 layer_version = 4;
8186
8187 // Bytes and packets sent by the client for the layer
8188 optional int64 tx_bytes = 5;
8189 optional int64 tx_packets = 6;
8190
8191 // Bytes and packets received by the client for the layer
8192 optional int64 rx_bytes = 7;
8193 optional int64 rx_packets = 8;
8194
8195 // Bytes and packets dropped due to client error
8196 optional int64 dropped_bytes = 9;
8197 optional int64 dropped_packets = 10;
8198}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008199
8200/**
8201 * State of a dangerous permission requested by a package - sampled
8202 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8203*/
8204message DangerousPermissionStateSampled {
8205 // Name of the permission
8206 optional string permission_name = 1;
8207
8208 // Uid of the package
8209 optional int32 uid = 2 [(is_uid) = true];
8210
8211 // If the permission is granted to the uid
8212 optional bool is_granted = 3;
8213
8214 // Permission flags as per android.content.pm.PermissionFlags
8215 optional int32 permission_flags = 4;
8216}
8217
Stan Iliev637ba5e2019-08-16 13:43:08 -04008218/**
8219 * HWUI renders pipeline type: GL (0) or Vulkan (1).
8220 */
8221enum PipelineType {
8222 GL = 0;
8223 VULKAN = 1;
8224}
8225
8226/**
8227 * HWUI stats for a given app.
8228 */
8229message GraphicsStats {
8230 // The package name of the app
8231 optional string package_name = 1;
8232
8233 // The version code of the app
8234 optional int64 version_code = 2;
8235
8236 // The start & end timestamps in UTC as
8237 // milliseconds since January 1, 1970
8238 // Compatible with java.util.Date#setTime()
8239 optional int64 stats_start = 3;
8240
8241 optional int64 stats_end = 4;
8242
8243 // HWUI renders pipeline type: GL or Vulkan.
8244 optional PipelineType pipeline = 5;
8245
8246 // Distinct frame count.
8247 optional int32 total_frames = 6;
8248
8249 // Number of "missed vsync" events.
8250 optional int32 missed_vsync_count = 7;
8251
8252 // Number of frames in triple-buffering scenario (high input latency)
8253 optional int32 high_input_latency_count = 8;
8254
8255 // Number of "slow UI thread" events.
8256 optional int32 slow_ui_thread_count = 9;
8257
8258 // Number of "slow bitmap upload" events.
8259 optional int32 slow_bitmap_upload_count = 10;
8260
8261 // Number of "slow draw" events.
8262 optional int32 slow_draw_count = 11;
8263
8264 // Number of frames that missed their deadline (aka, visibly janked)
8265 optional int32 missed_deadline_count = 12;
8266
8267 // The frame time histogram for the package
8268 optional FrameTimingHistogram cpu_histogram = 13
8269 [(android.os.statsd.log_mode) = MODE_BYTES];
8270
8271 // The gpu frame time histogram for the package
8272 optional FrameTimingHistogram gpu_histogram = 14
8273 [(android.os.statsd.log_mode) = MODE_BYTES];
8274
8275 // UI mainline module version.
8276 optional int64 version_ui_module = 15;
8277
8278 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8279 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8280 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8281 // more apps are running / rendering.
8282 optional bool is_today = 16;
8283}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008284
8285/**
8286 * Message related to dangerous (runtime) app ops access
8287 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008288message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008289 // Uid of the package accessing app op
8290 optional int32 uid = 1 [(is_uid) = true];
8291
8292 // Name of the package accessing app op
8293 optional string package_name = 2;
8294
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008295 // operation string id per OPSTR_ constants in AppOpsManager.java
8296 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008297
8298 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8299 // Features must be provided through manifest using <feature> tag available in R and above.
8300 optional string feature_id = 4;
8301
8302 // message related to app op access, limited to 600 chars by API
8303 optional string message = 5;
8304
8305 enum SamplingStrategy {
8306 DEFAULT = 0;
8307 UNIFORM = 1;
8308 RARELY_USED = 2;
8309 }
8310
8311 // sampling strategy used to collect this message
8312 optional SamplingStrategy sampling_strategy = 6;
8313}
8314
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008315/*
8316 * Logs userspace reboot outcome and duration.
8317 *
8318 * Logged from:
8319 * frameworks/base/core/java/com/android/server/BootReceiver.java
8320 */
8321message UserspaceRebootReported {
8322 // Possible outcomes of userspace reboot.
8323 enum Outcome {
8324 // Default value in case platform failed to determine the outcome.
8325 OUTCOME_UNKNOWN = 0;
8326 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8327 SUCCESS = 1;
8328 // Userspace reboot shutdown sequence was aborted.
8329 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8330 // Remounting userdata into checkpointing mode failed.
8331 FAILED_USERDATA_REMOUNT = 3;
8332 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8333 // reboot.
8334 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8335 }
8336 // Outcome of userspace reboot. Always set.
8337 optional Outcome outcome = 1;
8338 // Duration of userspace reboot in case it has a successful outcome.
8339 // Duration is measured as time between userspace reboot was initiated and until boot completed
8340 // (e.g. sys.boot_completed=1).
8341 optional int64 duration_millis = 2;
8342 // State of primary user's (user0) credential encryption storage.
8343 enum UserEncryptionState {
8344 // Default value.
8345 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8346 // Credential encrypted storage is unlocked.
8347 UNLOCKED = 1;
8348 // Credential encrypted storage is locked.
8349 LOCKED = 2;
8350 }
8351 // State of primary user's encryption storage at the moment boot completed. Always set.
8352 optional UserEncryptionState user_encryption_state = 3;
8353}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008354
8355/*
8356 * Logs integrity check information during each install.
8357 *
8358 * Logged from:
8359 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8360 */
8361message IntegrityCheckResultReported {
8362 optional string package_name = 1;
8363 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008364 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008365 optional string installer_package_name = 4;
8366 enum Response {
8367 UNKNOWN = 0;
8368 ALLOWED = 1;
8369 REJECTED = 2;
8370 FORCE_ALLOWED = 3;
8371 }
8372 optional Response response = 5;
8373 // An estimate on the cause of the response. This will only be populated for
8374 // REJECTED and FORCE_ALLOWED
8375 optional bool caused_by_app_cert_rule = 6;
8376 optional bool caused_by_installer_rule = 7;
8377}
8378
8379/**
8380 * Logs the information about the rules and the provider whenever rules are
8381 * pushed into AppIntegrityManager.
8382 *
8383 * Logged from:
8384 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8385 */
8386message IntegrityRulesPushed {
8387 optional bool success = 1;
8388 // Package name of the app that pushed the rules.
8389 optional string rule_provider = 2;
8390 // Version string of arbitrary format provided by the rule provider to
8391 // identify the rules.
8392 optional string rule_version = 3;
8393}
Jordan Liubedfa702019-12-20 15:08:45 -08008394
8395/**
8396 * Logs when a cell broadcast message is received on the device.
8397 *
8398 * Logged from CellBroadcastService module:
8399 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8400 */
8401message CellBroadcastMessageReported {
8402 // The type of Cell Broadcast message
8403 enum CbType {
8404 UNKNOWN_TYPE = 0;
8405 GSM = 1;
8406 CDMA = 2;
8407 CDMA_SPC = 3;
8408 }
8409
8410 // GSM, CDMA, CDMA-SCP
8411 optional CbType type = 1;
8412}
8413
8414/**
8415 * Logs when an error occurs while handling a cell broadcast message;
8416 *
8417 * Logged from CellBroadcastService module:
8418 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8419 */
8420message CellBroadcastMessageError {
8421 // The type of error raised when trying to handle a cell broadcast message
8422 enum ErrorType {
8423 UNKNOWN_TYPE = 0;
8424 CDMA_DECODING_ERROR = 1;
8425 CDMA_SCP_EMPTY = 2;
8426 CDMA_SCP_HANDLING_ERROR = 3;
8427 GSM_INVALID_HEADER_LENGTH = 4;
8428 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8429 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8430 GSM_INVALID_PDU = 7;
8431 GSM_INVALID_GEO_FENCING_DATA = 8;
8432 GSM_UMTS_INVALID_WAC = 9;
8433 FAILED_TO_INSERT_TO_DB = 10;
8434 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8435 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8436 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8437 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8438 }
8439
8440 // What kind of error occurred
8441 optional ErrorType type = 1;
8442
8443 // Exception message (or log message) associated with the error (max 1000 chars)
8444 optional string exception_message = 2;
8445}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008446
8447/**
8448 * Logs when the SDK Extensions test app has polled the current version.
8449 * This is atom ID 354.
8450 *
8451 * Logged from:
8452 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8453 */
8454message SdkExtensionStatus {
8455 enum ApiCallStatus {
8456 CALL_NOT_ATTEMPTED = 0;
8457 CALL_SUCCESSFUL = 1;
8458 CALL_FAILED = 2;
8459 }
8460
8461 optional ApiCallStatus result = 1;
8462
8463 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8464 optional int32 r_extension_version = 2;
8465
8466 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8467 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8468 optional int32 failed_call_symbol = 3;
8469}
Marco Ballesio497aff42020-01-24 08:39:42 -08008470
8471/**
8472 * Logs when an app is frozen or unfrozen.
8473 *
8474 * Logged from:
8475 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8476 */
8477message AppFreezeChanged {
8478 // The type of event.
8479 enum Action {
8480 UNKNOWN = 0;
8481 FREEZE_APP = 1;
8482 UNFREEZE_APP = 2;
8483 }
8484 optional Action action = 1;
8485
8486 // Pid of the process being frozen.
8487 optional int32 pid = 2;
8488
8489 // Name of the process being frozen.
8490 optional string process_name = 3;
8491
8492 // Time since last unfrozen.
8493 optional int64 time_unfrozen_millis = 4;
8494}