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