blob: c7e91a1057a86f85f8d00aeacafc6ebe13c2c625 [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"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070084 SensorStateChanged sensor_state_changed =
85 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080086 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070087 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
88 ScheduledJobStateChanged scheduled_job_state_changed =
89 8 [(module) = "framework", (module) = "statsdtest"];
90 ScreenBrightnessChanged screen_brightness_changed =
91 9 [(module) = "framework", (module) = "statsdtest"];
92 WakelockStateChanged wakelock_state_changed =
93 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080094 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
95 11 [(module) = "framework"];
96 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12 [(module) = "framework"];
97 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
98 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
99 14 [(module) = "framework"];
100 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
101 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
102 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
103 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800104 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700105 BatterySaverModeStateChanged battery_saver_mode_state_changed =
106 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800107 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
108 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
109 AudioStateChanged audio_state_changed = 23 [(module) = "framework"];
110 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
111 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
112 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700113 UidProcessStateChanged uid_process_state_changed =
114 27 [(module) = "framework", (module) = "statsdtest"];
115 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
116 28 [(module) = "framework", (module) = "statsdtest"];
117 ScreenStateChanged screen_state_changed =
118 29 [(module) = "framework", (module) = "statsdtest"];
119 BatteryLevelChanged battery_level_changed =
120 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800121 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
122 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
123 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800124 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800125 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
126 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800127 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
128 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
129 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800130 PhoneSignalStrengthChanged phone_signal_strength_changed = 40 [(module) = "framework"];
131 SettingChanged setting_changed = 41 [(module) = "framework"];
132 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700133 42 [(module) = "framework", (module) = "statsdtest"];
134 IsolatedUidChanged isolated_uid_changed =
135 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800136 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
137 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800138 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800139 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800140 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700141 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800142 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
143 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800144 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800145 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800146 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800147 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800148 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
149 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800150 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800151 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700152 OverlayStateChanged overlay_state_changed =
153 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800154 ForegroundServiceStateChanged foreground_service_state_changed
155 = 60 [(module) = "framework"];
Muhammad Qureshidbe9e812020-01-25 07:41:39 -0800156 CallStateChanged call_state_changed = 61 [(module) = "telecom"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800157 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
158 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
159 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800160 AppDied app_died = 65 [(module) = "framework"];
161 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
162 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800163 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
164 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800165 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
166 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800167 SpeakerImpedanceReported speaker_impedance_reported = 71;
168 HardwareFailed hardware_failed = 72;
169 PhysicalDropDetected physical_drop_detected = 73;
170 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800171 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
172 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800173 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700174 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800175 ANROccurred anr_occurred = 79 [(module) = "framework"];
176 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
177 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700178 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800179 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800180 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800181 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
182 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700183 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
185 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
186 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
187 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700188 BatteryHealthSnapshot battery_health_snapshot = 91;
189 SlowIo slow_io = 92;
190 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800191 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
192 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100193 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800194 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800195 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700196 // TODO: service state change is very noisy shortly after boot, as well
197 // as at other transitions - coming out of doze, device plugged in, etc.
198 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800199 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
200 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
201 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800202 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800203 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800204 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
205 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
206 105 [(module) = "docsui"];
207 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
208 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
209 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
210 108 [(module) = "docsui"];
211 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
212 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
213 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
214 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800215 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800216 WifiRunningStateChanged wifi_running_state_changed = 114
217 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800218 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800219 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800220 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800221 117 [(module) = "docsui"];
222 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
223 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
224 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
225 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800226 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
227 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
228 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800229 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
230 125 [(module) = "bluetooth"];
231 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
232 126 [(module) = "bluetooth"];
233 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
234 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800235 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000236 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800237 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
238 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
239 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800240 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800241 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
242 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
243 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
244 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
245 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
246 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800247 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
248 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800249 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
250 142 [(module) = "framework"];
251 AttentionManagerServiceResultReported attention_manager_service_result_reported =
252 143 [(module) = "framework"];
253 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800254 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800255 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800256 WatchdogRollbackOccurred watchdog_rollback_occurred =
257 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800258 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
259 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800260 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800261 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
262 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800263 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
264 151 [(module) = "bluetooth"];
265 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
266 152 [(module) = "bluetooth"];
267 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
268 153 [(module) = "bluetooth"];
269 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
270 154 [(module) = "bluetooth"];
271 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
272 155 [(module) = "bluetooth"];
273 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
274 156 [(module) = "bluetooth"];
275 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
276 157 [(module) = "bluetooth"];
277 BluetoothDeviceFailedContactCounterReported
278 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
279 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
280 159 [(module) = "bluetooth"];
281 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
282 160 [(module) = "bluetooth"];
283 BluetoothQualityReportReported bluetooth_quality_report_reported =
284 161 [(module) = "bluetooth"];
285 BluetoothDeviceInfoReported bluetooth_device_info_reported =
286 162 [(module) = "bluetooth"];
287 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
288 163 [(module) = "bluetooth"];
289 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
290 164 [(module) = "bluetooth"];
291 BluetoothBondStateChanged bluetooth_bond_state_changed =
292 165 [(module) = "bluetooth"];
293 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
294 166 [(module) = "bluetooth"];
295 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
296 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800297 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
298 168 [(module) = "framework"];
299 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700300 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800301 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800302 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800303 DeviceIdentifierAccessDenied device_identifier_access_denied =
304 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800305 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800306 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
307 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
308 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800309 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
310 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800311 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700312 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800313 180 [(module) = "permissioncontroller"];
314 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
315 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800316 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800317 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
318 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
319 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
320 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800321 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
322 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700323 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800324 188 [(module) = "intelligence"];
325 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
326 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800327 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800328 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800329 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
330 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
331 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
332 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
333 MediametricsCodecReported mediametrics_codec_reported = 195;
334 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
335 MediametricsExtractorReported mediametrics_extractor_reported = 197;
336 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
337 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
338 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700339 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800340 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
341 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800342 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800343 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
344 206 [(module) = "framework"];
345 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
346 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
347 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
348 LocationManagerApiUsageReported location_manager_api_usage_reported =
349 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100350 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800351 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100352 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800353 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100354 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800355 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100356 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800357 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100358 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800359 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100360 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800361 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100362 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800363 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100364 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800365 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800366 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
367 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
368 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
369 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800371 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700372 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
373 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800374 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100375 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800376 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800377 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800378 VmsClientConnectionStateChanged vms_client_connection_state_changed =
379 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800380 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
381 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700382 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800383 235 [(module) = "mediaprovider"];
384 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700385 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800386 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800387 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
388 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
389 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
390 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800391 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800392 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000393 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800394 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500395 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
396 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800397 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
398 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800399 CellBroadcastMessageReported cb_message_reported =
400 249 [(module) = "cellbroadcast"];
401 CellBroadcastMessageError cb_message_error =
402 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700403 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
404 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
405 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800406 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000407 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800408 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
409 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800410 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800411 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000412 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000413 }
David Chenc8a43242017-10-17 16:23:28 -0700414
David Chen6e3e6cb2018-01-03 16:14:06 -0800415 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700416 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700417 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800418 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
419 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
420 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
421 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
422 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
423 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700424 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800425 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700426 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800427 CpuTimePerUidFreq cpu_time_per_uid_freq =
428 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800429 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
430 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
431 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
432 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
433 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700434 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800435 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700436 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
437 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800438 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
439 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700440 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800441 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800442 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800443 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800444 DiskStats disk_stats = 10025 [(module) = "framework"];
445 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
446 AppSize app_size = 10027 [(module) = "framework"];
447 CategorySize category_size = 10028 [(module) = "framework"];
448 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800449 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800450 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
451 DiskIo disk_io = 10032 [(module) = "framework"];
452 PowerProfile power_profile = 10033 [(module) = "framework"];
453 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
454 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
455 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700456 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800457 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
458 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
459 10040 [(module) = "framework"];
460 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
461 10041 [(module) = "framework"];
462 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800463 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800464 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800465 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
467 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
468 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
469 RoleHolder role_holder = 10049 [(module) = "framework"];
470 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800471 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800472 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
473 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800474 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
475 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800476 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
477 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
478 FaceSettings face_settings = 10058 [(module) = "framework"];
479 CoolingDevice cooling_device = 10059 [(module) = "framework"];
480 AppOps app_ops = 10060 [(module) = "framework"];
481 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700482 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
483 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800484 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800485 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
487 DangerousPermissionStateSampled dangerous_permission_state_sampled =
488 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400489 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000490 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000491 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200492 PackageNotificationPreferences package_notification_preferences =
493 10071 [(module) = "framework"];
494 PackageNotificationChannelPreferences package_notification_channel_preferences =
495 10072 [(module) = "framework"];
496 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
497 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800498 GnssStats gnss_stats = 10074 [(module) = "framework"];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +0000499 AppFeaturesOps app_features_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700500 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
501 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
502 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
503 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700504 }
yroa1fe77c2018-02-26 14:22:54 -0800505
Bookatz76aafcf2018-09-17 16:17:10 -0700506 // DO NOT USE field numbers above 100,000 in AOSP.
507 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
508 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100509
510 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700511}
512
Yao Chend54f9dd2017-10-17 17:37:48 +0000513/**
Yangster-mac20877162017-12-22 17:19:39 -0800514 * This proto represents a node of an attribution chain.
515 * Note: All attribution chains are represented as a repeated field of type
516 * AttributionNode. It is understood that in such arrays, the order is that
517 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000518 */
Yangster-mac20877162017-12-22 17:19:39 -0800519message AttributionNode {
520 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800521 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800522
Yangster-mac20877162017-12-22 17:19:39 -0800523 // The (optional) string tag for an element in the attribution chain. If the
524 // element has no tag, it is encoded as an empty string.
525 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700526}
527
Yangster-mac48b3d622018-08-18 12:38:11 -0700528message KeyValuePair {
529 optional int32 key = 1;
530 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700531 int32 value_int = 2;
532 int64 value_long = 3;
533 string value_str = 4;
534 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700535 }
536}
537
538message KeyValuePairsAtom {
539 optional int32 uid = 1;
540 repeated KeyValuePair pairs = 2;
541}
542
Yao Chend54f9dd2017-10-17 17:37:48 +0000543/*
544 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800545 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000546 *
547 * RULES:
548 * - The field ids for each atom must start at 1, and count upwards by 1.
549 * Skipping field ids is not allowed.
550 * - These form an API, so renaming, renumbering or removing fields is
551 * not allowed between android releases. (This is not currently enforced,
552 * but there will be a tool to enforce this restriction).
553 * - The types must be built-in protocol buffer types, namely, no sub-messages
554 * are allowed (yet). The bytes type is also not allowed.
555 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800556 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000557 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800558 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000559 * - A field that is a uid should be a string field, tagged with the [xxx]
560 * annotation. The generated code on android will be represented by UIDs,
561 * and those UIDs will be translated in xxx to those strings.
562 *
563 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700564 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000565 * - If there is a UID, it goes first. Think in an object-oriented fashion.
566 * *****************************************************************************
567 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700568
Yao Chend54f9dd2017-10-17 17:37:48 +0000569/**
Tej Singha72344992019-04-17 18:55:08 -0700570 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700571 * Logs when the Thermal service HAL notifies the throttling start/stop events.
572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
575 */
576message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700577 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700578 optional android.os.TemperatureTypeEnum sensor_type = 1;
579
Maggie White442b6312019-04-05 16:26:44 -0700580 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700581 enum State {
582 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700583 START = 1; // START indicated that throttling was triggered.
584 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700585 }
Yangster-mace16189a2018-08-26 12:20:16 -0700586 optional State state = 2;
587
588 optional float temperature = 3;
589}
590
591/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000592 * Logs when the screen state changes.
593 *
594 * Logged from:
595 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
596 */
597message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800598 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800599 optional android.view.DisplayStateEnum state = 1
600 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700601}
Yao Chend54f9dd2017-10-17 17:37:48 +0000602
603/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700604 * Logs that the process state of the uid, as determined by ActivityManager
605 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000606 *
607 * Logged from:
608 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
609 */
Bookatzc1a050a2017-10-10 15:49:28 -0700610message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800611 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000612
Bookatzdb026a22018-01-10 19:01:56 -0800613 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800614 optional android.app.ProcessStateEnum state = 2
615 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000616}
617
618/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700619 * Logs process state change of a process, as per the activity manager.
620 *
621 * Logged from:
622 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
623 */
624message ProcessStateChanged {
625 optional int32 uid = 1;
626 optional string process_name = 2;
627 optional string package_name = 3;
628 // TODO: remove this when validation is done
629 optional int64 version = 5;
630 // The state, from frameworks/base/core/proto/android/app/enums.proto.
631 optional android.app.ProcessStateEnum state = 4;
632}
633
634/**
635 * Logs when ActivityManagerService sleep state is changed.
636 *
637 * Logged from:
638 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
639 */
640message ActivityManagerSleepStateChanged {
641 // TODO: import frameworks proto
642 enum State {
643 UNKNOWN = 0;
644 ASLEEP = 1;
645 AWAKE = 2;
646 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800647 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700648}
649
650/**
651 * Logs when system memory state changes.
652 *
653 * Logged from:
654 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
655 */
656message MemoryFactorStateChanged {
657 // TODO: import frameworks proto
658 enum State {
659 MEMORY_UNKNOWN = 0;
660 NORMAL = 1; // normal.
661 MODERATE = 2; // moderate memory pressure.
662 LOW = 3; // low memory.
663 CRITICAL = 4; // critical memory.
664
665 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800666 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700667}
668
669/**
670 * Logs when app is using too much cpu, according to ActivityManagerService.
671 *
672 * Logged from:
673 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
674 */
675message ExcessiveCpuUsageReported {
676 optional int32 uid = 1;
677 optional string process_name = 2;
678 optional string package_name = 3;
679 // package version. TODO: remove this when validation is done
680 optional int64 version = 4;
681}
682
683/**
684 * Logs when a cached process is killed, along with its pss.
685 *
686 * Logged from:
687 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
688 */
689message CachedKillReported {
690 optional int32 uid = 1;
691 optional string process_name = 2;
692 optional string package_name = 3;
693 // TODO: remove this when validation is done
694 optional int64 version = 5;
695 optional int64 pss = 4;
696}
697
698/**
xshu2c3d9e42019-09-26 17:54:02 -0700699 * Logs the change in wifi health.
700 *
701 * Logged from:
702 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
703 */
704message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800705 enum Band {
706 UNKNOWN = 0;
707 // All of 2.4GHz band
708 BAND_2G = 1;
709 // Frequencies in the range of [5150, 5250) GHz
710 BAND_5G_LOW = 2;
711 // Frequencies in the range of [5250, 5725) GHz
712 BAND_5G_MIDDLE = 3;
713 // Frequencies in the range of [5725, 5850) GHz
714 BAND_5G_HIGH = 4;
715 // Frequencies in the range of [5925, 6425) GHz
716 BAND_6G_LOW = 5;
717 // Frequencies in the range of [6425, 6875) GHz
718 BAND_6G_MIDDLE = 6;
719 // Frequencies in the range of [6875, 7125) GHz
720 BAND_6G_HIGH = 7;
721 }
xshu2c3d9e42019-09-26 17:54:02 -0700722 // duration this stat is obtained over in milliseconds
723 optional int32 duration_millis = 1;
724 // whether wifi is classified as sufficient for the user's data traffic, determined
725 // by whether the calculated throughput exceeds the average demand within |duration_millis|
726 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700727 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800728 optional bool is_cell_data_available = 3;
729 // the Band bucket the connected network is on
730 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700731}
732
733/**
734 * Logged when wifi detects a significant change in connection failure rate.
735 *
736 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
737 *
738 */
739message WifiFailureStatReported {
740 enum AbnormalityType {
741 UNKNOWN = 0;
742 SIGNIFICANT_INCREASE = 1;
743 SIGNIFICANT_DECREASE = 2;
744 SIMPLY_HIGH = 3;
745 }
746 enum FailureType {
747 FAILURE_UNKNOWN = 0;
748 FAILURE_CONNECTION = 1;
749 FAILURE_ASSOCIATION_REJECTION = 2;
750 FAILURE_ASSOCIATION_TIMEOUT = 3;
751 FAILURE_AUTHENTICATION = 4;
752 FAILURE_NON_LOCAL_DISCONNECTION = 5;
753 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
754 }
755 // Reason for uploading this stat
756 optional AbnormalityType abnormality_type = 1;
757 // The particular type of failure
758 optional FailureType failure_type = 2;
759 // How many times we have encountered this combination of AbnormalityType and FailureType
760 optional int32 failure_count = 3;
761}
762
763/**
764 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
765 *
766 * Logged from:
767 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
768 */
769message WifiConnectionResultReported {
770 enum FailureCode {
771 FAILURE_UNKNOWN = 0;
772 FAILURE_ASSOCIATION_TIMEOUT = 1;
773 FAILURE_ASSOCIATION_REJECTION = 2;
774 FAILURE_AUTHENTICATION_GENERAL = 3;
775 FAILURE_AUTHENTICATION_EAP = 4;
776 FAILURE_DHCP = 5;
777 FAILURE_NETWORK_DISCONNECTION = 6;
778 FAILURE_ROAM_TIMEOUT = 7;
779 }
780 // true represents a successful connection
781 optional bool connection_result = 1;
782 // reason for the connection failure
783 optional FailureCode failure_code = 2;
784 // scan rssi before the connection attempt
785 optional int32 rssi = 3;
786}
787
788/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700789 * Logs when memory stats of a process is reported.
790 *
791 * Logged from:
792 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
793 */
794message ProcessMemoryStatReported {
795 optional int32 uid = 1;
796 optional string process_name = 2;
797 optional string package_name = 3;
798 //TODO: remove this when validation is done
799 optional int64 version = 9;
800 optional int64 pss = 4;
801 optional int64 uss = 5;
802 optional int64 rss = 6;
803 enum Type {
804 ADD_PSS_INTERNAL_SINGLE = 0;
805 ADD_PSS_INTERNAL_ALL_MEM = 1;
806 ADD_PSS_INTERNAL_ALL_POLL = 2;
807 ADD_PSS_EXTERNAL = 3;
808 ADD_PSS_EXTERNAL_SLOW = 4;
809 }
810 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800811 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700812}
813
814/**
Bookatzc1a050a2017-10-10 15:49:28 -0700815 * Logs that a process started, finished, crashed, or ANRed.
816 *
817 * Logged from:
818 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
819 */
820message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700821 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700822
David Chen0b5c90c2018-01-25 16:51:49 -0800823 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800824 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700825
Bookatzddccf0a2017-11-28 16:48:14 -0800826 // What lifecycle state the process changed to.
827 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800828 enum State {
829 FINISHED = 0;
830 STARTED = 1;
831 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800832 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800833 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700834}
835
Bookatzc1a050a2017-10-10 15:49:28 -0700836/**
837 * Logs when the ble scan state changes.
838 *
839 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700840 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700841 */
842message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800843 repeated AttributionNode attribution_node = 1
844 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700845
846 enum State {
847 OFF = 0;
848 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700849 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
850 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700851 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800852 optional State state = 2 [
853 (state_field_option).option = EXCLUSIVE_STATE,
854 (state_field_option).default_state_value = 0 /* State.OFF */,
855 (state_field_option).reset_state_value = 2 /* State.RESET */,
856 (state_field_option).nested = true
857 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700858
Bookatze5ec0b42018-03-26 13:34:56 -0700859 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800860 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700861 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800862 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700863 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800864 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700865}
866
867/**
868 * Logs reporting of a ble scan finding results.
869 *
870 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700871 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700872 */
Bookatzae6738e2018-09-13 11:38:56 -0700873// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700874message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700876
877 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800878 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700879}
880
881/**
882 * Logs when a sensor state changes.
883 *
884 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700885 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700886 */
887message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800888 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700889
Bookatzc1a050a2017-10-10 15:49:28 -0700890 // The id (int) of the sensor.
891 optional int32 sensor_id = 2;
892
893 enum State {
894 OFF = 0;
895 ON = 1;
896 }
897 optional State state = 3;
898}
899
Bookatzc1a050a2017-10-10 15:49:28 -0700900/**
901 * Logs when GPS state changes.
902 *
903 * Logged from:
904 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
905 */
906message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800907 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700908
909 enum State {
910 OFF = 0;
911 ON = 1;
912 }
913 optional State state = 2;
914}
915
Bookatz48d362e2018-11-06 15:49:08 -0800916/**
917 * Logs when GPS signal quality.
918 *
919 * Logged from:
920 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
921 */
922message GpsSignalQualityChanged {
923 optional android.server.location.GpsSignalQualityEnum level = 1;
924}
925
Bookatzc1a050a2017-10-10 15:49:28 -0700926
927/**
928 * Logs when a sync manager sync state changes.
929 *
930 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700931 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700932 */
933message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800934 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700935
David Chen0b5c90c2018-01-25 16:51:49 -0800936 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800937 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700938
939 enum State {
940 OFF = 0;
941 ON = 1;
942 }
943 optional State state = 3;
944}
945
Yangster-mac96353002018-09-05 11:18:55 -0700946/*
947 * Deferred job stats.
948 *
949 * Logged from:
950 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
951*/
952message DeferredJobStatsReported {
953 repeated AttributionNode attribution_node = 1;
954
955 // Number of jobs deferred.
956 optional int32 num_jobs_deferred = 2;
957
958 // Time since the last job runs.
959 optional int64 time_since_last_job_millis = 3;
960}
961
Bookatzc1a050a2017-10-10 15:49:28 -0700962/**
963 * Logs when a job scheduler job state changes.
964 *
965 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700966 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700967 */
968message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800969 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700970
971 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800972 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700973
974 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800975 FINISHED = 0;
976 STARTED = 1;
977 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700978 }
979 optional State state = 3;
980
Tej Singh33a412b2018-03-16 18:43:59 -0700981 // The reason a job has stopped.
982 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700983 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700984 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100985
986 // The standby bucket of the app that scheduled the job. These match the framework constants
987 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
988 // already assigned 0.
989 enum Bucket {
990 UNKNOWN = -1;
991 ACTIVE = 0;
992 WORKING_SET = 1;
993 FREQUENT = 2;
994 RARE = 3;
995 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800996 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100997 }
998 optional Bucket standby_bucket = 5 [default = UNKNOWN];
999
1000 // The job id (as assigned by the app).
1001 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001002
1003 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1004 // constraints as they are always assumed to be set.
1005 optional bool has_charging_constraint = 7;
1006 optional bool has_battery_not_low_constraint = 8;
1007 optional bool has_storage_not_low_constraint = 9;
1008 optional bool has_timing_delay_constraint = 10;
1009 optional bool has_deadline_constraint = 11;
1010 optional bool has_idle_constraint = 12;
1011 optional bool has_connectivity_constraint = 13;
1012 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001013}
1014
1015/**
1016 * Logs when the audio state changes.
1017 *
1018 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001019 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001020 */
1021message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001022 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001023
1024 enum State {
1025 OFF = 0;
1026 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001027 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1028 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001029 }
1030 optional State state = 2;
1031}
1032
1033/**
1034 * Logs when the video codec state changes.
1035 *
1036 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001037 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001038 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001039message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001040 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001041
1042 enum State {
1043 OFF = 0;
1044 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001045 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1046 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001047 }
1048 optional State state = 2;
1049}
1050
1051/**
1052 * Logs when the flashlight state changes.
1053 *
1054 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001055 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001056 */
1057message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001058 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001059
1060 enum State {
1061 OFF = 0;
1062 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001063 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1064 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001065 }
1066 optional State state = 2;
1067}
1068
1069/**
1070 * Logs when the camera state changes.
1071 *
1072 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001073 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001074 */
1075message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001076 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001077
1078 enum State {
1079 OFF = 0;
1080 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001081 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1082 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001083 }
1084 optional State state = 2;
1085}
1086
1087/**
1088 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001089 *
1090 * Logged from:
1091 * TODO
1092 */
Bookatzd6746242017-10-24 18:39:35 -07001093message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001094 repeated AttributionNode attribution_node = 1
1095 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001096
Bookatz1a1b0462018-01-12 11:47:03 -08001097 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1098 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001099 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001100 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001101
1102 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001103 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001104
1105 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001106 RELEASE = 0;
1107 ACQUIRE = 1;
1108 CHANGE_RELEASE = 2;
1109 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001110 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001111 optional State state = 4 [
1112 (state_field_option).option = EXCLUSIVE_STATE,
1113 (state_field_option).default_state_value = 0,
1114 (state_field_option).nested = true
1115 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001116}
1117
1118/**
Bookatzc1a050a2017-10-10 15:49:28 -07001119 * Logs when a partial wakelock is considered 'long' (over 1 min).
1120 *
1121 * Logged from:
1122 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1123 */
1124message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001125 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001126
Yao Chend54f9dd2017-10-17 17:37:48 +00001127 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1128 optional string tag = 2;
1129
Bookatzc1a050a2017-10-10 15:49:28 -07001130 // TODO: I have no idea what this is.
1131 optional string history_tag = 3;
1132
1133 enum State {
1134 OFF = 0;
1135 ON = 1;
1136 }
1137 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001138}
1139
Bookatzc1a050a2017-10-10 15:49:28 -07001140/**
Bookatza66083f2018-09-20 17:24:00 -07001141 * Logs when the device is interactive, according to the PowerManager Notifier.
1142 *
1143 * Logged from:
1144 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1145 */
1146message InteractiveStateChanged {
1147 enum State {
1148 OFF = 0;
1149 ON = 1;
1150 }
1151 optional State state = 1;
1152}
1153
1154/**
Bookatzc1a050a2017-10-10 15:49:28 -07001155 * Logs Battery Saver state change.
1156 *
1157 * Logged from:
1158 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1159 */
1160message BatterySaverModeStateChanged {
1161 enum State {
1162 OFF = 0;
1163 ON = 1;
1164 }
1165 optional State state = 1;
1166}
1167
1168/**
1169 * Logs Doze mode state change.
1170 *
1171 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001172 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001173 */
1174message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001175 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001176}
1177
1178
1179/**
1180 * Logs state change of Doze mode including maintenance windows.
1181 *
1182 * Logged from:
1183 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1184 */
1185message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001186 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001187}
1188
1189/**
1190 * Logs screen brightness level.
1191 *
1192 * Logged from:
1193 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1194 */
1195message ScreenBrightnessChanged {
1196 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1197 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001198}
1199
1200/**
1201 * Logs battery level (percent full, from 0 to 100).
1202 *
1203 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001204 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001205 */
1206message BatteryLevelChanged {
1207 // Battery level. Should be in [0, 100].
1208 optional int32 battery_level = 1;
1209}
1210
1211/**
1212 * Logs change in charging status of the device.
1213 *
1214 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001215 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001216 */
1217message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001218 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1219 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001220}
1221
1222/**
1223 * Logs whether the device is plugged in, and what power source it is using.
1224 *
1225 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001226 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001227 */
1228message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001229 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1230 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001231}
1232
Bookatz8c6571b2017-10-24 15:04:41 -07001233/**
1234 * Logs when an app's wakeup alarm fires.
1235 *
1236 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001237 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001238 */
1239message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001240 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001241
1242 // Name of the wakeup alarm.
1243 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001244
1245 // Name of source package (for historical reasons, since BatteryStats tracked it).
1246 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001247
Ben Murdoch3389f1522019-05-21 15:05:34 +01001248 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001249 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001250}
1251
1252/**
1253 * Logs when an an app causes the mobile radio to change state.
1254 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1255 *
1256 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001257 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001258 */
1259message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001260 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001261
Bookatz1a1b0462018-01-12 11:47:03 -08001262 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1263 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001264}
1265
1266/**
1267 * Logs when an an app causes the wifi radio to change state.
1268 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1269 *
1270 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001271 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001272 */
1273message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001274 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001275
Bookatz1a1b0462018-01-12 11:47:03 -08001276 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1277 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001278}
1279
1280/**
1281 * Logs kernel wakeup reasons and aborts.
1282 *
1283 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001284 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001285 */
1286message KernelWakeupReported {
1287 // Name of the kernel wakeup reason (or abort).
1288 optional string wakeup_reason_name = 1;
1289
1290 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001291 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001292}
1293
1294/**
Bookatzda1798c2018-12-13 14:16:00 -08001295 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001296 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001297 *
1298 * Logged from:
1299 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1300 */
1301message WifiEnabledStateChanged {
1302 enum State {
1303 OFF = 0;
1304 ON = 1;
1305 }
1306 optional State state = 1;
1307}
1308
1309/**
tsaichristinececebdc2020-02-04 14:05:56 -08001310 * This atom is deprecated starting in R.
1311 *
Bookatzda1798c2018-12-13 14:16:00 -08001312 * 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 -08001313 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1314 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001315 *
1316 * Logged from:
1317 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1318 */
1319message WifiRunningStateChanged {
1320 repeated AttributionNode attribution_node = 1;
1321
1322 enum State {
1323 OFF = 0;
1324 ON = 1;
1325 }
1326 optional State state = 2;
1327}
1328
1329/**
Bookatze5885242017-10-24 20:10:31 -07001330 * Logs wifi locks held by an app.
1331 *
1332 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001333 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001334 */
1335message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001336 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001337
1338 enum State {
1339 OFF = 0;
1340 ON = 1;
1341 }
1342 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001343
1344 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1345 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001346}
1347
1348/**
1349 * Logs wifi signal strength changes.
1350 *
1351 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001352 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001353 */
1354message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001355 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1356 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001357}
1358
1359/**
1360 * Logs wifi scans performed by an app.
1361 *
1362 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001363 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001364 */
1365message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001366 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001367
1368 enum State {
1369 OFF = 0;
1370 ON = 1;
1371 }
1372 optional State state = 2;
1373}
1374
1375/**
Tej Singh4503e102018-01-04 14:35:01 -08001376 * Logs wifi multicast locks held by an app
1377 *
1378 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001379 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001380 */
1381message WifiMulticastLockStateChanged {
1382 repeated AttributionNode attribution_node = 1;
1383
1384 enum State {
1385 OFF = 0;
1386 ON = 1;
1387 }
1388 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001389
1390 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001391}
1392
1393/**
Tej Singh1ea42892018-01-19 09:27:00 -08001394 * Logs shutdown reason and duration on next boot.
1395 *
1396 * Logged from:
1397 * frameworks/base/core/java/com/android/server/BootReceiver.java
1398 */
1399message ShutdownSequenceReported {
1400 // True if shutdown is for a reboot. Default: false if we do not know.
1401 optional bool reboot = 1;
1402
1403 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1404 optional string reason = 2;
1405
1406 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1407 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001408 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001409
1410 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001411 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001412}
1413
Tej Singh6483ea42018-01-25 17:45:49 -08001414
1415/**
1416 * Logs boot reason and duration.
1417 *
1418 * Logged from:
1419 * system/core/bootstat/bootstat.cpp
1420 */
1421message BootSequenceReported {
1422 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1423 // Default: "<EMPTY>" if not available.
1424 optional string bootloader_reason = 1;
1425
1426 // Reason for system boot. Eg. bootloader, reboot,userrequested
1427 // Default: "<EMPTY>" if not available.
1428 optional string system_reason = 2;
1429
1430 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001431 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001432
1433 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001434 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001435
1436 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001437 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001438
1439 // Time since last boot in ms. Default: 0 if not available.
1440 optional int64 time_since_last_boot = 6;
1441}
1442
Tej Singhc477d9c2018-02-05 18:31:39 -08001443
1444/**
1445 * Logs call state and disconnect cause (if applicable).
1446 *
1447 * Logged from:
1448 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1449 */
1450message CallStateChanged {
1451 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1452 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1453 optional android.telecom.CallStateEnum call_state = 1;
1454
1455 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1456 // This value is only applicable when the call_state is DISCONNECTED, and
1457 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1458 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1459 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1460
1461 // True if the call is self-managed, which are apps that use the
1462 // telecom infrastructure to make their own calls.
1463 optional bool self_managed = 3;
1464
1465 // True if call is external. External calls are calls on connected Wear
1466 // devices but show up in Telecom so the user can pull them onto the device.
1467 optional bool external_call = 4;
1468}
1469
Tej Singh1ea42892018-01-19 09:27:00 -08001470/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001471 * Logs keyguard state. The keyguard is the lock screen.
1472 *
1473 * Logged from:
1474 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1475 */
1476message KeyguardStateChanged {
1477 enum State {
1478 UNKNOWN = 0;
1479 // The keyguard is hidden when the phone is unlocked.
1480 HIDDEN = 1;
1481 // The keyguard is shown when the phone is locked (screen turns off).
1482 SHOWN= 2;
1483 // The keyguard is occluded when something is overlaying the keyguard.
1484 // Eg. Opening the camera while on the lock screen.
1485 OCCLUDED = 3;
1486 }
1487 optional State state = 1;
1488}
1489
1490/**
1491 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1492 * prompts the user to enter a password (pattern, pin, etc).
1493 *
1494 * Logged from:
1495 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1496 */
1497
1498message KeyguardBouncerStateChanged {
1499 enum State {
1500 UNKNOWN = 0;
1501 // Bouncer is hidden, either as a result of successfully entering the
1502 // password, screen timing out, or user going back to lock screen.
1503 HIDDEN = 1;
1504 // This is when the user is being prompted to enter the password.
1505 SHOWN = 2;
1506 }
1507 optional State state = 1;
1508}
1509
1510/**
1511 * Logs the result of entering a password into the keyguard bouncer.
1512 *
1513 * Logged from:
1514 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1515 */
1516message KeyguardBouncerPasswordEntered {
1517 enum BouncerResult {
1518 UNKNOWN = 0;
1519 // The password entered was incorrect.
1520 FAILURE = 1;
1521 // The password entered was correct.
1522 SUCCESS = 2;
1523 }
1524 optional BouncerResult result = 1;
1525}
1526
Tej Singha883b372018-02-15 11:30:01 -08001527/*
1528 * Logs changes to the configuration of the device. The configuration is defined
1529 * in frameworks/base/core/java/android/content/res/Configuration.java
1530 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1531 * Please go there to interpret the possible values each field can be.
1532 *
1533 * Logged from:
1534 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1535 */
1536message ResourceConfigurationChanged {
1537 // Bit mask of color capabilities of the screen.
1538 // Contains information about the color gamut and hdr mode of the screen.
1539 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001540 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001541
1542 // The target screen density being rendered to.
1543 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001544 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001545
1546 // Current user preference for the scaling factor for fonts,
1547 // relative to the base density scaling.
1548 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001549 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001550
1551 // Flag indicating whether the hard keyboard is hidden.
1552 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001553 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001554
1555 // The type of keyboard attached to the device.
1556 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1557 optional int32 keyboard = 5;
1558
1559 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1560 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001561 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001562
1563 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1564 // 0 if undefined.
1565 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1566 optional int32 mcc = 7;
1567
1568 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1569 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1570 // MNC_ZERO symbol defined in Configuration.java.
1571 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1572 optional int32 mnc = 8;
1573
1574 // The kind of navigation available on the device.
1575 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1576 optional int32 navigation = 9;
1577
1578 // Flag indicating whether the navigation is available.
1579 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001580 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001581
1582 // Overall orientation of the screen.
1583 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1584 optional int32 orientation = 11;
1585
1586 // The current height of the available screen space, in dp units.
1587 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001588 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001589
1590 // Bit mask of overall layout of the screen.
1591 // Contains information about screen size, whether the screen is wider/taller
1592 // than normal, whether the screen layout is right-tl-left or left-to-right,
1593 // and whether the screen has a rounded shape.
1594 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001595 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001596
1597 // Current width of the available screen space, in dp units.
1598 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001599 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001600
1601 // The smallest screen size an application will see in normal operation.
1602 // This is the smallest value of both screenWidthDp and screenHeightDp
1603 // in portrait and landscape.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001606
1607 // The type of touch screen attached to the device.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1609 optional int32 touchscreen = 16;
1610
1611 // Bit mask of the ui mode.
1612 // Contains information about the overall ui mode of the device.
1613 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1614 // Also contains information about whether the device is in night mode.
1615 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001616 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001617}
1618
Tej Singheee317b2018-03-07 19:28:05 -08001619
1620/**
1621 * Logs changes in the connection state of the mobile radio.
1622 *
1623 * Logged from:
1624 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1625 */
1626message MobileConnectionStateChanged {
1627 // States are from the state machine DataConnection.java.
1628 enum State {
1629 UNKNOWN = 0;
1630 // The connection is inactive, or disconnected.
1631 INACTIVE = 1;
1632 // The connection is being activated, or connecting.
1633 ACTIVATING = 2;
1634 // The connection is active, or connected.
1635 ACTIVE = 3;
1636 // The connection is disconnecting.
1637 DISCONNECTING = 4;
1638 // The connection is disconnecting after creating a connection.
1639 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1640 }
1641 optional State state = 1;
1642 // For multi-sim phones, this distinguishes between the sim cards.
1643 optional int32 sim_slot_index = 2;
1644 // Used to identify the connection. Starts at 0 and increments by 1 for
1645 // every new network created. Resets whenever the device reboots.
1646 optional int32 data_connection_id = 3;
1647 // A bitmask for the capabilities of this connection.
1648 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1649 // Default value (if we have no information): 0
1650 optional int64 capabilities = 4;
1651 // If this connection has internet.
1652 // This just checks if the DEFAULT bit of capabilities is set.
1653 optional bool has_internet = 5;
1654}
1655
1656/**
1657 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1658 *
1659 * Logged from:
1660 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1661 */
1662message MobileRadioTechnologyChanged {
1663 optional android.telephony.NetworkTypeEnum state = 1;
1664 // For multi-sim phones, this distinguishes between the sim cards.
1665 optional int32 sim_slot_index = 2;
1666}
1667
Andrew Chantb56388b2018-03-22 21:07:33 -07001668/**
1669 * Logs the VID and PID of any connected USB devices.
1670 *
1671 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1672 *
1673 * Logged by Vendor.
1674 */
1675message UsbDeviceAttached {
1676 optional int32 vid = 1;
1677 optional int32 pid = 2;
1678 optional bool has_audio = 3;
1679 optional bool has_hid = 4;
1680 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001681 enum State {
1682 STATE_DISCONNECTED = 0;
1683 STATE_CONNECTED = 1;
1684 }
1685 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001686 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001687}
1688
Tej Singheee317b2018-03-07 19:28:05 -08001689
Tej Singhdd7bd352018-02-09 19:33:15 -08001690/**
Tej Singh5d991e12018-03-09 19:48:11 -08001691 * Logs when Bluetooth is enabled and disabled.
1692 *
1693 * Logged from:
1694 * services/core/java/com/android/server/BluetoothManagerService.java
1695 */
1696message BluetoothEnabledStateChanged {
1697 repeated AttributionNode attribution_node = 1;
1698 // Whether or not bluetooth is enabled on the device.
1699 enum State {
1700 UNKNOWN = 0;
1701 ENABLED = 1;
1702 DISABLED = 2;
1703 }
1704 optional State state = 2;
1705 // The reason for being enabled/disabled.
1706 // Eg. Airplane mode, crash, application request.
1707 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1708 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001709 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001710}
1711
1712/**
Jack Hed9837c82019-01-09 01:19:13 -08001713 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001714 *
1715 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001716 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1717 *
1718 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001719 */
1720message BluetoothConnectionStateChanged {
1721 // The state of the connection.
1722 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1723 optional android.bluetooth.ConnectionStateEnum state = 1;
1724 // An identifier that can be used to match connect and disconnect events.
1725 // Currently is last two bytes of a hash of a device level ID and
1726 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001727 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001728 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001729 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1730 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001731 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001732 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001733 // An identifier that can be used to match events for this device.
1734 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1735 // Salt: Randomly generated 256 bit value
1736 // Hash algorithm: HMAC-SHA256
1737 // Size: 32 byte
1738 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001739 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001740}
1741
1742/**
1743 * Logs when a Bluetooth device connects and disconnects over ACL
1744 *
1745 * Logged from:
1746 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1747 *
1748 * Next Tag: 3
1749 */
1750message BluetoothAclConnectionStateChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // The state of the connection.
1759 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1760 optional android.bluetooth.ConnectionStateEnum state = 2;
1761}
1762
1763/**
1764 * Logs when a Bluetooth device connects and disconnects over SCO
1765 *
1766 * Logged from:
1767 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1768 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1769 *
1770 * Next Tag: 4
1771 */
1772message BluetoothScoConnectionStateChanged {
1773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
1779 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1780 // The state of the connection.
1781 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1782 optional android.bluetooth.ConnectionStateEnum state = 2;
1783 // Codec used for this SCO connection
1784 // Default: UNKNOWN
1785 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001786}
1787
Jack Hec27040a2019-01-09 20:54:41 -08001788/**
1789 * Logged when active device of a profile changes
1790 *
1791 * Logged from:
1792 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1793 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1794 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1795 */
1796message BluetoothActiveDeviceChanged {
1797 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1798 // From android.bluetooth.BluetoothProfile
1799 optional int32 bt_profile = 1;
1800 // An identifier that can be used to match events for this new active device.
1801 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1802 // Salt: Randomly generated 256 bit value
1803 // Hash algorithm: HMAC-SHA256
1804 // Size: 32 byte
1805 // Default: null or empty if there is no active device for this profile
1806 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1807}
1808
Jack Heab86dbd22018-12-18 15:43:27 -08001809// Logs when there is an event affecting Bluetooth device's link layer connection.
1810// - This event is triggered when there is a related HCI command or event
1811// - Users of this metrics can deduce Bluetooth device's connection state from these events
1812// - HCI commands are logged before the command is sent, after receiving command status, and after
1813// receiving command complete
1814// - HCI events are logged when they arrive
1815//
1816// Low level log from system/bt
1817//
1818// Bluetooth classic commands:
1819// - CMD_CREATE_CONNECTION
1820// - CMD_DISCONNECT
1821// - CMD_CREATE_CONNECTION_CANCEL
1822// - CMD_ACCEPT_CONNECTION_REQUEST
1823// - CMD_REJECT_CONNECTION_REQUEST
1824// - CMD_SETUP_ESCO_CONNECTION
1825// - CMD_ACCEPT_ESCO_CONNECTION
1826// - CMD_REJECT_ESCO_CONNECTION
1827// - CMD_ENH_SETUP_ESCO_CONNECTION
1828// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1829//
1830// Bluetooth low energy commands:
1831// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1832// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1833// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1834// - CMD_BLE_CLEAR_WHITE_LIST
1835// - CMD_BLE_ADD_WHITE_LIST
1836// - CMD_BLE_REMOVE_WHITE_LIST
1837//
1838// Bluetooth classic events:
1839// - EVT_CONNECTION_COMP
1840// - EVT_CONNECTION_REQUEST
1841// - EVT_DISCONNECTION_COMP
1842// - EVT_ESCO_CONNECTION_COMP
1843// - EVT_ESCO_CONNECTION_CHANGED
1844//
1845// Bluetooth low energy meta events:
1846// - BLE_EVT_CONN_COMPLETE_EVT
1847// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1848//
1849// Next tag: 10
1850message BluetoothLinkLayerConnectionEvent {
1851 // An identifier that can be used to match events for this device.
1852 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1853 // Salt: Randomly generated 256 bit value
1854 // Hash algorithm: HMAC-SHA256
1855 // Size: 32 byte
1856 // Default: null or empty if the device identifier is not known
1857 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1858 // Connection handle of this connection if available
1859 // Range: 0x0000 - 0x0EFF (12 bits)
1860 // Default: 0xFFFF if the handle is unknown
1861 optional int32 connection_handle = 2;
1862 // Direction of the link
1863 // Default: DIRECTION_UNKNOWN
1864 optional android.bluetooth.DirectionEnum direction = 3;
1865 // Type of this link
1866 // Default: LINK_TYPE_UNKNOWN
1867 optional android.bluetooth.LinkTypeEnum type = 4;
1868
1869 // Reason metadata for this link layer connection event, rules for interpretation:
1870 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1871 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1872 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1873 // set and valid, ignore hci_ble_event
1874
1875 // HCI command associated with this event
1876 // Default: CMD_UNKNOWN
1877 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1878 // HCI event associated with this event
1879 // Default: EVT_UNKNOWN
1880 optional android.bluetooth.hci.EventEnum hci_event = 6;
1881 // HCI BLE meta event associated with this event
1882 // Default: BLE_EVT_UNKNOWN
1883 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1884 // HCI command status code if this is triggerred by hci_cmd
1885 // Default: STATUS_UNKNOWN
1886 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1887 // HCI reason code associated with this event
1888 // Default: STATUS_UNKNOWN
1889 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1890}
1891
Howard Roe103fe22019-01-17 16:52:16 -08001892/**
1893 * Logs when a module is rolled back by Watchdog.
1894 *
1895 * Logged from: Rollback Manager
1896 */
1897message WatchdogRollbackOccurred {
1898 enum RollbackType {
1899 UNKNOWN = 0;
1900 ROLLBACK_INITIATE = 1;
1901 ROLLBACK_SUCCESS = 2;
1902 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001903 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001904 }
1905 optional RollbackType rollback_type = 1;
1906
1907 optional string package_name = 2;
1908
1909 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001910
1911 enum RollbackReasonType {
1912 REASON_UNKNOWN = 0;
1913 REASON_NATIVE_CRASH = 1;
1914 REASON_EXPLICIT_HEALTH_CHECK = 2;
1915 REASON_APP_CRASH = 3;
1916 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001917 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001918 }
1919 optional RollbackReasonType rollback_reason = 4;
1920
1921 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1922 // is initiated. Empty if the package is unknown.
1923 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001924
1925 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001926}
1927
Jack Hec27040a2019-01-09 20:54:41 -08001928/**
1929 * Logs when there is a change in Bluetooth A2DP playback state
1930 *
1931 * Logged from:
1932 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1933 */
1934message BluetoothA2dpPlaybackStateChanged {
1935 // An identifier that can be used to match events for this device.
1936 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1937 // Salt: Randomly generated 256 bit value
1938 // Hash algorithm: HMAC-SHA256
1939 // Size: 32 byte
1940 // Default: null or empty if the device identifier is not known
1941 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1942 // Current playback state
1943 // Default: PLAYBACK_STATE_UNKNOWN
1944 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1945 // Current audio coding mode
1946 // Default: AUDIO_CODING_MODE_UNKNOWN
1947 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1948}
1949
1950/**
1951 * Logs when there is a change in A2DP codec config for a particular remote device
1952 *
1953 * Logged from:
1954 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1955 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1956 */
1957message BluetoothA2dpCodecConfigChanged {
1958 // An identifier that can be used to match events for this device.
1959 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1960 // Salt: Randomly generated 256 bit value
1961 // Hash algorithm: HMAC-SHA256
1962 // Size: 32 byte
1963 // Default: null or empty if the device identifier is not known
1964 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1965 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1966 // Default SOURCE_CODEC_TYPE_INVALID
1967 optional int32 codec_type = 2;
1968 // Codec priroity, the higher the more preferred, -1 for disabled
1969 // Default: CODEC_PRIORITY_DEFAULT
1970 optional int32 codec_priority = 3;
1971 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1972 // Default: SAMPLE_RATE_NONE
1973 optional int32 sample_rate = 4;
1974 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1975 // Default: BITS_PER_SAMPLE_NONE
1976 optional int32 bits_per_sample = 5;
1977 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1978 // Default: CHANNEL_MODE_NONE
1979 optional int32 channel_mode = 6;
1980 // Codec specific values
1981 // Default 0
1982 optional int64 codec_specific_1 = 7;
1983 optional int64 codec_specific_2 = 8;
1984 optional int64 codec_specific_3 = 9;
1985 optional int64 codec_specific_4 = 10;
1986}
1987
1988/**
1989 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1990 * Each codec's capability is logged separately due to statsd restriction
1991 *
1992 * Logged from:
1993 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1994 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1995 */
1996message BluetoothA2dpCodecCapabilityChanged {
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 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2005 // Default SOURCE_CODEC_TYPE_INVALID
2006 optional int32 codec_type = 2;
2007 // Codec priroity, the higher the more preferred, -1 for disabled
2008 // Default: CODEC_PRIORITY_DEFAULT
2009 optional int32 codec_priority = 3;
2010 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2011 // in BluetoothCodecConfig
2012 // Default: empty and SAMPLE_RATE_NONE for individual item
2013 optional int32 sample_rate = 4;
2014 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2015 // in BluetoothCodecConfig
2016 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2017 optional int32 bits_per_sample = 5;
2018 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2019 // BluetoothCodecConfig
2020 // Default: empty and CHANNEL_MODE_NONE for individual item
2021 optional int32 channel_mode = 6;
2022 // Codec specific values
2023 // Default 0
2024 optional int64 codec_specific_1 = 7;
2025 optional int64 codec_specific_2 = 8;
2026 optional int64 codec_specific_3 = 9;
2027 optional int64 codec_specific_4 = 10;
2028}
2029
2030/**
2031 * Logs when A2DP failed to read from PCM source.
2032 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2033 *
2034 * Logged from:
2035 * system/bt
2036 */
2037message BluetoothA2dpAudioUnderrunReported {
2038 // An identifier that can be used to match events for this device.
2039 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2040 // Salt: Randomly generated 256 bit value
2041 // Hash algorithm: HMAC-SHA256
2042 // Size: 32 byte
2043 // Default: null or empty if the device identifier is not known
2044 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2045 // Encoding interval in nanoseconds
2046 // Default: 0
2047 optional int64 encoding_interval_nanos = 2;
2048 // Number of bytes of PCM data that could not be read from the source
2049 // Default: 0
2050 optional int32 num_missing_pcm_bytes = 3;
2051}
2052
2053/**
2054 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2055 * buffer queue is full and we have to drop data
2056 *
2057 * Logged from:
2058 * system/bt
2059 */
2060message BluetoothA2dpAudioOverrunReported {
2061 // An identifier that can be used to match events for this device.
2062 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2063 // Salt: Randomly generated 256 bit value
2064 // Hash algorithm: HMAC-SHA256
2065 // Size: 32 byte
2066 // Default: null or empty if the device identifier is not known
2067 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2068 // Encoding interval in nanoseconds
2069 // Default: 0
2070 optional int64 encoding_interval_nanos = 2;
2071 // Number of buffers dropped in this event
2072 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2073 // Default: 0
2074 optional int32 num_dropped_buffers = 3;
2075 // Number of encoded buffers dropped in this event
2076 // Default 0
2077 optional int32 num_dropped_encoded_frames = 4;
2078 // Number of encoded bytes dropped in this event
2079 // Default: 0
2080 optional int32 num_dropped_encoded_bytes = 5;
2081}
2082
2083/**
2084 * Logs when we receive reports regarding a device's RSSI value
2085 *
2086 * Logged from:
2087 * system/bt
2088 */
2089message BluetoothDeviceRssiReported {
2090 // An identifier that can be used to match events for this device.
2091 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2092 // Salt: Randomly generated 256 bit value
2093 // Hash algorithm: HMAC-SHA256
2094 // Size: 32 byte
2095 // Default: null or empty if the device identifier is not known
2096 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2097 // Connection handle of this connection if available
2098 // Range: 0x0000 - 0x0EFF (12 bits)
2099 // Default: 0xFFFF if the handle is unknown
2100 optional int32 connection_handle = 2;
2101 // HCI command status code if this is triggerred by hci_cmd
2102 // Default: STATUS_UNKNOWN
2103 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2104 // BR/EDR
2105 // Range: -128 ≤ N ≤ 127 (signed integer)
2106 // Units: dB
2107 // LE:
2108 // Range: -127 to 20, 127 (signed integer)
2109 // Units: dBm
2110 // Invalid when an out of range value is reported
2111 optional int32 rssi = 4;
2112}
2113
2114/**
2115 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2116 *
2117 * Logged from:
2118 * system/bt
2119 */
2120message BluetoothDeviceFailedContactCounterReported {
2121 // An identifier that can be used to match events for this device.
2122 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2123 // Salt: Randomly generated 256 bit value
2124 // Hash algorithm: HMAC-SHA256
2125 // Size: 32 byte
2126 // Default: null or empty if the device identifier is not known
2127 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2128 // Connection handle of this connection if available
2129 // Range: 0x0000 - 0x0EFF (12 bits)
2130 // Default: 0xFFFF if the handle is unknown
2131 optional int32 connection_handle = 2;
2132 // HCI command status code if this is triggerred by hci_cmd
2133 // Default: STATUS_UNKNOWN
2134 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2135 // Number of consecutive failed contacts for a connection corresponding to the Handle
2136 // Range: uint16_t, 0-0xFFFF
2137 // Default: 0xFFFFF
2138 optional int32 failed_contact_counter = 4;
2139}
2140
2141/**
2142 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2143 *
2144 * Logged from:
2145 * system/bt
2146 */
2147message BluetoothDeviceTxPowerLevelReported {
2148 // An identifier that can be used to match events for this device.
2149 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2150 // Salt: Randomly generated 256 bit value
2151 // Hash algorithm: HMAC-SHA256
2152 // Size: 32 byte
2153 // Default: null or empty if the device identifier is not known
2154 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2155 // Connection handle of this connection if available
2156 // Range: 0x0000 - 0x0EFF (12 bits)
2157 // Default: 0xFFFF if the handle is unknown
2158 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002159 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002160 // Default: STATUS_UNKNOWN
2161 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2162 // Range: -30 ≤ N ≤ 20
2163 // Units: dBm
2164 // Invalid when an out of range value is reported
2165 optional int32 transmit_power_level = 4;
2166}
Jack Heab86dbd22018-12-18 15:43:27 -08002167
Tej Singh5d991e12018-03-09 19:48:11 -08002168/**
Jack He1021a612019-01-20 21:22:46 -08002169 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2170 * receiving an HCI command from the host
2171 *
2172 * Logged from: system/bt
2173 */
2174message BluetoothHciTimeoutReported {
2175 // HCI command associated with this event
2176 // Default: CMD_UNKNOWN
2177 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2178}
2179
2180/**
2181 * Logs when we receive Bluetooth Link Quality Report event from the controller
2182 * See Android Bluetooth HCI specification for more details
2183 *
2184 * Note: all count and bytes field are counted since last event
2185 *
2186 * Logged from: system/bt
2187 */
2188message BluetoothQualityReportReported {
2189 // Quality report ID
2190 // Original type: uint8_t
2191 // Default: BQR_ID_UNKNOWN
2192 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2193 // Packet type of the connection
2194 // Original type: uint8_t
2195 // Default: BQR_PACKET_TYPE_UNKNOWN
2196 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2197 // Connection handle of the connection
2198 // Original type: uint16_t
2199 optional int32 connection_handle = 3;
2200 // Performing Role for the connection
2201 // Original type: uint8_t
2202 optional int32 connection_role = 4;
2203 // Current Transmit Power Level for the connection. This value is the same as the controller's
2204 // response to the HCI_Read_Transmit_Power_Level HCI command
2205 // Original type: uint8_t
2206 optional int32 tx_power_level = 5;
2207 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2208 // absolute receiver signal strength value
2209 // Original type: int8_t
2210 optional int32 rssi = 6;
2211 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2212 // channels used by the link currently
2213 // Original type: uint8_t
2214 optional int32 snr = 7;
2215 // Indicates the number of unused channels in AFH_channel_map
2216 // Original type: uint8_t
2217 optional int32 unused_afh_channel_count = 8;
2218 // Indicates the number of the channels which are interfered and quality is bad but are still
2219 // selected for AFH
2220 // Original type: uint8_t
2221 optional int32 afh_select_unideal_channel_count = 9;
2222 // Current Link Supervision Timeout Setting
2223 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2224 // Original type: uint16_t
2225 optional int32 lsto = 10;
2226 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2227 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2228 // 0x01 (Piconet Clock)
2229 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2230 // Original type: uint32_t
2231 optional int64 connection_piconet_clock = 11;
2232 // The count of retransmission
2233 // Original type: uint32_t
2234 optional int64 retransmission_count = 12;
2235 // The count of no RX
2236 // Original type: uint32_t
2237 optional int64 no_rx_count = 13;
2238 // The count of NAK (Negative Acknowledge)
2239 // Original type: uint32_t
2240 optional int64 nak_count = 14;
2241 // Controller timestamp of last TX ACK
2242 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2243 // Original type: uint32_t
2244 optional int64 last_tx_ack_timestamp = 15;
2245 // The count of Flow-off (STOP)
2246 // Original type: uint32_t
2247 optional int64 flow_off_count = 16;
2248 // Controller timestamp of last Flow-on (GO)
2249 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2250 // Original type: uint32_t
2251 optional int64 last_flow_on_timestamp = 17;
2252 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2253 // Original type: uint32_t
2254 optional int64 buffer_overflow_bytes = 18;
2255 // Buffer underflow count (in byte) since last event
2256 // Original type: uint32_t
2257 optional int64 buffer_underflow_bytes = 19;
2258}
2259
2260/**
2261 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2262 *
2263 * Notes:
2264 * - Each event can be partially filled as we might learn different pieces of device
2265 * information at different time
2266 * - Multiple device info events can be combined to give more complete picture
2267 * - When multiple device info events tries to describe the same information, the
2268 * later one wins
2269 *
2270 * Logged from:
2271 * packages/apps/Bluetooth
2272 */
Jack Heaea26982019-04-04 11:19:48 -07002273message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002274 // An identifier that can be used to match events for this device.
2275 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2276 // Salt: Randomly generated 256 bit value
2277 // Hash algorithm: HMAC-SHA256
2278 // Size: 32 byte
2279 // Default: null or empty if the device identifier is not known
2280 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2281 // Where is this device info obtained from
2282 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2283 // Name of the data source
2284 // For EXTERNAL: package name of the data source
2285 // For INTERNAL: null for general case, component name otherwise
2286 optional string source_name = 3;
2287 // Name of the manufacturer of this device
2288 optional string manufacturer = 4;
2289 // Model of this device
2290 optional string model = 5;
2291 // Hardware version of this device
2292 optional string hardware_version = 6;
2293 // Software version of this device
2294 optional string software_version = 7;
2295}
2296
2297/**
2298 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2299 * device, as documented by the Bluetooth Core HCI specification
2300 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2301 * Vol 2, Part E, Page 1118
2302 *
2303 * Logged from:
2304 * system/bt
2305 */
2306message BluetoothRemoteVersionInfoReported {
2307 // Connection handle of the connection
2308 // Original type: uint16_t
2309 optional int32 connection_handle = 1;
2310 // HCI command status code
2311 // Default: STATUS_UNKNOWN
2312 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2313 // 1 byte Version of current LMP in the remote controller
2314 optional int32 lmp_version = 3;
2315 // 2 bytes LMP manufacturer code of the remote controller
2316 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2317 optional int32 lmp_manufacturer_code = 4;
2318 // 4 bytes subversion of the LMP in the remote controller
2319 optional int32 lmp_subversion = 5;
2320}
2321
2322/**
2323 * Logs when certain Bluetooth SDP attributes are discovered
2324 * Constant definitions are from:
2325 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2326 *
2327 * Current logged attributes:
2328 * - BluetoothProfileDescriptorList
2329 * - Supported Features Bitmask
2330 *
2331 * Logged from:
2332 * system/bt
2333 */
2334message BluetoothSdpAttributeReported {
2335 // An identifier that can be used to match events for this device.
2336 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2337 // Salt: Randomly generated 256 bit value
2338 // Hash algorithm: HMAC-SHA256
2339 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2340 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2341 // Original type: uint16_t
2342 optional int32 protocol_uuid = 2;
2343 // Short form UUIDs used to identify Bluetooth SDP attribute types
2344 // Original type: uint16_t
2345 optional int32 attribute_id = 3;
2346 // Attribute value for the particular attribute
2347 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2348}
2349
2350/**
2351 * Logs when bond state of a Bluetooth device changes
2352 *
2353 * Logged from:
2354 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2355 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2356 */
2357message BluetoothBondStateChanged {
2358 // An identifier that can be used to match events for this device.
2359 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2360 // Salt: Randomly generated 256 bit value
2361 // Hash algorithm: HMAC-SHA256
2362 // Size: 32 byte
2363 // Default: null or empty if the device identifier is not known
2364 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2365 // Preferred transport type to remote dual mode device
2366 // Default: TRANSPORT_AUTO means no preference
2367 optional android.bluetooth.TransportTypeEnum transport = 2;
2368 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2369 // Default: UNKNOWN
2370 optional android.bluetooth.DeviceTypeEnum type = 3;
2371 // Current bond state (NONE, BONDING, BONDED)
2372 // Default: BOND_STATE_UNKNOWN
2373 optional android.bluetooth.BondStateEnum bond_state = 4;
2374 // Bonding sub state
2375 // Default: BOND_SUB_STATE_UNKNOWN
2376 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2377 // Unbond Reason
2378 // Default: UNBOND_REASON_UNKNOWN
2379 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2380}
2381
2382/**
2383 * Logs there is an event related Bluetooth classic pairing
2384 *
2385 * Logged from:
2386 * system/bt
2387 */
2388message BluetoothClassicPairingEventReported {
2389 // An identifier that can be used to match events for this device.
2390 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2391 // Salt: Randomly generated 256 bit value
2392 // Hash algorithm: HMAC-SHA256
2393 // Size: 32 byte
2394 // Default: null or empty if the device identifier is not known
2395 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2396 // Connection handle of this connection if available
2397 // Range: 0x0000 - 0x0EFF (12 bits)
2398 // Default: 0xFFFF if the handle is unknown
2399 optional int32 connection_handle = 2;
2400 // HCI command associated with this event
2401 // Default: CMD_UNKNOWN
2402 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2403 // HCI event associated with this event
2404 // Default: EVT_UNKNOWN
2405 optional android.bluetooth.hci.EventEnum hci_event = 4;
2406 // HCI command status code if this is triggerred by hci_cmd
2407 // Default: STATUS_UNKNOWN
2408 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2409 // HCI reason code associated with this event
2410 // Default: STATUS_UNKNOWN
2411 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002412 // A status value related to this specific event
2413 // Default: 0
2414 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002415}
2416
2417/**
2418 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2419 *
2420 * Logged from:
2421 * system/bt
2422 */
2423message BluetoothSmpPairingEventReported {
2424 // An identifier that can be used to match events for this device.
2425 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2426 // Salt: Randomly generated 256 bit value
2427 // Hash algorithm: HMAC-SHA256
2428 // Size: 32 byte
2429 // Default: null or empty if the device identifier is not known
2430 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2431 // SMP command sent or received over L2CAP
2432 // Default: CMD_UNKNOWN
2433 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2434 // Whether this command is sent or received
2435 // Default: DIRECTION_UNKNOWN
2436 optional android.bluetooth.DirectionEnum direction = 3;
2437 // SMP failure reason code
2438 // Default: PAIRING_FAIL_REASON_DEFAULT
2439 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2440}
2441
2442/**
Jack He815cdba2019-01-30 17:24:55 -08002443 * Logs when a Bluetooth socket’s connection state changed
2444 *
2445 * Logged from:
2446 * system/bt
2447 */
2448message BluetoothSocketConnectionStateChanged {
2449 // An identifier that can be used to match events for this device.
2450 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2451 // Salt: Randomly generated 256 bit value
2452 // Hash algorithm: HMAC-SHA256
2453 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002454 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002455 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002456 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002457 // Default 0 when unknown or don't care
2458 optional int32 port = 2;
2459 // Socket type as mentioned in
2460 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2461 // Default: SOCKET_TYPE_UNKNOWN
2462 optional android.bluetooth.SocketTypeEnum type = 3;
2463 // Socket connection state
2464 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2465 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2466 // Number of bytes sent to remote device during this connection
2467 optional int64 tx_bytes = 5;
2468 // Number of bytes received from remote device during this connection
2469 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002470 // Socket owner's UID
2471 optional int32 uid = 7 [(is_uid) = true];
2472 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2473 // |port| must be spawned by |server_port|
2474 // Default 0 when unknown or don't care
2475 optional int32 server_port = 8;
2476 // Whether this is a server listener socket
2477 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002478}
2479
2480/**
Jack He71426802019-04-02 13:32:52 -07002481 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2482 *
2483 * Logged from:
2484 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2485 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2486 *
2487 */
2488message BluetoothClassOfDeviceReported {
2489 // An identifier that can be used to match events for this device.
2490 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2491 // Salt: Randomly generated 256 bit value
2492 // Hash algorithm: HMAC-SHA256
2493 // Size: 32 byte
2494 // Default: null or empty if this is a server listener socket
2495 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2496 // Class of Device (CoD) value including both Major, Minor device class and service class
2497 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2498 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2499 // Default: 0
2500 optional int32 class_of_device = 2;
2501}
2502
2503/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002504 * Logs when something is plugged into or removed from the USB-C connector.
2505 *
2506 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002507 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002508 */
2509message UsbConnectorStateChanged {
2510 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002511 STATE_DISCONNECTED = 0;
2512 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002513 }
2514 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002515 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002516 // Last active session in ms.
2517 // 0 when the port is in connected state.
2518 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002519}
2520
2521/**
2522 * Logs the reported speaker impedance.
2523 *
2524 * Logged from:
2525 * Vendor audio implementation.
2526 */
2527message SpeakerImpedanceReported {
2528 optional int32 speaker_location = 1;
2529 optional int32 impedance = 2;
2530}
2531
2532/**
2533 * Logs the report of a failed hardware.
2534 *
2535 * Logged from:
2536 * Vendor HALs.
2537 *
2538 */
2539message HardwareFailed {
2540 enum HardwareType {
2541 HARDWARE_FAILED_UNKNOWN = 0;
2542 HARDWARE_FAILED_MICROPHONE = 1;
2543 HARDWARE_FAILED_CODEC = 2;
2544 HARDWARE_FAILED_SPEAKER = 3;
2545 HARDWARE_FAILED_FINGERPRINT = 4;
2546 }
2547 optional HardwareType hardware_type = 1;
2548
Maggie White6dcd8572019-01-31 14:11:50 -08002549 /**
2550 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002551 * the same hardware_type. The specific locations are vendor defined integers,
2552 * referring to board-specific numbering schemes.
2553 */
2554 optional int32 hardware_location = 2;
2555
Maggie White6dcd8572019-01-31 14:11:50 -08002556 /**
2557 * failure_code is specific to the HardwareType of the failed hardware.
2558 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002559 */
Maggie White6dcd8572019-01-31 14:11:50 -08002560 enum HardwareErrorCode {
2561 UNKNOWN = 0;
2562 COMPLETE = 1;
2563 SPEAKER_HIGH_Z = 2;
2564 SPEAKER_SHORT = 3;
2565 FINGERPRINT_SENSOR_BROKEN = 4;
2566 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002567 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002568 }
2569 optional int32 failure_code = 3;
2570}
2571
2572/**
2573 * Log an event when the device has been physically dropped.
2574 * Reported from the /vendor partition.
2575 */
2576message PhysicalDropDetected {
2577 // Confidence that the event was actually a drop, 0 -> 100
2578 optional int32 confidence_pctg = 1;
2579 // Peak acceleration of the drop, in 1/1000s of a g.
2580 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002581 // Duration of freefall in ms
2582 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002583}
2584
2585/**
2586 * Log bucketed battery charge cycles.
2587 *
2588 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002589 * a given charge point. For example, if 10 cycle buckets are
2590 * initialized, bucket 1 is the lowest 1/10th of the battery,
2591 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002592 *
2593 * Logged from:
2594 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2595 */
2596message ChargeCyclesReported {
2597 optional int32 cycle_bucket_1 = 1;
2598 optional int32 cycle_bucket_2 = 2;
2599 optional int32 cycle_bucket_3 = 3;
2600 optional int32 cycle_bucket_4 = 4;
2601 optional int32 cycle_bucket_5 = 5;
2602 optional int32 cycle_bucket_6 = 6;
2603 optional int32 cycle_bucket_7 = 7;
2604 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002605 optional int32 cycle_bucket_9 = 9;
2606 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002607}
2608
2609/**
Howard Roa46b6582018-09-18 16:45:02 -07002610 * Log battery health snapshot.
2611 *
2612 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2613 * are snapshotted periodically over 24hrs.
2614 */
2615message BatteryHealthSnapshot {
2616 enum BatterySnapshotType {
2617 UNKNOWN = 0;
2618 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2619 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2620 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2621 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2622 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2623 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2624 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2625 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2626 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2627 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2628 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2629 }
2630 optional BatterySnapshotType type = 1;
2631 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002632 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002633 // Voltage Battery Voltage, in microVolts.
2634 optional int32 voltage_micro_volt = 3;
2635 // Current Battery current, in microAmps.
2636 optional int32 current_micro_amps = 4;
2637 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2638 optional int32 open_circuit_micro_volt = 5;
2639 // Resistance Battery Resistance, in microOhms.
2640 optional int32 resistance_micro_ohm = 6;
2641 // Level Battery Level, as % of full.
2642 optional int32 level_percent = 7;
2643}
2644
2645/**
2646 * Log slow I/O operations on the primary storage.
2647 */
2648message SlowIo {
2649 // Classifications of IO Operations.
2650 enum IoOperation {
2651 UNKNOWN = 0;
2652 READ = 1;
2653 WRITE = 2;
2654 UNMAP = 3;
2655 SYNC = 4;
2656 }
2657 optional IoOperation operation = 1;
2658
2659 // The number of slow IO operations of this type over 24 hours.
2660 optional int32 count = 2;
2661}
2662
2663/**
2664 * Log battery caused shutdown with the last recorded voltage.
2665 */
2666message BatteryCausedShutdown {
2667 // The last recorded battery voltage prior to shutdown.
2668 optional int32 last_recorded_micro_volt = 1;
2669}
2670
2671/**
Tej Singha72344992019-04-17 18:55:08 -07002672 * Logs when ThermalService receives throttling events.
2673 *
2674 * Logged from:
2675 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2676 */
2677message ThermalThrottlingSeverityStateChanged {
2678 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2679 optional android.os.TemperatureTypeEnum sensor_type = 1;
2680
2681 // The name of the temperature source. Eg. CPU0
2682 optional string sensor_name = 2;
2683
2684 // Temperature in tenths of a degree C.
2685 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2686 optional int32 temperature_deci_celsius = 3;
2687
2688 // Relative severity of the throttling, see enum definition.
2689 optional android.os.ThrottlingSeverityEnum severity = 4;
2690}
2691
2692/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002693 * Logs the duration of a davey (jank of >=700ms) when it occurs
2694 *
2695 * Logged from:
2696 * frameworks/base/libs/hwui/JankTracker.cpp
2697 */
2698message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002699 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002700 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002701
Tej Singhbb8554a2018-01-26 11:59:14 -08002702 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002703 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002704}
2705
2706/**
Bookatze5885242017-10-24 20:10:31 -07002707 * Logs phone signal strength changes.
2708 *
2709 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002710 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002711 */
2712message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002713 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2714 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002715}
2716
Yangster4ccebea2018-10-09 17:09:02 -07002717
2718/**
2719 * Logs when the phone state, sim state or signal strength changes
2720 *
2721 * Logged from:
2722 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2723 */
2724message PhoneServiceStateChanged {
2725 optional android.telephony.ServiceStateEnum state = 1;
2726 optional android.telephony.SimStateEnum sim_state = 2;
2727 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2728}
2729
2730/**
2731 * Logs when the phone becomes on or off.
2732 *
2733 * Logged from:
2734 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2735 */
2736message PhoneStateChanged {
2737 enum State {
2738 OFF = 0;
2739 ON = 1;
2740 }
2741 optional State state = 1;
2742}
2743
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002744message BackGesture {
2745 enum BackType {
2746 DEFAULT_BACK_TYPE = 0;
2747 COMPLETED = 1;
2748 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2749 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2750 INCOMPLETE = 4;
2751 }
2752 optional BackType type = 1;
2753
2754 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2755 enum WindowHorizontalLocation {
2756 DEFAULT_LOCATION = 0;
2757 LEFT = 1;
2758 RIGHT = 2;
2759 }
2760 optional WindowHorizontalLocation x_location = 3;
2761}
2762
2763message ExclusionRectStateChanged {
2764 optional string component_name = 1; // if not available, simply packageName
2765 optional int32 requested_height = 2; // px
2766 optional int32 rejected_height = 3; // px
2767
2768 enum WindowHorizontalLocation {
2769 DEFAULT_LOCATION = 0;
2770 LEFT = 1;
2771 RIGHT = 2;
2772 }
2773 optional WindowHorizontalLocation x_location = 4;
2774 optional bool landscape = 5;
2775 optional bool splitscreen = 6;
2776 optional int32 duration_millis = 7;
2777}
2778
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002779message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002780 optional android.stats.launcher.LauncherAction action = 1;
2781 optional android.stats.launcher.LauncherState src_state = 2;
2782 optional android.stats.launcher.LauncherState dst_state = 3;
2783 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002784 optional bool is_swipe_up_enabled = 5;
2785}
2786
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002787message StyleUIChanged {
2788 optional android.stats.style.Action action = 1;
2789 optional int32 color_package_hash = 2;
2790 optional int32 font_package_hash = 3;
2791 optional int32 shape_package_hash = 4;
2792 optional int32 clock_package_hash = 5;
2793 optional int32 launcher_grid = 6;
2794 optional int32 wallpaper_category_hash = 7;
2795 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002796 optional int32 color_preference = 9;
2797 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002798}
2799
David Chenc28b2bb2017-10-24 12:52:52 -07002800/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002801 * Logs when Settings UI has changed.
2802 *
2803 * Logged from:
2804 * packages/apps/Settings
2805 */
2806message SettingsUIChanged {
2807 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002808 * Where this SettingsUIChange event comes from. For example, if
2809 * it's a PAGE_VISIBLE event, where the page is opened from.
2810 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002811 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002812
2813 /**
2814 * What the UI action is.
2815 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002816 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002817
2818 /**
2819 * Where the action is happening
2820 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002821 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002822
2823 /**
2824 * What preference changed in this event.
2825 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002826 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002827
2828 /**
2829 * The new value of the changed preference.
2830 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002831 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002832}
2833
2834/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002835 * Logs basic timing information about touch events.
2836 * Reported at most every 5 minutes while device is being interacted with.
2837 *
2838 * Logged from:
2839 * frameworks/native/services/inputflinger
2840 */
2841message TouchEventReported {
2842 /**
2843 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002844 * and the standard deviation of the time spent processing touchscreen events
2845 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002846 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002847 * On supported devices, the starting point is taken during the hard interrupt inside the
2848 * kernel touch driver. On all other devices, the starting point is taken inside
2849 * the kernel's input event subsystem upon receipt of the input event.
2850 * The ending point is taken inside InputDispatcher, just after the input event
2851 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002852 */
2853 // Minimum value
2854 optional float latency_min_micros = 1;
2855 // Maximum value
2856 optional float latency_max_micros = 2;
2857 // Average value
2858 optional float latency_mean_micros = 3;
2859 // Standard deviation
2860 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002861 // Number of touch events (input_event) in this report
2862 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002863}
2864
2865/**
Philip Quinn0eded622019-01-29 12:46:28 -08002866 * Logs gesture classification and timing information for touch events.
2867 *
2868 * Logged from:
2869 * frameworks/base/core/java/android/view/GestureDetector.java
2870 * frameworks/base/core/java/android/view/View.java
2871 */
2872message TouchGestureClassified {
2873 // The source of the classification (e.g. Java class name).
2874 optional string source = 1;
2875
2876 enum Classification {
2877 UNKNOWN_CLASSIFICATION = 0;
2878 SINGLE_TAP = 1;
2879 DOUBLE_TAP = 2;
2880 LONG_PRESS = 3;
2881 DEEP_PRESS = 4;
2882 SCROLL = 5;
2883 }
2884 // The classification of the gesture.
2885 optional Classification classification = 2;
2886
2887 // The interval from the start of a touch event stream until the
2888 // classification was made.
2889 optional int32 latency_millis = 3;
2890
2891 // The distance from the location of the first touch event to the
2892 // location of the touch event when the classification was made.
2893 optional float displacement_px = 4;
2894}
2895
2896/**
David Chenc28b2bb2017-10-24 12:52:52 -07002897 * Logs that a setting was updated.
2898 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002899 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002900 * The tag and is_default allow resetting of settings to default values based on the specified
2901 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2902 */
2903message SettingChanged {
2904 // The name of the setting.
2905 optional string setting = 1;
2906
2907 // The change being imposed on this setting. May represent a number, eg "3".
2908 optional string value = 2;
2909
2910 // The new value of this setting. For most settings, this is same as value. For some settings,
2911 // value is +X or -X where X represents an element in a set. For example, if the previous value
2912 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2913 // The +/- feature is currently only used for location_providers_allowed.
2914 optional string new_value = 3;
2915
2916 // The previous value of this setting.
2917 optional string prev_value = 4;
2918
2919 // The tag used with the is_default for resetting sets of settings. This is generally null.
2920 optional string tag = 5;
2921
Bookatz90867622018-01-31 15:05:57 -08002922 // True if this setting with tag should be resettable.
2923 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002924
David Chenbd789912018-03-16 17:19:55 -07002925 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002926 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002927
2928 enum ChangeReason {
2929 UPDATED = 1; // Updated can be an insertion or an update.
2930 DELETED = 2;
2931 }
2932 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002933}
Chenjie Yub3dda412017-10-24 13:41:59 -07002934
Chenjie Yu05013b32017-11-21 10:21:41 -08002935/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002936 * Logs activity going to foreground or background
2937 *
2938 * Logged from:
2939 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2940 */
2941message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002942 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002943 optional string pkg_name = 2;
2944 optional string class_name = 3;
2945
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002946 enum State {
2947 BACKGROUND = 0;
2948 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002949 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002950 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002951}
David Chenc8a43242017-10-17 16:23:28 -07002952
2953/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002954 * Logs when a volume entered low Storage state.
2955 * Logged from:
2956 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2957 */
2958message LowStorageStateChanged {
2959 // Volume that ran out of storage.
2960 optional string volume_description = 1;
2961
2962 enum State {
2963 UNKNOWN = 0;
2964 OFF = 1;
2965 ON = 2;
2966 }
2967 optional State state = 2;
2968}
2969
2970/**
2971 * Logs when an app is downgraded.
2972 * Logged from:
2973 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2974 */
2975message AppDowngraded {
2976 optional string package_name = 1;
2977 // Size of the package (all data) before being downgraded.
2978 optional int64 size_in_bytes_before = 2;
2979 // Size of the package (all data) after being downgraded.
2980 optional int64 size_in_bytes_after = 3;
2981
2982 optional bool aggressive = 4;
2983}
2984
2985/**
2986 * Logs when an app is optimized after being downgraded.
2987 * Logged from:
2988 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2989 */
2990message AppOptimizedAfterDowngraded {
2991 optional string package_name = 1;
2992}
2993
2994/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002995 * Logs whenever an app is installed on external storage.
2996 * Logged from:
2997 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2998 */
2999message AppInstallOnExternalStorageReported {
3000 // The type of external storage.
3001 optional android.stats.storage.ExternalStorageType storage_type = 1;
3002 // The name of the package that is installed on the sd card.
3003 optional string package_name = 2;
3004}
3005
3006/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003007 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003008 * Logged from:
3009 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3010 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003011message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003012 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003013
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003014 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003015
3016 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003017 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003018 optional string process_name = 3;
3019
3020 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08003021 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003022
3023 optional string package_name = 5;
3024
3025 enum InstantApp {
3026 UNAVAILABLE = 0;
3027 FALSE = 1;
3028 TRUE = 2;
3029 }
3030 optional InstantApp is_instant_app = 6;
3031
3032 enum ForegroundState {
3033 UNKNOWN = 0;
3034 BACKGROUND = 1;
3035 FOREGROUND = 2;
3036 }
3037 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003038
3039 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003040}
David Chen9e3808c2017-11-20 17:25:34 -08003041
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003042/**
3043 * Logs when a WTF (What a Terrible Failure) happened.
3044 * Logged from:
3045 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3046 */
3047message WTFOccurred {
3048 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003049
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003050 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003051
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003052 // The name of the process.
3053 // system_server if it is not by an app
3054 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003055
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003056 // The pid if available. -1 means not available.
3057 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003058
3059 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003060}
3061
3062/**
3063 * Logs when system server reports low memory.
3064 * Logged from:
3065 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3066 */
3067message LowMemReported {
3068}
3069
3070/**
3071 * Logs when an app ANR (App Not Responding) occurs.
3072 * Logged from:
3073 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3074 */
3075message ANROccurred {
3076 optional int32 uid = 1 [(is_uid) = true];
3077
3078 optional string process_name = 2;
3079
3080 optional string short_component_name = 3;
3081
3082 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003083
3084 enum InstantApp {
3085 UNAVAILABLE = 0;
3086 FALSE = 1;
3087 TRUE = 2;
3088 }
3089 optional InstantApp is_instant_app = 5;
3090
3091 enum ForegroundState {
3092 UNKNOWN = 0;
3093 BACKGROUND = 1;
3094 FOREGROUND = 2;
3095 }
3096 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003097
3098 optional android.server.ErrorSource error_source = 7;
3099
3100 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003101}
3102
Bookatza7020bd2018-08-28 16:29:35 -07003103/**
3104 * Logs when the vibrator state changes.
3105 * Logged from:
3106 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3107 */
3108message VibratorStateChanged {
3109 repeated AttributionNode attribution_node = 1;
3110
3111 enum State {
3112 OFF = 0;
3113 ON = 1;
3114 }
3115 optional State state = 2;
3116
3117 // Duration (in milliseconds) requested to keep the vibrator on.
3118 // Only applicable for State == ON.
3119 optional int64 duration_millis = 3;
3120}
3121
David Chen0a368b22017-12-06 16:28:16 -08003122/*
3123 * Allows other apps to push events into statsd.
3124 * Logged from:
3125 * frameworks/base/core/java/android/util/StatsLog.java
3126 */
David Chen0b5c90c2018-01-25 16:51:49 -08003127message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003128 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003129 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003130
3131 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3132 optional int32 label = 2;
3133
3134 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3135 // predicates for the metrics).
3136 enum State {
3137 UNKNOWN = 0;
3138 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3139 STOP = 2;
3140 START = 3;
3141 }
3142 optional State state = 3;
3143}
3144
David Chen9e3808c2017-11-20 17:25:34 -08003145/**
Bookatz7948c872018-09-04 12:58:33 -07003146 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3147 * For example, this could be due to the user manually changing the time.
3148 *
3149 * Logged from:
3150 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3151 */
3152message WallClockTimeShifted {
3153 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3154 optional int64 wall_clock_timestamp_millis = 1;
3155}
3156
3157/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003158 * Logs when statsd detects an anomaly.
3159 *
3160 * Logged from:
3161 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3162 */
3163message AnomalyDetected {
3164 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003165 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003166
Yangster-mac94e197c2018-01-02 16:03:03 -08003167 // Id of the config whose anomaly detection alert fired.
3168 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003169
Yangster-mac94e197c2018-01-02 16:03:03 -08003170 // Id of the alert (i.e. name of the anomaly that was detected).
3171 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003172}
3173
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003174message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003175 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003176 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003177
3178 // The app package name.
3179 optional string pkg_name = 2;
3180
3181 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003182 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003183 WARM = 1;
3184 HOT = 2;
3185 COLD = 3;
3186 }
3187 // The transition type.
3188 optional TransitionType type = 3;
3189
3190 // The activity name.
3191 optional string activity_name = 4;
3192
3193 // The name of the calling app. Empty if not set.
3194 optional string calling_pkg_name = 5;
3195
3196 // Whether the app is an instant app.
3197 optional bool is_instant_app = 6;
3198
3199 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003200 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003201
Bookatz80d11a02018-01-16 10:46:35 -08003202 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003203
David Chen0b5c90c2018-01-25 16:51:49 -08003204 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003206 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003207 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003208 optional int32 bind_application_delay_millis = 11;
3209 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003210
3211 // Empty if not set.
3212 optional string launch_token = 13;
3213
Calin Juravle759fbda2018-02-20 19:52:30 +00003214 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003215 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003216
3217 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003218 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003219}
3220
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003221message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003222 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003223 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003224
3225 // The app package name.
3226 optional string pkg_name = 2;
3227
3228 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003229 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003230 WARM = 1;
3231 HOT = 2;
3232 COLD = 3;
3233 }
3234 // The transition type.
3235 optional TransitionType type = 3;
3236
3237 // The activity name.
3238 optional string activity_name = 4;
3239}
3240
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003241message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003242 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003243 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003244
3245 // The app package name.
3246 optional string pkg_name = 2;
3247
3248 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003249 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003250 WITH_BUNDLE = 1;
3251 WITHOUT_BUNDLE = 2;
3252 }
3253 // The transition type.
3254 optional TransitionType type = 3;
3255
3256 // The activity name.
3257 optional string activity_name = 4;
3258
3259 optional bool transition_process_running = 5;
3260
3261 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003262 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003263}
3264
Bookatz8fcd09a2017-12-18 13:01:10 -08003265/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003266 * Logs a picture-in-picture action
3267 * Logged from:
3268 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3269 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3270 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3271 */
3272message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003273 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003274 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003275
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003276 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003277
Chenjie Yu52cacc62017-12-08 18:11:45 -08003278 enum State {
3279 ENTERED = 1;
3280 EXPANDED_TO_FULL_SCREEN = 2;
3281 MINIMIZED = 3;
3282 DISMISSED = 4;
3283 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003284 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003285}
3286
3287/**
Chenjie Yue8904192017-12-08 19:12:57 -08003288 * Logs overlay action
3289 * Logged from:
3290 * services/core/java/com/android/server/wm/Session.java
3291 */
3292message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003293 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003294
tsaichristine5adc7e02020-01-14 17:07:39 -08003295 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003296
3297 optional bool using_alert_window = 3;
3298
3299 enum State {
3300 ENTERED = 1;
3301 EXITED = 2;
3302 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003303 optional State state = 4 [
3304 (state_field_option).option = EXCLUSIVE_STATE,
3305 (state_field_option).nested = false,
3306 (state_field_option).default_state_value = 2
3307 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003308}
3309
Adam Bookatz38767932020-02-05 12:13:40 -08003310/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003311 * Logs foreground service starts and stops.
3312 * Note that this is not when a service starts or stops, but when it is
3313 * considered foreground.
3314 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003315 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003316 */
3317message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003318 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003319 // package_name + "/" + class_name
3320 optional string short_name = 2;
3321
3322 enum State {
3323 ENTER = 1;
3324 EXIT = 2;
3325 }
3326 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003327
3328 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3329 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3330 optional bool allow_while_in_use_permission = 4;
3331}
3332
3333/**
3334 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3335 * A foreground service session is any continuous period during which the uid holds at least one
3336 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3337 * Accesses initiated while the uid is in the TOP state are ignored.
3338 * Sessions with no attempted accesses are not logged.
3339 * Logged from
3340 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3341 */
3342message ForegroundServiceAppOpSessionEnded {
3343 optional int32 uid = 1 [(is_uid) = true];
3344
3345 // The operation's name.
3346 // To the extent possible, preserve the mapping from AppOpsManager.OP_ constants.
3347 // Only these named ops are actually logged.
3348 enum AppOpName {
3349 OP_NONE = -1; // Also represents UNKNOWN.
3350 OP_COARSE_LOCATION = 0;
3351 OP_FINE_LOCATION = 1;
3352 OP_CAMERA = 26;
3353 OP_RECORD_AUDIO = 27;
3354 }
3355 optional AppOpName app_op_name = 2 [default = OP_NONE];
3356
3357 // The uid's permission mode for accessing the AppOp during this fgs session.
3358 enum Mode {
3359 MODE_UNKNOWN = 0;
3360 MODE_ALLOWED = 1; // Always allowed
3361 MODE_IGNORED = 2; // Denied
3362 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3363 }
3364 optional Mode app_op_mode = 3;
3365
3366 // Number of times this AppOp was requested and allowed.
3367 optional int32 count_ops_accepted = 4;
3368 // Number of times this AppOp was requested but denied.
3369 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003370}
3371
Chenjie Yue8904192017-12-08 19:12:57 -08003372/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003373 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3374 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3375 * attributed back to the parent (host) uid. One example is Chrome.
3376 *
3377 * Logged from:
3378 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3379 */
3380message IsolatedUidChanged {
3381 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003382 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003383 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003384 optional int32 parent_uid = 1;
3385
3386 optional int32 isolated_uid = 2;
3387
3388 // We expect an isolated uid to be removed before if it's used for another parent uid.
3389 enum Event {
3390 REMOVED = 0;
3391 CREATED = 1;
3392 }
3393 optional Event event = 3;
3394}
3395
3396/*
3397 * Logs the reception of an incoming network packet causing the main system to wake up for
3398 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3399 * and processed by WakeupController.cpp.
3400 */
3401message PacketWakeupOccurred {
3402 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3403 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003404 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003405 // The interface name on which the packet was received.
3406 optional string iface = 2;
3407 // The ethertype value of the packet.
3408 optional int32 ethertype = 3;
3409 // String representation of the destination MAC address of the packet.
3410 optional string destination_hardware_address = 4;
3411 // String representation of the source address of the packet if this was an IP packet.
3412 optional string source_ip = 5;
3413 // String representation of the destination address of the packet if this was an IP packet.
3414 optional string destination_ip = 6;
3415 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3416 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3417 // families.
3418 optional int32 ip_next_header = 7;
3419 // The source port if this was a TCP or UDP packet.
3420 optional int32 source_port = 8;
3421 // The destination port if this was a TCP or UDP packet.
3422 optional int32 destination_port = 9;
3423}
3424
3425/*
3426 * Logs the memory stats for an app on startup.
3427 * Logged from:
3428 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3429 */
3430message AppStartMemoryStateCaptured {
3431 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003432 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003433
3434 // The process name.
3435 optional string process_name = 2;
3436
3437 // The activity name.
3438 optional string activity_name = 3;
3439
3440 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003441 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003442
3443 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003444 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003445
3446 // RSS
3447 optional int64 rss_in_bytes = 6;
3448
3449 // CACHE
3450 optional int64 cache_in_bytes = 7;
3451
3452 // SWAP
3453 optional int64 swap_in_bytes = 8;
3454}
3455
3456/*
3457 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3458 * for LMK event.
3459 * Logged from:
3460 * system/core/lmkd/lmkd.c
3461 */
3462message LmkStateChanged {
3463 enum State {
3464 UNKNOWN = 0;
3465 START = 1;
3466 STOP = 2;
3467 }
3468 optional State state = 1;
3469}
3470
3471/*
3472 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3473 * Logged from:
3474 * system/core/lmkd/lmkd.c
3475 */
3476message LmkKillOccurred {
3477 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003478 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003479
3480 // The process name.
3481 optional string process_name = 2;
3482
3483 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003484 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003485
3486 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003487 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003488
3489 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003490 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003491
3492 // RSS
3493 optional int64 rss_in_bytes = 6;
3494
3495 // CACHE
3496 optional int64 cache_in_bytes = 7;
3497
3498 // SWAP
3499 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003500
3501 // The elapsed real time of start of the process.
3502 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003503
3504 // Min oom adj score considered by lmkd.
3505 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003506}
3507
Rajeev Kumar51b54602018-03-01 12:18:26 -08003508/*
3509 * Logs when the ActivityManagerService detects that an app died.
3510 *
3511 * Logged from:
3512 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3513 */
3514message AppDied {
3515 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003516 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003517}
3518
Howard Ro21a039c2018-08-06 14:55:47 -07003519/**
3520 * An atom for generic metrics logging. Available from Android Q.
3521 */
3522message GenericAtom {
3523 // The uid of the application that sent this custom atom.
3524 optional int32 uid = 1 [(is_uid) = true];
3525
3526 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003527 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003528}
3529
Tej Singhd6d6d772018-09-05 17:41:25 -07003530/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003531 * Atom for simple logging of user interaction and impression events, such as "the user touched
3532 * this button" or "this dialog was displayed".
3533 * Keep the UI event stream clean: don't use for system or background events.
3534 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003535 *
3536 * Logged from:
3537 * frameworks/base/services/core/java/com/android/server/
3538 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003539 */
3540message UiEventReported {
3541 // The event_id.
3542 optional int32 event_id = 1;
3543 // The event's source or target uid and package, if applicable.
3544 // For example, the package posting a notification, or the destination package of a share.
3545 optional int32 uid = 2 [(is_uid) = true];
3546 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003547 // An identifier used to disambiguate which logs refer to a particular instance of some
3548 // UI element. Useful when there might be multiple instances simultaneously active.
3549 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003550}
3551
3552/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003553 * Reports a notification was created or updated.
3554 *
3555 * Logged from:
3556 * frameworks/base/services/core/java/com/android/server/notification/
3557 */
3558message NotificationReported {
3559 // The event_id (as for UiEventReported).
3560 optional int32 event_id = 1;
3561 // The notifying app's uid and package.
3562 optional int32 uid = 2 [(is_uid) = true];
3563 optional string package_name = 3;
3564 // A small system-assigned identifier for the notification.
3565 // Locally probably-unique, but expect collisions across users and/or days.
3566 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003567 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3568 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003569
3570 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003571 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3572 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3573 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003574
3575 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003576 optional string category = 10; // App-assigned notification category (API-defined strings)
3577 optional int32 style = 11; // App-assigned notification style
3578 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003579
3580 // Ordering, importance and interruptiveness
3581
Will Brockman7614f6962020-02-10 19:43:03 -05003582 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003583
Will Brockman7614f6962020-02-10 19:43:03 -05003584 optional android.stats.sysui.NotificationImportance importance = 14;
3585 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003586
3587 enum NotificationImportanceExplanation {
3588 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3589 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3590 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3591 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3592 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3593 // Like _APP, but based on pre-channels priority signal.
3594 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3595 }
3596
Will Brockman7614f6962020-02-10 19:43:03 -05003597 optional NotificationImportanceExplanation importance_source = 16;
3598 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3599 optional NotificationImportanceExplanation importance_initial_source = 18;
3600 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3601 optional int32 assistant_hash = 20;
3602 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003603}
3604
3605message Notification {
3606 // The notifying app's uid and package.
3607 optional int32 uid = 1 [(is_uid) = true];
3608 optional string package_name = 2;
3609 // A small system-assigned identifier for the notification.
3610 optional int32 instance_id = 3;
3611
3612 // Grouping information.
3613 optional int32 group_instance_id = 4;
3614 optional bool is_group_summary = 5;
3615
3616 // The section of the shade that the notification is in.
3617 // See NotificationSectionsManager.PriorityBucket.
3618 enum NotificationSection {
3619 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003620 SECTION_HEADS_UP = 1;
3621 SECTION_PEOPLE = 2;
3622 SECTION_ALERTING = 3;
3623 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003624 }
3625 optional NotificationSection section = 6;
3626}
3627
3628message NotificationList {
3629 repeated Notification notifications = 1; // An ordered sequence of notifications.
3630}
3631
3632/**
3633 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3634 *
3635 * Logged from:
3636 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3637 */
3638message NotificationPanelReported {
3639 // The event_id (as for UiEventReported).
3640 optional int32 event_id = 1;
3641 optional int32 num_notifications = 2;
3642 // The notifications in the panel, in the order that they appear there.
3643 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3644}
3645
3646/**
3647 * Reports a notification channel, or channel group, was created, updated, or deleted.
3648 *
3649 * Logged from:
3650 * frameworks/base/services/core/java/com/android/server/notification/
3651 */
3652message NotificationChannelModified {
3653 // The event_id (as for UiEventReported).
3654 optional int32 event_id = 1;
3655 // The notifying app's uid and package.
3656 optional int32 uid = 2 [(is_uid) = true];
3657 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003658 // Hash of app-assigned notification channel ID or channel-group ID
3659 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003660 // Previous importance setting, if applicable
3661 optional android.stats.sysui.NotificationImportance old_importance = 5;
3662 // New importance setting
3663 optional android.stats.sysui.NotificationImportance importance = 6;
3664}
3665
3666
3667/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003668 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003669 *
3670 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003671 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003672 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003673message BiometricAcquired {
3674 // Biometric modality that was acquired.
3675 optional android.hardware.biometrics.ModalityEnum modality = 1;
3676 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3677 optional int32 user = 2;
3678 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3679 optional bool is_crypto = 3;
3680 // Action that the device is performing. Acquired messages are only expected for enroll and
3681 // authenticate. Other actions may indicate an error.
3682 optional android.hardware.biometrics.ActionEnum action = 4;
3683 // The client that this acquisition was received for.
3684 optional android.hardware.biometrics.ClientEnum client = 5;
3685 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3686 optional int32 acquire_info = 6;
3687 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3688 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003689 // Dictates if this message should trigger additional debugging.
3690 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003691}
3692
3693/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003694 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003695 *
3696 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003697 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003698 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003699message BiometricAuthenticated {
3700 // Biometric modality that was used.
3701 optional android.hardware.biometrics.ModalityEnum modality = 1;
3702 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3703 optional int32 user = 2;
3704 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3705 // storage.
3706 optional bool is_crypto = 3;
3707 // The client that this acquisition was received for.
3708 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003709 // If authentication requires user confirmation. See BiometricPrompt's
3710 // setRequireConfirmation(bool) method.
3711 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003712
Kevin Chyn1741a072019-01-17 11:54:40 -08003713 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003714 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003715 REJECTED = 1;
3716 PENDING_CONFIRMATION = 2;
3717 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003718 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003719
3720 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003721 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003722 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3723 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3724 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3725 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003726 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003727 // Dictates if this message should trigger additional debugging.
3728 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003729}
3730
3731/**
3732 * Logs when a biometric error occurs.
3733 *
3734 * Logged from:
3735 * frameworks/base/services/core/java/com/android/server/biometrics
3736 */
3737message BiometricErrorOccurred {
3738 // Biometric modality that was used.
3739 optional android.hardware.biometrics.ModalityEnum modality = 1;
3740 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3741 optional int32 user = 2;
3742 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3743 optional bool is_crypto = 3;
3744 // Action that the device is performing.
3745 optional android.hardware.biometrics.ActionEnum action = 4;
3746 // The client that this acquisition was received for.
3747 optional android.hardware.biometrics.ClientEnum client = 5;
3748 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3749 // are unique to modality.
3750 optional int32 error_info = 6;
3751 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3752 // by the vendor and not specified by the HIDL interface.
3753 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003754 // Dictates if this message should trigger additional debugging.
3755 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003756 // Time spent during the authentication attempt.
3757 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003758}
3759
3760/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003761 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003762 * Logged from:
3763 * frameworks/base/services/core/java/com/android/server/biometrics
3764 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003765message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003766 // Biometric modality.
3767 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003768 // Type of issue detected.
3769 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003770 // Dictates if this message should trigger additional debugging.
3771 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003772}
Howard Ro688ae182018-09-25 00:09:36 -07003773
joshmccloskey6f952b22019-03-25 20:59:35 -07003774/**
3775 * Logs when a biometric enrollment occurs.
3776 *
3777 * Logged from:
3778 * frameworks/base/services/core/java/com/android/server/biometrics
3779 */
3780message BiometricEnrolled {
3781 // Biometric modality that was used.
3782 optional android.hardware.biometrics.ModalityEnum modality = 1;
3783 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3784 optional int32 user = 2;
3785 // The amount of time the enrollment took in milliseconds.
3786 optional int64 latency_millis = 3;
3787 // Whether or not the enrollment was successful.
3788 optional bool success = 4;
3789}
3790
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003791/*
Tej Singh0d176952019-01-16 19:10:54 -08003792 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003793 */
Tej Singh0d176952019-01-16 19:10:54 -08003794message FlagFlipUpdateOccurred {
3795 // If the event is from a flag config package, specify the package name.
3796 optional string flag_flip_package_name = 1;
3797
3798 // The order id of the package
3799 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003800}
3801
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003802/**
3803 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003804 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003805 */
3806message TrainExperimentIds {
3807 repeated int64 experiment_id = 1;
3808}
3809
Yangster-macb89807e2018-11-15 21:10:57 -08003810/*
3811 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003812 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003813 */
3814message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003815 // Name of the train.
3816 optional string train_name = 1;
3817 // Version code for a "train" of packages that need to be installed atomically
3818 optional int64 train_version_code = 2;
3819 // After installation of this package, device requires a restart.
3820 optional bool requires_staging = 3;
3821 // Rollback should be enabled for this install.
3822 optional bool rollback_enabled = 4;
3823 // Requires low latency monitoring if possible.
3824 optional bool requires_low_latency_monitor = 5;
3825
Yangster-macb89807e2018-11-15 21:10:57 -08003826 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003827 UNKNOWN = 0;
3828 INSTALL_REQUESTED = 1;
3829 INSTALL_STARTED = 2;
3830 INSTALL_STAGED_NOT_READY = 3;
3831 INSTALL_STAGED_READY = 4;
3832 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003833 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3834 // and INSTALL_FAILURE_COMMIT.
3835 INSTALL_FAILURE = 6 [deprecated = true];
3836 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003837 INSTALL_CANCELLED = 7;
3838 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003839 INSTALLER_ROLLBACK_INITIATED = 9;
3840 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3841 INSTALLER_ROLLBACK_STAGED = 11;
3842 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3843 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3844 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3845 INSTALLER_ROLLBACK_SUCCESS = 15;
3846 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003847 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3848 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3849 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3850 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3851 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3852 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003853 INSTALL_FAILURE_DOWNLOAD = 23;
3854 INSTALL_FAILURE_STATE_MISMATCH = 24;
3855 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003856 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003857 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003858 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003859 // Possible experiment ids for monitoring this push.
3860 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3861 // user id
3862 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003863 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003864 // Whether or not this is a rollback event
3865 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003866}
3867
Tej Singhc9203082019-05-03 13:42:23 -07003868/* Test atom, is not logged anywhere */
3869message TestAtomReported {
3870 repeated AttributionNode attribution_node = 1;
3871 optional int32 int_field = 2;
3872 optional int64 long_field = 3;
3873 optional float float_field = 4;
3874 optional string string_field = 5;
3875 optional bool boolean_field = 6;
3876 enum State {
3877 UNKNOWN = 0;
3878 OFF = 1;
3879 ON = 2;
3880 }
3881 optional State state = 7;
3882 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3883}
3884
Maggie Whitefc1aa592018-11-28 21:55:23 -08003885/** Represents USB port overheat event. */
3886message UsbPortOverheatEvent {
3887 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3888 optional int32 plug_temperature_deci_c = 1;
3889
3890 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3891 optional int32 max_temperature_deci_c = 2;
3892
3893 /* Time between USB plug event and overheat threshold trip, in seconds. */
3894 optional int32 time_to_overheat_secs = 3;
3895
3896 /* Time between overheat threshold trip and hysteresis, in seconds. */
3897 optional int32 time_to_hysteresis_secs = 4;
3898
3899 /* Time between hysteresis and active mitigation ending, in seconds. */
3900 optional int32 time_to_inactive_secs = 5;
3901};
3902
Maggie White8735b852019-01-18 11:40:49 -08003903/**
3904 * Logs total effective full charge and discharge cycles on a battery.
3905 * Here are some examples of one effective cycle:
3906 * 1) the battery charges from 0% to 100% and drains back to 0%,
3907 * 2) charging from 50% to 100% and draining back to 50% twice.
3908 * Pulled from:
3909 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3910 */
3911message BatteryCycleCount {
3912 /* Number of total charge and discharge cycles on the system battery. */
3913 optional int32 cycle_count = 1;
3914}
3915
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003916/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003917 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3918 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003919 * Pulled from:
3920 * StatsCompanionService
3921 */
3922
Carmen Agimof12dec122019-03-06 16:14:38 +00003923message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003924
Carmen Agimof12dec122019-03-06 16:14:38 +00003925 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003926 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003927 PUBLIC = 1;
3928 PRIVATE = 2;
3929 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003930 }
3931
Carmen Agimof12dec122019-03-06 16:14:38 +00003932 // The type of external storage.
3933 optional android.stats.storage.ExternalStorageType storage_type = 1;
3934 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3935 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003936 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003937 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003938}
3939
Yangster-macb89807e2018-11-15 21:10:57 -08003940/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003941 * Logs when a connection becomes available and lost.
3942 * Logged in StatsCompanionService.java
3943 */
3944message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003945 // Id of the network.
3946 optional int32 net_id = 1;
3947
3948 enum State {
3949 UNKNOWN = 0;
3950 CONNECTED = 1;
3951 DISCONNECTED = 2;
3952 }
3953 // Connected state of a network.
3954 optional State state = 2;
3955}
3956
3957/**
3958 * Logs when a service starts and stops.
3959 * Logged from:
3960 * services/core/java/com/android/server/am/ActiveServices.java
3961 */
3962message ServiceStateChanged {
3963
3964 optional int32 uid = 1 [(is_uid) = true];
3965
3966 optional string package_name = 2;
3967
3968 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003969
3970 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003971 START = 1;
3972 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003973 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003974
3975 optional State state = 4;
3976}
3977
3978/**
3979 * Logs when a service is launched.
3980 * Logged from:
3981 * services/core/java/com/android/server/am/ActiveServices.java
3982 */
3983message ServiceLaunchReported {
3984
3985 optional int32 uid = 1 [(is_uid) = true];
3986
3987 optional string package_name = 2;
3988
3989 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003990}
Howard Ro688ae182018-09-25 00:09:36 -07003991
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003992/**
3993 * Logs when a hidden API is used.
3994 *
3995 * Logged from:
3996 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3997 */
3998message HiddenApiUsed {
3999 // The uid of the app making the hidden access.
4000 optional int32 uid = 1 [(is_uid) = true];
4001
4002 // Signature of the method or field accessed.
4003 optional string signature = 2;
4004
4005 enum AccessMethod {
4006 NONE = 0;
4007 REFLECTION = 1;
4008 JNI = 2;
4009 LINKING = 3;
4010 }
4011
4012 // Type of access.
4013 optional AccessMethod access_method = 3;
4014
4015 // Whether the access was prevented or not.
4016 optional bool access_denied = 4;
4017}
4018
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004019/**
4020 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4021 * - When user sees privacy chip
4022 * - When user clicks privacy chip
4023 * - How does the user exit the Privacy Dialog
4024 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004025 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4026 */
4027message PrivacyIndicatorsInteracted {
4028
4029 enum Type {
4030 UNKNOWN = 0;
4031 CHIP_VIEWED = 1;
4032 CHIP_CLICKED = 2;
4033 DIALOG_PRIVACY_SETTINGS = 3;
4034 DIALOG_DISMISS = 4;
4035 DIALOG_LINE_ITEM = 5;
4036 }
4037
tsaichristine5adc7e02020-01-14 17:07:39 -08004038 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004039
4040 // Used if the type is LINE_ITEM
4041 optional string package_name = 2;
4042}
4043
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004044/**
4045 * Logs information about a package that is moved from the internal to external storage and vice
4046 * versa.
4047 * It logs the package name, the type of the external storage where the package is installed
4048 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4049 * and the move type: if it's from internal to external or the other way around.
4050 *
4051 * Logged from:
4052 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4053 */
4054message AppMovedStorageReported {
4055 enum MoveType {
4056 UNKNOWN = 0;
4057 TO_EXTERNAL = 1;
4058 TO_INTERNAL = 2;
4059 }
4060 // The type of the external storage.
4061 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4062 // The type of move.
4063 optional MoveType move_type = 2;
4064 // The name of the package that was moved.
4065 optional string package_name = 3;
4066}
4067
jianjin8f2dee02019-03-29 14:03:08 -07004068/**
4069 * Logs when system server watchdog occurs.
4070 * Logged from:
4071 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4072 */
4073message SystemServerWatchdogOccurred {
4074 optional string subject = 1;
4075}
4076
4077/**
4078 * Logs when new file added to tombstones.
4079 * Logged from:
4080 * frameworks/base/core/java/com/android/server/BootReceiver.java
4081 */
4082message TombStoneOccurred {
4083}
4084
Hai Zhang5d3328d2019-04-13 21:25:06 +08004085/*
4086 * Information about a role request
4087 *
4088 * Logged from:
4089 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4090 */
4091message RoleRequestResultReported {
4092 // UID of application requesting the role
4093 optional int32 requesting_uid = 1;
4094
4095 // Package name of application requesting the role
4096 optional string requesting_package_name = 2;
4097
4098 // The role to be granted
4099 optional string role_name = 3;
4100
4101 // The count of applications qualifying for the role
4102 optional int32 qualifying_count = 4;
4103
4104 // UID of application current granted the role
4105 optional int32 current_uid = 5;
4106
4107 // Package name of application current granted the role
4108 optional string current_package_name = 6;
4109
4110 // UID of another application that user chose to grant the role to, instead of the requesting
4111 // application
4112 optional int32 granted_another_uid = 7;
4113
4114 // Package name of another application that user chose to grant the role to, instead of the
4115 // requesting application
4116 optional string granted_another_package_name = 8;
4117
4118 enum Result {
4119 UNDEFINED = 0;
4120 // role request was ignored
4121 IGNORED = 1;
4122 // role request was ignored because it's already granted
4123 IGNORED_ALREADY_GRANTED = 2;
4124 // role request was ignored because the application isn't qualified
4125 IGNORED_NOT_QUALIFIED = 3;
4126 // role request was ignored because user said it should be always denied
4127 IGNORED_USER_ALWAYS_DENIED = 4;
4128 // role was granted by user action
4129 USER_GRANTED = 5;
4130 // role was denied by user action
4131 USER_DENIED = 6;
4132 // role was denied by user granting another application the role
4133 USER_DENIED_GRANTED_ANOTHER = 7;
4134 // role was denied and set to be always denied by the user
4135 USER_DENIED_WITH_ALWAYS = 8;
4136 }
4137 // The result of the role request
4138 optional Result result = 9;
4139}
4140
Mark Tabrya824a642019-11-05 12:26:12 -08004141/**
4142 * Logs when a Vehicle Maps Service client's connection state has changed
4143 *
4144 * Logged from:
4145 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4146 */
4147message VmsClientConnectionStateChanged {
4148 // The UID of the VMS client app
4149 optional int32 uid = 1 [(is_uid) = true];
4150
4151 enum State {
4152 UNKNOWN = 0;
4153 // Attempting to connect to the client
4154 CONNECTING = 1;
4155 // Client connection established
4156 CONNECTED = 2;
4157 // Client connection closed unexpectedly
4158 DISCONNECTED = 3;
4159 // Client connection closed by VMS
4160 TERMINATED = 4;
4161 // Error establishing the client connection
4162 CONNECTION_ERROR = 5;
4163 }
4164
4165 optional State state = 2;
4166}
4167
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004168/**
4169 * Logs when MediaProvider has successfully finished scanning a storage volume.
4170 *
4171 * Logged from:
4172 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4173 */
4174message MediaProviderScanEvent {
4175 enum Reason {
4176 // Scan triggered due to unknown reason
4177 UNKNOWN = 0;
4178 // Scan triggered due to storage volume being mounted
4179 MOUNTED = 1;
4180 // Scan triggered due to explicit user action or app request
4181 DEMAND = 2;
4182 // Scan triggered due to idle maintenance
4183 IDLE = 3;
4184 }
4185
4186 // Volume type that this event pertains to
4187 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4188 // Reason why this scan was triggered
4189 optional Reason reason = 2;
4190 // Total number of files scanned
4191 optional int64 item_count = 3;
4192 // Duration of scan, normalized per file
4193 optional float normalized_duration_millis = 4;
4194 // Number of database inserts, normalized per file
4195 optional float normalized_insert_count = 5;
4196 // Number of database updates, normalized per file
4197 optional float normalized_update_count = 6;
4198 // Number of database deletes, normalized per file
4199 optional float normalized_delete_count = 7;
4200}
4201
4202/**
4203 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4204 *
4205 * Logged from:
4206 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4207 */
4208message MediaProviderDeletionEvent {
4209 // Volume type that this event pertains to
4210 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4211 // Device timestamp when this deletion event occurred
4212 optional int64 timestamp_millis = 2;
4213 // App that requested deletion
4214 optional string package_name = 3;
4215 // Number of items that were deleted
4216 optional int32 item_count = 4;
4217}
4218
4219/**
4220 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4221 *
4222 * Logged from:
4223 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4224 */
4225message MediaProviderPermissionEvent {
4226 enum Result {
4227 UNKNOWN = 0;
4228 USER_GRANTED = 1;
4229 AUTO_GRANTED = 2;
4230 USER_DENIED = 3;
4231 USER_DENIED_WITH_PREJUDICE = 4;
4232 AUTO_DENIED = 5;
4233 }
4234
4235 // Volume type that this event pertains to
4236 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4237 // Device timestamp when this permission event occurred
4238 optional int64 timestamp_millis = 2;
4239 // App that requested permission
4240 optional string package_name = 3;
4241 // Number of items that were requested
4242 optional int32 item_count = 4;
4243 // Result of this request
4244 optional Result result = 5;
4245}
4246
4247/**
4248 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4249 *
4250 * Logged from:
4251 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4252 */
4253message MediaProviderSchemaChange {
4254 // Volume type that this event pertains to
4255 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4256 // Old database version code
4257 optional int32 version_from = 2;
4258 // New database version code
4259 optional int32 version_to = 3;
4260 // Total number of files in database
4261 optional int64 item_count = 4;
4262 // Duration of schema change, normalized per file
4263 optional float normalized_duration_millis = 5;
4264}
4265
4266/**
4267 * Logs when MediaProvider has finished an idle maintenance job.
4268 *
4269 * Logged from:
4270 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4271 */
4272message MediaProviderIdleMaintenance {
4273 // Volume type that this event pertains to
4274 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4275
4276 // Total number of files in database
4277 optional int64 item_count = 2;
4278 // Duration of idle maintenance, normalized per file
4279 optional float normalized_duration_millis = 3;
4280 // Number of thumbnails found to be stale, normalized per file
4281 optional float normalized_stale_thumbnails = 4;
4282 // Number of items found to be expired, normalized per file
4283 optional float normalized_expired_media = 5;
4284}
4285
Keun young Park3e033cb2019-12-18 11:27:35 -08004286/**
4287 * Represents boot time event with duration in ms.
4288 *
4289 * Logged from: bootstat and various system server components. Check each enums for details.
4290 */
4291message BootTimeEventDuration {
4292 enum DurationEvent {
4293 UNKNOWN = 0;
4294 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4295 ABSOLUTE_BOOT_TIME = 1;
4296 // Bootloader's 1st stage execution time.
4297 // Logged from bootstat.
4298 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4299 // Bootloader's 1st stage loading time.
4300 // Logged from bootstat.
4301 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4302 // Bootloader's kernel loading time.
4303 // Logged from bootstat.
4304 BOOTLOADER_KERNEL_LOAD = 4;
4305 // Bootloader's 2nd stage execution time.
4306 // Logged from bootstat.
4307 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4308 // Bootloader's 2nd stage loading time.
4309 // Logged from bootstat.
4310 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4311 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4312 // for locked device.
4313 // Logged from bootstat.
4314 BOOTLOADER_UI_WAIT = 7;
4315 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4316 // Logged from bootstat.
4317 BOOTLOADER_TOTAL = 8;
4318 // Shutdown duration inside init for the reboot before the current boot up.
4319 // Logged from f/b/services/.../BootReceiver.java.
4320 SHUTDOWN_DURATION = 9;
4321 // Total time for mounting of disk devices during bootup.
4322 // Logged from f/b/services/.../BootReceiver.java.
4323 MOUNT_DEFAULT_DURATION = 10;
4324 // Total time for early stage mounting of disk devices during bootup.
4325 // Logged from f/b/services/.../BootReceiver.java.
4326 MOUNT_EARLY_DURATION = 11;
4327 // Total time for late stage mounting of disk devices during bootup.
4328 // Logged from f/b/services/.../BootReceiver.java.
4329 MOUNT_LATE_DURATION = 12;
4330 // Average time to scan non-system app after OTA
4331 // Logged from f/b/services/.../PackageManagerService.java
4332 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4333 // Time to initialize Package manager after OTA
4334 // Logged from f/b/services/.../PackageManagerService.java
4335 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4336 // Time to scan all system app from Package manager after OTA
4337 // Logged from f/b/services/.../PackageManagerService.java
4338 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4339 // Init's total time for cold boot stage.
4340 // Logged from bootstat.
4341 COLDBOOT_WAIT = 16;
4342 // Init's total time for initializing selinux.
4343 // Logged from bootstat.
4344 SELINUX_INIT = 17;
4345 // Time since last factory reset.
4346 // Logged from bootstat.
4347 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004348 // Init's total time spent for completing the 1st stage.
4349 // Logged from bootstat.
4350 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004351 }
4352
4353 // Type of the event.
4354 optional DurationEvent event = 1;
4355 // Duration of the event in ms.
4356 optional int64 duration_millis = 2;
4357}
4358
4359/**
4360 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4361 * since boot-up.
4362 *
4363 * Logged from: bootstat and various system server components. Check each enums for details.
4364 */
4365message BootTimeEventElapsedTime {
4366 enum ElapsedTimeEvent {
4367 UNKNOWN = 0;
4368 // Time when init starts 1st stage. Logged from bootstat.
4369 ANDROID_INIT_STAGE_1 = 1;
4370 // Time when sys.boot_completed prop is set.
4371 // Logged from bootstat.
4372 BOOT_COMPLETE = 2;
4373 // BOOT_COMPLETE for encrypted device.
4374 BOOT_COMPLETE_ENCRYPTION = 3;
4375 // BOOT_COMPLETE for device with no encryption.
4376 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4377 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004378 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004379 // BOOT_COMPLETE after factory reset.
4380 FACTORY_RESET_BOOT_COMPLETE = 6;
4381 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4382 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004383 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4384 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004385 // BOOT_COMPLETE after OTA.
4386 OTA_BOOT_COMPLETE = 9;
4387 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4388 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004389 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4390 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004391 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4392 // Logged from f/b/services/.../UserController.java
4393 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4394 // Time when the system starts sending BOOT_COMPLETED broadcast.
4395 // Logged from f/b/services/.../UserController.java
4396 FRAMEWORK_BOOT_COMPLETED = 13;
4397 // Time when the package manager starts init.
4398 // Logged from f/b/services/.../SystemServer.java
4399 PACKAGE_MANAGER_INIT_START = 14;
4400 // Time when package manager is ready
4401 // Logged from f/b/services/.../SystemServer.java
4402 PACKAGE_MANAGER_INIT_READY = 15;
4403 // Represents the time when user has entered unlock credential for system with user pin.
4404 // Logged from bootstat.
4405 POST_DECRYPT = 16;
4406 // Represents the start of zygote's init.
4407 // Logged from zygote itself.
4408 ZYGOTE_INIT_START = 17;
4409 // Represents the start of secondary zygote's init.
4410 // TODO: add logging to zygote
4411 SECONDARY_ZYGOTE_INIT_START = 18;
4412 // Represents the start of system server's init.
4413 // Logged from f/b/services/.../SystemServer.java
4414 SYSTEM_SERVER_INIT_START = 19;
4415 // Represents the completion of system server's init.
4416 // Logged from f/b/services/.../SystemServer.java
4417 SYSTEM_SERVER_READY = 20;
4418 // Represents the start of launcher during boot-up.
4419 // TODO: add logging
4420 LAUNCHER_START = 21;
4421 // Represents the completion of launcher's initial rendering. User can use other apps from
4422 // launcher from this point.
4423 // TODO: add logging
4424 LAUNCHER_SHOWN = 22;
4425 }
4426
4427 // Type of the event.
4428 optional ElapsedTimeEvent event = 1;
4429 // Time since bootup for the event.
4430 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4431 optional int64 time_millis = 2;
4432}
4433
4434/**
4435 * Boot time events with UTC time.
4436 *
4437 * Logged from: bootstat and various system server components. Check each enums for details.
4438 */
4439message BootTimeEventUtcTime {
4440 enum UtcTimeEvent {
4441 UNKNOWN = 0;
4442 // Time of the bootstat's marking of 1st boot after the last factory reset.
4443 // Logged from bootstat.
4444 FACTORY_RESET_RESET_TIME = 1;
4445 // The time when bootstat records FACTORY_RESET_* events. This is close to
4446 // BOOT_COMPLETE time for the current bootup.
4447 // Logged from bootstat.
4448 FACTORY_RESET_CURRENT_TIME = 2;
4449 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4450 // Logged from bootstat.
4451 FACTORY_RESET_RECORD_VALUE = 3;
4452 }
4453
4454 // Type of the event.
4455 optional UtcTimeEvent event = 1;
4456 // UTC time for the event.
4457 optional int64 utc_time_secs = 2;
4458}
4459
4460/**
4461 * Boot time events representing specific error code during bootup.
4462 * Meaning of error code can be different per each event type.
4463 *
4464 * Logged from: bootstat and various system server components. Check each enums for details.
4465 */
4466message BootTimeEventErrorCode {
4467 enum ErrorCodeEvent {
4468 UNKNOWN = 0;
4469 // Linux error code for time() call to get the current UTC time.
4470 // Logged from bootstat.
4471 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4472 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4473 // as UMOUNT_STAT_* from init/reboot.cpp.
4474 // Logged from f/b/services/.../BootReceiver.java.
4475 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004476 // Reprepsents fie system mounting error code of /data partition for the current boot.
4477 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004478 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004479 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004480 }
4481
4482 // Type of the event.
4483 optional ErrorCodeEvent event = 1;
4484 // error code defined per each event type.
4485 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4486 // FS_MGR_FS_STAT.
4487 optional int32 error_code = 2;
4488}
4489
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004490/**
4491 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4492 * after an OTA.
4493 *
4494 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004495 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004496 */
4497message SnapshotMergeReported {
4498 // Keep in sync with
4499 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4500 enum UpdateState {
4501 // No update or merge is in progress.
4502 NONE = 0;
4503 // An update is applying; snapshots may already exist.
4504 INITIATED = 1;
4505 // An update is pending, but has not been successfully booted yet.
4506 UNVERIFIED = 2;
4507 // The kernel is merging in the background.
4508 MERGING = 3;
4509 // Post-merge cleanup steps could not be completed due to a transient
4510 // error, but the next reboot will finish any pending operations.
4511 MERGE_NEEDS_REBOOT = 4;
4512 // Merging is complete, and needs to be acknowledged.
4513 MERGE_COMPLETED = 5;
4514 // Merging failed due to an unrecoverable error.
4515 MERGE_FAILED = 6;
4516 // The update was implicitly cancelled, either by a rollback or a flash
4517 // operation via fastboot. This state can only be returned by WaitForMerge.
4518 CANCELLED = 7;
4519 };
4520
4521 // Status of the update after the merge attempts.
4522 optional UpdateState final_state = 1;
4523
4524 // Time to complete a merge operation in milliseconds.
4525 // A negative value corresponds to the case in which the merge operation
4526 // was interrupted and resumed (e.g. in case of a system reboot during the
4527 // merge).
4528 optional int64 duration_millis = 2;
4529
4530 // Number of reboots that occurred after issuing and before completing the
4531 // merge of all the snapshot devices.
4532 optional int32 intermediate_reboots = 3;
4533}
4534
Chenjie Yubbcbc602018-02-05 16:51:52 -08004535//////////////////////////////////////////////////////////////////////
4536// Pulled atoms below this line //
4537//////////////////////////////////////////////////////////////////////
4538
4539/**
David Chenc8a43242017-10-17 16:23:28 -07004540 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4541 *
4542 * Pulled from:
4543 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4544 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004545message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004546 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004547
4548 optional int64 rx_bytes = 2;
4549
4550 optional int64 rx_packets = 3;
4551
4552 optional int64 tx_bytes = 4;
4553
4554 optional int64 tx_packets = 5;
4555}
4556
4557/**
4558 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4559 *
4560 * Pulled from:
4561 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4562 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004563message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004564 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004565
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004566 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4567 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004568
4569 optional int64 rx_bytes = 3;
4570
4571 optional int64 rx_packets = 4;
4572
4573 optional int64 tx_bytes = 5;
4574
4575 optional int64 tx_packets = 6;
4576}
4577
4578/**
4579 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4580 *
4581 * Pulled from:
4582 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004584message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004585 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004586
4587 optional int64 rx_bytes = 2;
4588
4589 optional int64 rx_packets = 3;
4590
4591 optional int64 tx_bytes = 4;
4592
4593 optional int64 tx_packets = 5;
4594}
4595
4596/**
4597 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4598 *
4599 * Pulled from:
4600 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4601 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004602message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004603 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004604
Yao Chenc40a19d2018-03-15 16:48:25 -07004605 // 1 denotes foreground and 0 denotes background. This is called Set in
4606 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004607 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004608
4609 optional int64 rx_bytes = 3;
4610
4611 optional int64 rx_packets = 4;
4612
4613 optional int64 tx_bytes = 5;
4614
4615 optional int64 tx_packets = 6;
4616}
4617
4618/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004619 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4620 *
4621 * Pulled from:
4622 * StatsCompanionService
4623 */
4624message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004625 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004626
4627 optional int64 rx_bytes = 2;
4628
4629 optional int64 tx_bytes = 3;
4630}
4631
4632/**
David Chenc8a43242017-10-17 16:23:28 -07004633 * Pulls the kernel wakelock durations. This atom is adapted from
4634 * android/internal/os/KernelWakelockStats.java
4635 *
4636 * Pulled from:
4637 * StatsCompanionService using KernelWakelockReader.
4638 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004639message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004640 optional string name = 1;
4641
4642 optional int32 count = 2;
4643
4644 optional int32 version = 3;
4645
Yangster-maca8a30442018-10-13 23:46:34 -07004646 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004647}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004648
Chenjie Yu05013b32017-11-21 10:21:41 -08004649/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004650 * Pulls low power state information. If power.stats HAL is not available, this
4651 * includes platform and subsystem sleep state information,
4652 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4653 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004654 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004655 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004656 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4657 * as defined in:
4658 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004659 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004660message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004661 // Subsystem name
4662 optional string subsystem_name = 1;
4663 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4664 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004665 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4666 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004667 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004668 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004669 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004670 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004671 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004672}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004673
Chenjie Yu05013b32017-11-21 10:21:41 -08004674/**
Bookatz92da2832018-11-01 18:10:03 -07004675 * Pulls on-device power measurement information.
4676 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4677 * Pulled from:
4678 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4679 */
4680message OnDevicePowerMeasurement {
4681 // Name of the subsystem (to which the rail belongs).
4682 optional string subsystem_name = 1;
4683
4684 // Rail name. The rail lies within the subsystem.
4685 optional string rail_name = 2;
4686
4687 // Time (in ms since boot) at which the rail energy value was measured.
4688 // This may differ slightly from the time that statsd logs this information.
4689 optional uint64 measurement_timestamp_millis = 3;
4690
4691 // Accumulated energy used via the rail since device boot in uWs.
4692 optional uint64 energy_microwatt_secs = 4;
4693}
4694
4695/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004696 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004697 * Pulls the time the cpu spend on the frequency index. Frequency index
4698 * starts from highest to lowest. The value should be monotonically
4699 * increasing since boot. However, if there is a cpu
4700 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004701 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004702message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004703 optional uint32 cluster = 1;
4704 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004705 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004706}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004707
Chenjie Yu05013b32017-11-21 10:21:41 -08004708/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004709 * Pulls Cpu Time Per Uid.
4710 * Note that isolated process uid time should be attributed to host uids.
4711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004712message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004713 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004714 optional uint64 user_time_micros = 2;
4715 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004716}
4717
4718/**
4719 * Pulls Cpu Time Per Uid per frequency.
4720 * Note that isolated process uid time should be attributed to host uids.
4721 * For each uid, we order the time by descending frequencies.
4722 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004723message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004724 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004725 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004726 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004727}
Hugo Benichi884970e2017-11-14 22:42:46 +09004728
Chenjie Yu05013b32017-11-21 10:21:41 -08004729/**
4730 * Pulls Wifi Controller Activity Energy Info
4731 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004732message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004733 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004734 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004735 // stack reported state
4736 // TODO: replace this with proto enum
4737 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004738 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004739 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004740 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004741 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004742 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004743 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004744 // product of current(mA), voltage(V) and time(ms)
4745 optional uint64 controller_energy_used = 6;
4746}
4747
4748/**
4749 * Pulls Modem Activity Energy Info
4750 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004751message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004752 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004753 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004754 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004755 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004756 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004757 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004758 /**
4759 * Tx power index
4760 * index 0 = tx_power < 0dBm
4761 * index 1 = 0dBm < tx_power < 5dBm
4762 * index 2 = 5dBm < tx_power < 15dBm
4763 * index 3 = 15dBm < tx_power < 20dBm
4764 * index 4 = tx_power > 20dBm
4765 */
4766 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004767 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004768 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004769 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004770 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004771 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004772 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004773 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004774 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004776 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004777 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004778 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004779 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004780}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004781
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004782/**
4783 * Pulls Bluetooth Activity Energy Info
4784 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4785 */
4786message BluetoothActivityInfo {
4787 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004788 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004789 // bluetooth stack state
4790 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004791 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004792 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004793 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004794 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004795 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004796 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004797 // product of current(mA), voltage(V) and time(ms)
4798 optional uint64 energy_used = 6;
4799}
4800
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004801/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004802 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004803 *
4804 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004805 */
4806message ProcessMemoryState {
4807 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004808 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004809
4810 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004811 // Usually package name, "system" for system server.
4812 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004813 optional string process_name = 2;
4814
Rafal Slawikda51b932018-12-13 16:31:33 +00004815 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004816 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004817
4818 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004819 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004820
4821 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004822 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004823
Rajeev Kumar90235992018-01-29 11:06:48 -08004824 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004825 // Value is read from memory.stat, field total_rss if per-app memory
4826 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004827 optional int64 rss_in_bytes = 6;
4828
4829 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004830 // Value is read from memory.stat, field total_cache if per-app memory
4831 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004832 optional int64 cache_in_bytes = 7;
4833
4834 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004835 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004836 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004837 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004838
Rafal Slawik203c3db2019-09-25 19:53:01 +01004839 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004840 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004841
Rafal Slawik203c3db2019-09-25 19:53:01 +01004842 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4843 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004844
Rafal Slawik203c3db2019-09-25 19:53:01 +01004845 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4846 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004847}
4848
4849/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004850 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004851 *
4852 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4853 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004854 *
4855 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004856 */
4857message ProcessMemoryHighWaterMark {
4858 // The uid if available. -1 means not available.
4859 optional int32 uid = 1 [(is_uid) = true];
4860
Rafal Slawikda51b932018-12-13 16:31:33 +00004861 // The process name.
4862 // Usually package name or process cmdline.
4863 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004864 optional string process_name = 2;
4865
Rafal Slawik239b6802019-09-09 18:46:01 +01004866 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4867 // computed by converting kilobytes to bytes.
4868 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4869
Rafal Slawik3bea8952018-11-15 12:39:33 +00004870 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4871 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004872 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004873}
4874
4875/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004876 * Logs the memory stats for a process.
4877 *
4878 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4879 * and for selected native processes.
4880 */
4881message ProcessMemorySnapshot {
4882 // The uid if available. -1 means not available.
4883 optional int32 uid = 1 [(is_uid) = true];
4884
4885 // The process name.
4886 // Usually package name or process cmdline.
4887 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4888 optional string process_name = 2;
4889
4890 // The pid of the process.
4891 // Allows to disambiguate instances of the process.
4892 optional int32 pid = 3;
4893
4894 // The current OOM score adjustment value.
4895 // Read from ProcessRecord for managed processes.
4896 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4897 optional int32 oom_score_adj = 4;
4898
4899 // The current RSS of the process.
4900 // VmRSS from /proc/pid/status.
4901 optional int32 rss_in_kilobytes = 5;
4902
4903 // The current anon RSS of the process.
4904 // RssAnon from /proc/pid/status.
4905 optional int32 anon_rss_in_kilobytes = 6;
4906
4907 // The current swap size of the process.
4908 // VmSwap from /proc/pid/status.
4909 optional int32 swap_in_kilobytes = 7;
4910
4911 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4912 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4913}
4914
4915/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004916 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004917 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004918message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004919 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004920}
4921
4922/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004923 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004924 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004925message SystemUptime {
4926 // Milliseconds since the system was booted.
4927 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4928 // for external input).
4929 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004930 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004931}
4932
4933/*
4934 * Reads from /proc/uid_concurrent_active_time which has the format:
4935 * active: X (X is # cores)
4936 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4937 * [uid1]: [time-0] [time-1] [time-2] ... ...
4938 * ...
4939 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4940 * The file contains a monotonically increasing count of time for a single boot.
4941 */
4942message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004943 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004944 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004945}
4946
4947/**
4948 * Reads from /proc/uid_concurrent_policy_time which has the format:
4949 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4950 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4951 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4952 * ...
4953 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4954 * The file contains a monotonically increasing count of time for a single boot.
4955 */
4956message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004957 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004958 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004959 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004960}
4961
4962/*
4963 * Pulls free disk space, for data, system partition and temporary directory.
4964 */
4965message DiskSpace {
4966 // available bytes in data partition
4967 optional uint64 data_available_bytes = 1;
4968 // available bytes in system partition
4969 optional uint64 system_available_bytes = 2;
4970 // available bytes in download cache or temp directories
4971 optional uint64 temp_available_bytes = 3;
4972}
Tej Singhbf972d92018-01-10 20:51:13 -08004973
4974/**
4975 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004976 *
4977 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004978 */
4979message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004980 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004981}
4982
4983/**
4984 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004985 * Pulled from:
4986 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004987 */
4988message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004989 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004990}
4991
4992/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004993 * Pulls battery voltage.
4994 * Pulled from:
4995 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4996 */
4997message BatteryVoltage {
4998 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004999 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005000}
5001
5002/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005003 * Pulls battery level (percent full, from 0 to 100).
5004 *
5005 * Pulled from:
5006 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5007 */
5008message BatteryLevel {
5009 // Battery level. Should be in [0, 100].
5010 optional int32 battery_level = 1;
5011}
5012
5013/**
Tej Singhd89137e2018-03-26 14:51:40 -07005014 * Pulls the temperature of various parts of the device.
5015 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005016 *
Maggie White442b6312019-04-05 16:26:44 -07005017 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005018 */
5019message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005020 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005021 optional android.os.TemperatureTypeEnum sensor_location = 1;
5022
5023 // The name of the temperature source. Eg. CPU0
5024 optional string sensor_name = 2;
5025
Tej Singhd89137e2018-03-26 14:51:40 -07005026 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005027 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005028 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005029
5030 // Relative severity of the throttling, see enum definition.
5031 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005032}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005033
5034/**
5035 * Pulls the statistics of calls to Binder.
5036 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005037 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5038 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005039 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005040 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005041 */
5042message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005043 // UID of the process responsible for the binder transaction. It will be set if the process
5044 // executing the binder transaction attribute the transaction to another uid using
5045 // Binder.setThreadWorkSource().
5046 //
5047 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005048 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005049 // UID of the process executing the binder transaction.
5050 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005051 // Fully qualified class name of the API call.
5052 //
5053 // This is a system server class name.
5054 //
5055 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5056 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5057 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5058 // commonly used APIs.
5059 optional string service_class_name = 2;
5060 // Method name of the API call. It can also be a transaction code if we cannot
5061 // resolve it to a name. See Binder#getTransactionName.
5062 //
5063 // This is a system server method name.
5064 optional string service_method_name = 3;
5065 // Total number of API calls.
5066 optional int64 call_count = 4;
5067 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5068 optional bool screen_interactive = 13;
5069 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5070 // call_count will be equal to recorded_call_count.
5071 //
5072 // If recorded_call_count is different than call_count, it means data collection has been
5073 // sampled. All the fields below will be sampled in this case.
5074 optional int64 recorded_call_count = 12;
5075 // Number of exceptions thrown by the API.
5076 optional int64 recorded_exception_count = 5;
5077 // Total latency of all API calls.
5078 // Average can be computed using total_latency_micros / recorded_call_count.
5079 optional int64 recorded_total_latency_micros = 6;
5080 // Maximum latency of one API call.
5081 optional int64 recorded_max_latency_micros = 7;
5082 // Total CPU usage of all API calls.
5083 // Average can be computed using total_cpu_micros / recorded_call_count.
5084 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5085 optional int64 recorded_total_cpu_micros = 8;
5086 // Maximum CPU usage of one API call.
5087 optional int64 recorded_max_cpu_micros = 9;
5088 // Maximum parcel reply size of one API call.
5089 optional int64 recorded_max_reply_size_bytes = 10;
5090 // Maximum parcel request size of one API call.
5091 optional int64 recorded_max_request_size_bytes = 11;
5092}
5093
5094/**
5095 * Pulls the statistics of exceptions during calls to Binder.
5096 *
5097 * Binder stats are cumulative from boot unless somebody reset the data using
5098 * > adb shell dumpsys binder_calls_stats --reset
5099 */
5100message BinderCallsExceptions {
5101 // Exception class name, e.g. java.lang.IllegalArgumentException.
5102 //
5103 // This is an exception class name thrown by the system server.
5104 optional string exception_class_name = 1;
5105 // Total number of exceptions.
5106 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005107}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005108
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005109/**
5110 * Pulls the statistics of message dispatching on HandlerThreads.
5111 *
5112 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5113 * config on the device.
5114 *
5115 * Next tag: 11
5116 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005117message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005118 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005119 optional int32 uid = 1 [(is_uid) = true];
5120
5121 // Fully qualified class name of the handler target class.
5122 //
5123 // This field does not contain PII. This is a system server class name.
5124 optional string handler_class_name = 2;
5125
5126 // The name of the thread that runs the Looper.
5127 //
5128 // This field does not contain PII. This is a system server thread name.
5129 optional string looper_thread_name = 3;
5130
5131 // The name of the dispatched message.
5132 //
5133 // This field does not contain PII. This is a system server constant or class
5134 // name.
5135 optional string message_name = 4;
5136
5137 // Total number of successfully dispatched messages.
5138 optional int64 message_count = 5;
5139
5140 // Total number of messages that failed dispatching.
5141 optional int64 exception_count = 6;
5142
5143 // Total number of processed messages we have data recorded for. If we
5144 // collected data for all the messages, message_count will be equal to
5145 // recorded_message_count.
5146 //
5147 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005148 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005149 optional int64 recorded_message_count = 7;
5150
5151 // Total latency of all processed messages.
5152 // Average can be computed using recorded_total_latency_micros /
5153 // recorded_message_count.
5154 optional int64 recorded_total_latency_micros = 8;
5155
5156 // Total CPU usage of all processed message.
5157 // Average can be computed using recorded_total_cpu_micros /
5158 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005159 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005160 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005161
5162 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5163 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005164
5165 // Max recorded CPU usage of all processed messages.
5166 optional int64 recorded_max_cpu_micros = 11;
5167
5168 // Max recorded latency of all processed messages.
5169 optional int64 recorded_max_latency_micros = 12;
5170
5171 // Total number of messages we tracked the dispatching delay for. If we
5172 // collected data for all the messages, message_count will be equal to
5173 // recorded_delay_message_count.
5174 //
5175 // If recorded_delay_message_count is different than message_count, it means data
5176 // collection has been sampled or/and not all messages specified the target dispatch time.
5177 // The fields below will be sampled in this case.
5178 optional int64 recorded_delay_message_count = 13;
5179
5180 // Total dispatching delay of all processed messages.
5181 // Calculated as a difference between the target dispatching time (Message.when)
5182 // and the actual dispatching time.
5183 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5184 optional int64 recorded_total_delay_millis = 14;
5185
5186 // Max dispatching delay of all processed messages.
5187 // Calculated as a difference between the target dispatching time (Message.when)
5188 // and the actual dispatching time.
5189 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005190}
Tej Singh86dc9db2018-09-06 00:39:57 +00005191
5192/**
5193 * Pulls disk information, such as write speed and latency.
5194 */
5195message DiskStats {
5196 // Time taken to open, write 512B to, and close a file.
5197 // -1 if error performing the check.
5198 optional int64 data_write_latency_millis = 1;
5199
5200 optional bool file_based_encryption = 2;
5201
5202 // Recent disk write speed in kB/s.
5203 // -1 if error querying storageed.
5204 // 0 if data is unavailable.
5205 optional int32 recent_disk_write_speed = 3;
5206}
5207
5208
5209/**
5210 * Free and total bytes of the Data, Cache, and System partition.
5211 */
5212message DirectoryUsage {
5213 enum Directory {
5214 UNKNOWN = 0;
5215 DATA = 1;
5216 CACHE = 2;
5217 SYSTEM = 3;
5218 }
5219 optional Directory directory = 1;
5220 optional int64 free_bytes = 2;
5221 optional int64 total_bytes = 3;
5222}
5223
5224
5225/**
5226 * Size of an application: apk size, data size, and cache size.
5227 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5228 * Information is only reported for apps with the primary user (user 0).
5229 * Sizes are aggregated by package name.
5230 */
5231message AppSize {
5232 // Including uids will involve modifying diskstats logic.
5233 optional string package_name = 1;
5234 // App size in bytes. -1 if unavailable.
5235 optional int64 app_size_bytes = 2;
5236 // App data size in bytes. -1 if unavailable.
5237 optional int64 app_data_size_bytes = 3;
5238 // App cache size in bytes. -1 if unavailable.
5239 optional int64 app_cache_size_bytes = 4;
5240 // Time that the cache file was produced.
5241 // Uses System.currentTimeMillis(), which is wall clock time.
5242 optional int64 cache_time_millis = 5;
5243}
5244
5245
5246/**
5247 * Size of a particular category. Eg: photos, videos.
5248 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5249 */
5250message CategorySize {
5251 enum Category {
5252 UNKNOWN = 0;
5253 APP_SIZE = 1;
5254 APP_DATA_SIZE = 2;
5255 APP_CACHE_SIZE = 3;
5256 PHOTOS = 4;
5257 VIDEOS = 5;
5258 AUDIO = 6;
5259 DOWNLOADS = 7;
5260 SYSTEM = 8;
5261 OTHER = 9;
5262 }
5263 optional Category category = 1;
5264 // Category size in bytes.
5265 optional int64 size_bytes = 2;
5266 // Time that the cache file was produced.
5267 // Uses System.currentTimeMillis(), which is wall clock time.
5268 optional int64 cache_time_millis = 3;
5269}
Tej Singhd6d6d772018-09-05 17:41:25 -07005270
5271/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005272 * Pulls per uid I/O stats. The stats are cumulative since boot.
5273 *
5274 * Read/write bytes are I/O events from a storage device
5275 * Read/write chars are data requested by read/write syscalls, and can be
5276 * satisfied by caching.
5277 *
5278 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5279 */
5280message DiskIo {
5281 optional int32 uid = 1 [(is_uid) = true];
5282 optional int64 fg_chars_read = 2;
5283 optional int64 fg_chars_write = 3;
5284 optional int64 fg_bytes_read = 4;
5285 optional int64 fg_bytes_write = 5;
5286 optional int64 bg_chars_read = 6;
5287 optional int64 bg_chars_write = 7;
5288 optional int64 bg_bytes_read = 8;
5289 optional int64 bg_bytes_write = 9;
5290 optional int64 fg_fsync = 10;
5291 optional int64 bg_fsync= 11;
5292}
5293
5294
5295/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005296 * Pulls the number of fingerprints for each user.
5297 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005298 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005299 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005300message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005301 // The associated user. Eg: 0 for owners, 10+ for others.
5302 // Defined in android/os/UserHandle.java
5303 optional int32 user = 1;
5304 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005305 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005306}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005307
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005308/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005309 * Pulls the number of faces for each user.
5310 *
5311 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5312 */
5313message NumFacesEnrolled {
5314 // The associated user. Eg: 0 for owners, 10+ for others.
5315 // Defined in android/os/UserHandle.java
5316 optional int32 user = 1;
5317 // Number of faces registered to that user.
5318 optional int32 num_faces_enrolled = 2;
5319}
5320/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005321 * A mapping of role holder -> role
5322 */
5323message RoleHolder {
5324 // uid of the role holder
5325 optional int32 uid = 1 [(is_uid) = true];
5326
5327 // package name of the role holder
5328 optional string package_name = 2;
5329
5330 // the role held
5331 optional string role = 3;
5332}
5333
Yangsteraf9aee72018-10-12 09:26:16 -07005334message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005335 // These are all in byte resolution.
5336 optional int64 min = 1 [deprecated = true];
5337 optional int64 average = 2 [deprecated = true];
5338 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005339
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005340 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5341 // int64 fields.
5342 optional int32 mean_kb = 4;
5343 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005344}
5345
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005346// A reduced subset of process states; reducing the number of possible states allows more
5347// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5348enum ProcessStateAggregated {
5349 PROCESS_STATE_UNKNOWN = 0;
5350 // Persistent system process.
5351 PROCESS_STATE_PERSISTENT = 1;
5352 // Top activity; actually any visible activity.
5353 PROCESS_STATE_TOP = 2;
5354 // Process binding to top or a foreground service.
5355 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5356 // Processing running a foreground service.
5357 PROCESS_STATE_FGS = 4;
5358 // Important foreground process (ime, wallpaper, etc).
5359 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5360 // Important background process.
5361 PROCESS_STATE_BACKGROUND = 6;
5362 // Process running a receiver.
5363 PROCESS_STATE_RECEIVER = 7;
5364 // All kinds of cached processes.
5365 PROCESS_STATE_CACHED = 8;
5366}
5367
5368// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005369message ProcessStatsStateProto {
5370 optional android.service.procstats.ScreenState screen_state = 1;
5371
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005372 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005373
5374 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5375 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005376 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5377
5378 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005379
5380 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005381 optional int64 duration_millis = 4 [deprecated = true];
5382 // Same as above, but with minute resolution so it fits into an int32.
5383 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005384
5385 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005386 optional int64 realtime_duration_millis = 9 [deprecated = true];
5387 // Same as above, but with minute resolution so it fits into an int32.
5388 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005389
5390 // # of samples taken
5391 optional int32 sample_size = 5;
5392
5393 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005394 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005395
5396 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005397 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005398
5399 // RSS is memory resident for this process
5400 optional AggStats rss = 8;
5401}
5402
5403// Next Tag: 7
5404message ProcessStatsProto {
5405 // Name of process.
5406 optional string process = 1;
5407
5408 // Uid of the process.
5409 optional int32 uid = 2;
5410
5411 // Information about how often kills occurred
5412 message Kill {
5413 // Count of excessive CPU kills
5414 optional int32 cpu = 1;
5415
5416 // Count of kills when cached
5417 optional int32 cached = 2;
5418
5419 // PSS stats during cached kill
5420 optional AggStats cached_pss = 3;
5421 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005422 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005423
5424 // Time and memory spent in various states.
5425 repeated ProcessStatsStateProto states = 5;
5426
5427 // Total time process has been running... screen_state, memory_state, and process_state
5428 // will not be set.
5429 optional ProcessStatsStateProto total_running_state = 6;
5430}
5431
5432message PackageServiceOperationStatsProto {
5433 // Operate enum: Started, Foreground, Bound, Executing
5434 optional android.service.procstats.ServiceOperationState operation = 1;
5435
5436 // Number of times the service was in this operation.
5437 optional int32 count = 2;
5438
5439 // Information about a state the service can be in.
5440 message StateStats {
5441 // Screen state enum.
5442 optional android.service.procstats.ScreenState screen_state = 1;
5443 // Memory state enum.
5444 optional android.service.procstats.MemoryState memory_state = 2;
5445
5446 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005447 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005448 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005449 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005450 }
5451 repeated StateStats state_stats = 3;
5452}
5453
5454message PackageServiceStatsProto {
5455 // Name of service component.
5456 optional string service_name = 1;
5457
5458 // The operation stats.
5459 // The package_name, package_uid, package_version, service_name will not be set to save space.
5460 repeated PackageServiceOperationStatsProto operation_stats = 2;
5461}
5462
5463message PackageAssociationSourceProcessStatsProto {
5464 // Uid of the process.
5465 optional int32 process_uid = 1;
5466 // Process name.
5467 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005468 // Package name.
5469 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005470 // Total count of the times this association appeared.
5471 optional int32 total_count = 3;
5472
5473 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005474 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005475
5476 // Total count of the times this association became actively impacting its target process.
5477 optional int32 active_count = 5;
5478
5479 // Information on one source in this association.
5480 message StateStats {
5481 // Process state enum.
5482 optional android.service.procstats.ProcessState process_state = 1;
5483 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005484 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005485 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005486 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005487 }
5488 repeated StateStats active_state_stats = 6;
5489}
5490
5491message PackageAssociationProcessStatsProto {
5492 // Name of the target component.
5493 optional string component_name = 1;
5494 // Information on one source in this association.
5495 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5496}
5497
5498
5499message ProcessStatsPackageProto {
5500 // Name of package.
5501 optional string package = 1;
5502
5503 // Uid of the package.
5504 optional int32 uid = 2;
5505
5506 // Version of the package.
5507 optional int64 version = 3;
5508
5509 // Stats for each process running with the package loaded in to it.
5510 repeated ProcessStatsProto process_stats = 4;
5511
5512 // Stats for each of the package's services.
5513 repeated PackageServiceStatsProto service_stats = 5;
5514
5515 // Stats for each association with the package.
5516 repeated PackageAssociationProcessStatsProto association_stats = 6;
5517}
5518
5519message ProcessStatsSectionProto {
5520 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005521 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005522
5523 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005524 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005525
5526 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005527 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005528
5529 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005530 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005531
5532 // System runtime library. e.g. "libdvm.so", "libart.so".
5533 optional string runtime = 5;
5534
5535 // whether kernel reports swapped pss.
5536 optional bool has_swapped_pss = 6;
5537
5538 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5539 enum Status {
5540 STATUS_UNKNOWN = 0;
5541 STATUS_COMPLETE = 1;
5542 STATUS_PARTIAL = 2;
5543 STATUS_SHUTDOWN = 3;
5544 STATUS_SYSPROPS = 4;
5545 }
5546 repeated Status status = 7;
5547
Chenjie Yub2ecc792019-01-17 10:27:26 -08005548 // Number of pages available of various types and sizes, representation fragmentation.
5549 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5550
Yangsteraf9aee72018-10-12 09:26:16 -07005551 // Stats for each process.
5552 repeated ProcessStatsProto process_stats = 8;
5553
5554 // Stats for each package.
5555 repeated ProcessStatsPackageProto package_stats = 9;
5556}
5557
Chenjie Yub2ecc792019-01-17 10:27:26 -08005558message ProcessStatsAvailablePagesProto {
5559 // Node these pages are in (as per /proc/pagetypeinfo)
5560 optional int32 node = 1;
5561
5562 // Zone these pages are in (as per /proc/pagetypeinfo)
5563 optional string zone = 2;
5564
5565 // Label for the type of these pages (as per /proc/pagetypeinfo)
5566 optional string label = 3;
5567
5568 // Distribution of number of pages available by order size. First entry in array is
5569 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5570 repeated int32 pages_per_order = 4;
5571}
5572
Chenjie Yu12e5e672018-09-14 15:54:59 -07005573/**
5574 * Pulled from ProcessStatsService.java
5575 */
5576message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005577 optional ProcessStatsSectionProto proc_stats_section = 1;
5578}
5579
Chenjie Yuf910b7802019-01-11 16:08:20 -08005580/**
5581 * Pulled from ProcessStatsService.java
5582 */
5583message ProcStatsPkgProc {
5584 optional ProcessStatsSectionProto proc_stats_section = 1;
5585}
5586
Chris Wrencdea3b72019-11-22 16:58:17 -05005587// Next Tag: 2
5588message PackageRemoteViewInfoProto {
5589 optional string package_name = 1;
5590 // add per-package additional info here (like channels)
5591}
5592
5593// Next Tag: 2
5594message NotificationRemoteViewsProto {
5595 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5596}
5597
5598/**
5599 * Pulled from NotificationManagerService.java
5600 */
5601message NotificationRemoteViews {
5602 optional NotificationRemoteViewsProto notification_remote_views = 1;
5603}
5604
Yotam Aron74299972020-01-16 16:20:58 +02005605/**
5606 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5607 */
5608message PackageNotificationPreferences {
5609 // Uid under which the package is installed.
5610 optional int32 uid = 1;
5611 // Notification importance, which specifies when and how a notification is displayed.
5612 // Specified under core/java/android/app/NotificationManager.java.
5613 optional int32 importance = 2;
5614 // Lockscreen visibility as set by the user.
5615 optional int32 visibility = 3;
5616 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5617 // PreferencesHelper.java)
5618 optional int32 user_locked_fields = 4;
5619}
5620
5621/**
5622 * Atom that contains a list of a package's channel preferences, pulled from
5623 * NotificationManagerService.java.
5624 */
5625message PackageNotificationChannelPreferences {
5626 // Uid under which the package is installed.
5627 optional int32 uid = 1;
5628 // Channel's ID. Should always be available.
5629 optional string channel_id = 2;
5630 // Channel's name. Should always be available.
5631 optional string channel_name = 3;
5632 // Channel's description. Optionally set by the channel creator.
5633 optional string description = 4;
5634 // Notification importance, which specifies when and how a notification is displayed. Specified
5635 // under core/java/android/app/NotificationManager.java.
5636 optional int32 importance = 5;
5637 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5638 // at core/java/android/app/NotificationChannel.java
5639 optional int32 user_locked_fields = 6;
5640 // Indicates if the channel was deleted by the app.
5641 optional bool is_deleted = 7;
5642}
5643
5644/**
5645 * Atom that contains a list of a package's channel group preferences, pulled from
5646 * NotificationManagerService.java.
5647 */
5648message PackageNotificationChannelGroupPreferences {
5649 // Uid under which the package is installed.
5650 optional int32 uid = 1;
5651 // Channel Group's ID. Should always be available.
5652 optional string group_id = 2;
5653 // Channel Group's name. Should always be available.
5654 optional string group_name = 3;
5655 // Channel Group's description. Optionally set by group creator.
5656 optional string description = 4;
5657 // Indicates if notifications from this channel group are blocked.
5658 optional bool is_blocked = 5;
5659 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5660 // at core/java/android/app/NotificationChannelGroup.java
5661 optional int32 user_locked_fields = 6;
5662}
5663
Yangsteraf9aee72018-10-12 09:26:16 -07005664message PowerProfileProto {
5665 optional double cpu_suspend = 1;
5666
5667 optional double cpu_idle = 2;
5668
5669 optional double cpu_active = 3;
5670
5671 message CpuCluster {
5672 optional int32 id = 1;
5673 optional double cluster_power = 2;
5674 optional int32 cores = 3;
5675 repeated int64 speed = 4;
5676 repeated double core_power = 5;
5677 }
5678
5679 repeated CpuCluster cpu_cluster = 40;
5680
5681 optional double wifi_scan = 4;
5682
5683 optional double wifi_on = 5;
5684
5685 optional double wifi_active = 6;
5686
5687 optional double wifi_controller_idle = 7;
5688
5689 optional double wifi_controller_rx = 8;
5690
5691 optional double wifi_controller_tx = 9;
5692
5693 repeated double wifi_controller_tx_levels = 10;
5694
5695 optional double wifi_controller_operating_voltage = 11;
5696
5697 optional double bluetooth_controller_idle = 12;
5698
5699 optional double bluetooth_controller_rx = 13;
5700
5701 optional double bluetooth_controller_tx = 14;
5702
5703 optional double bluetooth_controller_operating_voltage = 15;
5704
5705 optional double modem_controller_sleep = 16;
5706
5707 optional double modem_controller_idle = 17;
5708
5709 optional double modem_controller_rx = 18;
5710
5711 repeated double modem_controller_tx = 19;
5712
5713 optional double modem_controller_operating_voltage = 20;
5714
5715 optional double gps_on = 21;
5716
5717 repeated double gps_signal_quality_based = 22;
5718
5719 optional double gps_operating_voltage = 23;
5720
5721 optional double bluetooth_on = 24;
5722
5723 optional double bluetooth_active = 25;
5724
5725 optional double bluetooth_at_cmd = 26;
5726
5727 optional double ambient_display = 27;
5728
5729 optional double screen_on = 28;
5730
5731 optional double radio_on = 29;
5732
5733 optional double radio_scanning = 30;
5734
5735 optional double radio_active = 31;
5736
5737 optional double screen_full = 32;
5738
5739 optional double audio = 33;
5740
5741 optional double video = 34;
5742
5743 optional double flashlight = 35;
5744
5745 optional double memory = 36;
5746
5747 optional double camera = 37;
5748
5749 optional double wifi_batched_scan = 38;
5750
5751 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005752}
Chenjie Yuab530202018-09-26 12:39:20 -07005753
5754/**
5755 * power_profile.xml and other constants for power model calculations.
5756 * Pulled from PowerProfile.java
5757 */
5758message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005759 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005760}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005761
5762/**
arangelovd5db50e2018-10-12 20:24:39 +01005763 * Logs when a user restriction was added or removed.
5764 *
5765 * Logged from:
5766 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5767 */
5768message UserRestrictionChanged {
5769 // The raw string of the user restriction as defined in UserManager.
5770 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5771 optional string restriction = 1;
5772 // Whether the restriction is enabled or disabled.
5773 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005774}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005775
5776/**
5777 * Pulls process user time and system time. Puller takes a snapshot of all pids
5778 * in the system and returns cpu stats for those that are working at the time.
5779 * Dead pids will be dropped. Kernel processes are excluded.
5780 * Min cool-down is 5 sec.
5781 */
5782message ProcessCpuTime {
5783 optional int32 uid = 1 [(is_uid) = true];
5784
5785 optional string process_name = 2;
5786 // Process cpu time in user space, cumulative from boot/process start
5787 optional int64 user_time_millis = 3;
5788 // Process cpu time in system space, cumulative from boot/process start
5789 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005790}
Misha Wagner5a51e002018-10-03 15:04:09 +01005791
5792/**
5793 * Pulls the CPU usage for each thread.
5794 *
5795 * Read from /proc/$PID/task/$TID/time_in_state files.
5796 *
5797 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5798 * time_in_state files not being present on some phones, have not been addressed. These should be
5799 * considered before a public release.
5800 */
5801message CpuTimePerThreadFreq {
5802 // UID that owns the process.
5803 optional int32 uid = 1 [(is_uid) = true];
5804 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005805 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005806 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005807 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005808 // Name of the process taken from `/proc/$PID/cmdline`.
5809 optional string process_name = 4;
5810 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5811 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005812
5813 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5814 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5815 // frequencies are given here as the alternative is sending eight separate atoms. This method
5816 // significantly reduces the amount of data created
5817 optional int32 frequency1_khz = 6;
5818 optional int32 time1_millis = 7;
5819 optional int32 frequency2_khz = 8;
5820 optional int32 time2_millis = 9;
5821 optional int32 frequency3_khz = 10;
5822 optional int32 time3_millis = 11;
5823 optional int32 frequency4_khz = 12;
5824 optional int32 time4_millis = 13;
5825 optional int32 frequency5_khz = 14;
5826 optional int32 time5_millis = 15;
5827 optional int32 frequency6_khz = 16;
5828 optional int32 time6_millis = 17;
5829 optional int32 frequency7_khz = 18;
5830 optional int32 time7_millis = 19;
5831 optional int32 frequency8_khz = 20;
5832 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005833}
Bookatz75ee60422018-11-09 12:27:37 -08005834
5835/**
Bookatz366a4432018-11-20 09:42:33 -08005836 * Pulls information about the device's build.
5837 */
5838message BuildInformation {
5839 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5840 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5841 optional string fingerprint = 1;
5842
5843 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5844 optional string brand = 2;
5845
5846 // Build.PRODUCT. The name of the overall product.
5847 optional string product = 3;
5848
5849 // Build.DEVICE. The name of the industrial design.
5850 optional string device = 4;
5851
5852 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5853 optional string version_release = 5;
5854
5855 // Build.ID. E.g. a label like "M4-rc20".
5856 optional string id = 6;
5857
5858 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5859 // represent this build.
5860 optional string version_incremental = 7;
5861
5862 // Build.TYPE. The type of build, like "user" or "eng".
5863 optional string type = 8;
5864
5865 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5866 optional string tags = 9;
5867}
5868
5869/**
Adam He420947c2019-01-23 15:59:09 -08005870 * Logs information about mismatched caller for content capture.
5871 *
5872 * Logged from:
5873 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5874 */
5875message ContentCaptureCallerMismatchReported {
5876 optional string intended_package = 1;
5877 optional string calling_package = 2;
5878}
5879
5880/**
5881 * Logs information about content capture service events.
5882 *
5883 * Logged from:
5884 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5885 */
5886message ContentCaptureServiceEvents {
5887 // The type of event.
5888 enum Event {
5889 UNKNOWN = 0;
5890 ON_CONNECTED = 1;
5891 ON_DISCONNECTED = 2;
5892 SET_WHITELIST = 3;
5893 SET_DISABLED = 4;
5894 ON_USER_DATA_REMOVED = 5;
5895 }
5896 optional Event event = 1;
5897 // component/package of content capture service.
5898 optional string service_info = 2;
5899 // component/package of target.
5900 // it's a concatenated list of component/package for SET_WHITELIST event
5901 // separated by " ".
5902 optional string target_info = 3;
5903}
5904
5905/**
5906 * Logs information about content capture session events.
5907 *
5908 * Logged from:
5909 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5910 */
5911message ContentCaptureSessionEvents {
5912 // The type of event.
5913 enum Event {
5914 UNKNOWN = 0;
5915 ON_SESSION_STARTED = 1;
5916 ON_SESSION_FINISHED = 2;
5917 SESSION_NOT_CREATED = 3;
5918 }
5919 optional int32 session_id = 1;
5920 optional Event event = 2;
5921 // (n/a on session finished)
5922 optional int32 state_flags = 3;
5923 // component/package of content capture service.
5924 optional string service_info = 4;
5925 // component/package of app.
5926 // (n/a on session finished)
5927 optional string app_info = 5;
5928 optional bool is_child_session = 6;
5929}
5930
5931/**
5932 * Logs information about session being flushed.
5933 *
5934 * Logged from:
5935 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5936 */
5937message ContentCaptureFlushed {
5938 optional int32 session_id = 1;
5939 // component/package of content capture service.
5940 optional string service_info = 2;
5941 // component/package of app.
5942 optional string app_info = 3;
5943 // session start/finish events
5944 optional int32 child_session_started = 4;
5945 optional int32 child_session_finished = 5;
5946 // count of view events.
5947 optional int32 view_appeared_count = 6;
5948 optional int32 view_disappeared_count = 7;
5949 optional int32 view_text_changed_count = 8;
5950
5951 // Flush stats.
5952 optional int32 max_events = 9;
5953 optional int32 idle_flush_freq = 10;
5954 optional int32 text_flush_freq = 11;
5955 optional int32 flush_reason = 12;
5956}
5957
5958/**
Bookatz75ee60422018-11-09 12:27:37 -08005959 * Pulls on-device BatteryStats power use calculations for the overall device.
5960 */
5961message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005962 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5963 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5964 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5965 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005966}
5967
5968/**
5969 * Pulls on-device BatteryStats power use calculations broken down by uid.
5970 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5971 * that is attributed to non-uid items. They must all be included to get the total power use.
5972 */
5973message DeviceCalculatedPowerBlameUid {
5974 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5975 optional int32 uid = 1 [(is_uid) = true];
5976
Bookatz3dbc13a2018-12-21 12:16:51 -08005977 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5978 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5979 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005980}
5981
5982/**
5983 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5984 * drain type.
5985 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5986 * is attributed uids. They must all be included to get the total power use.
5987 */
5988message DeviceCalculatedPowerBlameOther {
5989 // The type of item whose power use is being reported.
5990 enum DrainType {
5991 AMBIENT_DISPLAY = 0;
5992 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5993 BLUETOOTH = 2;
5994 CAMERA = 3;
5995 // Cell-standby
5996 CELL = 4;
5997 FLASHLIGHT = 5;
5998 IDLE = 6;
5999 MEMORY = 7;
6000 // Amount that total computed drain exceeded the drain estimated using the
6001 // battery level changes and capacity.
6002 OVERCOUNTED = 8;
6003 PHONE = 9;
6004 SCREEN = 10;
6005 // Amount that total computed drain was below the drain estimated using the
6006 // battery level changes and capacity.
6007 UNACCOUNTED = 11;
6008 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6009 WIFI = 13;
6010 }
6011 optional DrainType drain_type = 1;
6012
Bookatz3dbc13a2018-12-21 12:16:51 -08006013 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6014 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6015 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006016}
arangelov4e994062018-11-13 16:12:38 +00006017
6018/**
6019 * Logs device policy features.
6020 *
6021 * Logged from:
6022 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6023 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6024 */
6025message DevicePolicyEvent {
6026 // The event id - unique for each event.
6027 optional android.stats.devicepolicy.EventId event_id = 1;
6028 // The admin package name.
6029 optional string admin_package_name = 2;
6030 // A generic integer parameter.
6031 optional int32 integer_value = 3;
6032 // A generic boolean parameter.
6033 optional bool boolean_value = 4;
6034 // A parameter specifying a time period in milliseconds.
6035 optional uint64 time_period_millis = 5;
6036 // A parameter specifying a list of package names, bundle extras or string parameters.
6037 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6038}
shawnlinea5b66b2018-11-13 15:05:29 +08006039
6040/**
6041 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6042 *
6043 * Logged from:
6044 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6045 */
6046message DocsUILaunchReported {
6047 optional android.stats.docsui.LaunchAction launch_action = 1;
6048 optional bool has_initial_uri = 2;
6049 optional android.stats.docsui.MimeType mime_type = 3;
6050 optional android.stats.docsui.Root initial_root = 4;
6051}
6052
6053/**
6054 * Logs root/app visited event in file managers/picker. Call this when the user
6055 * taps on root/app in hamburger menu.
6056 *
6057 * Logged from:
6058 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6059 */
6060message DocsUIRootVisitedReported {
6061 optional android.stats.docsui.ContextScope scope = 1;
6062 optional android.stats.docsui.Root root = 2;
6063}
6064
6065/**
6066 * Logs file operation stats. Call this when a file operation has completed.
6067 *
6068 * Logged from:
6069 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6070 */
6071message DocsUIFileOperationReported {
6072 optional android.stats.docsui.Provider provider = 1;
6073 optional android.stats.docsui.FileOperation file_op = 2;
6074}
6075
6076/**
6077 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6078 * mode.
6079 *
6080 * Logged from:
6081 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6082 */
6083message DocsUIFileOperationCopyMoveModeReported {
6084 optional android.stats.docsui.FileOperation file_op = 1;
6085 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6086}
6087
6088
6089/**
6090 * Logs file sub operation stats. Call this when a file operation has failed.
6091 *
6092 * Logged from:
6093 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6094 */
6095message DocsUIFileOperationFailureReported {
6096 optional android.stats.docsui.Authority authority = 1;
6097 optional android.stats.docsui.SubFileOperation sub_op = 2;
6098}
6099
6100/**
6101* Logs the cancellation of a file operation. Call this when a job is canceled
6102*
6103* Logged from:
6104* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6105*/
6106message DocsUIFileOperationCanceledReported {
6107 optional android.stats.docsui.FileOperation file_op = 1;
6108}
6109
6110/**
6111 * Logs startup time in milliseconds.
6112 *
6113 * Logged from:
6114 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6115 */
6116message DocsUIStartupMsReported {
6117 optional int32 startup_millis = 1;
6118}
6119
6120/**
6121 * Logs the action that was started by user.
6122 *
6123 * Logged from:
6124 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6125 */
6126message DocsUIUserActionReported {
6127 optional android.stats.docsui.UserAction action = 1;
6128}
6129
6130/**
6131 * Logs the invalid type when invalid scoped access is requested.
6132 *
6133 * Logged from:
6134 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6135 */
6136message DocsUIInvalidScopedAccessRequestReported {
6137 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006138}
Ben Murdochbab399f62018-12-06 11:01:38 +00006139
6140/**
shawnlina75e82d2019-01-07 10:31:12 +08006141 * Logs the package name that launches docsui picker mode.
6142 *
6143 * Logged from:
6144 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6145 */
6146message DocsUIPickerLaunchedFromReported {
6147 optional string package_name = 1;
6148}
6149
6150/**
6151 * Logs the search type.
6152 *
6153 * Logged from:
6154 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6155 */
6156message DocsUISearchTypeReported {
6157 optional android.stats.docsui.SearchType search_type = 1;
6158}
6159
6160/**
6161 * Logs the search mode.
6162 *
6163 * Logged from:
6164 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6165 */
6166message DocsUISearchModeReported {
6167 optional android.stats.docsui.SearchMode search_mode = 1;
6168}
6169
6170/**
6171 * Logs the pick result information.
6172 *
6173 * Logged from:
6174 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6175 */
6176message DocsUIPickResultReported {
6177 optional int32 total_action_count = 1;
6178 optional int64 duration_millis = 2;
6179 optional int32 file_count= 3;
6180 optional bool is_searching = 4;
6181 optional android.stats.docsui.Root picked_from = 5;
6182 optional android.stats.docsui.MimeType mime_type = 6;
6183 optional int32 repeatedly_pick_times = 7;
6184}
6185
6186/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006187 * Logs when an app's memory is compacted.
6188 *
6189 * Logged from:
6190 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6191 */
6192message AppCompacted {
6193 // The pid of the process being compacted.
6194 optional int32 pid = 1;
6195
6196 // The name of the process being compacted.
6197 optional string process_name = 2;
6198
6199 // The type of compaction.
6200 enum Action {
6201 UNKNOWN = 0;
6202 SOME = 1;
6203 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006204 PERSISTENT = 3;
6205 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006206 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006207 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006208
6209 // Total RSS in kilobytes consumed by the process prior to compaction.
6210 optional int64 before_rss_total_kilobytes = 4;
6211
6212 // File RSS in kilobytes consumed by the process prior to compaction.
6213 optional int64 before_rss_file_kilobytes = 5;
6214
6215 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6216 optional int64 before_rss_anon_kilobytes = 6;
6217
6218 // Swap in kilobytes consumed by the process prior to compaction.
6219 optional int64 before_swap_kilobytes = 7;
6220
6221 // Total RSS in kilobytes consumed by the process after compaction.
6222 optional int64 after_rss_total_kilobytes = 8;
6223
6224 // File RSS in kilobytes consumed by the process after compaction.
6225 optional int64 after_rss_file_kilobytes = 9;
6226
6227 // Anonymous RSS in kilobytes consumed by the process after compaction.
6228 optional int64 after_rss_anon_kilobytes = 10;
6229
6230 // Swap in kilobytes consumed by the process after compaction.
6231 optional int64 after_swap_kilobytes = 11;
6232
6233 // The time taken to perform compaction in milliseconds.
6234 optional int64 time_to_compact_millis = 12;
6235
6236 // The last compaction action performed for this app.
6237 optional Action last_action = 13;
6238
Ben Murdoch01720b82018-12-19 18:03:44 +00006239 // The last time that compaction was attempted on this process in milliseconds
6240 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6241 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006242
Ben Murdoch885c21b2019-03-15 18:02:04 +00006243 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006244 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006245
6246 // The process state at the time of compaction.
6247 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006248
6249 // Free ZRAM in kilobytes before compaction.
6250 optional int64 before_zram_free_kilobytes = 17;
6251
6252 // Free ZRAM in kilobytes after compaction.
6253 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006254}
lifr157fc552018-12-12 16:38:04 +08006255
6256/**
lifrb6b90b62019-03-29 00:40:17 +08006257 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6258 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6259 *
lifr1f74b052019-04-16 22:16:30 +08006260 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6261 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6262 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6263 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006264 */
6265message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006266 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006267
lifr1f74b052019-04-16 22:16:30 +08006268 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006269
6270 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006271 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006272
lifr1f74b052019-04-16 22:16:30 +08006273 // Only valid for event_type = EVENT_GETADDRINFO.
6274 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006275
lifr1f74b052019-04-16 22:16:30 +08006276 // Flags passed to android_res_nsend() defined in multinetwork.h
6277 // Only valid for event_type = EVENT_RESNSEND.
6278 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006279
lifrad9becc2019-05-20 11:04:41 +08006280 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006281
6282 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006283 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006284
6285 // Additional pass-through fields opaque to statsd.
6286 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006287 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006288
6289 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6290 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006291}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006292
6293/**
6294 * Logs when a data stall event occurs.
6295 *
6296 * Log from:
6297 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6298 */
6299message DataStallEvent {
6300 // Data stall evaluation type.
6301 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6302 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6303 optional int32 evaluation_type = 1;
6304 // See definition in data_stall_event.proto.
6305 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6306 // See definition in data_stall_event.proto.
6307 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6308 // See definition in data_stall_event.proto.
6309 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6310 // See definition in data_stall_event.proto.
6311 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6312 // See definition in data_stall_event.proto.
6313 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6314}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006315
6316/*
6317 * Logs when RescueParty resets some set of experiment flags.
6318 *
6319 * Logged from:
6320 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6321 */
6322message RescuePartyResetReported {
6323 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6324 optional int32 rescue_level = 1;
6325}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006326
6327/**
6328 * Logs when signed config is received from an APK, and if that config was applied successfully.
6329 * Logged from:
6330 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6331 */
6332message SignedConfigReported {
6333 enum Type {
6334 UNKNOWN_TYPE = 0;
6335 GLOBAL_SETTINGS = 1;
6336 }
6337 optional Type type = 1;
6338
6339 // The final status of the signed config received.
6340 enum Status {
6341 UNKNOWN_STATUS = 0;
6342 APPLIED = 1;
6343 BASE64_FAILURE_CONFIG = 2;
6344 BASE64_FAILURE_SIGNATURE = 3;
6345 SECURITY_EXCEPTION = 4;
6346 INVALID_CONFIG = 5;
6347 OLD_CONFIG = 6;
6348 SIGNATURE_CHECK_FAILED = 7;
6349 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006350 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006351 }
6352 optional Status status = 2;
6353
6354 // The version of the signed config processed.
6355 optional int32 version = 3;
6356
6357 // The package name that the config was extracted from.
6358 optional string from_package = 4;
6359
6360 enum Key {
6361 NO_KEY = 0;
6362 DEBUG = 1;
6363 PRODUCTION = 2;
6364 }
6365 // Which key was used to verify the config.
6366 optional Key verified_with = 5;
6367}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006368
6369/*
6370 * Logs GNSS Network-Initiated (NI) location events.
6371 *
6372 * Logged from:
6373 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6374 */
6375message GnssNiEventReported {
6376 // The type of GnssNiEvent.
6377 enum EventType {
6378 UNKNOWN = 0;
6379 NI_REQUEST = 1;
6380 NI_RESPONSE = 2;
6381 }
6382 optional EventType event_type = 1;
6383
6384 // An ID generated by HAL to associate NI notifications and UI responses.
6385 optional int32 notification_id = 2;
6386
6387 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006388 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006389
6390 // NI requires notification.
6391 optional bool need_notify = 4;
6392
6393 // NI requires verification.
6394 optional bool need_verify = 5;
6395
6396 // NI requires privacy override, no notification/minimal trace.
6397 optional bool privacy_override = 6;
6398
6399 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6400 // seconds.
6401 optional int32 timeout = 7;
6402
6403 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006404 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006405
6406 // String representing the requester of the network inititated location request.
6407 optional string requestor_id = 9;
6408
6409 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6410 // network initiated location request.
6411 optional string text = 10;
6412
6413 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006414 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006415
6416 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006417 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006418
6419 // True if SUPL ES is enabled.
6420 optional bool is_supl_es_enabled = 13;
6421
6422 // True if GNSS location is enabled.
6423 optional bool is_location_enabled = 14;
6424
6425 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006426 optional android.server.location.GnssUserResponseType user_response = 15;
6427}
6428
6429/**
6430 * Logs GNSS non-framework (NFW) location notification.
6431 *
6432 * Logged from:
6433 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6434 */
6435message GnssNfwNotificationReported {
6436 // Package name of the Android proxy application representing the non-framework entity that
6437 // requested location. Set to empty string if unknown.
6438 optional string proxy_app_package_name = 1;
6439
6440 // Protocol stack that initiated the non-framework location request.
6441 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6442
6443 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6444 // set to empty string. This field is opaque to the framework and used for logging purposes.
6445 optional string other_protocol_stack_name = 3;
6446
6447 // Source initiating/receiving the location information.
6448 optional android.server.location.NfwRequestor requestor = 4;
6449
6450 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6451 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6452 // and used for logging purposes.
6453 optional string requestor_id = 5;
6454
6455 // Indicates whether location information was provided for this request.
6456 optional android.server.location.NfwResponseType response_type = 6;
6457
6458 // True if the device is in user initiated emergency session.
6459 optional bool in_emergency_mode = 7;
6460
6461 // True if cached location is provided.
6462 optional bool is_cached_location = 8;
6463
6464 // True if proxy app permission mismatch between framework and GNSS HAL.
6465 optional bool is_permission_mismatched = 9;
6466}
6467
6468/**
6469 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6470 *
6471 * Logged from:
6472 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6473 */
6474message GnssConfigurationReported {
6475 // SUPL host name.
6476 optional string supl_host = 1;
6477
6478 // SUPL port number.
6479 optional int32 supl_port = 2;
6480
6481 // C2K host name.
6482 optional string c2k_host = 3;
6483
6484 // C2K port number.
6485 optional int32 c2k_port = 4;
6486
6487 // The SUPL version requested by Carrier.
6488 optional int32 supl_ver = 5;
6489
6490 // The SUPL mode.
6491 optional android.server.location.SuplMode supl_mode = 6;
6492
6493 // True if NI emergency SUPL restrictions is enabled.
6494 optional bool supl_es = 7;
6495
6496 // LTE Positioning Profile settings
6497 optional android.server.location.LppProfile lpp_profile = 8;
6498
6499 // Positioning protocol on A-Glonass system.
6500 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6501
6502 // True if emergency PDN is used. Otherwise, regular PDN is used.
6503 optional bool use_emergency_pdn_for_emergency_supl= 10;
6504
6505 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6506 optional android.server.location.GpsLock gps_lock = 11;
6507
6508 // Number of seconds to extend the emergency session duration post emergency call.
6509 optional int32 es_extension_sec = 12;
6510
6511 // The full list of package names of proxy Android applications representing the non-framework
6512 // location access entities (on/off the device) for which the framework user has granted
6513 // non-framework location access permission. The package names are concatenated in one string
6514 // with spaces as separators.
6515 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006516}
Jack Yu95b64f32018-12-13 18:26:11 +08006517
6518/**
6519 * Logs when a NFC device's error occurred.
6520 * Logged from:
6521 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6522 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6523 */
6524message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006525 enum Type {
6526 UNKNOWN = 0;
6527 CMD_TIMEOUT = 1;
6528 ERROR_NOTIFICATION = 2;
6529 AID_OVERFLOW = 3;
6530 }
6531 optional Type type = 1;
6532 // If it's nci cmd timeout, log the timeout command.
6533 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006534
Alex Salod7c3eef2019-01-25 14:43:27 -08006535 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006536}
6537
6538/**
6539 * Logs when a NFC device's state changed event
6540 * Logged from:
6541 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6542 */
6543message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006544 enum State {
6545 UNKNOWN = 0;
6546 OFF = 1;
6547 ON = 2;
6548 ON_LOCKED = 3; // Secure Nfc enabled.
6549 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6550 }
6551 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006552}
6553
6554/**
6555 * Logs when a NFC Beam Transaction occurred.
6556 * Logged from:
6557 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6558 */
6559message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006560 enum Operation {
6561 UNKNOWN = 0;
6562 SEND = 1;
6563 RECEIVE = 2;
6564 }
6565 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006566}
6567
6568/**
6569 * Logs when a NFC Card Emulation Transaction occurred.
6570 * Logged from:
6571 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6572 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6573 */
6574message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006575 enum Category {
6576 UNKNOWN = 0;
6577 HCE_PAYMENT = 1;
6578 HCE_OTHER = 2;
6579 OFFHOST = 3;
6580 }
6581 // Transaction belongs to HCE payment or HCE other category, or offhost.
6582 optional Category category = 1;
6583 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6584 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006585}
6586
6587/**
6588 * Logs when a NFC Tag event occurred.
6589 * Logged from:
6590 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6591 */
6592message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006593 enum Type {
6594 UNKNOWN = 0;
6595 URL = 1;
6596 BT_PAIRING = 2;
6597 PROVISION = 3;
6598 WIFI_CONNECT = 4;
6599 APP_LAUNCH = 5;
6600 OTHERS = 6;
6601 }
6602 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006603}
6604
6605/**
6606 * Logs when Hce transaction triggered
6607 * Logged from:
6608 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6609 */
6610message NfcHceTransactionOccurred {
6611 // The latency period(in microseconds) it took for the first HCE data
6612 // exchange.
6613 optional uint32 latency_micros = 1;
6614}
6615
6616/**
6617 * Logs when SecureElement state event changed
6618 * Logged from:
6619 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6620 */
6621message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006622 enum State {
6623 UNKNOWN = 0;
6624 INITIALIZED = 1;
6625 DISCONNECTED = 2;
6626 CONNECTED = 3;
6627 HALCRASH = 4;
6628 }
6629 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006630
Alex Salod7c3eef2019-01-25 14:43:27 -08006631 optional string state_change_reason = 2;
6632 // SIMx or eSEx.
6633 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006634}
6635
6636/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006637 * Information about a permission grant request
6638 */
6639message PermissionGrantRequestResultReported {
6640 // unique value identifying an API call. A API call might result in multiple of these atoms
6641 optional int64 request_id = 1;
6642
6643 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006644 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006645
6646 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006647 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006648
6649 // The permission to be granted
6650 optional string permission_name = 4;
6651
6652 // If the permission was explicitly requested via the API or added by the system
6653 optional bool is_implicit = 5;
6654
6655 enum Result {
6656 UNDEFINED = 0;
6657 // permission request was ignored
6658 IGNORED = 1;
6659 // permission request was ignored because it was user fixed
6660 IGNORED_USER_FIXED = 2;
6661 // permission request was ignored because it was policy fixed
6662 IGNORED_POLICY_FIXED = 3;
6663 // permission was granted by user action
6664 USER_GRANTED = 4;
6665 // permission was automatically granted
6666 AUTO_GRANTED = 5;
6667 // permission was denied by user action
6668 USER_DENIED = 6;
6669 // permission was denied with prejudice by the user
6670 USER_DENIED_WITH_PREJUDICE = 7;
6671 // permission was automatically denied
6672 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006673 // permission request was ignored because permission is restricted
6674 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006675 // one time permission was granted by user action
6676 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006677 // user ignored request by leaving the request screen without choosing any option
6678 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006679 // user granted the permission after being linked to settings
6680 USER_GRANTED_IN_SETTINGS = 12;
6681 // user denied the permission after being linked to settings
6682 USER_DENIED_IN_SETTINGS = 13;
6683 // user denied the permission with prejudice after being linked to settings
6684 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6685 // permission was automatically revoked after one-time permission expired
6686 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006687 // permission was automatically revoked for unused app
6688 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006689 }
6690 // The result of the permission grant
6691 optional Result result = 6;
6692}
6693
6694/**
Jack Yu95b64f32018-12-13 18:26:11 +08006695 * Logs when Omapi API used
6696 * Logged from:
6697 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6698 */
6699message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006700 enum Operation {
6701 UNKNOWN = 0;
6702 OPEN_CHANNEL = 1;
6703 }
6704 optional Operation operation = 1;
6705 // SIMx or eSEx.
6706 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006707
Alex Salod7c3eef2019-01-25 14:43:27 -08006708 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006709}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006710
6711/**
Alex Saloa060aee2019-01-21 14:36:41 -08006712 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6713 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006714 * Logged from:
6715 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6716 */
6717message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006718 optional int64 dispatch_latency_millis = 1;
6719}
6720
6721/**
6722 * Logs AttentionManagerService attention check result.
6723 *
6724 * Logged from:
6725 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6726 */
6727message AttentionManagerServiceResultReported {
6728 // See core/java/android/service/attention/AttentionService.java
6729 enum AttentionCheckResult {
6730 UNKNOWN = 20;
6731 ATTENTION_SUCCESS_ABSENT = 0;
6732 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006733 ATTENTION_FAILURE_UNKNOWN = 2;
6734 ATTENTION_FAILURE_CANCELLED = 3;
6735 ATTENTION_FAILURE_PREEMPTED = 4;
6736 ATTENTION_FAILURE_TIMED_OUT = 5;
6737 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006738 }
6739 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006740}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006741
6742/**
6743 * Logs when an adb connection changes state.
6744 *
6745 * Logged from:
6746 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6747 */
6748message AdbConnectionChanged {
6749 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6750 // previously selected for this system.
6751 optional int64 last_connection_time_millis = 1;
6752
6753 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6754 // to reconnect via adb without user interaction.
6755 optional int64 auth_window_millis = 2;
6756
6757 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6758 optional android.debug.AdbConnectionStateEnum state = 3;
6759
6760 // True if the 'always allow' option was selected for this system.
6761 optional bool always_allow = 4;
6762}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006763
6764/*
6765 * Logs the reported speech DSP status.
6766 *
6767 * Logged from:
6768 * Vendor audio implementation.
6769 */
6770message SpeechDspStatReported {
6771 // The total Speech DSP uptime in milliseconds.
6772 optional int32 total_uptime_millis = 1;
6773 // The total Speech DSP downtime in milliseconds.
6774 optional int32 total_downtime_millis = 2;
6775 optional int32 total_crash_count = 3;
6776 optional int32 total_recover_count = 4;
6777}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006778
6779/**
6780 * Logs USB connector contaminant status.
6781 *
6782 * Logged from: USB Service.
6783 */
6784message UsbContaminantReported {
6785 optional string id = 1;
6786 optional android.service.usb.ContaminantPresenceStatus status = 2;
6787}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006788
6789/**
6790 * This atom is for debugging purpose.
6791 */
6792message DebugElapsedClock {
6793 // Monotically increasing value for each pull.
6794 optional int64 pull_count = 1;
6795 // Time from System.elapsedRealtime.
6796 optional int64 elapsed_clock_millis = 2;
6797 // Time from System.elapsedRealtime.
6798 optional int64 same_elapsed_clock_millis = 3;
6799 // Diff between current elapsed time and elapsed time from previous pull.
6800 optional int64 elapsed_clock_diff_millis = 4;
6801
6802 enum Type {
6803 TYPE_UNKNOWN = 0;
6804 ALWAYS_PRESENT = 1;
6805 PRESENT_ON_ODD_PULLS = 2;
6806 }
6807 // Type of behavior for the pulled data.
6808 optional Type type = 5;
6809}
6810
6811/**
6812 * This atom is for debugging purpose.
6813 */
6814message DebugFailingElapsedClock {
6815 // Monotically increasing value for each pull.
6816 optional int64 pull_count = 1;
6817 // Time from System.elapsedRealtime.
6818 optional int64 elapsed_clock_millis = 2;
6819 // Time from System.elapsedRealtime.
6820 optional int64 same_elapsed_clock_millis = 3;
6821 // Diff between current elapsed time and elapsed time from previous pull.
6822 optional int64 elapsed_clock_diff_millis = 4;
6823}
Steven Wuacef6bb2019-01-23 14:21:17 -05006824
6825/** Logs System UI bubbles event changed.
6826 *
6827 * Logged from:
6828 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6829 */
6830message BubbleUIChanged {
6831
6832 // The app package that is posting the bubble.
6833 optional string package_name = 1;
6834
6835 // The notification channel that is posting the bubble.
6836 optional string notification_channel = 2;
6837
6838 // The notification id associated with the posted bubble.
6839 optional int32 notification_id = 3;
6840
6841 // The position of the bubble within the bubble stack.
6842 optional int32 position = 4;
6843
6844 // The total number of bubbles within the bubble stack.
6845 optional int32 total_number = 5;
6846
6847 // User interactions with the bubble.
6848 enum Action {
6849 UNKNOWN = 0;
6850 POSTED = 1;
6851 UPDATED = 2;
6852 EXPANDED = 3;
6853 COLLAPSED = 4;
6854 DISMISSED = 5;
6855 STACK_DISMISSED = 6;
6856 STACK_MOVED = 7;
6857 HEADER_GO_TO_APP = 8;
6858 HEADER_GO_TO_SETTINGS = 9;
6859 PERMISSION_OPT_IN = 10;
6860 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006861 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006862 SWIPE_LEFT = 13;
6863 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006864 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006865 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006866 }
6867 optional Action action = 6;
6868
6869 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6870 optional float normalized_x_position = 7;
6871 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006872
6873 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6874 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006875
6876 // Whether the bubble is an on-going one.
6877 optional bool is_ongoing = 10;
6878
6879 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006880 // This is deprecated and the value should be ignored.
6881 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006882}
Kweku Adams8845d012018-12-11 20:06:45 -08006883
6884/**
Steven Wu552f63f2019-02-05 13:41:36 -05006885 * Logs System UI bubbles developer errors.
6886 *
6887 * Logged from:
6888 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6889 */
6890message BubbleDeveloperErrorReported {
6891
6892 // The app package that is posting the bubble.
6893 optional string package_name = 1;
6894
6895 // Bubble developer error type enums.
6896 enum Error {
6897 UNKNOWN = 0;
6898 ACTIVITY_INFO_MISSING = 1;
6899 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6900 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6901 }
6902 optional Error error = 2 [default = UNKNOWN];
6903}
6904
6905/**
Kweku Adams8845d012018-12-11 20:06:45 -08006906 * Logs that a constraint for a scheduled job has changed.
6907 *
6908 * Logged from:
6909 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6910 */
6911message ScheduledJobConstraintChanged {
6912 repeated AttributionNode attribution_node = 1;
6913
6914 // Name of the job.
6915 optional string job_name = 2;
6916
6917 optional com.android.server.job.ConstraintEnum constraint = 3;
6918
6919 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006920 UNKNOWN = 0;
6921 UNSATISFIED = 1;
6922 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006923 }
6924 optional State state = 4;
6925}
Alex Salod7c3eef2019-01-25 14:43:27 -08006926
6927/**
6928 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6929 * returns true.
6930 *
6931 * Logged from:
6932 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6933 */
6934message ScreenTimeoutExtensionReported {
6935 // Describes how many times in a row did the power manager reset the screen off timeout.
6936 optional uint32 consecutive_timeout_extended_count = 1;
6937}
Hui Yu885aca12019-01-10 17:11:34 -08006938
6939/*
6940* Logs number of milliseconds it takes to start a process.
6941* The definition of app process start time is from the app launch time to
6942* the time that Zygote finished forking the app process and loaded the
6943* application package's java classes.
6944
6945* This metric is different from AppStartOccurred which is for foreground
6946* activity only.
6947
6948* ProcessStartTime can report all processes (both foreground and background)
6949* start time.
6950*
6951* Logged from:
6952* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6953*/
6954message ProcessStartTime {
6955 // The uid of the ProcessRecord.
6956 optional int32 uid = 1 [(is_uid) = true];
6957
6958 // The process pid.
6959 optional int32 pid = 2;
6960
6961 // The process name.
6962 // Usually package name, "system" for system server.
6963 // Provided by ActivityManagerService.
6964 optional string process_name = 3;
6965
6966 enum StartType {
6967 UNKNOWN = 0;
6968 WARM = 1;
6969 HOT = 2;
6970 COLD = 3;
6971 }
6972
6973 // The start type.
6974 optional StartType type = 4;
6975
6976 // The elapsed realtime at the start of the process.
6977 optional int64 process_start_time_millis = 5;
6978
6979 // Number of milliseconds it takes to reach bind application.
6980 optional int32 bind_application_delay_millis = 6;
6981
6982 // Number of milliseconds it takes to finish start of the process.
6983 optional int32 process_start_delay_millis = 7;
6984
6985 // hostingType field in ProcessRecord, the component type such as "activity",
6986 // "service", "content provider", "broadcast" or other strings.
6987 optional string hosting_type = 8;
6988
6989 // hostingNameStr field in ProcessRecord. The component class name that runs
6990 // in this process.
6991 optional string hosting_name = 9;
6992}
6993
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006994/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006995 * Track Media Codec usage
6996 * Logged from:
6997 * frameworks/av/media/libstagefright/MediaCodec.cpp
6998 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6999 */
7000message MediametricsCodecReported {
7001 optional int64 timestamp_nanos = 1;
7002 optional string package_name = 2;
7003 optional int64 package_version_code = 3;
7004 optional int64 media_apex_version = 4;
7005
7006 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7007}
7008
7009/**
7010 * Track Media Extractor (pulling video/audio streams out of containers) usage
7011 * Logged from:
7012 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7013 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7014 */
7015message MediametricsExtractorReported {
7016 optional int64 timestamp_nanos = 1;
7017 optional string package_name = 2;
7018 optional int64 package_version_code = 3;
7019 optional int64 media_apex_version = 4;
7020
7021 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7022}
7023
7024/**
7025 * Track how we arbitrate between microphone/input requests.
7026 * Logged from
7027 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7028 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7029 */
7030message MediametricsAudiopolicyReported {
7031 optional int64 timestamp_nanos = 1;
7032 optional string package_name = 2;
7033 optional int64 package_version_code = 3;
7034 optional int64 media_apex_version = 4;
7035
7036 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7037}
7038
7039/**
7040 * Track how we arbitrate between microphone requests.
7041 * Logged from
7042 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7043 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7044 */
7045message MediametricsAudiorecordReported {
7046 optional int64 timestamp_nanos = 1;
7047 optional string package_name = 2;
7048 optional int64 package_version_code = 3;
7049 optional int64 media_apex_version = 4;
7050
7051 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7052}
7053
7054/**
7055 * Track how we arbitrate between microphone/input requests.
7056 * Logged from
7057 * frameworks/av/media/libnblog/ReportPerformance.cpp
7058 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7059 */
7060message MediametricsAudiothreadReported {
7061 optional int64 timestamp_nanos = 1;
7062 optional string package_name = 2;
7063 optional int64 package_version_code = 3;
7064 optional int64 media_apex_version = 4;
7065
7066 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7067}
7068
7069/**
7070 * Track how we arbitrate between microphone/input requests.
7071 * Logged from
7072 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7073 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7074 */
7075message MediametricsAudiotrackReported {
7076 optional int64 timestamp_nanos = 1;
7077 optional string package_name = 2;
7078 optional int64 package_version_code = 3;
7079 optional int64 media_apex_version = 4;
7080
7081 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7082}
7083
7084/**
7085 * Track information about DRM framework performance
7086 * Logged from
7087 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7088 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7089 */
7090message MediametricsMediadrmReported {
7091 optional int64 timestamp_nanos = 1;
7092 optional string package_name = 2;
7093 optional int64 package_version_code = 3;
7094 optional int64 media_apex_version = 4;
7095
7096 // vendor+description tell about which DRM plugin is in use on this device
7097 optional string vendor = 5;
7098 optional string description = 6;
7099 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7100 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7101}
7102
7103/**
7104 * Track information about the widevine DRM plugin performance
7105 * Logged from
7106 * vendor/widevine/libwvdrmengine/cdm/metrics
7107 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7108 */
7109message MediametricsDrmWidevineReported {
7110 optional int64 timestamp_nanos = 1;
7111 optional string package_name = 2;
7112 optional int64 package_version_code = 3;
7113 optional int64 media_apex_version = 4;
7114
7115 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7116}
7117
7118/**
7119 * Track information about recordings (e.g. camcorder)
7120 * Logged from
7121 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7122 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7123 */
7124message MediametricsRecorderReported {
7125 optional int64 timestamp_nanos = 1;
7126 optional string package_name = 2;
7127 optional int64 package_version_code = 3;
7128 optional int64 media_apex_version = 4;
7129
7130 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7131}
7132
7133/**
7134 * Track Media Player usage
7135 * Logged from:
7136 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7137 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7138 */
7139message MediametricsNuPlayerReported {
7140 optional int64 timestamp_nanos = 1;
7141 optional string package_name = 2;
7142 optional int64 package_version_code = 3;
7143 optional int64 media_apex_version = 4;
7144
7145 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7146}
7147
7148/**
Robert Shiha4beed32019-08-19 14:15:23 -07007149 * Track Legacy DRM usage
7150 * Logged from
7151 * frameworks/av/drm/drmserver/DrmManager.cpp
7152 */
7153message MediametricsDrmManagerReported {
7154 optional int64 timestamp_nanos = 1;
7155 optional string package_name = 2;
7156 optional int64 package_version_code = 3;
7157 optional int64 media_apex_version = 4;
7158
7159 enum Method {
7160 METHOD_NOT_FOUND = -1;
7161 GET_CONSTRAINTS = 0;
7162 GET_METADATA = 1;
7163 CAN_HANDLE = 2;
7164 PROCESS_DRM_INFO = 3;
7165 ACQUIRE_DRM_INFO = 4;
7166 SAVE_RIGHTS = 5;
7167 GET_ORIGINAL_MIME_TYPE = 6;
7168 GET_DRM_OBJECT_TYPE = 7;
7169 CHECK_RIGHTS_STATUS = 8;
7170 REMOVE_RIGHTS = 9;
7171 REMOVE_ALL_RIGHTS = 10;
7172 OPEN_CONVERT_SESSION = 11;
7173 OPEN_DECRYPT_SESSION = 12;
7174 }
7175
7176 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7177 optional string plugin_id = 5;
7178 optional string description = 6;
7179 optional Method method = 7;
7180 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007181
7182 optional int64 get_constraints_count = 9;
7183 optional int64 get_metadata_count = 10;
7184 optional int64 can_handle_count = 11;
7185 optional int64 process_drm_info_count = 12;
7186 optional int64 acquire_drm_info_count = 13;
7187 optional int64 save_rights_count = 14;
7188 optional int64 get_original_mime_type_count = 15;
7189 optional int64 get_drm_object_type_count = 16;
7190 optional int64 check_rights_status_count = 17;
7191 optional int64 remove_rights_count = 18;
7192 optional int64 remove_all_rights_count = 19;
7193 optional int64 open_convert_session_count = 20;
7194 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007195}
7196
7197/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007198 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007199 * Pulled from: StatsCompanionService
7200*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007201message DangerousPermissionState {
7202 // Name of the permission
7203 optional string permission_name = 1;
7204
7205 // Uid of the package
7206 optional int32 uid = 2 [(is_uid) = true];
7207
7208 // Package requesting the permission
7209 optional string package_name = 3;
7210
7211 // If the permission is granted to the uid
7212 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007213
7214 // Permission flags as per android.content.pm.PermissionFlags
7215 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007216}
7217
Michael Groover4a0ca942019-01-24 17:41:25 -08007218/**
7219 * Logs when a package is denied access to a device identifier based on the new access requirements.
7220 *
7221 * Logged from:
7222 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7223 */
7224message DeviceIdentifierAccessDenied {
7225 // The name of the package denied access to the requested device identifier.
7226 optional string package_name = 1;
7227
7228 // The name of the device identifier method the package attempted to invoke.
7229 optional string method_name = 2;
7230
7231 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007232 // Starting from Android 11, this boolean is not set and will always be false.
7233 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007234
7235 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007236 // Starting from Android 11, this boolean is not set and will always be false.
7237 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007238}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007239
7240/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007241 * Pulls the ongoing mainline install train version code.
7242 * Pulled from StatsCompanionService
7243 */
7244message TrainInfo {
7245 optional int64 train_version_code = 1;
7246
7247 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007248
7249 optional string train_name = 3;
7250
7251 enum Status {
7252 UNKNOWN = 0;
7253 INSTALL_REQUESTED = 1;
7254 INSTALL_STARTED = 2;
7255 INSTALL_STAGED_NOT_READY = 3;
7256 INSTALL_STAGED_READY = 4;
7257 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007258 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7259 // and INSTALL_FAILURE_COMMIT.
7260 INSTALL_FAILURE = 6 [deprecated = true];
7261 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007262 INSTALL_CANCELLED = 7;
7263 INSTALLER_ROLLBACK_REQUESTED = 8;
7264 INSTALLER_ROLLBACK_INITIATED = 9;
7265 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7266 INSTALLER_ROLLBACK_STAGED = 11;
7267 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7268 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7269 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7270 INSTALLER_ROLLBACK_SUCCESS = 15;
7271 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007272 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7273 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7274 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7275 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7276 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7277 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007278 INSTALL_FAILURE_DOWNLOAD = 23;
7279 INSTALL_FAILURE_STATE_MISMATCH = 24;
7280 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007281 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007282 }
7283 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007284}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007285
7286/**
7287 * Logs the gesture stage changed event.
7288 *
7289 * Logged from:
7290 * frameworks/base/packages/SystemUI/
7291 */
7292message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007293 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007294}
7295
7296/**
7297 * Logs the feedback type.
7298 *
7299 * Logged from:
7300 * frameworks/base/packages/SystemUI/
7301 */
7302message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007303 // Whether or not the gesture was used.
7304 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007305}
7306
7307/**
7308 * Logs the progress.
7309 *
7310 * Logged from:
7311 * frameworks/base/packages/SystemUI/
7312 */
7313message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007314 // [0,100] progress for the assist gesture.
7315 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007316}
Neil Fullerdb14b482019-02-05 19:44:44 +00007317
7318/*
7319 * Information about the time zone data on a device.
7320 */
7321message TimeZoneDataInfo {
7322 // A version identifier for the data set on device. e.g. "2018i"
7323 optional string tzdb_version = 1;
7324}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007325
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007326/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007327 * Logs the GPU stats global health information.
7328 *
7329 * Logged from:
7330 * frameworks/native/services/gpuservice/gpustats/
7331 */
7332message GpuStatsGlobalInfo {
7333 // Package name of the gpu driver.
7334 optional string driver_package_name = 1;
7335
7336 // Version name of the gpu driver.
7337 optional string driver_version_name = 2;
7338
7339 // Version code of the gpu driver.
7340 optional int64 driver_version_code = 3;
7341
7342 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7343 optional int64 driver_build_time = 4;
7344
7345 // Total count of the gl driver gets loaded.
7346 optional int64 gl_loading_count = 5;
7347
7348 // Total count of the gl driver fails to be loaded.
7349 optional int64 gl_loading_failure_count = 6;
7350
7351 // Total count of the Vulkan driver gets loaded.
7352 optional int64 vk_loading_count = 7;
7353
7354 // Total count of the Vulkan driver fails to be loaded.
7355 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007356
7357 // Api version of the system Vulkan driver.
7358 optional int32 vulkan_version = 9;
7359
7360 // Api version of the system CPU Vulkan driver.
7361 optional int32 cpu_vulkan_version = 10;
7362
7363 // Api version of the system GLES driver.
7364 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007365
7366 // Total count of the angle driver gets loaded.
7367 optional int64 angle_loading_count = 12;
7368
7369 // Total count of the angle driver fails to be loaded.
7370 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007371}
7372
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007373/**
7374 * GPU driver loading time info.
7375 */
7376message GpuDriverLoadingTime {
7377 // List of all the driver loading times for this app. The list size is
7378 // capped at 50.
7379 repeated int64 driver_loading_time = 1;
7380}
7381
7382/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007383 * Logs the GPU stats per app health information.
7384 *
7385 * Logged from:
7386 * frameworks/native/services/gpuservice/gpustats/
7387 */
7388message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007389 // Package name of the application that loads the gpu driver. Total number
7390 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007391 optional string app_package_name = 1;
7392
7393 // Version code of the gpu driver this app loads.
7394 optional int64 driver_version_code = 2;
7395
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007396 // gl driver loading time info.
7397 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7398 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007399
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007400 // Vulkan driver loading time info.
7401 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7402 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007403
7404 // Angle driver loading time info.
7405 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7406 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007407
7408 // CPU Vulkan implementation is in use.
7409 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007410
7411 // App is not doing pre-rotation correctly.
7412 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007413
7414 // App creates GLESv1 context.
7415 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007416}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007417
7418/*
7419 * Logs the size of the system ion heap.
7420 *
7421 * Pulled from StatsCompanionService.
7422 */
7423message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007424 // Deprecated due to limited support of ion stats in debugfs.
7425 // Use `IonHeapSize` instead.
7426 option deprecated = true;
7427
Rafal Slawikd4e87572019-03-12 13:08:38 +00007428 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007429 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007430 optional int64 size_in_bytes = 1;
7431}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007432
Rafal Slawik77987ed2019-06-17 12:28:23 +01007433/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007434 * Logs the total size of the ion heap.
7435 *
7436 * Pulled from StatsCompanionService.
7437 */
7438message IonHeapSize {
7439 // Total size of all ion heaps in kilobytes.
7440 // Read from: /sys/kernel/ion/total_heaps_kb.
7441 optional int32 total_size_kb = 1;
7442}
7443
7444/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007445 * Logs the per-process size of the system ion heap.
7446 *
7447 * Pulled from StatsCompanionService.
7448 */
7449message ProcessSystemIonHeapSize {
7450 // The uid if available. -1 means not available.
7451 optional int32 uid = 1 [(is_uid) = true];
7452
7453 // The process name (from /proc/PID/cmdline).
7454 optional string process_name = 2;
7455
7456 // Sum of sizes of all allocations.
7457 optional int32 total_size_in_kilobytes = 3;
7458
7459 // Number of allocations.
7460 optional int32 allocation_count = 4;
7461
7462 // Size of the largest allocation.
7463 optional int32 max_size_in_kilobytes = 5;
7464}
7465
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007466/**
7467 * Push network stack events.
7468 *
7469 * Log from:
7470 * frameworks/base/packages/NetworkStack/
7471 */
7472message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007473 // The id that indicates the event reported from NetworkStack.
7474 optional int32 event_id = 1;
7475 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007476 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7477}
Carmen Agimofa769c152019-03-04 14:39:14 +00007478
7479/**
7480 * Logs the apps that are installed on the external storage.
7481 * Pulled from:
7482 * StatsCompanionService
7483 */
7484message AppsOnExternalStorageInfo {
7485 // The type of the external storage.
7486 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7487 // The name of the package that is installed on the external storage.
7488 optional string package_name = 2;
7489}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007490
7491/**
7492 * Logs the settings related to Face.
7493 * Logged from:
7494 * frameworks/base/services/core/java/com/android/server/stats
7495 */
7496message FaceSettings {
7497 // Whether or not face unlock is allowed on Keyguard.
7498 optional bool unlock_keyguard_enabled = 1;
7499 // Whether or not face unlock dismisses the Keyguard.
7500 optional bool unlock_dismisses_keyguard = 2;
7501 // Whether or not face unlock requires attention.
7502 optional bool unlock_attention_required = 3;
7503 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7504 optional bool unlock_app_enabled = 4;
7505 // Whether or not face unlock always requires user confirmation.
7506 optional bool unlock_always_require_confirmation = 5;
7507 // Whether or not a diverse set of poses are required during enrollment.
7508 optional bool unlock_diversity_required = 6;
7509}
Maggie White442b6312019-04-05 16:26:44 -07007510
7511/**
7512 * Logs cooling devices maintained by the kernel.
7513 *
7514 * Pulled from StatsCompanionService.java
7515 */
7516message CoolingDevice {
7517 // The type of cooling device being reported. Eg. CPU, GPU...
7518 optional android.os.CoolingTypeEnum device_location = 1;
7519 // The name of the cooling device source. Eg. CPU0
7520 optional string device_name = 2;
7521 // Current throttle state of the cooling device. The value can any unsigned
7522 // integer between 0 and max_state defined in its driver. 0 means device is
7523 // not in throttling, higher value means deeper throttling.
7524 optional int32 state = 3;
7525}
Ben Blount763a5d52019-04-10 11:48:58 -07007526
7527/**
7528 * Intelligence has several counter-type events that don't warrant a
7529 * full separate atom. These are primarily API call counters but also include
7530 * counters for feature usage and specific failure modes.
7531 *
7532 * Logged from the Intelligence mainline module.
7533 */
7534message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007535 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007536 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007537 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007538 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007539 // How many times the event occured (to report a batch of high frequency events).
7540 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007541 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007542 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007543}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007544
7545/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007546 * Logs when Car Power state changed.
7547 *
7548 * Logged from:
7549 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7550 */
7551message CarPowerStateChanged {
7552 // States come from CpmsState in CarPowerManagementService.java.
7553 enum State {
7554 WAIT_FOR_VHAL = 0;
7555 ON = 1;
7556 SHUTDOWN_PREPARE = 2;
7557 WAIT_FOR_FINISH = 3;
7558 SUSPEND = 4;
7559 SIMULATE_SLEEP = 5;
7560 }
7561 optional State state = 1;
7562}
7563
7564/**
7565 * Logs whether GarageMode is entered.
7566 *
7567 * Logged from:
7568 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7569 */
7570message GarageModeInfo {
7571 // Whether GarageMode is entered.
7572 optional bool is_garage_mode = 1;
7573}
Martijn Coenencd95d462019-04-25 17:09:45 +02007574
7575/**
7576 * Historical app ops data per package.
7577 */
7578message AppOps {
7579 // Uid of the package requesting the op
7580 optional int32 uid = 1 [(is_uid) = true];
7581
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007582 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007583 optional string package_name = 2;
7584
7585 // operation id; maps to the OP_* constants in AppOpsManager.java
7586 optional int32 op_id = 3;
7587
7588 // The number of times the op was granted while the app was in the
7589 // foreground (only for trusted requests)
7590 optional int64 trusted_foreground_granted_count = 4;
7591
7592 // The number of times the op was granted while the app was in the
7593 // background (only for trusted requests)
7594 optional int64 trusted_background_granted_count = 5;
7595
7596 // The number of times the op was rejected while the app was in the
7597 // foreground (only for trusted requests)
7598 optional int64 trusted_foreground_rejected_count = 6;
7599
7600 // The number of times the op was rejected while the app was in the
7601 // background (only for trusted requests)
7602 optional int64 trusted_background_rejected_count = 7;
7603
7604 // For long-running operations, total duration of the operation
7605 // while the app was in the foreground (only for trusted requests)
7606 optional int64 trusted_foreground_duration_millis = 8;
7607
7608 // For long-running operations, total duration of the operation
7609 // while the app was in the background (only for trusted requests)
7610 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007611
7612 // Whether AppOps is guarded by Runtime permission
7613 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007614}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007615
7616/**
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007617 * Historical app ops data per package and features.
7618 */
7619message AppFeaturesOps {
7620 // Uid of the package requesting the op
7621 optional int32 uid = 1 [(is_uid) = true];
7622
7623 // Name of the package performing the op
7624 optional string package_name = 2;
7625
7626 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
7627 // Features must be provided through manifest using <feature> tag available in R and above.
7628 optional string feature_id = 3;
7629
7630 // operation id; maps to the OPSTR_* constants in AppOpsManager.java
7631 optional string op = 4;
7632
7633 // The number of times the op was granted while the app was in the
7634 // foreground (only for trusted requests)
7635 optional int64 trusted_foreground_granted_count = 5;
7636
7637 // The number of times the op was granted while the app was in the
7638 // background (only for trusted requests)
7639 optional int64 trusted_background_granted_count = 6;
7640
7641 // The number of times the op was rejected while the app was in the
7642 // foreground (only for trusted requests)
7643 optional int64 trusted_foreground_rejected_count = 7;
7644
7645 // The number of times the op was rejected while the app was in the
7646 // background (only for trusted requests)
7647 optional int64 trusted_background_rejected_count = 8;
7648
7649 // For long-running operations, total duration of the operation
7650 // while the app was in the foreground (only for trusted requests)
7651 optional int64 trusted_foreground_duration_millis = 9;
7652
7653 // For long-running operations, total duration of the operation
7654 // while the app was in the background (only for trusted requests)
7655 optional int64 trusted_background_duration_millis = 10;
7656
7657 // Whether AppOps is guarded by Runtime permission
7658 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007659
7660 // Sampling rate used on device, from 0 to 100
7661 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007662}
7663
7664/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007665 * Location Manager API Usage information(e.g. API under usage,
7666 * API call's parameters).
7667 * Logged from:
7668 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7669 */
7670message LocationManagerApiUsageReported {
7671
7672 // Indicating if usage starts or usage ends.
7673 optional android.stats.location.UsageState state = 1;
7674
7675 // LocationManagerService's API in use.
7676 // We can identify which API from LocationManager is
7677 // invoking current LMS API by the combination of
7678 // API parameter(e.g. is_listener_null, is_intent_null,
7679 // is_location_request_null)
7680 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7681
7682 // Name of the package calling the API.
7683 optional string calling_package_name = 3;
7684
7685 // Type of the location provider.
7686 optional android.stats.location.ProviderType provider = 4;
7687
7688 // Quality of the location request
7689 optional android.stats.location.LocationRequestQuality quality = 5;
7690
7691 // The desired interval for active location updates, in milliseconds.
7692 // Bucketized to reduce cardinality.
7693 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7694
7695 // Minimum distance between location updates, in meters.
7696 // Bucketized to reduce cardinality.
7697 optional android.stats.location.SmallestDisplacementBucket
7698 bucketized_smallest_displacement = 7;
7699
7700 // The number of location updates.
7701 optional int64 num_updates = 8;
7702
7703 // The request expiration time, in millisecond since boot.
7704 // Bucketized to reduce cardinality.
7705 optional android.stats.location.ExpirationBucket
7706 bucketized_expire_in = 9;
7707
7708 // Type of Callback passed in for this API.
7709 optional android.stats.location.CallbackType callback_type = 10;
7710
7711 // The radius of the central point of the alert
7712 // region, in meters. Only for API REQUEST_GEOFENCE.
7713 // Bucketized to reduce cardinality.
7714 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7715
7716 // Activity Importance of API caller.
7717 // Categorized to 3 types that are interesting from location's perspective.
7718 optional android.stats.location.ActivityImportance activiy_importance = 12;
7719}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007720
7721/**
7722 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7723 */
7724message ReviewPermissionsFragmentResultReported {
7725 // unique value identifying a permission group change. A permission group change might result
7726 // in multiple of these atoms
7727 optional int64 change_id = 1;
7728
7729 // UID of package the permission belongs to
7730 optional int32 uid = 2 [(is_uid) = true];
7731
7732 // Name of package the permission belongs to
7733 optional string package_name = 3;
7734
7735 // The permission to be granted
7736 optional string permission_name = 4;
7737
7738 // The result of the permission grant
7739 optional bool permission_granted = 5;
7740}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007741
7742/**
7743* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7744* Logged from: RuntimePermissionUpdgradeController
7745*/
7746message RuntimePermissionsUpgradeResult {
7747 // Permission granted as result of upgrade
7748 optional string permission_name = 1;
7749
7750 // UID of package granted permission
7751 optional int32 uid = 2 [(is_uid) = true];
7752
7753 // Name of package granted permission
7754 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007755}
7756
7757/**
7758* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7759*/
7760message GrantPermissionsActivityButtonActions {
7761 // Permission granted as result of upgrade
7762 optional string permission_group_name = 1;
7763
7764 // UID of package granted permission
7765 optional int32 uid = 2 [(is_uid) = true];
7766
7767 // Name of package requesting permission
7768 optional string package_name = 3;
7769
7770 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7771 // LABEL_ constants in GrantPermissionActivity.java
7772 optional int32 buttons_presented = 4;
7773
7774 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7775 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007776
7777 // id which identifies single session of user interacting with permission controller
7778 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007779}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007780
7781/**
7782 * Information about LocationAccessCheck notification presented to user
7783 */
7784message LocationAccessCheckNotificationAction {
7785
7786 // id which identifies single session of user interacting with permission controller
7787 optional int64 session_id = 1;
7788
7789 // Uid of package for which location access check is presented
7790 optional int32 package_uid = 2;
7791
7792 // Name of package for which location access check is presented
7793 optional string package_name = 3;
7794
7795 enum Result {
7796 UNDEFINED = 0;
7797 // notification was presented to the user
7798 NOTIFICATION_PRESENTED = 1;
7799 // notification was declined by the user
7800 NOTIFICATION_DECLINED = 2;
7801 // notification was clicked by the user
7802 NOTIFICATION_CLICKED = 3;
7803 }
7804
7805 // View / interaction recorded
7806 optional Result result = 4;
7807}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007808
7809/**
7810 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7811 */
7812message AppPermissionFragmentActionReported {
7813 // id which identifies single session of user interacting with permission controller
7814 optional int64 session_id = 1;
7815
7816 // unique value identifying a permission group change. A permission group change might result
7817 // in multiple of these atoms
7818 optional int64 change_id = 2;
7819
7820 // UID of package the permission belongs to
7821 optional int32 uid = 3 [(is_uid) = true];
7822
7823 // Name of package the permission belongs to
7824 optional string package_name = 4;
7825
7826 // The permission to be granted
7827 optional string permission_name = 5;
7828
7829 // The result of the permission grant
7830 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007831
7832 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7833 optional int32 permission_flags = 7;
7834
7835 enum Button {
7836 UNDEFINED = 0;
7837 // Allow button
7838 ALLOW = 1;
7839 // Deny button
7840 DENY = 2;
7841 // Ask every time button
7842 ASK_EVERY_TIME = 3;
7843 // Allow all the time button
7844 ALLOW_ALWAYS = 4;
7845 // Allow only while using the app button
7846 ALLOW_FOREGROUND = 5;
7847 // Same is Deny button but shown in while in use dialog
7848 DENY_FOREGROUND = 6;
7849 }
7850
7851 // Button pressed in the dialog
7852 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007853}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007854
7855/**
7856* Information about a AppPermissionFragment viewed by user
7857*/
7858message AppPermissionFragmentViewed {
7859 // id which identifies single session of user interacting with permission controller
7860 optional int64 session_id = 1;
7861
7862 // UID of package for which permissions are viewed
7863 optional int32 uid = 2 [(is_uid) = true];
7864
7865 // Name of package for which permissions are viewed
7866 optional string package_name = 3;
7867
7868 // Permission group viewed
7869 optional string permission_group_name = 4;
7870}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007871
7872/**
7873* Information about a AppPermissionsFragment viewed by user
7874*/
7875message AppPermissionsFragmentViewed {
7876 // id which identifies single session of user interacting with permission controller
7877 optional int64 session_id = 1;
7878
7879 // id which identifies single view as every view might have several logging records
7880 // with different package information attached
7881 optional int64 view_id = 2;
7882
7883 // Permission group viewed
7884 optional string permission_group_name = 3;
7885
7886 // UID of package for which permissions are viewed
7887 optional int32 uid = 4 [(is_uid) = true];
7888
7889 // Name of package for which permissions are viewed
7890 optional string package_name = 5;
7891
7892 // Category in which permission is included
7893 enum Category {
7894 UNDEFINED = 0;
7895 ALLOWED = 1;
7896 ALLOWED_FOREGROUND = 2;
7897 DENIED = 3;
7898 }
7899 optional Category category = 6;
7900}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007901
7902/**
7903* Information about a PermissionAppsFragment viewed by user.
7904* Logged from ui/handheld/PermissionAppsFragment.java
7905*/
7906message PermissionAppsFragmentViewed {
7907 // id which identifies single session of user interacting with permission controller
7908 optional int64 session_id = 1;
7909
7910 // id which identifies single view as every view might have several logging records
7911 // with different package information attached
7912 optional int64 view_id = 2;
7913
7914 // Permission group viewed
7915 optional string permission_group_name = 3;
7916
7917 // UID of package for which permissions are viewed
7918 optional int32 uid = 4 [(is_uid) = true];
7919
7920 // Name of package for which permissions are viewed
7921 optional string package_name = 5;
7922
7923 // Category in which app is included
7924 enum Category {
7925 UNDEFINED = 0;
7926 ALLOWED = 1;
7927 ALLOWED_FOREGROUND = 2;
7928 DENIED = 3;
7929 }
7930 optional Category category = 6;
7931}
Tony Make2b1b672019-07-29 16:59:47 +01007932
7933/**
7934 * Logs when there is a smart selection related event.
7935 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7936 * Logged from: TextClassifierEventLogger.java
7937 */
7938message TextSelectionEvent {
7939 // A session ID.
7940 optional string session_id = 1;
7941
7942 // Event type of this event.
7943 optional android.stats.textclassifier.EventType event_type = 2;
7944
Tony Mak9c84bd22019-12-09 07:27:25 +00007945 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007946 optional string model_name = 3;
7947
7948 // Type of widget that was involved in triggering this event.
7949 optional android.stats.textclassifier.WidgetType widget_type = 4;
7950
7951 // Index of this event in a session.
7952 optional int32 event_index = 5;
7953
7954 // Entity type that is involved.
7955 optional string entity_type = 6;
7956
7957 // Relative word index of the start of the selection.
7958 optional int32 relative_word_start_index = 7;
7959
7960 // Relative word (exclusive) index of the end of the selection.
7961 optional int32 relative_word_end_index = 8;
7962
7963 // Relative word index of the start of the smart selection.
7964 optional int32 relative_suggested_word_start_index = 9;
7965
7966 // Relative word (exclusive) index of the end of the smart selection.
7967 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007968
7969 // Name of source package.
7970 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007971}
7972
7973/**
7974 * Logs when there is a smart linkify related event.
7975 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7976 * Logged from: TextClassifierEventLogger.java
7977 */
7978message TextLinkifyEvent {
7979 // A session ID.
7980 optional string session_id = 1;
7981
7982 // Event type of this event.
7983 optional android.stats.textclassifier.EventType event_type = 2;
7984
Tony Mak9c84bd22019-12-09 07:27:25 +00007985 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007986 optional string model_name = 3;
7987
7988 // Type of widget that was involved in triggering this event.
7989 optional android.stats.textclassifier.WidgetType widget_type = 4;
7990
7991 // Index of this event in a session.
7992 optional int32 event_index = 5;
7993
7994 // Entity type that is involved.
7995 optional string entity_type = 6;
7996
7997 // Number of links detected.
7998 optional int32 num_links = 7;
7999
8000 // The total length of all links.
8001 optional int32 linked_text_length = 8;
8002
8003 // Length of input text.
8004 optional int32 text_length = 9;
8005
8006 // Time spent on generating links in ms.
8007 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008008
8009 // Name of source package.
8010 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008011}
8012
8013/**
8014 * Logs when there is a conversation actions related event.
8015 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8016 * Logged from: TextClassifierEventLogger.java
8017 */
8018message ConversationActionsEvent {
8019 // A session ID.
8020 optional string session_id = 1;
8021
8022 // Event type of this event.
8023 optional android.stats.textclassifier.EventType event_type = 2;
8024
Tony Mak9c84bd22019-12-09 07:27:25 +00008025 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008026 optional string model_name = 3;
8027
8028 // Type of widget that was involved in triggering this event.
8029 optional android.stats.textclassifier.WidgetType widget_type = 4;
8030
8031 // The first entity type that is involved.
8032 optional string first_entity_type = 5;
8033
8034 // The second entity type that is involved.
8035 optional string second_entity_type = 6;
8036
8037 // The third entity type that is involved.
8038 optional string third_entity_type = 7;
8039
8040 // The score of the first entity type.
8041 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008042
8043 // Name of source package.
8044 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008045
8046 // Name of the annotator model that is involved in this event.
8047 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008048}
8049
8050/**
8051 * Logs when there is a language detection related event.
8052 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8053 * Logged from: TextClassifierEventLogger.java
8054 */
8055message LanguageDetectionEvent {
8056 // A session ID.
8057 optional string session_id = 1;
8058
8059 // Event type of this event.
8060 optional android.stats.textclassifier.EventType event_type = 2;
8061
Tony Mak9c84bd22019-12-09 07:27:25 +00008062 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008063 optional string model_name = 3;
8064
8065 // Type of widget that was involved in triggering this event.
8066 optional android.stats.textclassifier.WidgetType widget_type = 4;
8067
8068 // Detected language.
8069 optional string language_tag = 5;
8070
8071 // Score of the detected language.
8072 optional float score = 6;
8073
8074 // Position of this action.
8075 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008076
8077 // Name of source package.
8078 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008079}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008080
8081/**
8082 * Information about an OTA update attempt by update_engine.
8083 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8084 */
8085message UpdateEngineUpdateAttemptReported {
8086 // The number of attempts for the update engine to apply a given payload.
8087 optional int32 attempt_number = 1;
8088
8089 optional android.stats.otaupdate.PayloadType payload_type = 2;
8090
8091 // The total time in minutes for the update engine to apply a given payload.
8092 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8093 // it's increased when the system is sleeping.
8094 optional int32 duration_boottime_in_minutes = 3;
8095
8096 // The total time in minutes for the update engine to apply a given payload.
8097 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8098 // and it's not increased when the system is sleeping.
8099 optional int32 duration_monotonic_in_minutes = 4;
8100
8101 // The size of the payload in MiBs.
8102 optional int32 payload_size_mib = 5;
8103
8104 // The attempt result reported by the update engine for an OTA update.
8105 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8106
8107 // The error code reported by the update engine after an OTA update attempt
8108 // on A/B devices.
8109 optional android.stats.otaupdate.ErrorCode error_code = 7;
8110
8111 // The build fingerprint of the source system. The value is read from a
8112 // system property when the device takes the update. e.g.
8113 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8114 optional string source_fingerprint = 8;
8115}
8116
8117/**
8118 * Information about all the attempts the device make before finishing the
8119 * successful update.
8120 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8121 */
8122message UpdateEngineSuccessfulUpdateReported {
8123 // The number of attempts for the update engine to apply the payload for a
8124 // successful update.
8125 optional int32 attempt_count = 1;
8126
8127 optional android.stats.otaupdate.PayloadType payload_type = 2;
8128
8129 optional int32 payload_size_mib = 3;
8130
8131 // The total number of bytes downloaded by update_engine since the last
8132 // successful update.
8133 optional int32 total_bytes_downloaded_mib = 4;
8134
8135 // The ratio in percentage of the over-downloaded bytes compared to the
8136 // total bytes needed to successfully install the update. e.g. 200 if we
8137 // download 200MiB in total for a 100MiB package.
8138 optional int32 download_overhead_percentage = 5;
8139
8140 // The total time in minutes for the update engine to apply the payload for a
8141 // successful update.
8142 optional int32 total_duration_minutes = 6;
8143
8144 // The number of reboot of the device during a successful update.
8145 optional int32 reboot_count = 7;
8146}
Alec Mourie088e762019-07-02 13:10:55 -07008147
8148/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008149 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8150 * key to indicate whether it was successful or not.
8151 *
8152 * Logged from:
8153 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8154 */
8155message RebootEscrowRecoveryReported {
8156 optional bool successful = 1;
8157}
8158
8159/**
Alec Mourie088e762019-07-02 13:10:55 -07008160 * Global display pipeline metrics reported by SurfaceFlinger.
8161 * Pulled from:
8162 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8163 */
8164message SurfaceflingerStatsGlobalInfo {
8165 // Total number of frames presented during the tracing period
8166 optional int64 total_frames = 1;
8167 // Total number of frames missed
8168 optional int64 missed_frames = 2;
8169 // Total number of frames that fell back to client composition
8170 optional int64 client_composition_frames = 3;
8171 // Total time the display was turned on
8172 optional int64 display_on_millis = 4;
8173 // Total time that was spent performing animations.
8174 // This is derived from the present-to-present layer histogram
8175 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008176 // Total number of event connections tracked by SurfaceFlinger at the time
8177 // of this pull. If this number grows prohibitively large, then this can
8178 // cause jank due to resource contention.
8179 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008180 // Set of timings measured from when SurfaceFlinger began compositing a
8181 // frame, until the frame was requested to be presented to the display. This
8182 // measures SurfaceFlinger's total CPU walltime on the critical path per
8183 // frame.
8184 optional FrameTimingHistogram frame_duration = 7
8185 [(android.os.statsd.log_mode) = MODE_BYTES];
8186 // Set of timings measured from when SurfaceFlinger first began using the
8187 // GPU to composite a frame, until the GPU has finished compositing that
8188 // frame. This measures the total additional time SurfaceFlinger needed to
8189 // perform due to falling back into GPU composition.
8190 optional FrameTimingHistogram render_engine_timing = 8
8191 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008192}
8193
8194/**
8195 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8196 * The number of layers uploaded will be restricted due to size limitations.
8197 * Pulled from:
8198 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8199 */
8200message SurfaceflingerStatsLayerInfo {
8201 // The layer for this set of metrics
8202 // For now we can infer that the package name is included in the layer
8203 // name.
8204 optional string layer_name = 1;
8205 // Total number of frames presented
8206 optional int64 total_frames = 2;
8207 // Total number of dropped frames while latching a buffer for this layer.
8208 optional int64 dropped_frames = 3;
8209 // Set of timings measured between successive presentation timestamps.
8210 optional FrameTimingHistogram present_to_present = 4
8211 [(android.os.statsd.log_mode) = MODE_BYTES];
8212 // Set of timings measured from when an app queued a buffer for
8213 // presentation, until the buffer was actually presented to the
8214 // display.
8215 optional FrameTimingHistogram post_to_present = 5
8216 [(android.os.statsd.log_mode) = MODE_BYTES];
8217 // Set of timings measured from when a buffer is ready to be presented,
8218 // until the buffer was actually presented to the display.
8219 optional FrameTimingHistogram acquire_to_present = 6
8220 [(android.os.statsd.log_mode) = MODE_BYTES];
8221 // Set of timings measured from when a buffer was latched by
8222 // SurfaceFlinger, until the buffer was presented to the display
8223 optional FrameTimingHistogram latch_to_present = 7
8224 [(android.os.statsd.log_mode) = MODE_BYTES];
8225 // Set of timings measured from the desired presentation to the actual
8226 // presentation time
8227 optional FrameTimingHistogram desired_to_present = 8
8228 [(android.os.statsd.log_mode) = MODE_BYTES];
8229 // Set of timings measured from when an app queued a buffer for
8230 // presentation, until the buffer was ready to be presented.
8231 optional FrameTimingHistogram post_to_acquire = 9
8232 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008233 // Frames missed latch because the acquire fence didn't fire
8234 optional int64 late_acquire_frames = 10;
8235 // Frames latched early because the desired present time was bad
8236 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008237}
8238
8239/**
8240 * Histogram of frame counts bucketed by time in milliseconds.
8241 * Because of size limitations, we hard-cap the number of buckets, with
8242 * buckets for corresponding to larger milliseconds being less precise.
8243 */
8244message FrameTimingHistogram {
8245 // Timings in milliseconds that describes a set of histogram buckets
8246 repeated int32 time_millis_buckets = 1;
8247 // Number of frames that match to each time_millis, i.e. the bucket
8248 // contents
8249 // It's required that len(time_millis) == len(frame_count)
8250 repeated int64 frame_counts = 2;
8251}
Emilian Peev6729f372019-08-29 09:14:09 -07008252
Emilian Peev6729f372019-08-29 09:14:09 -07008253/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008254 * Janky event as reported by SurfaceFlinger.
8255 * This event is intended to be consumed by a Perfetto subscriber for
8256 * automated trace collection.
8257 *
8258 * Logged from:
8259 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8260 */
8261message DisplayJankReported {
8262 // Informational field for how long the janky event lasted in milliseconds
8263 optional int64 event_duration_millis = 1;
8264 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8265 // the display on time.
8266 optional int32 present_deadlines_missed = 2;
8267}
8268
8269/**
Emilian Peev6729f372019-08-29 09:14:09 -07008270 * Information about camera facing and API level usage.
8271 * Logged from:
8272 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8273 */
8274message CameraActionEvent {
8275 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008276 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008277
8278 // Camera API level used
8279 optional int32 api_level = 2;
8280
8281 // Name of client package
8282 optional string package_name = 3;
8283
8284 // Camera facing
8285 enum Facing {
8286 UNKNOWN = 0;
8287 BACK = 1;
8288 FRONT = 2;
8289 EXTERNAL = 3;
8290 }
8291 optional Facing facing = 4;
8292}
atrost01a20932019-08-28 15:40:37 +01008293
8294/**
8295 * Logs when a compatibility change is affecting an app.
8296 *
8297 * Logged from:
8298 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8299 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8300 */
8301message AppCompatibilityChangeReported {
8302 // The UID of the app being affected by the compatibilty change.
8303 optional int32 uid = 1 [(is_uid) = true];
8304
8305 // The ID of the change affecting the app.
8306 optional int64 change_id = 2;
8307
8308 enum State {
8309 UNKNOWN_STATE = 0;
8310 ENABLED = 1;
8311 DISABLED = 2;
8312 LOGGED = 3;
8313 }
8314
8315 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8316 // logged otherwise.
8317 optional State state = 3;
8318
8319 enum Source {
8320 UNKNOWN_SOURCE = 0;
8321 APP_PROCESS = 1;
8322 SYSTEM_SERVER = 2;
8323 }
8324
8325 // Where it was logged from.
8326 optional Source source = 4;
8327
8328}
Hector Dearman40579f62019-11-01 13:19:30 +00008329
8330/**
8331 * Logged from
8332 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8333 */
8334message PerfettoUploaded {
8335 enum Event {
8336 PERFETTO_UNDEFINED = 0;
8337 PERFETTO_TRACE_BEGIN = 1;
8338 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8339 PERFETTO_ON_CONNECT = 3;
8340 PERFETTO_ON_TRACING_DISABLED = 4;
8341 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8342 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8343 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8344 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8345 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8346 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8347 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8348 PERFETTO_TRIGGER_BEGIN = 12;
8349 PERFETTO_TRIGGER_SUCCESS = 13;
8350 PERFETTO_TRIGGER_FAILURE = 14;
8351 PERFETTO_HIT_GUARDRAILS = 15;
8352 PERFETTO_ON_TIMEOUT = 16;
8353 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8354 }
8355
8356 // Which stage of the pipeline we are reporting from.
8357 optional Event event = 1;
8358
8359 // UUID matching the one set inside the SystemInfo trace packet.
8360 optional int64 trace_uuid_lsb = 2;
8361 optional int64 trace_uuid_msb = 3;
8362}
Mark Tabrya824a642019-11-05 12:26:12 -08008363
8364/**
8365 * Pulls client metrics on data transferred via Vehicle Maps Service.
8366 * Metrics are keyed by uid + layer.
8367 *
8368 * Pulled from:
8369 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8370 */
8371message VmsClientStats {
8372 // UID of the VMS client app
8373 optional int32 uid = 1 [(is_uid) = true];
8374
8375 // VMS layer definition
8376 optional int32 layer_type = 2;
8377 optional int32 layer_channel = 3;
8378 optional int32 layer_version = 4;
8379
8380 // Bytes and packets sent by the client for the layer
8381 optional int64 tx_bytes = 5;
8382 optional int64 tx_packets = 6;
8383
8384 // Bytes and packets received by the client for the layer
8385 optional int64 rx_bytes = 7;
8386 optional int64 rx_packets = 8;
8387
8388 // Bytes and packets dropped due to client error
8389 optional int64 dropped_bytes = 9;
8390 optional int64 dropped_packets = 10;
8391}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008392
8393/**
8394 * State of a dangerous permission requested by a package - sampled
8395 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8396*/
8397message DangerousPermissionStateSampled {
8398 // Name of the permission
8399 optional string permission_name = 1;
8400
8401 // Uid of the package
8402 optional int32 uid = 2 [(is_uid) = true];
8403
8404 // If the permission is granted to the uid
8405 optional bool is_granted = 3;
8406
8407 // Permission flags as per android.content.pm.PermissionFlags
8408 optional int32 permission_flags = 4;
8409}
8410
Stan Iliev637ba5e2019-08-16 13:43:08 -04008411/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008412 * HWUI stats for a given app.
8413 */
8414message GraphicsStats {
8415 // The package name of the app
8416 optional string package_name = 1;
8417
8418 // The version code of the app
8419 optional int64 version_code = 2;
8420
8421 // The start & end timestamps in UTC as
8422 // milliseconds since January 1, 1970
8423 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008424 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008425
Stan Ilievb6517192020-02-18 10:12:42 -05008426 optional int64 end_millis = 4;
8427
8428 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8429 enum PipelineType {
8430 UNKNOWN = 0;
8431 GL = 1;
8432 VULKAN = 2;
8433 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008434
8435 // HWUI renders pipeline type: GL or Vulkan.
8436 optional PipelineType pipeline = 5;
8437
8438 // Distinct frame count.
8439 optional int32 total_frames = 6;
8440
8441 // Number of "missed vsync" events.
8442 optional int32 missed_vsync_count = 7;
8443
8444 // Number of frames in triple-buffering scenario (high input latency)
8445 optional int32 high_input_latency_count = 8;
8446
8447 // Number of "slow UI thread" events.
8448 optional int32 slow_ui_thread_count = 9;
8449
8450 // Number of "slow bitmap upload" events.
8451 optional int32 slow_bitmap_upload_count = 10;
8452
8453 // Number of "slow draw" events.
8454 optional int32 slow_draw_count = 11;
8455
8456 // Number of frames that missed their deadline (aka, visibly janked)
8457 optional int32 missed_deadline_count = 12;
8458
8459 // The frame time histogram for the package
8460 optional FrameTimingHistogram cpu_histogram = 13
8461 [(android.os.statsd.log_mode) = MODE_BYTES];
8462
8463 // The gpu frame time histogram for the package
8464 optional FrameTimingHistogram gpu_histogram = 14
8465 [(android.os.statsd.log_mode) = MODE_BYTES];
8466
8467 // UI mainline module version.
8468 optional int64 version_ui_module = 15;
8469
8470 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8471 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8472 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8473 // more apps are running / rendering.
8474 optional bool is_today = 16;
8475}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008476
8477/**
8478 * Message related to dangerous (runtime) app ops access
8479 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008480message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008481 // Uid of the package accessing app op
8482 optional int32 uid = 1 [(is_uid) = true];
8483
8484 // Name of the package accessing app op
8485 optional string package_name = 2;
8486
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008487 // operation string id per OPSTR_ constants in AppOpsManager.java
8488 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008489
8490 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8491 // Features must be provided through manifest using <feature> tag available in R and above.
8492 optional string feature_id = 4;
8493
8494 // message related to app op access, limited to 600 chars by API
8495 optional string message = 5;
8496
8497 enum SamplingStrategy {
8498 DEFAULT = 0;
8499 UNIFORM = 1;
8500 RARELY_USED = 2;
8501 }
8502
8503 // sampling strategy used to collect this message
8504 optional SamplingStrategy sampling_strategy = 6;
8505}
8506
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008507/*
8508 * Logs userspace reboot outcome and duration.
8509 *
8510 * Logged from:
8511 * frameworks/base/core/java/com/android/server/BootReceiver.java
8512 */
8513message UserspaceRebootReported {
8514 // Possible outcomes of userspace reboot.
8515 enum Outcome {
8516 // Default value in case platform failed to determine the outcome.
8517 OUTCOME_UNKNOWN = 0;
8518 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8519 SUCCESS = 1;
8520 // Userspace reboot shutdown sequence was aborted.
8521 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8522 // Remounting userdata into checkpointing mode failed.
8523 FAILED_USERDATA_REMOUNT = 3;
8524 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8525 // reboot.
8526 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8527 }
8528 // Outcome of userspace reboot. Always set.
8529 optional Outcome outcome = 1;
8530 // Duration of userspace reboot in case it has a successful outcome.
8531 // Duration is measured as time between userspace reboot was initiated and until boot completed
8532 // (e.g. sys.boot_completed=1).
8533 optional int64 duration_millis = 2;
8534 // State of primary user's (user0) credential encryption storage.
8535 enum UserEncryptionState {
8536 // Default value.
8537 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8538 // Credential encrypted storage is unlocked.
8539 UNLOCKED = 1;
8540 // Credential encrypted storage is locked.
8541 LOCKED = 2;
8542 }
8543 // State of primary user's encryption storage at the moment boot completed. Always set.
8544 optional UserEncryptionState user_encryption_state = 3;
8545}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008546
8547/*
8548 * Logs integrity check information during each install.
8549 *
8550 * Logged from:
8551 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8552 */
8553message IntegrityCheckResultReported {
8554 optional string package_name = 1;
8555 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008556 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008557 optional string installer_package_name = 4;
8558 enum Response {
8559 UNKNOWN = 0;
8560 ALLOWED = 1;
8561 REJECTED = 2;
8562 FORCE_ALLOWED = 3;
8563 }
8564 optional Response response = 5;
8565 // An estimate on the cause of the response. This will only be populated for
8566 // REJECTED and FORCE_ALLOWED
8567 optional bool caused_by_app_cert_rule = 6;
8568 optional bool caused_by_installer_rule = 7;
8569}
8570
8571/**
8572 * Logs the information about the rules and the provider whenever rules are
8573 * pushed into AppIntegrityManager.
8574 *
8575 * Logged from:
8576 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8577 */
8578message IntegrityRulesPushed {
8579 optional bool success = 1;
8580 // Package name of the app that pushed the rules.
8581 optional string rule_provider = 2;
8582 // Version string of arbitrary format provided by the rule provider to
8583 // identify the rules.
8584 optional string rule_version = 3;
8585}
Jordan Liubedfa702019-12-20 15:08:45 -08008586
8587/**
8588 * Logs when a cell broadcast message is received on the device.
8589 *
8590 * Logged from CellBroadcastService module:
8591 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8592 */
8593message CellBroadcastMessageReported {
8594 // The type of Cell Broadcast message
8595 enum CbType {
8596 UNKNOWN_TYPE = 0;
8597 GSM = 1;
8598 CDMA = 2;
8599 CDMA_SPC = 3;
8600 }
8601
8602 // GSM, CDMA, CDMA-SCP
8603 optional CbType type = 1;
8604}
8605
8606/**
8607 * Logs when an error occurs while handling a cell broadcast message;
8608 *
8609 * Logged from CellBroadcastService module:
8610 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8611 */
8612message CellBroadcastMessageError {
8613 // The type of error raised when trying to handle a cell broadcast message
8614 enum ErrorType {
8615 UNKNOWN_TYPE = 0;
8616 CDMA_DECODING_ERROR = 1;
8617 CDMA_SCP_EMPTY = 2;
8618 CDMA_SCP_HANDLING_ERROR = 3;
8619 GSM_INVALID_HEADER_LENGTH = 4;
8620 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8621 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8622 GSM_INVALID_PDU = 7;
8623 GSM_INVALID_GEO_FENCING_DATA = 8;
8624 GSM_UMTS_INVALID_WAC = 9;
8625 FAILED_TO_INSERT_TO_DB = 10;
8626 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8627 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8628 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8629 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8630 }
8631
8632 // What kind of error occurred
8633 optional ErrorType type = 1;
8634
8635 // Exception message (or log message) associated with the error (max 1000 chars)
8636 optional string exception_message = 2;
8637}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008638
8639/**
8640 * Logs when the SDK Extensions test app has polled the current version.
8641 * This is atom ID 354.
8642 *
8643 * Logged from:
8644 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8645 */
8646message SdkExtensionStatus {
8647 enum ApiCallStatus {
8648 CALL_NOT_ATTEMPTED = 0;
8649 CALL_SUCCESSFUL = 1;
8650 CALL_FAILED = 2;
8651 }
8652
8653 optional ApiCallStatus result = 1;
8654
8655 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8656 optional int32 r_extension_version = 2;
8657
8658 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8659 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8660 optional int32 failed_call_symbol = 3;
8661}
Marco Ballesio497aff42020-01-24 08:39:42 -08008662
8663/**
8664 * Logs when an app is frozen or unfrozen.
8665 *
8666 * Logged from:
8667 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8668 */
8669message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008670 // The type of event.
8671 enum Action {
8672 UNKNOWN = 0;
8673 FREEZE_APP = 1;
8674 UNFREEZE_APP = 2;
8675 }
8676 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008677
Blake Kragten6ce382a2020-01-16 20:20:46 -08008678 // Pid of the process being frozen.
8679 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008680
Blake Kragten6ce382a2020-01-16 20:20:46 -08008681 // Name of the process being frozen.
8682 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008683
Blake Kragten6ce382a2020-01-16 20:20:46 -08008684 // Time since last unfrozen.
8685 optional int64 time_unfrozen_millis = 4;
8686}
8687
8688/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008689 * Pulls information for a single voice call.
8690 *
8691 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8692 *
8693 * Pulled from:
8694 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8695 */
8696message VoiceCallSession {
8697 // Bearer (IMS or CS) when the call started.
8698 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8699
8700 // Bearer (IMS or CS) when the call ended.
8701 // The bearer may change during the call, e.g. due to SRVCC.
8702 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8703
8704 // Direction of the call (incoming or outgoing).
8705 optional android.telephony.CallDirectionEnum direction = 3;
8706
8707 // Time spent setting up the call.
8708 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8709
8710 // Whether the call ended before the setup was completed.
8711 optional bool setup_failed = 5;
8712
8713 // IMS reason code or CS disconnect cause.
8714 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8715 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8716 optional int32 disconnect_reason_code = 6;
8717
8718 // IMS extra code or CS precise disconnect cause.
8719 // For IMS, this code is vendor-specific
8720 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8721 optional int32 disconnect_extra_code = 7;
8722
8723 // IMS extra message or CS vendor cause.
8724 optional string disconnect_extra_message = 8;
8725
8726 // Radio access technology (RAT) used when call started.
8727 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8728
8729 // Radio access technology (RAT) used when call terminated.
8730 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8731
8732 // Number of times RAT changed during the call.
8733 optional int64 rat_switch_count = 11;
8734
8735 // A bitmask of all codecs used during the call.
8736 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8737 optional int64 codec_bitmask = 12;
8738
8739 // Number of other calls going on during call setup, for the same SIM slot.
8740 optional int32 concurrent_call_count_at_start = 13;
8741
8742 // Number of other calls going on during call termination, for the same SIM slot.
8743 optional int32 concurrent_call_count_at_end = 14;
8744
8745 // Index of the SIM is used, 0 for single-SIM devices.
8746 optional int32 sim_slot_index = 15;
8747
8748 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8749 optional bool is_multi_sim = 16;
8750
8751 // Whether the call was made with an eSIM profile.
8752 optional bool is_esim = 17;
8753
8754 // Carrier ID of the SIM card.
8755 // See https://source.android.com/devices/tech/config/carrierid.
8756 optional int32 carrier_id = 18;
8757
8758 // Whether an SRVCC has been completed successfully.
8759 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8760 // events once the call is switched to CS.
8761 optional bool srvcc_completed = 19;
8762
8763 // Number of SRVCC failures.
8764 optional int64 srvcc_failure_count = 20;
8765
8766 // Number of SRVCC cancellations.
8767 optional int64 srvcc_cancellation_count = 21;
8768
8769 // Whether the Real-Time Text (RTT) was ever used in the call.
8770 optional bool rtt_enabled = 22;
8771
8772 // Whether this was an emergency call.
8773 optional bool is_emergency = 23;
8774
8775 // Whether the call was performed while roaming.
8776 optional bool is_roaming = 24;
8777}
8778
8779/**
8780 * Pulls voice call radio access technology (RAT) usage.
8781 *
8782 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8783 * time. The atom will be skipped if not enough data is available.
8784 *
8785 * Pulled from:
8786 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8787 */
8788message VoiceCallRatUsage {
8789 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8790 optional int32 carrier_id = 1;
8791
8792 // Radio access technology.
8793 optional android.telephony.NetworkTypeEnum rat = 2;
8794
8795 // Total duration that voice calls spent on this carrier and RAT.
8796 optional int64 total_duration_seconds = 3;
8797
8798 // Total number of calls using this carrier and RAT.
8799 // A call is counted once even if it used the RAT multiple times.
8800 optional int64 call_count = 4;
8801}
8802
8803/**
8804 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8805 *
8806 * Pulled from:
8807 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8808 */
8809message SimSlotState {
8810 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8811 optional int32 active_slot_count = 1;
8812
8813 // Number of SIM cards (both physical and active eSIM profiles).
8814 // This number is always equal to or less than the number of active SIM slots.
8815 optional int32 sim_count = 2;
8816
8817 // Number of active eSIM profiles.
8818 // This number is always equal to or less than the number of SIMs.
8819 optional int32 esim_count = 3;
8820}
8821
8822/**
8823 * Pulls supported cellular radio access technologies.
8824 *
8825 * This atom reports the capabilities of the device, rather than the network it has access to.
8826 *
8827 * Pulled from:
8828 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8829 */
8830message SupportedRadioAccessFamily {
8831 // A bitmask of supported radio technologies.
8832 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8833 optional int64 network_type_bitmask = 1;
8834}
8835
8836/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008837 * Logs gnss stats from location service provider
8838 *
8839 * Pulled from:
8840 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8841 */
8842
8843message GnssStats {
8844 // Number of location reports since boot
8845 optional int64 location_reports = 1;
8846
8847 // Total pulled reports of Location failures since boot
8848 optional int64 location_failure_reports = 2;
8849
8850 // Number of time to first fix reports since boot
8851 optional int64 time_to_first_fix_reports = 3;
8852
8853 // Total pulled reported time to first fix (in milli-seconds) since boot
8854 optional int64 time_to_first_fix_milli_s = 4;
8855
8856 // Number of position accuracy reports since boot
8857 optional int64 position_accuracy_reports = 5;
8858
8859 // Total pulled reported position accuracy (in meters) since boot
8860 optional int64 position_accuracy_meters = 6;
8861
8862 // Number of top 4 average CN0 reports since boot
8863 optional int64 top_four_average_cn0_reports = 7;
8864
8865 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8866 optional int64 top_four_average_cn0_db_mhz = 8;
8867
8868 // Number of l5 top 4 average CN0 reports since boot
8869 optional int64 l5_top_four_average_cn0_reports = 9;
8870
8871 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8872 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8873
8874 // Total number of sv status messages reports since boot
8875 optional int64 sv_status_reports = 11;
8876
8877 // Total number of sv status messages reports, where sv is used in fix since boot
8878 optional int64 sv_status_reports_used_in_fix = 12;
8879
8880 // Total number of L5 sv status messages reports since boot
8881 optional int64 l5_sv_status_reports = 13;
8882
8883 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8884 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008885}
Kweku Adams12752132020-02-18 15:36:48 -08008886
8887/**
8888 * Logs when an app is moved to a different standby bucket.
8889 *
8890 * Logged from:
8891 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8892 */
8893message AppStandbyBucketChanged {
8894 optional string package_name = 1;
8895
8896 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8897 optional int32 user_id = 2;
8898
8899 // These enum values match the constants defined in UsageStatsManager.java.
8900 enum Bucket {
8901 BUCKET_UNKNOWN = 0;
8902 BUCKET_EXEMPTED = 5;
8903 BUCKET_ACTIVE = 10;
8904 BUCKET_WORKING_SET = 20;
8905 BUCKET_FREQUENT = 30;
8906 BUCKET_RARE = 40;
8907 BUCKET_RESTRICTED = 45;
8908 BUCKET_NEVER = 50;
8909 }
8910 optional Bucket bucket = 3;
8911
8912 enum MainReason {
8913 MAIN_UNKNOWN = 0;
8914 MAIN_DEFAULT = 0x0100;
8915 MAIN_TIMEOUT = 0x0200;
8916 MAIN_USAGE = 0x0300;
8917 MAIN_FORCED_BY_USER = 0x0400;
8918 MAIN_PREDICTED = 0x0500;
8919 MAIN_FORCED_BY_SYSTEM = 0x0600;
8920 }
8921 optional MainReason main_reason = 4;
8922
8923 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8924 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8925 // UsageStatsManager.java.
8926 optional int32 sub_reason = 5;
8927}