blob: f9711c3ce7639cf330419ef0e782828b57514539 [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"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500412 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
413 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000414 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000415 }
David Chenc8a43242017-10-17 16:23:28 -0700416
David Chen6e3e6cb2018-01-03 16:14:06 -0800417 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700418 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700419 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800420 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
421 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
422 MobileBytesTransfer mobile_bytes_transfer = 10002 [(module) = "framework"];
423 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003 [(module) = "framework"];
424 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
425 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700426 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800427 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700428 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800429 CpuTimePerUidFreq cpu_time_per_uid_freq =
430 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
432 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
433 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
434 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
435 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700436 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800437 CpuActiveTime cpu_active_time = 10016 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700438 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
439 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800440 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
441 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700442 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800443 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800444 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800445 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800446 DiskStats disk_stats = 10025 [(module) = "framework"];
447 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
448 AppSize app_size = 10027 [(module) = "framework"];
449 CategorySize category_size = 10028 [(module) = "framework"];
450 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800451 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800452 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
453 DiskIo disk_io = 10032 [(module) = "framework"];
454 PowerProfile power_profile = 10033 [(module) = "framework"];
455 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
456 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
457 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700458 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
460 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
461 10040 [(module) = "framework"];
462 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
463 10041 [(module) = "framework"];
464 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800465 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800467 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800468 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
469 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
470 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
471 RoleHolder role_holder = 10049 [(module) = "framework"];
472 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800473 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800474 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
475 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800476 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
477 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800478 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
479 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
480 FaceSettings face_settings = 10058 [(module) = "framework"];
481 CoolingDevice cooling_device = 10059 [(module) = "framework"];
482 AppOps app_ops = 10060 [(module) = "framework"];
483 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700484 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
485 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800486 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800487 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800488 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
489 DangerousPermissionStateSampled dangerous_permission_state_sampled =
490 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400491 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000492 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000493 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200494 PackageNotificationPreferences package_notification_preferences =
495 10071 [(module) = "framework"];
496 PackageNotificationChannelPreferences package_notification_channel_preferences =
497 10072 [(module) = "framework"];
498 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
499 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800500 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800501 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700502 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
503 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
504 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
505 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
David Chenc8a43242017-10-17 16:23:28 -0700506 }
yroa1fe77c2018-02-26 14:22:54 -0800507
Bookatz76aafcf2018-09-17 16:17:10 -0700508 // DO NOT USE field numbers above 100,000 in AOSP.
509 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
510 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100511
512 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700513}
514
Yao Chend54f9dd2017-10-17 17:37:48 +0000515/**
Yangster-mac20877162017-12-22 17:19:39 -0800516 * This proto represents a node of an attribution chain.
517 * Note: All attribution chains are represented as a repeated field of type
518 * AttributionNode. It is understood that in such arrays, the order is that
519 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000520 */
Yangster-mac20877162017-12-22 17:19:39 -0800521message AttributionNode {
522 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800523 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800524
Yangster-mac20877162017-12-22 17:19:39 -0800525 // The (optional) string tag for an element in the attribution chain. If the
526 // element has no tag, it is encoded as an empty string.
527 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700528}
529
Yangster-mac48b3d622018-08-18 12:38:11 -0700530message KeyValuePair {
531 optional int32 key = 1;
532 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700533 int32 value_int = 2;
534 int64 value_long = 3;
535 string value_str = 4;
536 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700537 }
538}
539
540message KeyValuePairsAtom {
541 optional int32 uid = 1;
542 repeated KeyValuePair pairs = 2;
543}
544
Yao Chend54f9dd2017-10-17 17:37:48 +0000545/*
546 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800547 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000548 *
549 * RULES:
550 * - The field ids for each atom must start at 1, and count upwards by 1.
551 * Skipping field ids is not allowed.
552 * - These form an API, so renaming, renumbering or removing fields is
553 * not allowed between android releases. (This is not currently enforced,
554 * but there will be a tool to enforce this restriction).
555 * - The types must be built-in protocol buffer types, namely, no sub-messages
556 * are allowed (yet). The bytes type is also not allowed.
557 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800558 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000559 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800560 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000561 * - A field that is a uid should be a string field, tagged with the [xxx]
562 * annotation. The generated code on android will be represented by UIDs,
563 * and those UIDs will be translated in xxx to those strings.
564 *
565 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700566 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000567 * - If there is a UID, it goes first. Think in an object-oriented fashion.
568 * *****************************************************************************
569 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700570
Yao Chend54f9dd2017-10-17 17:37:48 +0000571/**
Tej Singha72344992019-04-17 18:55:08 -0700572 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700573 * Logs when the Thermal service HAL notifies the throttling start/stop events.
574 *
575 * Logged from:
576 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
577 */
578message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700579 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700580 optional android.os.TemperatureTypeEnum sensor_type = 1;
581
Maggie White442b6312019-04-05 16:26:44 -0700582 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700583 enum State {
584 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700585 START = 1; // START indicated that throttling was triggered.
586 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700587 }
Yangster-mace16189a2018-08-26 12:20:16 -0700588 optional State state = 2;
589
590 optional float temperature = 3;
591}
592
593/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000594 * Logs when the screen state changes.
595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
598 */
599message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800600 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800601 optional android.view.DisplayStateEnum state = 1
602 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700603}
Yao Chend54f9dd2017-10-17 17:37:48 +0000604
605/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700606 * Logs that the process state of the uid, as determined by ActivityManager
607 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000608 *
609 * Logged from:
610 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
611 */
Bookatzc1a050a2017-10-10 15:49:28 -0700612message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800613 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000614
Bookatzdb026a22018-01-10 19:01:56 -0800615 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800616 optional android.app.ProcessStateEnum state = 2
617 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000618}
619
620/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700621 * Logs process state change of a process, as per the activity manager.
622 *
623 * Logged from:
624 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
625 */
626message ProcessStateChanged {
627 optional int32 uid = 1;
628 optional string process_name = 2;
629 optional string package_name = 3;
630 // TODO: remove this when validation is done
631 optional int64 version = 5;
632 // The state, from frameworks/base/core/proto/android/app/enums.proto.
633 optional android.app.ProcessStateEnum state = 4;
634}
635
636/**
637 * Logs when ActivityManagerService sleep state is changed.
638 *
639 * Logged from:
640 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
641 */
642message ActivityManagerSleepStateChanged {
643 // TODO: import frameworks proto
644 enum State {
645 UNKNOWN = 0;
646 ASLEEP = 1;
647 AWAKE = 2;
648 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800649 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700650}
651
652/**
653 * Logs when system memory state changes.
654 *
655 * Logged from:
656 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
657 */
658message MemoryFactorStateChanged {
659 // TODO: import frameworks proto
660 enum State {
661 MEMORY_UNKNOWN = 0;
662 NORMAL = 1; // normal.
663 MODERATE = 2; // moderate memory pressure.
664 LOW = 3; // low memory.
665 CRITICAL = 4; // critical memory.
666
667 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800668 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700669}
670
671/**
672 * Logs when app is using too much cpu, according to ActivityManagerService.
673 *
674 * Logged from:
675 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
676 */
677message ExcessiveCpuUsageReported {
678 optional int32 uid = 1;
679 optional string process_name = 2;
680 optional string package_name = 3;
681 // package version. TODO: remove this when validation is done
682 optional int64 version = 4;
683}
684
685/**
686 * Logs when a cached process is killed, along with its pss.
687 *
688 * Logged from:
689 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
690 */
691message CachedKillReported {
692 optional int32 uid = 1;
693 optional string process_name = 2;
694 optional string package_name = 3;
695 // TODO: remove this when validation is done
696 optional int64 version = 5;
697 optional int64 pss = 4;
698}
699
700/**
xshu2c3d9e42019-09-26 17:54:02 -0700701 * Logs the change in wifi health.
702 *
703 * Logged from:
704 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
705 */
706message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800707 enum Band {
708 UNKNOWN = 0;
709 // All of 2.4GHz band
710 BAND_2G = 1;
711 // Frequencies in the range of [5150, 5250) GHz
712 BAND_5G_LOW = 2;
713 // Frequencies in the range of [5250, 5725) GHz
714 BAND_5G_MIDDLE = 3;
715 // Frequencies in the range of [5725, 5850) GHz
716 BAND_5G_HIGH = 4;
717 // Frequencies in the range of [5925, 6425) GHz
718 BAND_6G_LOW = 5;
719 // Frequencies in the range of [6425, 6875) GHz
720 BAND_6G_MIDDLE = 6;
721 // Frequencies in the range of [6875, 7125) GHz
722 BAND_6G_HIGH = 7;
723 }
xshu2c3d9e42019-09-26 17:54:02 -0700724 // duration this stat is obtained over in milliseconds
725 optional int32 duration_millis = 1;
726 // whether wifi is classified as sufficient for the user's data traffic, determined
727 // by whether the calculated throughput exceeds the average demand within |duration_millis|
728 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700729 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800730 optional bool is_cell_data_available = 3;
731 // the Band bucket the connected network is on
732 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700733}
734
735/**
736 * Logged when wifi detects a significant change in connection failure rate.
737 *
738 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
739 *
740 */
741message WifiFailureStatReported {
742 enum AbnormalityType {
743 UNKNOWN = 0;
744 SIGNIFICANT_INCREASE = 1;
745 SIGNIFICANT_DECREASE = 2;
746 SIMPLY_HIGH = 3;
747 }
748 enum FailureType {
749 FAILURE_UNKNOWN = 0;
750 FAILURE_CONNECTION = 1;
751 FAILURE_ASSOCIATION_REJECTION = 2;
752 FAILURE_ASSOCIATION_TIMEOUT = 3;
753 FAILURE_AUTHENTICATION = 4;
754 FAILURE_NON_LOCAL_DISCONNECTION = 5;
755 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
756 }
757 // Reason for uploading this stat
758 optional AbnormalityType abnormality_type = 1;
759 // The particular type of failure
760 optional FailureType failure_type = 2;
761 // How many times we have encountered this combination of AbnormalityType and FailureType
762 optional int32 failure_count = 3;
763}
764
765/**
766 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
767 *
768 * Logged from:
769 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
770 */
771message WifiConnectionResultReported {
772 enum FailureCode {
773 FAILURE_UNKNOWN = 0;
774 FAILURE_ASSOCIATION_TIMEOUT = 1;
775 FAILURE_ASSOCIATION_REJECTION = 2;
776 FAILURE_AUTHENTICATION_GENERAL = 3;
777 FAILURE_AUTHENTICATION_EAP = 4;
778 FAILURE_DHCP = 5;
779 FAILURE_NETWORK_DISCONNECTION = 6;
780 FAILURE_ROAM_TIMEOUT = 7;
781 }
782 // true represents a successful connection
783 optional bool connection_result = 1;
784 // reason for the connection failure
785 optional FailureCode failure_code = 2;
786 // scan rssi before the connection attempt
787 optional int32 rssi = 3;
788}
789
790/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700791 * Logs when memory stats of a process is reported.
792 *
793 * Logged from:
794 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
795 */
796message ProcessMemoryStatReported {
797 optional int32 uid = 1;
798 optional string process_name = 2;
799 optional string package_name = 3;
800 //TODO: remove this when validation is done
801 optional int64 version = 9;
802 optional int64 pss = 4;
803 optional int64 uss = 5;
804 optional int64 rss = 6;
805 enum Type {
806 ADD_PSS_INTERNAL_SINGLE = 0;
807 ADD_PSS_INTERNAL_ALL_MEM = 1;
808 ADD_PSS_INTERNAL_ALL_POLL = 2;
809 ADD_PSS_EXTERNAL = 3;
810 ADD_PSS_EXTERNAL_SLOW = 4;
811 }
812 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800813 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700814}
815
816/**
Bookatzc1a050a2017-10-10 15:49:28 -0700817 * Logs that a process started, finished, crashed, or ANRed.
818 *
819 * Logged from:
820 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
821 */
822message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700823 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700824
David Chen0b5c90c2018-01-25 16:51:49 -0800825 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800826 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700827
Bookatzddccf0a2017-11-28 16:48:14 -0800828 // What lifecycle state the process changed to.
829 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800830 enum State {
831 FINISHED = 0;
832 STARTED = 1;
833 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800834 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800835 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700836}
837
Bookatzc1a050a2017-10-10 15:49:28 -0700838/**
839 * Logs when the ble scan state changes.
840 *
841 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700842 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700843 */
844message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800845 repeated AttributionNode attribution_node = 1
846 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700847
848 enum State {
849 OFF = 0;
850 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700851 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
852 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700853 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800854 optional State state = 2 [
855 (state_field_option).option = EXCLUSIVE_STATE,
856 (state_field_option).default_state_value = 0 /* State.OFF */,
857 (state_field_option).reset_state_value = 2 /* State.RESET */,
858 (state_field_option).nested = true
859 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700860
Bookatze5ec0b42018-03-26 13:34:56 -0700861 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800862 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700863 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800864 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700865 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800866 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700867}
868
869/**
870 * Logs reporting of a ble scan finding results.
871 *
872 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700873 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700874 */
Bookatzae6738e2018-09-13 11:38:56 -0700875// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700876message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800877 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700878
879 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800880 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700881}
882
883/**
884 * Logs when a sensor state changes.
885 *
886 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700887 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700888 */
889message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800890 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700891
Bookatzc1a050a2017-10-10 15:49:28 -0700892 // The id (int) of the sensor.
893 optional int32 sensor_id = 2;
894
895 enum State {
896 OFF = 0;
897 ON = 1;
898 }
899 optional State state = 3;
900}
901
Bookatzc1a050a2017-10-10 15:49:28 -0700902/**
903 * Logs when GPS state changes.
904 *
905 * Logged from:
906 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
907 */
908message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800909 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700910
911 enum State {
912 OFF = 0;
913 ON = 1;
914 }
915 optional State state = 2;
916}
917
Bookatz48d362e2018-11-06 15:49:08 -0800918/**
919 * Logs when GPS signal quality.
920 *
921 * Logged from:
922 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
923 */
924message GpsSignalQualityChanged {
925 optional android.server.location.GpsSignalQualityEnum level = 1;
926}
927
Bookatzc1a050a2017-10-10 15:49:28 -0700928
929/**
930 * Logs when a sync manager sync state changes.
931 *
932 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700933 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700934 */
935message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800936 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700937
David Chen0b5c90c2018-01-25 16:51:49 -0800938 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800939 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700940
941 enum State {
942 OFF = 0;
943 ON = 1;
944 }
945 optional State state = 3;
946}
947
Yangster-mac96353002018-09-05 11:18:55 -0700948/*
949 * Deferred job stats.
950 *
951 * Logged from:
952 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
953*/
954message DeferredJobStatsReported {
955 repeated AttributionNode attribution_node = 1;
956
957 // Number of jobs deferred.
958 optional int32 num_jobs_deferred = 2;
959
960 // Time since the last job runs.
961 optional int64 time_since_last_job_millis = 3;
962}
963
Bookatzc1a050a2017-10-10 15:49:28 -0700964/**
965 * Logs when a job scheduler job state changes.
966 *
967 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700968 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700969 */
970message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800971 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700972
973 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800974 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700975
976 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800977 FINISHED = 0;
978 STARTED = 1;
979 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700980 }
981 optional State state = 3;
982
Tej Singh33a412b2018-03-16 18:43:59 -0700983 // The reason a job has stopped.
984 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700985 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700986 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100987
988 // The standby bucket of the app that scheduled the job. These match the framework constants
989 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
990 // already assigned 0.
991 enum Bucket {
992 UNKNOWN = -1;
993 ACTIVE = 0;
994 WORKING_SET = 1;
995 FREQUENT = 2;
996 RARE = 3;
997 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -0800998 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +0100999 }
1000 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1001
1002 // The job id (as assigned by the app).
1003 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001004
1005 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1006 // constraints as they are always assumed to be set.
1007 optional bool has_charging_constraint = 7;
1008 optional bool has_battery_not_low_constraint = 8;
1009 optional bool has_storage_not_low_constraint = 9;
1010 optional bool has_timing_delay_constraint = 10;
1011 optional bool has_deadline_constraint = 11;
1012 optional bool has_idle_constraint = 12;
1013 optional bool has_connectivity_constraint = 13;
1014 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001015}
1016
1017/**
1018 * Logs when the audio state changes.
1019 *
1020 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001021 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001022 */
1023message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001024 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001025
1026 enum State {
1027 OFF = 0;
1028 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001029 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1030 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001031 }
1032 optional State state = 2;
1033}
1034
1035/**
1036 * Logs when the video codec state changes.
1037 *
1038 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001039 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001040 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001041message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001043
1044 enum State {
1045 OFF = 0;
1046 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001047 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1048 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001049 }
1050 optional State state = 2;
1051}
1052
1053/**
1054 * Logs when the flashlight state changes.
1055 *
1056 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001057 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001058 */
1059message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001060 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001061
1062 enum State {
1063 OFF = 0;
1064 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001065 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1066 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001067 }
1068 optional State state = 2;
1069}
1070
1071/**
1072 * Logs when the camera state changes.
1073 *
1074 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001075 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001076 */
1077message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001078 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001079
1080 enum State {
1081 OFF = 0;
1082 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001083 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1084 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001085 }
1086 optional State state = 2;
1087}
1088
1089/**
1090 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001091 *
1092 * Logged from:
1093 * TODO
1094 */
Bookatzd6746242017-10-24 18:39:35 -07001095message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001096 repeated AttributionNode attribution_node = 1
1097 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001098
Bookatz1a1b0462018-01-12 11:47:03 -08001099 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1100 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001101 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001102 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001103
1104 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001105 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001106
1107 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001108 RELEASE = 0;
1109 ACQUIRE = 1;
1110 CHANGE_RELEASE = 2;
1111 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001112 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001113 optional State state = 4 [
1114 (state_field_option).option = EXCLUSIVE_STATE,
1115 (state_field_option).default_state_value = 0,
1116 (state_field_option).nested = true
1117 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001118}
1119
1120/**
Bookatzc1a050a2017-10-10 15:49:28 -07001121 * Logs when a partial wakelock is considered 'long' (over 1 min).
1122 *
1123 * Logged from:
1124 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1125 */
1126message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001127 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001128
Yao Chend54f9dd2017-10-17 17:37:48 +00001129 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1130 optional string tag = 2;
1131
Bookatzc1a050a2017-10-10 15:49:28 -07001132 // TODO: I have no idea what this is.
1133 optional string history_tag = 3;
1134
1135 enum State {
1136 OFF = 0;
1137 ON = 1;
1138 }
1139 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001140}
1141
Bookatzc1a050a2017-10-10 15:49:28 -07001142/**
Bookatza66083f2018-09-20 17:24:00 -07001143 * Logs when the device is interactive, according to the PowerManager Notifier.
1144 *
1145 * Logged from:
1146 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1147 */
1148message InteractiveStateChanged {
1149 enum State {
1150 OFF = 0;
1151 ON = 1;
1152 }
1153 optional State state = 1;
1154}
1155
1156/**
Bookatzc1a050a2017-10-10 15:49:28 -07001157 * Logs Battery Saver state change.
1158 *
1159 * Logged from:
1160 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1161 */
1162message BatterySaverModeStateChanged {
1163 enum State {
1164 OFF = 0;
1165 ON = 1;
1166 }
1167 optional State state = 1;
1168}
1169
1170/**
1171 * Logs Doze mode state change.
1172 *
1173 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001174 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001175 */
1176message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001177 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001178}
1179
1180
1181/**
1182 * Logs state change of Doze mode including maintenance windows.
1183 *
1184 * Logged from:
1185 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1186 */
1187message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001188 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001189}
1190
1191/**
1192 * Logs screen brightness level.
1193 *
1194 * Logged from:
1195 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1196 */
1197message ScreenBrightnessChanged {
1198 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1199 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001200}
1201
1202/**
1203 * Logs battery level (percent full, from 0 to 100).
1204 *
1205 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001206 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001207 */
1208message BatteryLevelChanged {
1209 // Battery level. Should be in [0, 100].
1210 optional int32 battery_level = 1;
1211}
1212
1213/**
1214 * Logs change in charging status of the device.
1215 *
1216 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001217 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001218 */
1219message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001220 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1221 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001222}
1223
1224/**
1225 * Logs whether the device is plugged in, and what power source it is using.
1226 *
1227 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001228 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001229 */
1230message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001231 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1232 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001233}
1234
Bookatz8c6571b2017-10-24 15:04:41 -07001235/**
1236 * Logs when an app's wakeup alarm fires.
1237 *
1238 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001239 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001240 */
1241message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001242 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001243
1244 // Name of the wakeup alarm.
1245 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001246
1247 // Name of source package (for historical reasons, since BatteryStats tracked it).
1248 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001249
Ben Murdoch3389f1522019-05-21 15:05:34 +01001250 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001251 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001252}
1253
1254/**
1255 * Logs when an an app causes the mobile radio to change state.
1256 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1257 *
1258 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001259 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001260 */
1261message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001262 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001263
Bookatz1a1b0462018-01-12 11:47:03 -08001264 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1265 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001266}
1267
1268/**
1269 * Logs when an an app causes the wifi radio to change state.
1270 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1271 *
1272 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001273 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001274 */
1275message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001276 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001277
Bookatz1a1b0462018-01-12 11:47:03 -08001278 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1279 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001280}
1281
1282/**
1283 * Logs kernel wakeup reasons and aborts.
1284 *
1285 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001286 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001287 */
1288message KernelWakeupReported {
1289 // Name of the kernel wakeup reason (or abort).
1290 optional string wakeup_reason_name = 1;
1291
1292 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001293 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001294}
1295
1296/**
Bookatzda1798c2018-12-13 14:16:00 -08001297 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001298 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001299 *
1300 * Logged from:
1301 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1302 */
1303message WifiEnabledStateChanged {
1304 enum State {
1305 OFF = 0;
1306 ON = 1;
1307 }
1308 optional State state = 1;
1309}
1310
1311/**
tsaichristinececebdc2020-02-04 14:05:56 -08001312 * This atom is deprecated starting in R.
1313 *
Bookatzda1798c2018-12-13 14:16:00 -08001314 * 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 -08001315 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1316 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001317 *
1318 * Logged from:
1319 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1320 */
1321message WifiRunningStateChanged {
1322 repeated AttributionNode attribution_node = 1;
1323
1324 enum State {
1325 OFF = 0;
1326 ON = 1;
1327 }
1328 optional State state = 2;
1329}
1330
1331/**
Bookatze5885242017-10-24 20:10:31 -07001332 * Logs wifi locks held by an app.
1333 *
1334 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001335 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001336 */
1337message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001338 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001339
1340 enum State {
1341 OFF = 0;
1342 ON = 1;
1343 }
1344 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001345
1346 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1347 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001348}
1349
1350/**
1351 * Logs wifi signal strength changes.
1352 *
1353 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001354 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001355 */
1356message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001357 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1358 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001359}
1360
1361/**
1362 * Logs wifi scans performed by an app.
1363 *
1364 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001365 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001366 */
1367message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001368 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001369
1370 enum State {
1371 OFF = 0;
1372 ON = 1;
1373 }
1374 optional State state = 2;
1375}
1376
1377/**
Tej Singh4503e102018-01-04 14:35:01 -08001378 * Logs wifi multicast locks held by an app
1379 *
1380 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001381 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001382 */
1383message WifiMulticastLockStateChanged {
1384 repeated AttributionNode attribution_node = 1;
1385
1386 enum State {
1387 OFF = 0;
1388 ON = 1;
1389 }
1390 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001391
1392 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001393}
1394
1395/**
Tej Singh1ea42892018-01-19 09:27:00 -08001396 * Logs shutdown reason and duration on next boot.
1397 *
1398 * Logged from:
1399 * frameworks/base/core/java/com/android/server/BootReceiver.java
1400 */
1401message ShutdownSequenceReported {
1402 // True if shutdown is for a reboot. Default: false if we do not know.
1403 optional bool reboot = 1;
1404
1405 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1406 optional string reason = 2;
1407
1408 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1409 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001410 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001411
1412 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001413 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001414}
1415
Tej Singh6483ea42018-01-25 17:45:49 -08001416
1417/**
1418 * Logs boot reason and duration.
1419 *
1420 * Logged from:
1421 * system/core/bootstat/bootstat.cpp
1422 */
1423message BootSequenceReported {
1424 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1425 // Default: "<EMPTY>" if not available.
1426 optional string bootloader_reason = 1;
1427
1428 // Reason for system boot. Eg. bootloader, reboot,userrequested
1429 // Default: "<EMPTY>" if not available.
1430 optional string system_reason = 2;
1431
1432 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001433 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001434
1435 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001436 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001437
1438 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001439 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001440
1441 // Time since last boot in ms. Default: 0 if not available.
1442 optional int64 time_since_last_boot = 6;
1443}
1444
Tej Singhc477d9c2018-02-05 18:31:39 -08001445
1446/**
1447 * Logs call state and disconnect cause (if applicable).
1448 *
1449 * Logged from:
1450 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1451 */
1452message CallStateChanged {
1453 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1454 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1455 optional android.telecom.CallStateEnum call_state = 1;
1456
1457 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1458 // This value is only applicable when the call_state is DISCONNECTED, and
1459 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1460 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1461 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1462
1463 // True if the call is self-managed, which are apps that use the
1464 // telecom infrastructure to make their own calls.
1465 optional bool self_managed = 3;
1466
1467 // True if call is external. External calls are calls on connected Wear
1468 // devices but show up in Telecom so the user can pull them onto the device.
1469 optional bool external_call = 4;
1470}
1471
Tej Singh1ea42892018-01-19 09:27:00 -08001472/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001473 * Logs keyguard state. The keyguard is the lock screen.
1474 *
1475 * Logged from:
1476 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1477 */
1478message KeyguardStateChanged {
1479 enum State {
1480 UNKNOWN = 0;
1481 // The keyguard is hidden when the phone is unlocked.
1482 HIDDEN = 1;
1483 // The keyguard is shown when the phone is locked (screen turns off).
1484 SHOWN= 2;
1485 // The keyguard is occluded when something is overlaying the keyguard.
1486 // Eg. Opening the camera while on the lock screen.
1487 OCCLUDED = 3;
1488 }
1489 optional State state = 1;
1490}
1491
1492/**
1493 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1494 * prompts the user to enter a password (pattern, pin, etc).
1495 *
1496 * Logged from:
1497 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1498 */
1499
1500message KeyguardBouncerStateChanged {
1501 enum State {
1502 UNKNOWN = 0;
1503 // Bouncer is hidden, either as a result of successfully entering the
1504 // password, screen timing out, or user going back to lock screen.
1505 HIDDEN = 1;
1506 // This is when the user is being prompted to enter the password.
1507 SHOWN = 2;
1508 }
1509 optional State state = 1;
1510}
1511
1512/**
1513 * Logs the result of entering a password into the keyguard bouncer.
1514 *
1515 * Logged from:
1516 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1517 */
1518message KeyguardBouncerPasswordEntered {
1519 enum BouncerResult {
1520 UNKNOWN = 0;
1521 // The password entered was incorrect.
1522 FAILURE = 1;
1523 // The password entered was correct.
1524 SUCCESS = 2;
1525 }
1526 optional BouncerResult result = 1;
1527}
1528
Tej Singha883b372018-02-15 11:30:01 -08001529/*
1530 * Logs changes to the configuration of the device. The configuration is defined
1531 * in frameworks/base/core/java/android/content/res/Configuration.java
1532 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1533 * Please go there to interpret the possible values each field can be.
1534 *
1535 * Logged from:
1536 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1537 */
1538message ResourceConfigurationChanged {
1539 // Bit mask of color capabilities of the screen.
1540 // Contains information about the color gamut and hdr mode of the screen.
1541 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001542 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001543
1544 // The target screen density being rendered to.
1545 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001546 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001547
1548 // Current user preference for the scaling factor for fonts,
1549 // relative to the base density scaling.
1550 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001551 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001552
1553 // Flag indicating whether the hard keyboard is hidden.
1554 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001555 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001556
1557 // The type of keyboard attached to the device.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1559 optional int32 keyboard = 5;
1560
1561 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1566 // 0 if undefined.
1567 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1568 optional int32 mcc = 7;
1569
1570 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1571 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1572 // MNC_ZERO symbol defined in Configuration.java.
1573 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1574 optional int32 mnc = 8;
1575
1576 // The kind of navigation available on the device.
1577 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1578 optional int32 navigation = 9;
1579
1580 // Flag indicating whether the navigation is available.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001582 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001583
1584 // Overall orientation of the screen.
1585 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1586 optional int32 orientation = 11;
1587
1588 // The current height of the available screen space, in dp units.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // Bit mask of overall layout of the screen.
1593 // Contains information about screen size, whether the screen is wider/taller
1594 // than normal, whether the screen layout is right-tl-left or left-to-right,
1595 // and whether the screen has a rounded shape.
1596 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001597 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001598
1599 // Current width of the available screen space, in dp units.
1600 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001601 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001602
1603 // The smallest screen size an application will see in normal operation.
1604 // This is the smallest value of both screenWidthDp and screenHeightDp
1605 // in portrait and landscape.
1606 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001607 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001608
1609 // The type of touch screen attached to the device.
1610 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1611 optional int32 touchscreen = 16;
1612
1613 // Bit mask of the ui mode.
1614 // Contains information about the overall ui mode of the device.
1615 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1616 // Also contains information about whether the device is in night mode.
1617 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001618 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001619}
1620
Tej Singheee317b2018-03-07 19:28:05 -08001621
1622/**
1623 * Logs changes in the connection state of the mobile radio.
1624 *
1625 * Logged from:
1626 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1627 */
1628message MobileConnectionStateChanged {
1629 // States are from the state machine DataConnection.java.
1630 enum State {
1631 UNKNOWN = 0;
1632 // The connection is inactive, or disconnected.
1633 INACTIVE = 1;
1634 // The connection is being activated, or connecting.
1635 ACTIVATING = 2;
1636 // The connection is active, or connected.
1637 ACTIVE = 3;
1638 // The connection is disconnecting.
1639 DISCONNECTING = 4;
1640 // The connection is disconnecting after creating a connection.
1641 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1642 }
1643 optional State state = 1;
1644 // For multi-sim phones, this distinguishes between the sim cards.
1645 optional int32 sim_slot_index = 2;
1646 // Used to identify the connection. Starts at 0 and increments by 1 for
1647 // every new network created. Resets whenever the device reboots.
1648 optional int32 data_connection_id = 3;
1649 // A bitmask for the capabilities of this connection.
1650 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1651 // Default value (if we have no information): 0
1652 optional int64 capabilities = 4;
1653 // If this connection has internet.
1654 // This just checks if the DEFAULT bit of capabilities is set.
1655 optional bool has_internet = 5;
1656}
1657
1658/**
1659 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1660 *
1661 * Logged from:
1662 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1663 */
1664message MobileRadioTechnologyChanged {
1665 optional android.telephony.NetworkTypeEnum state = 1;
1666 // For multi-sim phones, this distinguishes between the sim cards.
1667 optional int32 sim_slot_index = 2;
1668}
1669
Andrew Chantb56388b2018-03-22 21:07:33 -07001670/**
1671 * Logs the VID and PID of any connected USB devices.
1672 *
1673 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1674 *
1675 * Logged by Vendor.
1676 */
1677message UsbDeviceAttached {
1678 optional int32 vid = 1;
1679 optional int32 pid = 2;
1680 optional bool has_audio = 3;
1681 optional bool has_hid = 4;
1682 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001683 enum State {
1684 STATE_DISCONNECTED = 0;
1685 STATE_CONNECTED = 1;
1686 }
1687 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001688 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001689}
1690
Tej Singheee317b2018-03-07 19:28:05 -08001691
Tej Singhdd7bd352018-02-09 19:33:15 -08001692/**
Tej Singh5d991e12018-03-09 19:48:11 -08001693 * Logs when Bluetooth is enabled and disabled.
1694 *
1695 * Logged from:
1696 * services/core/java/com/android/server/BluetoothManagerService.java
1697 */
1698message BluetoothEnabledStateChanged {
1699 repeated AttributionNode attribution_node = 1;
1700 // Whether or not bluetooth is enabled on the device.
1701 enum State {
1702 UNKNOWN = 0;
1703 ENABLED = 1;
1704 DISABLED = 2;
1705 }
1706 optional State state = 2;
1707 // The reason for being enabled/disabled.
1708 // Eg. Airplane mode, crash, application request.
1709 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1710 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001711 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001712}
1713
1714/**
Jack Hed9837c82019-01-09 01:19:13 -08001715 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001716 *
1717 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001718 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1719 *
1720 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001721 */
1722message BluetoothConnectionStateChanged {
1723 // The state of the connection.
1724 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1725 optional android.bluetooth.ConnectionStateEnum state = 1;
1726 // An identifier that can be used to match connect and disconnect events.
1727 // Currently is last two bytes of a hash of a device level ID and
1728 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001729 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001730 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001731 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1732 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001733 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001734 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001735 // An identifier that can be used to match events for this device.
1736 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1737 // Salt: Randomly generated 256 bit value
1738 // Hash algorithm: HMAC-SHA256
1739 // Size: 32 byte
1740 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001741 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001742}
1743
1744/**
1745 * Logs when a Bluetooth device connects and disconnects over ACL
1746 *
1747 * Logged from:
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1749 *
1750 * Next Tag: 3
1751 */
1752message BluetoothAclConnectionStateChanged {
1753 // An identifier that can be used to match events for this device.
1754 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1755 // Salt: Randomly generated 256 bit value
1756 // Hash algorithm: HMAC-SHA256
1757 // Size: 32 byte
1758 // Default: null or empty if the device identifier is not known
1759 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1760 // The state of the connection.
1761 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1762 optional android.bluetooth.ConnectionStateEnum state = 2;
1763}
1764
1765/**
1766 * Logs when a Bluetooth device connects and disconnects over SCO
1767 *
1768 * Logged from:
1769 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1770 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1771 *
1772 * Next Tag: 4
1773 */
1774message BluetoothScoConnectionStateChanged {
1775 // An identifier that can be used to match events for this device.
1776 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1777 // Salt: Randomly generated 256 bit value
1778 // Hash algorithm: HMAC-SHA256
1779 // Size: 32 byte
1780 // Default: null or empty if the device identifier is not known
1781 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1782 // The state of the connection.
1783 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1784 optional android.bluetooth.ConnectionStateEnum state = 2;
1785 // Codec used for this SCO connection
1786 // Default: UNKNOWN
1787 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001788}
1789
Jack Hec27040a2019-01-09 20:54:41 -08001790/**
1791 * Logged when active device of a profile changes
1792 *
1793 * Logged from:
1794 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1795 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1796 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1797 */
1798message BluetoothActiveDeviceChanged {
1799 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1800 // From android.bluetooth.BluetoothProfile
1801 optional int32 bt_profile = 1;
1802 // An identifier that can be used to match events for this new active device.
1803 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1804 // Salt: Randomly generated 256 bit value
1805 // Hash algorithm: HMAC-SHA256
1806 // Size: 32 byte
1807 // Default: null or empty if there is no active device for this profile
1808 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1809}
1810
Jack Heab86dbd22018-12-18 15:43:27 -08001811// Logs when there is an event affecting Bluetooth device's link layer connection.
1812// - This event is triggered when there is a related HCI command or event
1813// - Users of this metrics can deduce Bluetooth device's connection state from these events
1814// - HCI commands are logged before the command is sent, after receiving command status, and after
1815// receiving command complete
1816// - HCI events are logged when they arrive
1817//
1818// Low level log from system/bt
1819//
1820// Bluetooth classic commands:
1821// - CMD_CREATE_CONNECTION
1822// - CMD_DISCONNECT
1823// - CMD_CREATE_CONNECTION_CANCEL
1824// - CMD_ACCEPT_CONNECTION_REQUEST
1825// - CMD_REJECT_CONNECTION_REQUEST
1826// - CMD_SETUP_ESCO_CONNECTION
1827// - CMD_ACCEPT_ESCO_CONNECTION
1828// - CMD_REJECT_ESCO_CONNECTION
1829// - CMD_ENH_SETUP_ESCO_CONNECTION
1830// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1831//
1832// Bluetooth low energy commands:
1833// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1834// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1835// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1836// - CMD_BLE_CLEAR_WHITE_LIST
1837// - CMD_BLE_ADD_WHITE_LIST
1838// - CMD_BLE_REMOVE_WHITE_LIST
1839//
1840// Bluetooth classic events:
1841// - EVT_CONNECTION_COMP
1842// - EVT_CONNECTION_REQUEST
1843// - EVT_DISCONNECTION_COMP
1844// - EVT_ESCO_CONNECTION_COMP
1845// - EVT_ESCO_CONNECTION_CHANGED
1846//
1847// Bluetooth low energy meta events:
1848// - BLE_EVT_CONN_COMPLETE_EVT
1849// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1850//
1851// Next tag: 10
1852message BluetoothLinkLayerConnectionEvent {
1853 // An identifier that can be used to match events for this device.
1854 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1855 // Salt: Randomly generated 256 bit value
1856 // Hash algorithm: HMAC-SHA256
1857 // Size: 32 byte
1858 // Default: null or empty if the device identifier is not known
1859 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1860 // Connection handle of this connection if available
1861 // Range: 0x0000 - 0x0EFF (12 bits)
1862 // Default: 0xFFFF if the handle is unknown
1863 optional int32 connection_handle = 2;
1864 // Direction of the link
1865 // Default: DIRECTION_UNKNOWN
1866 optional android.bluetooth.DirectionEnum direction = 3;
1867 // Type of this link
1868 // Default: LINK_TYPE_UNKNOWN
1869 optional android.bluetooth.LinkTypeEnum type = 4;
1870
1871 // Reason metadata for this link layer connection event, rules for interpretation:
1872 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1873 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1874 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1875 // set and valid, ignore hci_ble_event
1876
1877 // HCI command associated with this event
1878 // Default: CMD_UNKNOWN
1879 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1880 // HCI event associated with this event
1881 // Default: EVT_UNKNOWN
1882 optional android.bluetooth.hci.EventEnum hci_event = 6;
1883 // HCI BLE meta event associated with this event
1884 // Default: BLE_EVT_UNKNOWN
1885 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1886 // HCI command status code if this is triggerred by hci_cmd
1887 // Default: STATUS_UNKNOWN
1888 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1889 // HCI reason code associated with this event
1890 // Default: STATUS_UNKNOWN
1891 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1892}
1893
Howard Roe103fe22019-01-17 16:52:16 -08001894/**
1895 * Logs when a module is rolled back by Watchdog.
1896 *
1897 * Logged from: Rollback Manager
1898 */
1899message WatchdogRollbackOccurred {
1900 enum RollbackType {
1901 UNKNOWN = 0;
1902 ROLLBACK_INITIATE = 1;
1903 ROLLBACK_SUCCESS = 2;
1904 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001905 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001906 }
1907 optional RollbackType rollback_type = 1;
1908
1909 optional string package_name = 2;
1910
1911 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001912
1913 enum RollbackReasonType {
1914 REASON_UNKNOWN = 0;
1915 REASON_NATIVE_CRASH = 1;
1916 REASON_EXPLICIT_HEALTH_CHECK = 2;
1917 REASON_APP_CRASH = 3;
1918 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001919 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001920 }
1921 optional RollbackReasonType rollback_reason = 4;
1922
1923 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1924 // is initiated. Empty if the package is unknown.
1925 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001926
1927 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001928}
1929
Jack Hec27040a2019-01-09 20:54:41 -08001930/**
1931 * Logs when there is a change in Bluetooth A2DP playback state
1932 *
1933 * Logged from:
1934 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1935 */
1936message BluetoothA2dpPlaybackStateChanged {
1937 // An identifier that can be used to match events for this device.
1938 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1939 // Salt: Randomly generated 256 bit value
1940 // Hash algorithm: HMAC-SHA256
1941 // Size: 32 byte
1942 // Default: null or empty if the device identifier is not known
1943 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1944 // Current playback state
1945 // Default: PLAYBACK_STATE_UNKNOWN
1946 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1947 // Current audio coding mode
1948 // Default: AUDIO_CODING_MODE_UNKNOWN
1949 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1950}
1951
1952/**
1953 * Logs when there is a change in A2DP codec config for a particular remote device
1954 *
1955 * Logged from:
1956 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1957 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1958 */
1959message BluetoothA2dpCodecConfigChanged {
1960 // An identifier that can be used to match events for this device.
1961 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1962 // Salt: Randomly generated 256 bit value
1963 // Hash algorithm: HMAC-SHA256
1964 // Size: 32 byte
1965 // Default: null or empty if the device identifier is not known
1966 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1967 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1968 // Default SOURCE_CODEC_TYPE_INVALID
1969 optional int32 codec_type = 2;
1970 // Codec priroity, the higher the more preferred, -1 for disabled
1971 // Default: CODEC_PRIORITY_DEFAULT
1972 optional int32 codec_priority = 3;
1973 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1974 // Default: SAMPLE_RATE_NONE
1975 optional int32 sample_rate = 4;
1976 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1977 // Default: BITS_PER_SAMPLE_NONE
1978 optional int32 bits_per_sample = 5;
1979 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1980 // Default: CHANNEL_MODE_NONE
1981 optional int32 channel_mode = 6;
1982 // Codec specific values
1983 // Default 0
1984 optional int64 codec_specific_1 = 7;
1985 optional int64 codec_specific_2 = 8;
1986 optional int64 codec_specific_3 = 9;
1987 optional int64 codec_specific_4 = 10;
1988}
1989
1990/**
1991 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1992 * Each codec's capability is logged separately due to statsd restriction
1993 *
1994 * Logged from:
1995 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1996 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1997 */
1998message BluetoothA2dpCodecCapabilityChanged {
1999 // An identifier that can be used to match events for this device.
2000 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2001 // Salt: Randomly generated 256 bit value
2002 // Hash algorithm: HMAC-SHA256
2003 // Size: 32 byte
2004 // Default: null or empty if the device identifier is not known
2005 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2006 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2007 // Default SOURCE_CODEC_TYPE_INVALID
2008 optional int32 codec_type = 2;
2009 // Codec priroity, the higher the more preferred, -1 for disabled
2010 // Default: CODEC_PRIORITY_DEFAULT
2011 optional int32 codec_priority = 3;
2012 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2013 // in BluetoothCodecConfig
2014 // Default: empty and SAMPLE_RATE_NONE for individual item
2015 optional int32 sample_rate = 4;
2016 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2017 // in BluetoothCodecConfig
2018 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2019 optional int32 bits_per_sample = 5;
2020 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2021 // BluetoothCodecConfig
2022 // Default: empty and CHANNEL_MODE_NONE for individual item
2023 optional int32 channel_mode = 6;
2024 // Codec specific values
2025 // Default 0
2026 optional int64 codec_specific_1 = 7;
2027 optional int64 codec_specific_2 = 8;
2028 optional int64 codec_specific_3 = 9;
2029 optional int64 codec_specific_4 = 10;
2030}
2031
2032/**
2033 * Logs when A2DP failed to read from PCM source.
2034 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2035 *
2036 * Logged from:
2037 * system/bt
2038 */
2039message BluetoothA2dpAudioUnderrunReported {
2040 // An identifier that can be used to match events for this device.
2041 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2042 // Salt: Randomly generated 256 bit value
2043 // Hash algorithm: HMAC-SHA256
2044 // Size: 32 byte
2045 // Default: null or empty if the device identifier is not known
2046 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2047 // Encoding interval in nanoseconds
2048 // Default: 0
2049 optional int64 encoding_interval_nanos = 2;
2050 // Number of bytes of PCM data that could not be read from the source
2051 // Default: 0
2052 optional int32 num_missing_pcm_bytes = 3;
2053}
2054
2055/**
2056 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2057 * buffer queue is full and we have to drop data
2058 *
2059 * Logged from:
2060 * system/bt
2061 */
2062message BluetoothA2dpAudioOverrunReported {
2063 // An identifier that can be used to match events for this device.
2064 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2065 // Salt: Randomly generated 256 bit value
2066 // Hash algorithm: HMAC-SHA256
2067 // Size: 32 byte
2068 // Default: null or empty if the device identifier is not known
2069 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2070 // Encoding interval in nanoseconds
2071 // Default: 0
2072 optional int64 encoding_interval_nanos = 2;
2073 // Number of buffers dropped in this event
2074 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2075 // Default: 0
2076 optional int32 num_dropped_buffers = 3;
2077 // Number of encoded buffers dropped in this event
2078 // Default 0
2079 optional int32 num_dropped_encoded_frames = 4;
2080 // Number of encoded bytes dropped in this event
2081 // Default: 0
2082 optional int32 num_dropped_encoded_bytes = 5;
2083}
2084
2085/**
2086 * Logs when we receive reports regarding a device's RSSI value
2087 *
2088 * Logged from:
2089 * system/bt
2090 */
2091message BluetoothDeviceRssiReported {
2092 // An identifier that can be used to match events for this device.
2093 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2094 // Salt: Randomly generated 256 bit value
2095 // Hash algorithm: HMAC-SHA256
2096 // Size: 32 byte
2097 // Default: null or empty if the device identifier is not known
2098 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2099 // Connection handle of this connection if available
2100 // Range: 0x0000 - 0x0EFF (12 bits)
2101 // Default: 0xFFFF if the handle is unknown
2102 optional int32 connection_handle = 2;
2103 // HCI command status code if this is triggerred by hci_cmd
2104 // Default: STATUS_UNKNOWN
2105 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2106 // BR/EDR
2107 // Range: -128 ≤ N ≤ 127 (signed integer)
2108 // Units: dB
2109 // LE:
2110 // Range: -127 to 20, 127 (signed integer)
2111 // Units: dBm
2112 // Invalid when an out of range value is reported
2113 optional int32 rssi = 4;
2114}
2115
2116/**
2117 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2118 *
2119 * Logged from:
2120 * system/bt
2121 */
2122message BluetoothDeviceFailedContactCounterReported {
2123 // An identifier that can be used to match events for this device.
2124 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2125 // Salt: Randomly generated 256 bit value
2126 // Hash algorithm: HMAC-SHA256
2127 // Size: 32 byte
2128 // Default: null or empty if the device identifier is not known
2129 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2130 // Connection handle of this connection if available
2131 // Range: 0x0000 - 0x0EFF (12 bits)
2132 // Default: 0xFFFF if the handle is unknown
2133 optional int32 connection_handle = 2;
2134 // HCI command status code if this is triggerred by hci_cmd
2135 // Default: STATUS_UNKNOWN
2136 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2137 // Number of consecutive failed contacts for a connection corresponding to the Handle
2138 // Range: uint16_t, 0-0xFFFF
2139 // Default: 0xFFFFF
2140 optional int32 failed_contact_counter = 4;
2141}
2142
2143/**
2144 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2145 *
2146 * Logged from:
2147 * system/bt
2148 */
2149message BluetoothDeviceTxPowerLevelReported {
2150 // An identifier that can be used to match events for this device.
2151 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2152 // Salt: Randomly generated 256 bit value
2153 // Hash algorithm: HMAC-SHA256
2154 // Size: 32 byte
2155 // Default: null or empty if the device identifier is not known
2156 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2157 // Connection handle of this connection if available
2158 // Range: 0x0000 - 0x0EFF (12 bits)
2159 // Default: 0xFFFF if the handle is unknown
2160 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002161 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002162 // Default: STATUS_UNKNOWN
2163 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2164 // Range: -30 ≤ N ≤ 20
2165 // Units: dBm
2166 // Invalid when an out of range value is reported
2167 optional int32 transmit_power_level = 4;
2168}
Jack Heab86dbd22018-12-18 15:43:27 -08002169
Tej Singh5d991e12018-03-09 19:48:11 -08002170/**
Jack He1021a612019-01-20 21:22:46 -08002171 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2172 * receiving an HCI command from the host
2173 *
2174 * Logged from: system/bt
2175 */
2176message BluetoothHciTimeoutReported {
2177 // HCI command associated with this event
2178 // Default: CMD_UNKNOWN
2179 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2180}
2181
2182/**
2183 * Logs when we receive Bluetooth Link Quality Report event from the controller
2184 * See Android Bluetooth HCI specification for more details
2185 *
2186 * Note: all count and bytes field are counted since last event
2187 *
2188 * Logged from: system/bt
2189 */
2190message BluetoothQualityReportReported {
2191 // Quality report ID
2192 // Original type: uint8_t
2193 // Default: BQR_ID_UNKNOWN
2194 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2195 // Packet type of the connection
2196 // Original type: uint8_t
2197 // Default: BQR_PACKET_TYPE_UNKNOWN
2198 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2199 // Connection handle of the connection
2200 // Original type: uint16_t
2201 optional int32 connection_handle = 3;
2202 // Performing Role for the connection
2203 // Original type: uint8_t
2204 optional int32 connection_role = 4;
2205 // Current Transmit Power Level for the connection. This value is the same as the controller's
2206 // response to the HCI_Read_Transmit_Power_Level HCI command
2207 // Original type: uint8_t
2208 optional int32 tx_power_level = 5;
2209 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2210 // absolute receiver signal strength value
2211 // Original type: int8_t
2212 optional int32 rssi = 6;
2213 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2214 // channels used by the link currently
2215 // Original type: uint8_t
2216 optional int32 snr = 7;
2217 // Indicates the number of unused channels in AFH_channel_map
2218 // Original type: uint8_t
2219 optional int32 unused_afh_channel_count = 8;
2220 // Indicates the number of the channels which are interfered and quality is bad but are still
2221 // selected for AFH
2222 // Original type: uint8_t
2223 optional int32 afh_select_unideal_channel_count = 9;
2224 // Current Link Supervision Timeout Setting
2225 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2226 // Original type: uint16_t
2227 optional int32 lsto = 10;
2228 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2229 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2230 // 0x01 (Piconet Clock)
2231 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2232 // Original type: uint32_t
2233 optional int64 connection_piconet_clock = 11;
2234 // The count of retransmission
2235 // Original type: uint32_t
2236 optional int64 retransmission_count = 12;
2237 // The count of no RX
2238 // Original type: uint32_t
2239 optional int64 no_rx_count = 13;
2240 // The count of NAK (Negative Acknowledge)
2241 // Original type: uint32_t
2242 optional int64 nak_count = 14;
2243 // Controller timestamp of last TX ACK
2244 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2245 // Original type: uint32_t
2246 optional int64 last_tx_ack_timestamp = 15;
2247 // The count of Flow-off (STOP)
2248 // Original type: uint32_t
2249 optional int64 flow_off_count = 16;
2250 // Controller timestamp of last Flow-on (GO)
2251 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2252 // Original type: uint32_t
2253 optional int64 last_flow_on_timestamp = 17;
2254 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2255 // Original type: uint32_t
2256 optional int64 buffer_overflow_bytes = 18;
2257 // Buffer underflow count (in byte) since last event
2258 // Original type: uint32_t
2259 optional int64 buffer_underflow_bytes = 19;
2260}
2261
2262/**
2263 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2264 *
2265 * Notes:
2266 * - Each event can be partially filled as we might learn different pieces of device
2267 * information at different time
2268 * - Multiple device info events can be combined to give more complete picture
2269 * - When multiple device info events tries to describe the same information, the
2270 * later one wins
2271 *
2272 * Logged from:
2273 * packages/apps/Bluetooth
2274 */
Jack Heaea26982019-04-04 11:19:48 -07002275message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002276 // An identifier that can be used to match events for this device.
2277 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2278 // Salt: Randomly generated 256 bit value
2279 // Hash algorithm: HMAC-SHA256
2280 // Size: 32 byte
2281 // Default: null or empty if the device identifier is not known
2282 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2283 // Where is this device info obtained from
2284 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2285 // Name of the data source
2286 // For EXTERNAL: package name of the data source
2287 // For INTERNAL: null for general case, component name otherwise
2288 optional string source_name = 3;
2289 // Name of the manufacturer of this device
2290 optional string manufacturer = 4;
2291 // Model of this device
2292 optional string model = 5;
2293 // Hardware version of this device
2294 optional string hardware_version = 6;
2295 // Software version of this device
2296 optional string software_version = 7;
2297}
2298
2299/**
2300 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2301 * device, as documented by the Bluetooth Core HCI specification
2302 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2303 * Vol 2, Part E, Page 1118
2304 *
2305 * Logged from:
2306 * system/bt
2307 */
2308message BluetoothRemoteVersionInfoReported {
2309 // Connection handle of the connection
2310 // Original type: uint16_t
2311 optional int32 connection_handle = 1;
2312 // HCI command status code
2313 // Default: STATUS_UNKNOWN
2314 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2315 // 1 byte Version of current LMP in the remote controller
2316 optional int32 lmp_version = 3;
2317 // 2 bytes LMP manufacturer code of the remote controller
2318 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2319 optional int32 lmp_manufacturer_code = 4;
2320 // 4 bytes subversion of the LMP in the remote controller
2321 optional int32 lmp_subversion = 5;
2322}
2323
2324/**
2325 * Logs when certain Bluetooth SDP attributes are discovered
2326 * Constant definitions are from:
2327 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2328 *
2329 * Current logged attributes:
2330 * - BluetoothProfileDescriptorList
2331 * - Supported Features Bitmask
2332 *
2333 * Logged from:
2334 * system/bt
2335 */
2336message BluetoothSdpAttributeReported {
2337 // An identifier that can be used to match events for this device.
2338 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2339 // Salt: Randomly generated 256 bit value
2340 // Hash algorithm: HMAC-SHA256
2341 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2342 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2343 // Original type: uint16_t
2344 optional int32 protocol_uuid = 2;
2345 // Short form UUIDs used to identify Bluetooth SDP attribute types
2346 // Original type: uint16_t
2347 optional int32 attribute_id = 3;
2348 // Attribute value for the particular attribute
2349 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2350}
2351
2352/**
2353 * Logs when bond state of a Bluetooth device changes
2354 *
2355 * Logged from:
2356 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2357 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2358 */
2359message BluetoothBondStateChanged {
2360 // An identifier that can be used to match events for this device.
2361 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2362 // Salt: Randomly generated 256 bit value
2363 // Hash algorithm: HMAC-SHA256
2364 // Size: 32 byte
2365 // Default: null or empty if the device identifier is not known
2366 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2367 // Preferred transport type to remote dual mode device
2368 // Default: TRANSPORT_AUTO means no preference
2369 optional android.bluetooth.TransportTypeEnum transport = 2;
2370 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2371 // Default: UNKNOWN
2372 optional android.bluetooth.DeviceTypeEnum type = 3;
2373 // Current bond state (NONE, BONDING, BONDED)
2374 // Default: BOND_STATE_UNKNOWN
2375 optional android.bluetooth.BondStateEnum bond_state = 4;
2376 // Bonding sub state
2377 // Default: BOND_SUB_STATE_UNKNOWN
2378 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2379 // Unbond Reason
2380 // Default: UNBOND_REASON_UNKNOWN
2381 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2382}
2383
2384/**
2385 * Logs there is an event related Bluetooth classic pairing
2386 *
2387 * Logged from:
2388 * system/bt
2389 */
2390message BluetoothClassicPairingEventReported {
2391 // An identifier that can be used to match events for this device.
2392 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2393 // Salt: Randomly generated 256 bit value
2394 // Hash algorithm: HMAC-SHA256
2395 // Size: 32 byte
2396 // Default: null or empty if the device identifier is not known
2397 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2398 // Connection handle of this connection if available
2399 // Range: 0x0000 - 0x0EFF (12 bits)
2400 // Default: 0xFFFF if the handle is unknown
2401 optional int32 connection_handle = 2;
2402 // HCI command associated with this event
2403 // Default: CMD_UNKNOWN
2404 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2405 // HCI event associated with this event
2406 // Default: EVT_UNKNOWN
2407 optional android.bluetooth.hci.EventEnum hci_event = 4;
2408 // HCI command status code if this is triggerred by hci_cmd
2409 // Default: STATUS_UNKNOWN
2410 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2411 // HCI reason code associated with this event
2412 // Default: STATUS_UNKNOWN
2413 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002414 // A status value related to this specific event
2415 // Default: 0
2416 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002417}
2418
2419/**
2420 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2421 *
2422 * Logged from:
2423 * system/bt
2424 */
2425message BluetoothSmpPairingEventReported {
2426 // An identifier that can be used to match events for this device.
2427 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2428 // Salt: Randomly generated 256 bit value
2429 // Hash algorithm: HMAC-SHA256
2430 // Size: 32 byte
2431 // Default: null or empty if the device identifier is not known
2432 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2433 // SMP command sent or received over L2CAP
2434 // Default: CMD_UNKNOWN
2435 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2436 // Whether this command is sent or received
2437 // Default: DIRECTION_UNKNOWN
2438 optional android.bluetooth.DirectionEnum direction = 3;
2439 // SMP failure reason code
2440 // Default: PAIRING_FAIL_REASON_DEFAULT
2441 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2442}
2443
2444/**
Jack He815cdba2019-01-30 17:24:55 -08002445 * Logs when a Bluetooth socket’s connection state changed
2446 *
2447 * Logged from:
2448 * system/bt
2449 */
2450message BluetoothSocketConnectionStateChanged {
2451 // An identifier that can be used to match events for this device.
2452 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2453 // Salt: Randomly generated 256 bit value
2454 // Hash algorithm: HMAC-SHA256
2455 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002456 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002457 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002458 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002459 // Default 0 when unknown or don't care
2460 optional int32 port = 2;
2461 // Socket type as mentioned in
2462 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2463 // Default: SOCKET_TYPE_UNKNOWN
2464 optional android.bluetooth.SocketTypeEnum type = 3;
2465 // Socket connection state
2466 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2467 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2468 // Number of bytes sent to remote device during this connection
2469 optional int64 tx_bytes = 5;
2470 // Number of bytes received from remote device during this connection
2471 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002472 // Socket owner's UID
2473 optional int32 uid = 7 [(is_uid) = true];
2474 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2475 // |port| must be spawned by |server_port|
2476 // Default 0 when unknown or don't care
2477 optional int32 server_port = 8;
2478 // Whether this is a server listener socket
2479 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002480}
2481
2482/**
Jack He71426802019-04-02 13:32:52 -07002483 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2484 *
2485 * Logged from:
2486 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2487 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2488 *
2489 */
2490message BluetoothClassOfDeviceReported {
2491 // An identifier that can be used to match events for this device.
2492 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2493 // Salt: Randomly generated 256 bit value
2494 // Hash algorithm: HMAC-SHA256
2495 // Size: 32 byte
2496 // Default: null or empty if this is a server listener socket
2497 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2498 // Class of Device (CoD) value including both Major, Minor device class and service class
2499 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2500 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2501 // Default: 0
2502 optional int32 class_of_device = 2;
2503}
2504
2505/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002506 * Logs when something is plugged into or removed from the USB-C connector.
2507 *
2508 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002509 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002510 */
2511message UsbConnectorStateChanged {
2512 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002513 STATE_DISCONNECTED = 0;
2514 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002515 }
2516 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002517 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002518 // Last active session in ms.
2519 // 0 when the port is in connected state.
2520 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002521}
2522
2523/**
2524 * Logs the reported speaker impedance.
2525 *
2526 * Logged from:
2527 * Vendor audio implementation.
2528 */
2529message SpeakerImpedanceReported {
2530 optional int32 speaker_location = 1;
2531 optional int32 impedance = 2;
2532}
2533
2534/**
2535 * Logs the report of a failed hardware.
2536 *
2537 * Logged from:
2538 * Vendor HALs.
2539 *
2540 */
2541message HardwareFailed {
2542 enum HardwareType {
2543 HARDWARE_FAILED_UNKNOWN = 0;
2544 HARDWARE_FAILED_MICROPHONE = 1;
2545 HARDWARE_FAILED_CODEC = 2;
2546 HARDWARE_FAILED_SPEAKER = 3;
2547 HARDWARE_FAILED_FINGERPRINT = 4;
2548 }
2549 optional HardwareType hardware_type = 1;
2550
Maggie White6dcd8572019-01-31 14:11:50 -08002551 /**
2552 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002553 * the same hardware_type. The specific locations are vendor defined integers,
2554 * referring to board-specific numbering schemes.
2555 */
2556 optional int32 hardware_location = 2;
2557
Maggie White6dcd8572019-01-31 14:11:50 -08002558 /**
2559 * failure_code is specific to the HardwareType of the failed hardware.
2560 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002561 */
Maggie White6dcd8572019-01-31 14:11:50 -08002562 enum HardwareErrorCode {
2563 UNKNOWN = 0;
2564 COMPLETE = 1;
2565 SPEAKER_HIGH_Z = 2;
2566 SPEAKER_SHORT = 3;
2567 FINGERPRINT_SENSOR_BROKEN = 4;
2568 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002569 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002570 }
2571 optional int32 failure_code = 3;
2572}
2573
2574/**
2575 * Log an event when the device has been physically dropped.
2576 * Reported from the /vendor partition.
2577 */
2578message PhysicalDropDetected {
2579 // Confidence that the event was actually a drop, 0 -> 100
2580 optional int32 confidence_pctg = 1;
2581 // Peak acceleration of the drop, in 1/1000s of a g.
2582 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002583 // Duration of freefall in ms
2584 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002585}
2586
2587/**
2588 * Log bucketed battery charge cycles.
2589 *
2590 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002591 * a given charge point. For example, if 10 cycle buckets are
2592 * initialized, bucket 1 is the lowest 1/10th of the battery,
2593 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002594 *
2595 * Logged from:
2596 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2597 */
2598message ChargeCyclesReported {
2599 optional int32 cycle_bucket_1 = 1;
2600 optional int32 cycle_bucket_2 = 2;
2601 optional int32 cycle_bucket_3 = 3;
2602 optional int32 cycle_bucket_4 = 4;
2603 optional int32 cycle_bucket_5 = 5;
2604 optional int32 cycle_bucket_6 = 6;
2605 optional int32 cycle_bucket_7 = 7;
2606 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002607 optional int32 cycle_bucket_9 = 9;
2608 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002609}
2610
2611/**
Howard Roa46b6582018-09-18 16:45:02 -07002612 * Log battery health snapshot.
2613 *
2614 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2615 * are snapshotted periodically over 24hrs.
2616 */
2617message BatteryHealthSnapshot {
2618 enum BatterySnapshotType {
2619 UNKNOWN = 0;
2620 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2621 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2622 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2623 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2624 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2625 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2626 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2627 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2628 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2629 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2630 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2631 }
2632 optional BatterySnapshotType type = 1;
2633 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002634 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002635 // Voltage Battery Voltage, in microVolts.
2636 optional int32 voltage_micro_volt = 3;
2637 // Current Battery current, in microAmps.
2638 optional int32 current_micro_amps = 4;
2639 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2640 optional int32 open_circuit_micro_volt = 5;
2641 // Resistance Battery Resistance, in microOhms.
2642 optional int32 resistance_micro_ohm = 6;
2643 // Level Battery Level, as % of full.
2644 optional int32 level_percent = 7;
2645}
2646
2647/**
2648 * Log slow I/O operations on the primary storage.
2649 */
2650message SlowIo {
2651 // Classifications of IO Operations.
2652 enum IoOperation {
2653 UNKNOWN = 0;
2654 READ = 1;
2655 WRITE = 2;
2656 UNMAP = 3;
2657 SYNC = 4;
2658 }
2659 optional IoOperation operation = 1;
2660
2661 // The number of slow IO operations of this type over 24 hours.
2662 optional int32 count = 2;
2663}
2664
2665/**
2666 * Log battery caused shutdown with the last recorded voltage.
2667 */
2668message BatteryCausedShutdown {
2669 // The last recorded battery voltage prior to shutdown.
2670 optional int32 last_recorded_micro_volt = 1;
2671}
2672
2673/**
Tej Singha72344992019-04-17 18:55:08 -07002674 * Logs when ThermalService receives throttling events.
2675 *
2676 * Logged from:
2677 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2678 */
2679message ThermalThrottlingSeverityStateChanged {
2680 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2681 optional android.os.TemperatureTypeEnum sensor_type = 1;
2682
2683 // The name of the temperature source. Eg. CPU0
2684 optional string sensor_name = 2;
2685
2686 // Temperature in tenths of a degree C.
2687 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2688 optional int32 temperature_deci_celsius = 3;
2689
2690 // Relative severity of the throttling, see enum definition.
2691 optional android.os.ThrottlingSeverityEnum severity = 4;
2692}
2693
2694/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002695 * Logs the duration of a davey (jank of >=700ms) when it occurs
2696 *
2697 * Logged from:
2698 * frameworks/base/libs/hwui/JankTracker.cpp
2699 */
2700message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002701 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002702 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002703
Tej Singhbb8554a2018-01-26 11:59:14 -08002704 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002705 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002706}
2707
2708/**
Bookatze5885242017-10-24 20:10:31 -07002709 * Logs phone signal strength changes.
2710 *
2711 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002712 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002713 */
2714message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002715 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2716 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002717}
2718
Yangster4ccebea2018-10-09 17:09:02 -07002719
2720/**
2721 * Logs when the phone state, sim state or signal strength changes
2722 *
2723 * Logged from:
2724 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2725 */
2726message PhoneServiceStateChanged {
2727 optional android.telephony.ServiceStateEnum state = 1;
2728 optional android.telephony.SimStateEnum sim_state = 2;
2729 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2730}
2731
2732/**
2733 * Logs when the phone becomes on or off.
2734 *
2735 * Logged from:
2736 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2737 */
2738message PhoneStateChanged {
2739 enum State {
2740 OFF = 0;
2741 ON = 1;
2742 }
2743 optional State state = 1;
2744}
2745
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002746message BackGesture {
2747 enum BackType {
2748 DEFAULT_BACK_TYPE = 0;
2749 COMPLETED = 1;
2750 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2751 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2752 INCOMPLETE = 4;
2753 }
2754 optional BackType type = 1;
2755
2756 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2757 enum WindowHorizontalLocation {
2758 DEFAULT_LOCATION = 0;
2759 LEFT = 1;
2760 RIGHT = 2;
2761 }
2762 optional WindowHorizontalLocation x_location = 3;
2763}
2764
2765message ExclusionRectStateChanged {
2766 optional string component_name = 1; // if not available, simply packageName
2767 optional int32 requested_height = 2; // px
2768 optional int32 rejected_height = 3; // px
2769
2770 enum WindowHorizontalLocation {
2771 DEFAULT_LOCATION = 0;
2772 LEFT = 1;
2773 RIGHT = 2;
2774 }
2775 optional WindowHorizontalLocation x_location = 4;
2776 optional bool landscape = 5;
2777 optional bool splitscreen = 6;
2778 optional int32 duration_millis = 7;
2779}
2780
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002781message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002782 optional android.stats.launcher.LauncherAction action = 1;
2783 optional android.stats.launcher.LauncherState src_state = 2;
2784 optional android.stats.launcher.LauncherState dst_state = 3;
2785 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002786 optional bool is_swipe_up_enabled = 5;
2787}
2788
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002789message StyleUIChanged {
2790 optional android.stats.style.Action action = 1;
2791 optional int32 color_package_hash = 2;
2792 optional int32 font_package_hash = 3;
2793 optional int32 shape_package_hash = 4;
2794 optional int32 clock_package_hash = 5;
2795 optional int32 launcher_grid = 6;
2796 optional int32 wallpaper_category_hash = 7;
2797 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002798 optional int32 color_preference = 9;
2799 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002800}
2801
David Chenc28b2bb2017-10-24 12:52:52 -07002802/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002803 * Logs when Settings UI has changed.
2804 *
2805 * Logged from:
2806 * packages/apps/Settings
2807 */
2808message SettingsUIChanged {
2809 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002810 * Where this SettingsUIChange event comes from. For example, if
2811 * it's a PAGE_VISIBLE event, where the page is opened from.
2812 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002813 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002814
2815 /**
2816 * What the UI action is.
2817 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002818 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002819
2820 /**
2821 * Where the action is happening
2822 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002823 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002824
2825 /**
2826 * What preference changed in this event.
2827 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002828 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002829
2830 /**
2831 * The new value of the changed preference.
2832 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002833 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002834}
2835
2836/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002837 * Logs basic timing information about touch events.
2838 * Reported at most every 5 minutes while device is being interacted with.
2839 *
2840 * Logged from:
2841 * frameworks/native/services/inputflinger
2842 */
2843message TouchEventReported {
2844 /**
2845 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002846 * and the standard deviation of the time spent processing touchscreen events
2847 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002848 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002849 * On supported devices, the starting point is taken during the hard interrupt inside the
2850 * kernel touch driver. On all other devices, the starting point is taken inside
2851 * the kernel's input event subsystem upon receipt of the input event.
2852 * The ending point is taken inside InputDispatcher, just after the input event
2853 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002854 */
2855 // Minimum value
2856 optional float latency_min_micros = 1;
2857 // Maximum value
2858 optional float latency_max_micros = 2;
2859 // Average value
2860 optional float latency_mean_micros = 3;
2861 // Standard deviation
2862 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002863 // Number of touch events (input_event) in this report
2864 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002865}
2866
2867/**
Philip Quinn0eded622019-01-29 12:46:28 -08002868 * Logs gesture classification and timing information for touch events.
2869 *
2870 * Logged from:
2871 * frameworks/base/core/java/android/view/GestureDetector.java
2872 * frameworks/base/core/java/android/view/View.java
2873 */
2874message TouchGestureClassified {
2875 // The source of the classification (e.g. Java class name).
2876 optional string source = 1;
2877
2878 enum Classification {
2879 UNKNOWN_CLASSIFICATION = 0;
2880 SINGLE_TAP = 1;
2881 DOUBLE_TAP = 2;
2882 LONG_PRESS = 3;
2883 DEEP_PRESS = 4;
2884 SCROLL = 5;
2885 }
2886 // The classification of the gesture.
2887 optional Classification classification = 2;
2888
2889 // The interval from the start of a touch event stream until the
2890 // classification was made.
2891 optional int32 latency_millis = 3;
2892
2893 // The distance from the location of the first touch event to the
2894 // location of the touch event when the classification was made.
2895 optional float displacement_px = 4;
2896}
2897
2898/**
David Chenc28b2bb2017-10-24 12:52:52 -07002899 * Logs that a setting was updated.
2900 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002901 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002902 * The tag and is_default allow resetting of settings to default values based on the specified
2903 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2904 */
2905message SettingChanged {
2906 // The name of the setting.
2907 optional string setting = 1;
2908
2909 // The change being imposed on this setting. May represent a number, eg "3".
2910 optional string value = 2;
2911
2912 // The new value of this setting. For most settings, this is same as value. For some settings,
2913 // value is +X or -X where X represents an element in a set. For example, if the previous value
2914 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2915 // The +/- feature is currently only used for location_providers_allowed.
2916 optional string new_value = 3;
2917
2918 // The previous value of this setting.
2919 optional string prev_value = 4;
2920
2921 // The tag used with the is_default for resetting sets of settings. This is generally null.
2922 optional string tag = 5;
2923
Bookatz90867622018-01-31 15:05:57 -08002924 // True if this setting with tag should be resettable.
2925 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002926
David Chenbd789912018-03-16 17:19:55 -07002927 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002928 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002929
2930 enum ChangeReason {
2931 UPDATED = 1; // Updated can be an insertion or an update.
2932 DELETED = 2;
2933 }
2934 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002935}
Chenjie Yub3dda412017-10-24 13:41:59 -07002936
Chenjie Yu05013b32017-11-21 10:21:41 -08002937/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002938 * Logs activity going to foreground or background
2939 *
2940 * Logged from:
2941 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2942 */
2943message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002944 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002945 optional string pkg_name = 2;
2946 optional string class_name = 3;
2947
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002948 enum State {
2949 BACKGROUND = 0;
2950 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002951 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002952 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002953}
David Chenc8a43242017-10-17 16:23:28 -07002954
2955/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002956 * Logs when a volume entered low Storage state.
2957 * Logged from:
2958 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2959 */
2960message LowStorageStateChanged {
2961 // Volume that ran out of storage.
2962 optional string volume_description = 1;
2963
2964 enum State {
2965 UNKNOWN = 0;
2966 OFF = 1;
2967 ON = 2;
2968 }
2969 optional State state = 2;
2970}
2971
2972/**
2973 * Logs when an app is downgraded.
2974 * Logged from:
2975 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2976 */
2977message AppDowngraded {
2978 optional string package_name = 1;
2979 // Size of the package (all data) before being downgraded.
2980 optional int64 size_in_bytes_before = 2;
2981 // Size of the package (all data) after being downgraded.
2982 optional int64 size_in_bytes_after = 3;
2983
2984 optional bool aggressive = 4;
2985}
2986
2987/**
2988 * Logs when an app is optimized after being downgraded.
2989 * Logged from:
2990 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2991 */
2992message AppOptimizedAfterDowngraded {
2993 optional string package_name = 1;
2994}
2995
2996/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002997 * Logs whenever an app is installed on external storage.
2998 * Logged from:
2999 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3000 */
3001message AppInstallOnExternalStorageReported {
3002 // The type of external storage.
3003 optional android.stats.storage.ExternalStorageType storage_type = 1;
3004 // The name of the package that is installed on the sd card.
3005 optional string package_name = 2;
3006}
3007
3008/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003009 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003010 * Logged from:
3011 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3012 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003013message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003014 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003015
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003016 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003017
3018 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003019 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003020 optional string process_name = 3;
3021
3022 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003023 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003024
3025 optional string package_name = 5;
3026
3027 enum InstantApp {
3028 UNAVAILABLE = 0;
3029 FALSE = 1;
3030 TRUE = 2;
3031 }
3032 optional InstantApp is_instant_app = 6;
3033
3034 enum ForegroundState {
3035 UNKNOWN = 0;
3036 BACKGROUND = 1;
3037 FOREGROUND = 2;
3038 }
3039 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003040
3041 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003042}
David Chen9e3808c2017-11-20 17:25:34 -08003043
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003044/**
3045 * Logs when a WTF (What a Terrible Failure) happened.
3046 * Logged from:
3047 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3048 */
3049message WTFOccurred {
3050 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003051
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003052 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003053
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003054 // The name of the process.
3055 // system_server if it is not by an app
3056 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003057
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003058 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003059 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003060
3061 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003062}
3063
3064/**
3065 * Logs when system server reports low memory.
3066 * Logged from:
3067 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3068 */
3069message LowMemReported {
3070}
3071
3072/**
3073 * Logs when an app ANR (App Not Responding) occurs.
3074 * Logged from:
3075 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3076 */
3077message ANROccurred {
3078 optional int32 uid = 1 [(is_uid) = true];
3079
3080 optional string process_name = 2;
3081
3082 optional string short_component_name = 3;
3083
3084 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003085
3086 enum InstantApp {
3087 UNAVAILABLE = 0;
3088 FALSE = 1;
3089 TRUE = 2;
3090 }
3091 optional InstantApp is_instant_app = 5;
3092
3093 enum ForegroundState {
3094 UNKNOWN = 0;
3095 BACKGROUND = 1;
3096 FOREGROUND = 2;
3097 }
3098 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003099
3100 optional android.server.ErrorSource error_source = 7;
3101
3102 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003103}
3104
Bookatza7020bd2018-08-28 16:29:35 -07003105/**
3106 * Logs when the vibrator state changes.
3107 * Logged from:
3108 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3109 */
3110message VibratorStateChanged {
3111 repeated AttributionNode attribution_node = 1;
3112
3113 enum State {
3114 OFF = 0;
3115 ON = 1;
3116 }
3117 optional State state = 2;
3118
3119 // Duration (in milliseconds) requested to keep the vibrator on.
3120 // Only applicable for State == ON.
3121 optional int64 duration_millis = 3;
3122}
3123
David Chen0a368b22017-12-06 16:28:16 -08003124/*
3125 * Allows other apps to push events into statsd.
3126 * Logged from:
3127 * frameworks/base/core/java/android/util/StatsLog.java
3128 */
David Chen0b5c90c2018-01-25 16:51:49 -08003129message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003130 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003131 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003132
3133 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3134 optional int32 label = 2;
3135
3136 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3137 // predicates for the metrics).
3138 enum State {
3139 UNKNOWN = 0;
3140 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3141 STOP = 2;
3142 START = 3;
3143 }
3144 optional State state = 3;
3145}
3146
David Chen9e3808c2017-11-20 17:25:34 -08003147/**
Bookatz7948c872018-09-04 12:58:33 -07003148 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3149 * For example, this could be due to the user manually changing the time.
3150 *
3151 * Logged from:
3152 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3153 */
3154message WallClockTimeShifted {
3155 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3156 optional int64 wall_clock_timestamp_millis = 1;
3157}
3158
3159/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003160 * Logs when statsd detects an anomaly.
3161 *
3162 * Logged from:
3163 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3164 */
3165message AnomalyDetected {
3166 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003167 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003168
Yangster-mac94e197c2018-01-02 16:03:03 -08003169 // Id of the config whose anomaly detection alert fired.
3170 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003171
Yangster-mac94e197c2018-01-02 16:03:03 -08003172 // Id of the alert (i.e. name of the anomaly that was detected).
3173 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003174}
3175
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003176message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003177 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003178 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003179
3180 // The app package name.
3181 optional string pkg_name = 2;
3182
3183 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003184 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003185 WARM = 1;
3186 HOT = 2;
3187 COLD = 3;
3188 }
3189 // The transition type.
3190 optional TransitionType type = 3;
3191
3192 // The activity name.
3193 optional string activity_name = 4;
3194
3195 // The name of the calling app. Empty if not set.
3196 optional string calling_pkg_name = 5;
3197
3198 // Whether the app is an instant app.
3199 optional bool is_instant_app = 6;
3200
3201 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003202 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003203
Bookatz80d11a02018-01-16 10:46:35 -08003204 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003205
David Chen0b5c90c2018-01-25 16:51:49 -08003206 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003207 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003208 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003209 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003210 optional int32 bind_application_delay_millis = 11;
3211 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003212
3213 // Empty if not set.
3214 optional string launch_token = 13;
3215
Calin Juravle759fbda2018-02-20 19:52:30 +00003216 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003217 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003218
3219 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003220 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003221}
3222
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003223message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003224 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003225 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003226
3227 // The app package name.
3228 optional string pkg_name = 2;
3229
3230 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003231 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003232 WARM = 1;
3233 HOT = 2;
3234 COLD = 3;
3235 }
3236 // The transition type.
3237 optional TransitionType type = 3;
3238
3239 // The activity name.
3240 optional string activity_name = 4;
3241}
3242
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003243message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003244 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003245 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003246
3247 // The app package name.
3248 optional string pkg_name = 2;
3249
3250 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003251 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003252 WITH_BUNDLE = 1;
3253 WITHOUT_BUNDLE = 2;
3254 }
3255 // The transition type.
3256 optional TransitionType type = 3;
3257
3258 // The activity name.
3259 optional string activity_name = 4;
3260
3261 optional bool transition_process_running = 5;
3262
3263 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003264 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003265}
3266
Bookatz8fcd09a2017-12-18 13:01:10 -08003267/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003268 * Logs a picture-in-picture action
3269 * Logged from:
3270 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3271 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3272 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3273 */
3274message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003275 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003276 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003277
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003278 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003279
Chenjie Yu52cacc62017-12-08 18:11:45 -08003280 enum State {
3281 ENTERED = 1;
3282 EXPANDED_TO_FULL_SCREEN = 2;
3283 MINIMIZED = 3;
3284 DISMISSED = 4;
3285 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003286 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003287}
3288
3289/**
Chenjie Yue8904192017-12-08 19:12:57 -08003290 * Logs overlay action
3291 * Logged from:
3292 * services/core/java/com/android/server/wm/Session.java
3293 */
3294message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003295 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003296
tsaichristine5adc7e02020-01-14 17:07:39 -08003297 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003298
3299 optional bool using_alert_window = 3;
3300
3301 enum State {
3302 ENTERED = 1;
3303 EXITED = 2;
3304 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003305 optional State state = 4 [
3306 (state_field_option).option = EXCLUSIVE_STATE,
3307 (state_field_option).nested = false,
3308 (state_field_option).default_state_value = 2
3309 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003310}
3311
Adam Bookatz38767932020-02-05 12:13:40 -08003312/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003313 * Logs foreground service starts and stops.
3314 * Note that this is not when a service starts or stops, but when it is
3315 * considered foreground.
3316 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003317 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003318 */
3319message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003320 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003321 // package_name + "/" + class_name
3322 optional string short_name = 2;
3323
3324 enum State {
3325 ENTER = 1;
3326 EXIT = 2;
3327 }
3328 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003329
3330 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3331 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3332 optional bool allow_while_in_use_permission = 4;
3333}
3334
3335/**
3336 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3337 * A foreground service session is any continuous period during which the uid holds at least one
3338 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3339 * Accesses initiated while the uid is in the TOP state are ignored.
3340 * Sessions with no attempted accesses are not logged.
3341 * Logged from
3342 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3343 */
3344message ForegroundServiceAppOpSessionEnded {
3345 optional int32 uid = 1 [(is_uid) = true];
3346
3347 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003348 // Only following four ops are logged
3349 // COARSE_LOCATION = 0
3350 // FINE_LOCATION = 1
3351 // CAMERA = 26
3352 // RECORD_AUDIO = 27
3353 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003354
3355 // The uid's permission mode for accessing the AppOp during this fgs session.
3356 enum Mode {
3357 MODE_UNKNOWN = 0;
3358 MODE_ALLOWED = 1; // Always allowed
3359 MODE_IGNORED = 2; // Denied
3360 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3361 }
3362 optional Mode app_op_mode = 3;
3363
3364 // Number of times this AppOp was requested and allowed.
3365 optional int32 count_ops_accepted = 4;
3366 // Number of times this AppOp was requested but denied.
3367 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003368}
3369
Chenjie Yue8904192017-12-08 19:12:57 -08003370/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003371 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3372 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3373 * attributed back to the parent (host) uid. One example is Chrome.
3374 *
3375 * Logged from:
3376 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3377 */
3378message IsolatedUidChanged {
3379 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003380 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003381 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003382 optional int32 parent_uid = 1;
3383
3384 optional int32 isolated_uid = 2;
3385
3386 // We expect an isolated uid to be removed before if it's used for another parent uid.
3387 enum Event {
3388 REMOVED = 0;
3389 CREATED = 1;
3390 }
3391 optional Event event = 3;
3392}
3393
3394/*
3395 * Logs the reception of an incoming network packet causing the main system to wake up for
3396 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3397 * and processed by WakeupController.cpp.
3398 */
3399message PacketWakeupOccurred {
3400 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3401 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003402 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003403 // The interface name on which the packet was received.
3404 optional string iface = 2;
3405 // The ethertype value of the packet.
3406 optional int32 ethertype = 3;
3407 // String representation of the destination MAC address of the packet.
3408 optional string destination_hardware_address = 4;
3409 // String representation of the source address of the packet if this was an IP packet.
3410 optional string source_ip = 5;
3411 // String representation of the destination address of the packet if this was an IP packet.
3412 optional string destination_ip = 6;
3413 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3414 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3415 // families.
3416 optional int32 ip_next_header = 7;
3417 // The source port if this was a TCP or UDP packet.
3418 optional int32 source_port = 8;
3419 // The destination port if this was a TCP or UDP packet.
3420 optional int32 destination_port = 9;
3421}
3422
3423/*
3424 * Logs the memory stats for an app on startup.
3425 * Logged from:
3426 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3427 */
3428message AppStartMemoryStateCaptured {
3429 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003430 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003431
3432 // The process name.
3433 optional string process_name = 2;
3434
3435 // The activity name.
3436 optional string activity_name = 3;
3437
3438 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003439 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003440
3441 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003442 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003443
3444 // RSS
3445 optional int64 rss_in_bytes = 6;
3446
3447 // CACHE
3448 optional int64 cache_in_bytes = 7;
3449
3450 // SWAP
3451 optional int64 swap_in_bytes = 8;
3452}
3453
3454/*
3455 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3456 * for LMK event.
3457 * Logged from:
3458 * system/core/lmkd/lmkd.c
3459 */
3460message LmkStateChanged {
3461 enum State {
3462 UNKNOWN = 0;
3463 START = 1;
3464 STOP = 2;
3465 }
3466 optional State state = 1;
3467}
3468
3469/*
3470 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3471 * Logged from:
3472 * system/core/lmkd/lmkd.c
3473 */
3474message LmkKillOccurred {
3475 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003476 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003477
3478 // The process name.
3479 optional string process_name = 2;
3480
3481 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003482 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003483
3484 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003485 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003486
3487 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003488 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003489
3490 // RSS
3491 optional int64 rss_in_bytes = 6;
3492
3493 // CACHE
3494 optional int64 cache_in_bytes = 7;
3495
3496 // SWAP
3497 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003498
3499 // The elapsed real time of start of the process.
3500 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003501
3502 // Min oom adj score considered by lmkd.
3503 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003504}
3505
Rajeev Kumar51b54602018-03-01 12:18:26 -08003506/*
3507 * Logs when the ActivityManagerService detects that an app died.
3508 *
3509 * Logged from:
3510 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3511 */
3512message AppDied {
3513 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003514 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003515}
3516
Howard Ro21a039c2018-08-06 14:55:47 -07003517/**
3518 * An atom for generic metrics logging. Available from Android Q.
3519 */
3520message GenericAtom {
3521 // The uid of the application that sent this custom atom.
3522 optional int32 uid = 1 [(is_uid) = true];
3523
3524 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003525 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003526}
3527
Tej Singhd6d6d772018-09-05 17:41:25 -07003528/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003529 * Atom for simple logging of user interaction and impression events, such as "the user touched
3530 * this button" or "this dialog was displayed".
3531 * Keep the UI event stream clean: don't use for system or background events.
3532 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003533 *
3534 * Logged from:
3535 * frameworks/base/services/core/java/com/android/server/
3536 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003537 */
3538message UiEventReported {
3539 // The event_id.
3540 optional int32 event_id = 1;
3541 // The event's source or target uid and package, if applicable.
3542 // For example, the package posting a notification, or the destination package of a share.
3543 optional int32 uid = 2 [(is_uid) = true];
3544 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003545 // An identifier used to disambiguate which logs refer to a particular instance of some
3546 // UI element. Useful when there might be multiple instances simultaneously active.
3547 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003548}
3549
3550/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003551 * Reports a notification was created or updated.
3552 *
3553 * Logged from:
3554 * frameworks/base/services/core/java/com/android/server/notification/
3555 */
3556message NotificationReported {
3557 // The event_id (as for UiEventReported).
3558 optional int32 event_id = 1;
3559 // The notifying app's uid and package.
3560 optional int32 uid = 2 [(is_uid) = true];
3561 optional string package_name = 3;
3562 // A small system-assigned identifier for the notification.
3563 // Locally probably-unique, but expect collisions across users and/or days.
3564 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003565 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3566 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003567
3568 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003569 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3570 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3571 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003572
3573 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003574 optional string category = 10; // App-assigned notification category (API-defined strings)
3575 optional int32 style = 11; // App-assigned notification style
3576 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003577
3578 // Ordering, importance and interruptiveness
3579
Will Brockman7614f6962020-02-10 19:43:03 -05003580 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003581
Will Brockman7614f6962020-02-10 19:43:03 -05003582 optional android.stats.sysui.NotificationImportance importance = 14;
3583 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003584
3585 enum NotificationImportanceExplanation {
3586 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3587 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3588 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3589 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3590 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3591 // Like _APP, but based on pre-channels priority signal.
3592 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3593 }
3594
Will Brockman7614f6962020-02-10 19:43:03 -05003595 optional NotificationImportanceExplanation importance_source = 16;
3596 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3597 optional NotificationImportanceExplanation importance_initial_source = 18;
3598 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3599 optional int32 assistant_hash = 20;
3600 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003601}
3602
3603message Notification {
3604 // The notifying app's uid and package.
3605 optional int32 uid = 1 [(is_uid) = true];
3606 optional string package_name = 2;
3607 // A small system-assigned identifier for the notification.
3608 optional int32 instance_id = 3;
3609
3610 // Grouping information.
3611 optional int32 group_instance_id = 4;
3612 optional bool is_group_summary = 5;
3613
3614 // The section of the shade that the notification is in.
3615 // See NotificationSectionsManager.PriorityBucket.
3616 enum NotificationSection {
3617 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003618 SECTION_HEADS_UP = 1;
3619 SECTION_PEOPLE = 2;
3620 SECTION_ALERTING = 3;
3621 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003622 }
3623 optional NotificationSection section = 6;
3624}
3625
3626message NotificationList {
3627 repeated Notification notifications = 1; // An ordered sequence of notifications.
3628}
3629
3630/**
3631 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3632 *
3633 * Logged from:
3634 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3635 */
3636message NotificationPanelReported {
3637 // The event_id (as for UiEventReported).
3638 optional int32 event_id = 1;
3639 optional int32 num_notifications = 2;
3640 // The notifications in the panel, in the order that they appear there.
3641 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3642}
3643
3644/**
3645 * Reports a notification channel, or channel group, was created, updated, or deleted.
3646 *
3647 * Logged from:
3648 * frameworks/base/services/core/java/com/android/server/notification/
3649 */
3650message NotificationChannelModified {
3651 // The event_id (as for UiEventReported).
3652 optional int32 event_id = 1;
3653 // The notifying app's uid and package.
3654 optional int32 uid = 2 [(is_uid) = true];
3655 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003656 // Hash of app-assigned notification channel ID or channel-group ID
3657 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003658 // Previous importance setting, if applicable
3659 optional android.stats.sysui.NotificationImportance old_importance = 5;
3660 // New importance setting
3661 optional android.stats.sysui.NotificationImportance importance = 6;
3662}
3663
3664
3665/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003666 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003667 *
3668 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003669 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003670 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003671message BiometricAcquired {
3672 // Biometric modality that was acquired.
3673 optional android.hardware.biometrics.ModalityEnum modality = 1;
3674 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3675 optional int32 user = 2;
3676 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3677 optional bool is_crypto = 3;
3678 // Action that the device is performing. Acquired messages are only expected for enroll and
3679 // authenticate. Other actions may indicate an error.
3680 optional android.hardware.biometrics.ActionEnum action = 4;
3681 // The client that this acquisition was received for.
3682 optional android.hardware.biometrics.ClientEnum client = 5;
3683 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3684 optional int32 acquire_info = 6;
3685 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3686 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003687 // Dictates if this message should trigger additional debugging.
3688 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003689}
3690
3691/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003692 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003693 *
3694 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003695 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003696 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003697message BiometricAuthenticated {
3698 // Biometric modality that was used.
3699 optional android.hardware.biometrics.ModalityEnum modality = 1;
3700 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3701 optional int32 user = 2;
3702 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3703 // storage.
3704 optional bool is_crypto = 3;
3705 // The client that this acquisition was received for.
3706 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003707 // If authentication requires user confirmation. See BiometricPrompt's
3708 // setRequireConfirmation(bool) method.
3709 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003710
Kevin Chyn1741a072019-01-17 11:54:40 -08003711 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003712 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003713 REJECTED = 1;
3714 PENDING_CONFIRMATION = 2;
3715 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003716 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003717
3718 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003719 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003720 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3721 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3722 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3723 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003724 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003725 // Dictates if this message should trigger additional debugging.
3726 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003727}
3728
3729/**
3730 * Logs when a biometric error occurs.
3731 *
3732 * Logged from:
3733 * frameworks/base/services/core/java/com/android/server/biometrics
3734 */
3735message BiometricErrorOccurred {
3736 // Biometric modality that was used.
3737 optional android.hardware.biometrics.ModalityEnum modality = 1;
3738 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3739 optional int32 user = 2;
3740 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3741 optional bool is_crypto = 3;
3742 // Action that the device is performing.
3743 optional android.hardware.biometrics.ActionEnum action = 4;
3744 // The client that this acquisition was received for.
3745 optional android.hardware.biometrics.ClientEnum client = 5;
3746 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3747 // are unique to modality.
3748 optional int32 error_info = 6;
3749 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3750 // by the vendor and not specified by the HIDL interface.
3751 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003752 // Dictates if this message should trigger additional debugging.
3753 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003754 // Time spent during the authentication attempt.
3755 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003756}
3757
3758/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003759 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003760 * Logged from:
3761 * frameworks/base/services/core/java/com/android/server/biometrics
3762 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003763message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003764 // Biometric modality.
3765 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003766 // Type of issue detected.
3767 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003768 // Dictates if this message should trigger additional debugging.
3769 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003770}
Howard Ro688ae182018-09-25 00:09:36 -07003771
joshmccloskey6f952b22019-03-25 20:59:35 -07003772/**
3773 * Logs when a biometric enrollment occurs.
3774 *
3775 * Logged from:
3776 * frameworks/base/services/core/java/com/android/server/biometrics
3777 */
3778message BiometricEnrolled {
3779 // Biometric modality that was used.
3780 optional android.hardware.biometrics.ModalityEnum modality = 1;
3781 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3782 optional int32 user = 2;
3783 // The amount of time the enrollment took in milliseconds.
3784 optional int64 latency_millis = 3;
3785 // Whether or not the enrollment was successful.
3786 optional bool success = 4;
3787}
3788
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003789/*
Tej Singh0d176952019-01-16 19:10:54 -08003790 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003791 */
Tej Singh0d176952019-01-16 19:10:54 -08003792message FlagFlipUpdateOccurred {
3793 // If the event is from a flag config package, specify the package name.
3794 optional string flag_flip_package_name = 1;
3795
3796 // The order id of the package
3797 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003798}
3799
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003800/**
3801 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003802 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003803 */
3804message TrainExperimentIds {
3805 repeated int64 experiment_id = 1;
3806}
3807
Yangster-macb89807e2018-11-15 21:10:57 -08003808/*
3809 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003810 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003811 */
3812message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003813 // Name of the train.
3814 optional string train_name = 1;
3815 // Version code for a "train" of packages that need to be installed atomically
3816 optional int64 train_version_code = 2;
3817 // After installation of this package, device requires a restart.
3818 optional bool requires_staging = 3;
3819 // Rollback should be enabled for this install.
3820 optional bool rollback_enabled = 4;
3821 // Requires low latency monitoring if possible.
3822 optional bool requires_low_latency_monitor = 5;
3823
Yangster-macb89807e2018-11-15 21:10:57 -08003824 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003825 UNKNOWN = 0;
3826 INSTALL_REQUESTED = 1;
3827 INSTALL_STARTED = 2;
3828 INSTALL_STAGED_NOT_READY = 3;
3829 INSTALL_STAGED_READY = 4;
3830 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003831 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3832 // and INSTALL_FAILURE_COMMIT.
3833 INSTALL_FAILURE = 6 [deprecated = true];
3834 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003835 INSTALL_CANCELLED = 7;
3836 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003837 INSTALLER_ROLLBACK_INITIATED = 9;
3838 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3839 INSTALLER_ROLLBACK_STAGED = 11;
3840 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3841 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3842 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3843 INSTALLER_ROLLBACK_SUCCESS = 15;
3844 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003845 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3846 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3847 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3848 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3849 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3850 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003851 INSTALL_FAILURE_DOWNLOAD = 23;
3852 INSTALL_FAILURE_STATE_MISMATCH = 24;
3853 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003854 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003855 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003856 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003857 // Possible experiment ids for monitoring this push.
3858 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3859 // user id
3860 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003861 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003862 // Whether or not this is a rollback event
3863 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003864}
3865
Tej Singhc9203082019-05-03 13:42:23 -07003866/* Test atom, is not logged anywhere */
3867message TestAtomReported {
3868 repeated AttributionNode attribution_node = 1;
3869 optional int32 int_field = 2;
3870 optional int64 long_field = 3;
3871 optional float float_field = 4;
3872 optional string string_field = 5;
3873 optional bool boolean_field = 6;
3874 enum State {
3875 UNKNOWN = 0;
3876 OFF = 1;
3877 ON = 2;
3878 }
3879 optional State state = 7;
3880 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3881}
3882
Maggie Whitefc1aa592018-11-28 21:55:23 -08003883/** Represents USB port overheat event. */
3884message UsbPortOverheatEvent {
3885 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3886 optional int32 plug_temperature_deci_c = 1;
3887
3888 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3889 optional int32 max_temperature_deci_c = 2;
3890
3891 /* Time between USB plug event and overheat threshold trip, in seconds. */
3892 optional int32 time_to_overheat_secs = 3;
3893
3894 /* Time between overheat threshold trip and hysteresis, in seconds. */
3895 optional int32 time_to_hysteresis_secs = 4;
3896
3897 /* Time between hysteresis and active mitigation ending, in seconds. */
3898 optional int32 time_to_inactive_secs = 5;
3899};
3900
Maggie White8735b852019-01-18 11:40:49 -08003901/**
3902 * Logs total effective full charge and discharge cycles on a battery.
3903 * Here are some examples of one effective cycle:
3904 * 1) the battery charges from 0% to 100% and drains back to 0%,
3905 * 2) charging from 50% to 100% and draining back to 50% twice.
3906 * Pulled from:
3907 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3908 */
3909message BatteryCycleCount {
3910 /* Number of total charge and discharge cycles on the system battery. */
3911 optional int32 cycle_count = 1;
3912}
3913
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003914/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003915 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3916 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003917 * Pulled from:
3918 * StatsCompanionService
3919 */
3920
Carmen Agimof12dec122019-03-06 16:14:38 +00003921message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003922
Carmen Agimof12dec122019-03-06 16:14:38 +00003923 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003924 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003925 PUBLIC = 1;
3926 PRIVATE = 2;
3927 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003928 }
3929
Carmen Agimof12dec122019-03-06 16:14:38 +00003930 // The type of external storage.
3931 optional android.stats.storage.ExternalStorageType storage_type = 1;
3932 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3933 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003934 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003935 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003936}
3937
Yangster-macb89807e2018-11-15 21:10:57 -08003938/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003939 * Logs when a connection becomes available and lost.
3940 * Logged in StatsCompanionService.java
3941 */
3942message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003943 // Id of the network.
3944 optional int32 net_id = 1;
3945
3946 enum State {
3947 UNKNOWN = 0;
3948 CONNECTED = 1;
3949 DISCONNECTED = 2;
3950 }
3951 // Connected state of a network.
3952 optional State state = 2;
3953}
3954
3955/**
3956 * Logs when a service starts and stops.
3957 * Logged from:
3958 * services/core/java/com/android/server/am/ActiveServices.java
3959 */
3960message ServiceStateChanged {
3961
3962 optional int32 uid = 1 [(is_uid) = true];
3963
3964 optional string package_name = 2;
3965
3966 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003967
3968 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003969 START = 1;
3970 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003971 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003972
3973 optional State state = 4;
3974}
3975
3976/**
3977 * Logs when a service is launched.
3978 * Logged from:
3979 * services/core/java/com/android/server/am/ActiveServices.java
3980 */
3981message ServiceLaunchReported {
3982
3983 optional int32 uid = 1 [(is_uid) = true];
3984
3985 optional string package_name = 2;
3986
3987 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003988}
Howard Ro688ae182018-09-25 00:09:36 -07003989
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003990/**
3991 * Logs when a hidden API is used.
3992 *
3993 * Logged from:
3994 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3995 */
3996message HiddenApiUsed {
3997 // The uid of the app making the hidden access.
3998 optional int32 uid = 1 [(is_uid) = true];
3999
4000 // Signature of the method or field accessed.
4001 optional string signature = 2;
4002
4003 enum AccessMethod {
4004 NONE = 0;
4005 REFLECTION = 1;
4006 JNI = 2;
4007 LINKING = 3;
4008 }
4009
4010 // Type of access.
4011 optional AccessMethod access_method = 3;
4012
4013 // Whether the access was prevented or not.
4014 optional bool access_denied = 4;
4015}
4016
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004017/**
4018 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4019 * - When user sees privacy chip
4020 * - When user clicks privacy chip
4021 * - How does the user exit the Privacy Dialog
4022 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004023 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4024 */
4025message PrivacyIndicatorsInteracted {
4026
4027 enum Type {
4028 UNKNOWN = 0;
4029 CHIP_VIEWED = 1;
4030 CHIP_CLICKED = 2;
4031 DIALOG_PRIVACY_SETTINGS = 3;
4032 DIALOG_DISMISS = 4;
4033 DIALOG_LINE_ITEM = 5;
4034 }
4035
tsaichristine5adc7e02020-01-14 17:07:39 -08004036 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004037
4038 // Used if the type is LINE_ITEM
4039 optional string package_name = 2;
4040}
4041
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004042/**
4043 * Logs information about a package that is moved from the internal to external storage and vice
4044 * versa.
4045 * It logs the package name, the type of the external storage where the package is installed
4046 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4047 * and the move type: if it's from internal to external or the other way around.
4048 *
4049 * Logged from:
4050 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4051 */
4052message AppMovedStorageReported {
4053 enum MoveType {
4054 UNKNOWN = 0;
4055 TO_EXTERNAL = 1;
4056 TO_INTERNAL = 2;
4057 }
4058 // The type of the external storage.
4059 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4060 // The type of move.
4061 optional MoveType move_type = 2;
4062 // The name of the package that was moved.
4063 optional string package_name = 3;
4064}
4065
jianjin8f2dee02019-03-29 14:03:08 -07004066/**
4067 * Logs when system server watchdog occurs.
4068 * Logged from:
4069 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4070 */
4071message SystemServerWatchdogOccurred {
4072 optional string subject = 1;
4073}
4074
4075/**
4076 * Logs when new file added to tombstones.
4077 * Logged from:
4078 * frameworks/base/core/java/com/android/server/BootReceiver.java
4079 */
4080message TombStoneOccurred {
4081}
4082
Hai Zhang5d3328d2019-04-13 21:25:06 +08004083/*
4084 * Information about a role request
4085 *
4086 * Logged from:
4087 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4088 */
4089message RoleRequestResultReported {
4090 // UID of application requesting the role
4091 optional int32 requesting_uid = 1;
4092
4093 // Package name of application requesting the role
4094 optional string requesting_package_name = 2;
4095
4096 // The role to be granted
4097 optional string role_name = 3;
4098
4099 // The count of applications qualifying for the role
4100 optional int32 qualifying_count = 4;
4101
4102 // UID of application current granted the role
4103 optional int32 current_uid = 5;
4104
4105 // Package name of application current granted the role
4106 optional string current_package_name = 6;
4107
4108 // UID of another application that user chose to grant the role to, instead of the requesting
4109 // application
4110 optional int32 granted_another_uid = 7;
4111
4112 // Package name of another application that user chose to grant the role to, instead of the
4113 // requesting application
4114 optional string granted_another_package_name = 8;
4115
4116 enum Result {
4117 UNDEFINED = 0;
4118 // role request was ignored
4119 IGNORED = 1;
4120 // role request was ignored because it's already granted
4121 IGNORED_ALREADY_GRANTED = 2;
4122 // role request was ignored because the application isn't qualified
4123 IGNORED_NOT_QUALIFIED = 3;
4124 // role request was ignored because user said it should be always denied
4125 IGNORED_USER_ALWAYS_DENIED = 4;
4126 // role was granted by user action
4127 USER_GRANTED = 5;
4128 // role was denied by user action
4129 USER_DENIED = 6;
4130 // role was denied by user granting another application the role
4131 USER_DENIED_GRANTED_ANOTHER = 7;
4132 // role was denied and set to be always denied by the user
4133 USER_DENIED_WITH_ALWAYS = 8;
4134 }
4135 // The result of the role request
4136 optional Result result = 9;
4137}
4138
Mark Tabrya824a642019-11-05 12:26:12 -08004139/**
4140 * Logs when a Vehicle Maps Service client's connection state has changed
4141 *
4142 * Logged from:
4143 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4144 */
4145message VmsClientConnectionStateChanged {
4146 // The UID of the VMS client app
4147 optional int32 uid = 1 [(is_uid) = true];
4148
4149 enum State {
4150 UNKNOWN = 0;
4151 // Attempting to connect to the client
4152 CONNECTING = 1;
4153 // Client connection established
4154 CONNECTED = 2;
4155 // Client connection closed unexpectedly
4156 DISCONNECTED = 3;
4157 // Client connection closed by VMS
4158 TERMINATED = 4;
4159 // Error establishing the client connection
4160 CONNECTION_ERROR = 5;
4161 }
4162
4163 optional State state = 2;
4164}
4165
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004166/**
4167 * Logs when MediaProvider has successfully finished scanning a storage volume.
4168 *
4169 * Logged from:
4170 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4171 */
4172message MediaProviderScanEvent {
4173 enum Reason {
4174 // Scan triggered due to unknown reason
4175 UNKNOWN = 0;
4176 // Scan triggered due to storage volume being mounted
4177 MOUNTED = 1;
4178 // Scan triggered due to explicit user action or app request
4179 DEMAND = 2;
4180 // Scan triggered due to idle maintenance
4181 IDLE = 3;
4182 }
4183
4184 // Volume type that this event pertains to
4185 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4186 // Reason why this scan was triggered
4187 optional Reason reason = 2;
4188 // Total number of files scanned
4189 optional int64 item_count = 3;
4190 // Duration of scan, normalized per file
4191 optional float normalized_duration_millis = 4;
4192 // Number of database inserts, normalized per file
4193 optional float normalized_insert_count = 5;
4194 // Number of database updates, normalized per file
4195 optional float normalized_update_count = 6;
4196 // Number of database deletes, normalized per file
4197 optional float normalized_delete_count = 7;
4198}
4199
4200/**
4201 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4202 *
4203 * Logged from:
4204 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4205 */
4206message MediaProviderDeletionEvent {
4207 // Volume type that this event pertains to
4208 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4209 // Device timestamp when this deletion event occurred
4210 optional int64 timestamp_millis = 2;
4211 // App that requested deletion
4212 optional string package_name = 3;
4213 // Number of items that were deleted
4214 optional int32 item_count = 4;
4215}
4216
4217/**
4218 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4219 *
4220 * Logged from:
4221 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4222 */
4223message MediaProviderPermissionEvent {
4224 enum Result {
4225 UNKNOWN = 0;
4226 USER_GRANTED = 1;
4227 AUTO_GRANTED = 2;
4228 USER_DENIED = 3;
4229 USER_DENIED_WITH_PREJUDICE = 4;
4230 AUTO_DENIED = 5;
4231 }
4232
4233 // Volume type that this event pertains to
4234 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4235 // Device timestamp when this permission event occurred
4236 optional int64 timestamp_millis = 2;
4237 // App that requested permission
4238 optional string package_name = 3;
4239 // Number of items that were requested
4240 optional int32 item_count = 4;
4241 // Result of this request
4242 optional Result result = 5;
4243}
4244
4245/**
4246 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4247 *
4248 * Logged from:
4249 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4250 */
4251message MediaProviderSchemaChange {
4252 // Volume type that this event pertains to
4253 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4254 // Old database version code
4255 optional int32 version_from = 2;
4256 // New database version code
4257 optional int32 version_to = 3;
4258 // Total number of files in database
4259 optional int64 item_count = 4;
4260 // Duration of schema change, normalized per file
4261 optional float normalized_duration_millis = 5;
4262}
4263
4264/**
4265 * Logs when MediaProvider has finished an idle maintenance job.
4266 *
4267 * Logged from:
4268 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4269 */
4270message MediaProviderIdleMaintenance {
4271 // Volume type that this event pertains to
4272 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4273
4274 // Total number of files in database
4275 optional int64 item_count = 2;
4276 // Duration of idle maintenance, normalized per file
4277 optional float normalized_duration_millis = 3;
4278 // Number of thumbnails found to be stale, normalized per file
4279 optional float normalized_stale_thumbnails = 4;
4280 // Number of items found to be expired, normalized per file
4281 optional float normalized_expired_media = 5;
4282}
4283
Keun young Park3e033cb2019-12-18 11:27:35 -08004284/**
4285 * Represents boot time event with duration in ms.
4286 *
4287 * Logged from: bootstat and various system server components. Check each enums for details.
4288 */
4289message BootTimeEventDuration {
4290 enum DurationEvent {
4291 UNKNOWN = 0;
4292 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4293 ABSOLUTE_BOOT_TIME = 1;
4294 // Bootloader's 1st stage execution time.
4295 // Logged from bootstat.
4296 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4297 // Bootloader's 1st stage loading time.
4298 // Logged from bootstat.
4299 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4300 // Bootloader's kernel loading time.
4301 // Logged from bootstat.
4302 BOOTLOADER_KERNEL_LOAD = 4;
4303 // Bootloader's 2nd stage execution time.
4304 // Logged from bootstat.
4305 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4306 // Bootloader's 2nd stage loading time.
4307 // Logged from bootstat.
4308 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4309 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4310 // for locked device.
4311 // Logged from bootstat.
4312 BOOTLOADER_UI_WAIT = 7;
4313 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4314 // Logged from bootstat.
4315 BOOTLOADER_TOTAL = 8;
4316 // Shutdown duration inside init for the reboot before the current boot up.
4317 // Logged from f/b/services/.../BootReceiver.java.
4318 SHUTDOWN_DURATION = 9;
4319 // Total time for mounting of disk devices during bootup.
4320 // Logged from f/b/services/.../BootReceiver.java.
4321 MOUNT_DEFAULT_DURATION = 10;
4322 // Total time for early stage mounting of disk devices during bootup.
4323 // Logged from f/b/services/.../BootReceiver.java.
4324 MOUNT_EARLY_DURATION = 11;
4325 // Total time for late stage mounting of disk devices during bootup.
4326 // Logged from f/b/services/.../BootReceiver.java.
4327 MOUNT_LATE_DURATION = 12;
4328 // Average time to scan non-system app after OTA
4329 // Logged from f/b/services/.../PackageManagerService.java
4330 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4331 // Time to initialize Package manager after OTA
4332 // Logged from f/b/services/.../PackageManagerService.java
4333 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4334 // Time to scan all system app from Package manager after OTA
4335 // Logged from f/b/services/.../PackageManagerService.java
4336 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4337 // Init's total time for cold boot stage.
4338 // Logged from bootstat.
4339 COLDBOOT_WAIT = 16;
4340 // Init's total time for initializing selinux.
4341 // Logged from bootstat.
4342 SELINUX_INIT = 17;
4343 // Time since last factory reset.
4344 // Logged from bootstat.
4345 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004346 // Init's total time spent for completing the 1st stage.
4347 // Logged from bootstat.
4348 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004349 }
4350
4351 // Type of the event.
4352 optional DurationEvent event = 1;
4353 // Duration of the event in ms.
4354 optional int64 duration_millis = 2;
4355}
4356
4357/**
4358 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4359 * since boot-up.
4360 *
4361 * Logged from: bootstat and various system server components. Check each enums for details.
4362 */
4363message BootTimeEventElapsedTime {
4364 enum ElapsedTimeEvent {
4365 UNKNOWN = 0;
4366 // Time when init starts 1st stage. Logged from bootstat.
4367 ANDROID_INIT_STAGE_1 = 1;
4368 // Time when sys.boot_completed prop is set.
4369 // Logged from bootstat.
4370 BOOT_COMPLETE = 2;
4371 // BOOT_COMPLETE for encrypted device.
4372 BOOT_COMPLETE_ENCRYPTION = 3;
4373 // BOOT_COMPLETE for device with no encryption.
4374 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4375 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004376 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004377 // BOOT_COMPLETE after factory reset.
4378 FACTORY_RESET_BOOT_COMPLETE = 6;
4379 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4380 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004381 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4382 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004383 // BOOT_COMPLETE after OTA.
4384 OTA_BOOT_COMPLETE = 9;
4385 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4386 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004387 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4388 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004389 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4390 // Logged from f/b/services/.../UserController.java
4391 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4392 // Time when the system starts sending BOOT_COMPLETED broadcast.
4393 // Logged from f/b/services/.../UserController.java
4394 FRAMEWORK_BOOT_COMPLETED = 13;
4395 // Time when the package manager starts init.
4396 // Logged from f/b/services/.../SystemServer.java
4397 PACKAGE_MANAGER_INIT_START = 14;
4398 // Time when package manager is ready
4399 // Logged from f/b/services/.../SystemServer.java
4400 PACKAGE_MANAGER_INIT_READY = 15;
4401 // Represents the time when user has entered unlock credential for system with user pin.
4402 // Logged from bootstat.
4403 POST_DECRYPT = 16;
4404 // Represents the start of zygote's init.
4405 // Logged from zygote itself.
4406 ZYGOTE_INIT_START = 17;
4407 // Represents the start of secondary zygote's init.
4408 // TODO: add logging to zygote
4409 SECONDARY_ZYGOTE_INIT_START = 18;
4410 // Represents the start of system server's init.
4411 // Logged from f/b/services/.../SystemServer.java
4412 SYSTEM_SERVER_INIT_START = 19;
4413 // Represents the completion of system server's init.
4414 // Logged from f/b/services/.../SystemServer.java
4415 SYSTEM_SERVER_READY = 20;
4416 // Represents the start of launcher during boot-up.
4417 // TODO: add logging
4418 LAUNCHER_START = 21;
4419 // Represents the completion of launcher's initial rendering. User can use other apps from
4420 // launcher from this point.
4421 // TODO: add logging
4422 LAUNCHER_SHOWN = 22;
4423 }
4424
4425 // Type of the event.
4426 optional ElapsedTimeEvent event = 1;
4427 // Time since bootup for the event.
4428 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4429 optional int64 time_millis = 2;
4430}
4431
4432/**
4433 * Boot time events with UTC time.
4434 *
4435 * Logged from: bootstat and various system server components. Check each enums for details.
4436 */
4437message BootTimeEventUtcTime {
4438 enum UtcTimeEvent {
4439 UNKNOWN = 0;
4440 // Time of the bootstat's marking of 1st boot after the last factory reset.
4441 // Logged from bootstat.
4442 FACTORY_RESET_RESET_TIME = 1;
4443 // The time when bootstat records FACTORY_RESET_* events. This is close to
4444 // BOOT_COMPLETE time for the current bootup.
4445 // Logged from bootstat.
4446 FACTORY_RESET_CURRENT_TIME = 2;
4447 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4448 // Logged from bootstat.
4449 FACTORY_RESET_RECORD_VALUE = 3;
4450 }
4451
4452 // Type of the event.
4453 optional UtcTimeEvent event = 1;
4454 // UTC time for the event.
4455 optional int64 utc_time_secs = 2;
4456}
4457
4458/**
4459 * Boot time events representing specific error code during bootup.
4460 * Meaning of error code can be different per each event type.
4461 *
4462 * Logged from: bootstat and various system server components. Check each enums for details.
4463 */
4464message BootTimeEventErrorCode {
4465 enum ErrorCodeEvent {
4466 UNKNOWN = 0;
4467 // Linux error code for time() call to get the current UTC time.
4468 // Logged from bootstat.
4469 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4470 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4471 // as UMOUNT_STAT_* from init/reboot.cpp.
4472 // Logged from f/b/services/.../BootReceiver.java.
4473 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004474 // Reprepsents fie system mounting error code of /data partition for the current boot.
4475 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004476 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004477 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004478 }
4479
4480 // Type of the event.
4481 optional ErrorCodeEvent event = 1;
4482 // error code defined per each event type.
4483 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4484 // FS_MGR_FS_STAT.
4485 optional int32 error_code = 2;
4486}
4487
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004488/**
4489 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4490 * after an OTA.
4491 *
4492 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004493 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004494 */
4495message SnapshotMergeReported {
4496 // Keep in sync with
4497 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4498 enum UpdateState {
4499 // No update or merge is in progress.
4500 NONE = 0;
4501 // An update is applying; snapshots may already exist.
4502 INITIATED = 1;
4503 // An update is pending, but has not been successfully booted yet.
4504 UNVERIFIED = 2;
4505 // The kernel is merging in the background.
4506 MERGING = 3;
4507 // Post-merge cleanup steps could not be completed due to a transient
4508 // error, but the next reboot will finish any pending operations.
4509 MERGE_NEEDS_REBOOT = 4;
4510 // Merging is complete, and needs to be acknowledged.
4511 MERGE_COMPLETED = 5;
4512 // Merging failed due to an unrecoverable error.
4513 MERGE_FAILED = 6;
4514 // The update was implicitly cancelled, either by a rollback or a flash
4515 // operation via fastboot. This state can only be returned by WaitForMerge.
4516 CANCELLED = 7;
4517 };
4518
4519 // Status of the update after the merge attempts.
4520 optional UpdateState final_state = 1;
4521
4522 // Time to complete a merge operation in milliseconds.
4523 // A negative value corresponds to the case in which the merge operation
4524 // was interrupted and resumed (e.g. in case of a system reboot during the
4525 // merge).
4526 optional int64 duration_millis = 2;
4527
4528 // Number of reboots that occurred after issuing and before completing the
4529 // merge of all the snapshot devices.
4530 optional int32 intermediate_reboots = 3;
4531}
4532
Chenjie Yubbcbc602018-02-05 16:51:52 -08004533//////////////////////////////////////////////////////////////////////
4534// Pulled atoms below this line //
4535//////////////////////////////////////////////////////////////////////
4536
4537/**
David Chenc8a43242017-10-17 16:23:28 -07004538 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4539 *
4540 * Pulled from:
4541 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4542 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004543message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004544 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004545
4546 optional int64 rx_bytes = 2;
4547
4548 optional int64 rx_packets = 3;
4549
4550 optional int64 tx_bytes = 4;
4551
4552 optional int64 tx_packets = 5;
4553}
4554
4555/**
4556 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4557 *
4558 * Pulled from:
4559 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4560 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004561message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004562 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004563
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004564 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4565 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004566
4567 optional int64 rx_bytes = 3;
4568
4569 optional int64 rx_packets = 4;
4570
4571 optional int64 tx_bytes = 5;
4572
4573 optional int64 tx_packets = 6;
4574}
4575
4576/**
4577 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4578 *
4579 * Pulled from:
4580 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4581 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004582message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004583 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004584
4585 optional int64 rx_bytes = 2;
4586
4587 optional int64 rx_packets = 3;
4588
4589 optional int64 tx_bytes = 4;
4590
4591 optional int64 tx_packets = 5;
4592}
4593
4594/**
4595 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4596 *
4597 * Pulled from:
4598 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4599 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004600message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004601 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004602
Yao Chenc40a19d2018-03-15 16:48:25 -07004603 // 1 denotes foreground and 0 denotes background. This is called Set in
4604 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004605 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004606
4607 optional int64 rx_bytes = 3;
4608
4609 optional int64 rx_packets = 4;
4610
4611 optional int64 tx_bytes = 5;
4612
4613 optional int64 tx_packets = 6;
4614}
4615
4616/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004617 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4618 *
4619 * Pulled from:
4620 * StatsCompanionService
4621 */
4622message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004623 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004624
4625 optional int64 rx_bytes = 2;
4626
4627 optional int64 tx_bytes = 3;
4628}
4629
4630/**
David Chenc8a43242017-10-17 16:23:28 -07004631 * Pulls the kernel wakelock durations. This atom is adapted from
4632 * android/internal/os/KernelWakelockStats.java
4633 *
4634 * Pulled from:
4635 * StatsCompanionService using KernelWakelockReader.
4636 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004637message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004638 optional string name = 1;
4639
4640 optional int32 count = 2;
4641
4642 optional int32 version = 3;
4643
Yangster-maca8a30442018-10-13 23:46:34 -07004644 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004645}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004646
Chenjie Yu05013b32017-11-21 10:21:41 -08004647/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004648 * Pulls low power state information. If power.stats HAL is not available, this
4649 * includes platform and subsystem sleep state information,
4650 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4651 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004652 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004653 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004654 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4655 * as defined in:
4656 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004657 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004658message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004659 // Subsystem name
4660 optional string subsystem_name = 1;
4661 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4662 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004663 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4664 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004665 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004666 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004667 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004668 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004669 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004670}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004671
Chenjie Yu05013b32017-11-21 10:21:41 -08004672/**
Bookatz92da2832018-11-01 18:10:03 -07004673 * Pulls on-device power measurement information.
4674 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4675 * Pulled from:
4676 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4677 */
4678message OnDevicePowerMeasurement {
4679 // Name of the subsystem (to which the rail belongs).
4680 optional string subsystem_name = 1;
4681
4682 // Rail name. The rail lies within the subsystem.
4683 optional string rail_name = 2;
4684
4685 // Time (in ms since boot) at which the rail energy value was measured.
4686 // This may differ slightly from the time that statsd logs this information.
4687 optional uint64 measurement_timestamp_millis = 3;
4688
4689 // Accumulated energy used via the rail since device boot in uWs.
4690 optional uint64 energy_microwatt_secs = 4;
4691}
4692
4693/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004694 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004695 * Pulls the time the cpu spend on the frequency index. Frequency index
4696 * starts from highest to lowest. The value should be monotonically
4697 * increasing since boot. However, if there is a cpu
4698 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004699 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004700message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004701 optional uint32 cluster = 1;
4702 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004703 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004704}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004705
Chenjie Yu05013b32017-11-21 10:21:41 -08004706/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004707 * Pulls Cpu Time Per Uid.
4708 * Note that isolated process uid time should be attributed to host uids.
4709 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004710message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004711 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004712 optional uint64 user_time_micros = 2;
4713 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004714}
4715
4716/**
4717 * Pulls Cpu Time Per Uid per frequency.
4718 * Note that isolated process uid time should be attributed to host uids.
4719 * For each uid, we order the time by descending frequencies.
4720 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004721message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004722 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004723 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004724 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004725}
Hugo Benichi884970e2017-11-14 22:42:46 +09004726
Chenjie Yu05013b32017-11-21 10:21:41 -08004727/**
4728 * Pulls Wifi Controller Activity Energy Info
4729 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004730message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004731 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004732 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004733 // stack reported state
4734 // TODO: replace this with proto enum
4735 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004736 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004737 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004738 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004739 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004740 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004741 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004742 // product of current(mA), voltage(V) and time(ms)
4743 optional uint64 controller_energy_used = 6;
4744}
4745
4746/**
4747 * Pulls Modem Activity Energy Info
4748 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004749message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004750 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004751 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004752 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004753 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004754 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004755 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004756 /**
4757 * Tx power index
4758 * index 0 = tx_power < 0dBm
4759 * index 1 = 0dBm < tx_power < 5dBm
4760 * index 2 = 5dBm < tx_power < 15dBm
4761 * index 3 = 15dBm < tx_power < 20dBm
4762 * index 4 = tx_power > 20dBm
4763 */
4764 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004765 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004766 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004767 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004768 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004769 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004770 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004771 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004772 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004773 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004774 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004775 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004776 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004777 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004778}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004779
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004780/**
4781 * Pulls Bluetooth Activity Energy Info
4782 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4783 */
4784message BluetoothActivityInfo {
4785 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004786 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004787 // bluetooth stack state
4788 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004789 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004790 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004791 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004792 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004793 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004794 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004795 // product of current(mA), voltage(V) and time(ms)
4796 optional uint64 energy_used = 6;
4797}
4798
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004799/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004800 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004801 *
4802 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004803 */
4804message ProcessMemoryState {
4805 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004806 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004807
4808 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004809 // Usually package name, "system" for system server.
4810 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004811 optional string process_name = 2;
4812
Rafal Slawikda51b932018-12-13 16:31:33 +00004813 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004814 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004815
4816 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004817 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004818
4819 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004820 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004821
Rajeev Kumar90235992018-01-29 11:06:48 -08004822 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004823 // Value is read from memory.stat, field total_rss if per-app memory
4824 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004825 optional int64 rss_in_bytes = 6;
4826
4827 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004828 // Value is read from memory.stat, field total_cache if per-app memory
4829 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004830 optional int64 cache_in_bytes = 7;
4831
4832 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004833 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004834 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004835 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004836
Rafal Slawik203c3db2019-09-25 19:53:01 +01004837 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004838 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004839
Rafal Slawik203c3db2019-09-25 19:53:01 +01004840 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4841 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004842
Rafal Slawik203c3db2019-09-25 19:53:01 +01004843 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4844 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004845}
4846
4847/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004848 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004849 *
4850 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4851 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004852 *
4853 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004854 */
4855message ProcessMemoryHighWaterMark {
4856 // The uid if available. -1 means not available.
4857 optional int32 uid = 1 [(is_uid) = true];
4858
Rafal Slawikda51b932018-12-13 16:31:33 +00004859 // The process name.
4860 // Usually package name or process cmdline.
4861 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004862 optional string process_name = 2;
4863
Rafal Slawik239b6802019-09-09 18:46:01 +01004864 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4865 // computed by converting kilobytes to bytes.
4866 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4867
Rafal Slawik3bea8952018-11-15 12:39:33 +00004868 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4869 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004870 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004871}
4872
4873/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004874 * Logs the memory stats for a process.
4875 *
4876 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4877 * and for selected native processes.
4878 */
4879message ProcessMemorySnapshot {
4880 // The uid if available. -1 means not available.
4881 optional int32 uid = 1 [(is_uid) = true];
4882
4883 // The process name.
4884 // Usually package name or process cmdline.
4885 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4886 optional string process_name = 2;
4887
4888 // The pid of the process.
4889 // Allows to disambiguate instances of the process.
4890 optional int32 pid = 3;
4891
4892 // The current OOM score adjustment value.
4893 // Read from ProcessRecord for managed processes.
4894 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4895 optional int32 oom_score_adj = 4;
4896
4897 // The current RSS of the process.
4898 // VmRSS from /proc/pid/status.
4899 optional int32 rss_in_kilobytes = 5;
4900
4901 // The current anon RSS of the process.
4902 // RssAnon from /proc/pid/status.
4903 optional int32 anon_rss_in_kilobytes = 6;
4904
4905 // The current swap size of the process.
4906 // VmSwap from /proc/pid/status.
4907 optional int32 swap_in_kilobytes = 7;
4908
4909 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4910 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4911}
4912
4913/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004914 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004915 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004916message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004917 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004918}
4919
4920/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004921 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004922 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004923message SystemUptime {
4924 // Milliseconds since the system was booted.
4925 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4926 // for external input).
4927 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004928 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004929}
4930
4931/*
4932 * Reads from /proc/uid_concurrent_active_time which has the format:
4933 * active: X (X is # cores)
4934 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4935 * [uid1]: [time-0] [time-1] [time-2] ... ...
4936 * ...
4937 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4938 * The file contains a monotonically increasing count of time for a single boot.
4939 */
4940message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004941 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004942 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004943}
4944
4945/**
4946 * Reads from /proc/uid_concurrent_policy_time which has the format:
4947 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4948 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4949 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4950 * ...
4951 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4952 * The file contains a monotonically increasing count of time for a single boot.
4953 */
4954message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004955 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004956 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004957 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004958}
4959
4960/*
4961 * Pulls free disk space, for data, system partition and temporary directory.
4962 */
4963message DiskSpace {
4964 // available bytes in data partition
4965 optional uint64 data_available_bytes = 1;
4966 // available bytes in system partition
4967 optional uint64 system_available_bytes = 2;
4968 // available bytes in download cache or temp directories
4969 optional uint64 temp_available_bytes = 3;
4970}
Tej Singhbf972d92018-01-10 20:51:13 -08004971
4972/**
4973 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004974 *
4975 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004976 */
4977message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004978 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004979}
4980
4981/**
4982 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004983 * Pulled from:
4984 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004985 */
4986message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004987 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004988}
4989
4990/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004991 * Pulls battery voltage.
4992 * Pulled from:
4993 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4994 */
4995message BatteryVoltage {
4996 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004997 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004998}
4999
5000/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005001 * Pulls battery level (percent full, from 0 to 100).
5002 *
5003 * Pulled from:
5004 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5005 */
5006message BatteryLevel {
5007 // Battery level. Should be in [0, 100].
5008 optional int32 battery_level = 1;
5009}
5010
5011/**
Tej Singhd89137e2018-03-26 14:51:40 -07005012 * Pulls the temperature of various parts of the device.
5013 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005014 *
Maggie White442b6312019-04-05 16:26:44 -07005015 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005016 */
5017message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005018 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005019 optional android.os.TemperatureTypeEnum sensor_location = 1;
5020
5021 // The name of the temperature source. Eg. CPU0
5022 optional string sensor_name = 2;
5023
Tej Singhd89137e2018-03-26 14:51:40 -07005024 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005025 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005026 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005027
5028 // Relative severity of the throttling, see enum definition.
5029 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005030}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005031
5032/**
5033 * Pulls the statistics of calls to Binder.
5034 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005035 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5036 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005037 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005038 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005039 */
5040message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005041 // UID of the process responsible for the binder transaction. It will be set if the process
5042 // executing the binder transaction attribute the transaction to another uid using
5043 // Binder.setThreadWorkSource().
5044 //
5045 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005046 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005047 // UID of the process executing the binder transaction.
5048 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005049 // Fully qualified class name of the API call.
5050 //
5051 // This is a system server class name.
5052 //
5053 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5054 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5055 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5056 // commonly used APIs.
5057 optional string service_class_name = 2;
5058 // Method name of the API call. It can also be a transaction code if we cannot
5059 // resolve it to a name. See Binder#getTransactionName.
5060 //
5061 // This is a system server method name.
5062 optional string service_method_name = 3;
5063 // Total number of API calls.
5064 optional int64 call_count = 4;
5065 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5066 optional bool screen_interactive = 13;
5067 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5068 // call_count will be equal to recorded_call_count.
5069 //
5070 // If recorded_call_count is different than call_count, it means data collection has been
5071 // sampled. All the fields below will be sampled in this case.
5072 optional int64 recorded_call_count = 12;
5073 // Number of exceptions thrown by the API.
5074 optional int64 recorded_exception_count = 5;
5075 // Total latency of all API calls.
5076 // Average can be computed using total_latency_micros / recorded_call_count.
5077 optional int64 recorded_total_latency_micros = 6;
5078 // Maximum latency of one API call.
5079 optional int64 recorded_max_latency_micros = 7;
5080 // Total CPU usage of all API calls.
5081 // Average can be computed using total_cpu_micros / recorded_call_count.
5082 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5083 optional int64 recorded_total_cpu_micros = 8;
5084 // Maximum CPU usage of one API call.
5085 optional int64 recorded_max_cpu_micros = 9;
5086 // Maximum parcel reply size of one API call.
5087 optional int64 recorded_max_reply_size_bytes = 10;
5088 // Maximum parcel request size of one API call.
5089 optional int64 recorded_max_request_size_bytes = 11;
5090}
5091
5092/**
5093 * Pulls the statistics of exceptions during calls to Binder.
5094 *
5095 * Binder stats are cumulative from boot unless somebody reset the data using
5096 * > adb shell dumpsys binder_calls_stats --reset
5097 */
5098message BinderCallsExceptions {
5099 // Exception class name, e.g. java.lang.IllegalArgumentException.
5100 //
5101 // This is an exception class name thrown by the system server.
5102 optional string exception_class_name = 1;
5103 // Total number of exceptions.
5104 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005105}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005106
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005107/**
5108 * Pulls the statistics of message dispatching on HandlerThreads.
5109 *
5110 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5111 * config on the device.
5112 *
5113 * Next tag: 11
5114 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005115message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005116 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005117 optional int32 uid = 1 [(is_uid) = true];
5118
5119 // Fully qualified class name of the handler target class.
5120 //
5121 // This field does not contain PII. This is a system server class name.
5122 optional string handler_class_name = 2;
5123
5124 // The name of the thread that runs the Looper.
5125 //
5126 // This field does not contain PII. This is a system server thread name.
5127 optional string looper_thread_name = 3;
5128
5129 // The name of the dispatched message.
5130 //
5131 // This field does not contain PII. This is a system server constant or class
5132 // name.
5133 optional string message_name = 4;
5134
5135 // Total number of successfully dispatched messages.
5136 optional int64 message_count = 5;
5137
5138 // Total number of messages that failed dispatching.
5139 optional int64 exception_count = 6;
5140
5141 // Total number of processed messages we have data recorded for. If we
5142 // collected data for all the messages, message_count will be equal to
5143 // recorded_message_count.
5144 //
5145 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005146 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005147 optional int64 recorded_message_count = 7;
5148
5149 // Total latency of all processed messages.
5150 // Average can be computed using recorded_total_latency_micros /
5151 // recorded_message_count.
5152 optional int64 recorded_total_latency_micros = 8;
5153
5154 // Total CPU usage of all processed message.
5155 // Average can be computed using recorded_total_cpu_micros /
5156 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005157 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005158 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005159
5160 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5161 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005162
5163 // Max recorded CPU usage of all processed messages.
5164 optional int64 recorded_max_cpu_micros = 11;
5165
5166 // Max recorded latency of all processed messages.
5167 optional int64 recorded_max_latency_micros = 12;
5168
5169 // Total number of messages we tracked the dispatching delay for. If we
5170 // collected data for all the messages, message_count will be equal to
5171 // recorded_delay_message_count.
5172 //
5173 // If recorded_delay_message_count is different than message_count, it means data
5174 // collection has been sampled or/and not all messages specified the target dispatch time.
5175 // The fields below will be sampled in this case.
5176 optional int64 recorded_delay_message_count = 13;
5177
5178 // Total dispatching delay of all processed messages.
5179 // Calculated as a difference between the target dispatching time (Message.when)
5180 // and the actual dispatching time.
5181 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5182 optional int64 recorded_total_delay_millis = 14;
5183
5184 // Max dispatching delay of all processed messages.
5185 // Calculated as a difference between the target dispatching time (Message.when)
5186 // and the actual dispatching time.
5187 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005188}
Tej Singh86dc9db2018-09-06 00:39:57 +00005189
5190/**
5191 * Pulls disk information, such as write speed and latency.
5192 */
5193message DiskStats {
5194 // Time taken to open, write 512B to, and close a file.
5195 // -1 if error performing the check.
5196 optional int64 data_write_latency_millis = 1;
5197
5198 optional bool file_based_encryption = 2;
5199
5200 // Recent disk write speed in kB/s.
5201 // -1 if error querying storageed.
5202 // 0 if data is unavailable.
5203 optional int32 recent_disk_write_speed = 3;
5204}
5205
5206
5207/**
5208 * Free and total bytes of the Data, Cache, and System partition.
5209 */
5210message DirectoryUsage {
5211 enum Directory {
5212 UNKNOWN = 0;
5213 DATA = 1;
5214 CACHE = 2;
5215 SYSTEM = 3;
5216 }
5217 optional Directory directory = 1;
5218 optional int64 free_bytes = 2;
5219 optional int64 total_bytes = 3;
5220}
5221
5222
5223/**
5224 * Size of an application: apk size, data size, and cache size.
5225 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5226 * Information is only reported for apps with the primary user (user 0).
5227 * Sizes are aggregated by package name.
5228 */
5229message AppSize {
5230 // Including uids will involve modifying diskstats logic.
5231 optional string package_name = 1;
5232 // App size in bytes. -1 if unavailable.
5233 optional int64 app_size_bytes = 2;
5234 // App data size in bytes. -1 if unavailable.
5235 optional int64 app_data_size_bytes = 3;
5236 // App cache size in bytes. -1 if unavailable.
5237 optional int64 app_cache_size_bytes = 4;
5238 // Time that the cache file was produced.
5239 // Uses System.currentTimeMillis(), which is wall clock time.
5240 optional int64 cache_time_millis = 5;
5241}
5242
5243
5244/**
5245 * Size of a particular category. Eg: photos, videos.
5246 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5247 */
5248message CategorySize {
5249 enum Category {
5250 UNKNOWN = 0;
5251 APP_SIZE = 1;
5252 APP_DATA_SIZE = 2;
5253 APP_CACHE_SIZE = 3;
5254 PHOTOS = 4;
5255 VIDEOS = 5;
5256 AUDIO = 6;
5257 DOWNLOADS = 7;
5258 SYSTEM = 8;
5259 OTHER = 9;
5260 }
5261 optional Category category = 1;
5262 // Category size in bytes.
5263 optional int64 size_bytes = 2;
5264 // Time that the cache file was produced.
5265 // Uses System.currentTimeMillis(), which is wall clock time.
5266 optional int64 cache_time_millis = 3;
5267}
Tej Singhd6d6d772018-09-05 17:41:25 -07005268
5269/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005270 * Pulls per uid I/O stats. The stats are cumulative since boot.
5271 *
5272 * Read/write bytes are I/O events from a storage device
5273 * Read/write chars are data requested by read/write syscalls, and can be
5274 * satisfied by caching.
5275 *
5276 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5277 */
5278message DiskIo {
5279 optional int32 uid = 1 [(is_uid) = true];
5280 optional int64 fg_chars_read = 2;
5281 optional int64 fg_chars_write = 3;
5282 optional int64 fg_bytes_read = 4;
5283 optional int64 fg_bytes_write = 5;
5284 optional int64 bg_chars_read = 6;
5285 optional int64 bg_chars_write = 7;
5286 optional int64 bg_bytes_read = 8;
5287 optional int64 bg_bytes_write = 9;
5288 optional int64 fg_fsync = 10;
5289 optional int64 bg_fsync= 11;
5290}
5291
5292
5293/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005294 * Pulls the number of fingerprints for each user.
5295 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005296 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005297 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005298message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005299 // The associated user. Eg: 0 for owners, 10+ for others.
5300 // Defined in android/os/UserHandle.java
5301 optional int32 user = 1;
5302 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005303 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005304}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005305
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005306/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005307 * Pulls the number of faces for each user.
5308 *
5309 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5310 */
5311message NumFacesEnrolled {
5312 // The associated user. Eg: 0 for owners, 10+ for others.
5313 // Defined in android/os/UserHandle.java
5314 optional int32 user = 1;
5315 // Number of faces registered to that user.
5316 optional int32 num_faces_enrolled = 2;
5317}
5318/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005319 * A mapping of role holder -> role
5320 */
5321message RoleHolder {
5322 // uid of the role holder
5323 optional int32 uid = 1 [(is_uid) = true];
5324
5325 // package name of the role holder
5326 optional string package_name = 2;
5327
5328 // the role held
5329 optional string role = 3;
5330}
5331
Yangsteraf9aee72018-10-12 09:26:16 -07005332message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005333 // These are all in byte resolution.
5334 optional int64 min = 1 [deprecated = true];
5335 optional int64 average = 2 [deprecated = true];
5336 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005337
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005338 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5339 // int64 fields.
5340 optional int32 mean_kb = 4;
5341 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005342}
5343
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005344// A reduced subset of process states; reducing the number of possible states allows more
5345// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5346enum ProcessStateAggregated {
5347 PROCESS_STATE_UNKNOWN = 0;
5348 // Persistent system process.
5349 PROCESS_STATE_PERSISTENT = 1;
5350 // Top activity; actually any visible activity.
5351 PROCESS_STATE_TOP = 2;
5352 // Process binding to top or a foreground service.
5353 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5354 // Processing running a foreground service.
5355 PROCESS_STATE_FGS = 4;
5356 // Important foreground process (ime, wallpaper, etc).
5357 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5358 // Important background process.
5359 PROCESS_STATE_BACKGROUND = 6;
5360 // Process running a receiver.
5361 PROCESS_STATE_RECEIVER = 7;
5362 // All kinds of cached processes.
5363 PROCESS_STATE_CACHED = 8;
5364}
5365
5366// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005367message ProcessStatsStateProto {
5368 optional android.service.procstats.ScreenState screen_state = 1;
5369
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005370 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005371
5372 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5373 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005374 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5375
5376 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005377
5378 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005379 optional int64 duration_millis = 4 [deprecated = true];
5380 // Same as above, but with minute resolution so it fits into an int32.
5381 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005382
5383 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005384 optional int64 realtime_duration_millis = 9 [deprecated = true];
5385 // Same as above, but with minute resolution so it fits into an int32.
5386 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005387
5388 // # of samples taken
5389 optional int32 sample_size = 5;
5390
5391 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005392 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005393
5394 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005395 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005396
5397 // RSS is memory resident for this process
5398 optional AggStats rss = 8;
5399}
5400
5401// Next Tag: 7
5402message ProcessStatsProto {
5403 // Name of process.
5404 optional string process = 1;
5405
5406 // Uid of the process.
5407 optional int32 uid = 2;
5408
5409 // Information about how often kills occurred
5410 message Kill {
5411 // Count of excessive CPU kills
5412 optional int32 cpu = 1;
5413
5414 // Count of kills when cached
5415 optional int32 cached = 2;
5416
5417 // PSS stats during cached kill
5418 optional AggStats cached_pss = 3;
5419 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005420 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005421
5422 // Time and memory spent in various states.
5423 repeated ProcessStatsStateProto states = 5;
5424
5425 // Total time process has been running... screen_state, memory_state, and process_state
5426 // will not be set.
5427 optional ProcessStatsStateProto total_running_state = 6;
5428}
5429
5430message PackageServiceOperationStatsProto {
5431 // Operate enum: Started, Foreground, Bound, Executing
5432 optional android.service.procstats.ServiceOperationState operation = 1;
5433
5434 // Number of times the service was in this operation.
5435 optional int32 count = 2;
5436
5437 // Information about a state the service can be in.
5438 message StateStats {
5439 // Screen state enum.
5440 optional android.service.procstats.ScreenState screen_state = 1;
5441 // Memory state enum.
5442 optional android.service.procstats.MemoryState memory_state = 2;
5443
5444 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005445 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005446 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005447 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005448 }
5449 repeated StateStats state_stats = 3;
5450}
5451
5452message PackageServiceStatsProto {
5453 // Name of service component.
5454 optional string service_name = 1;
5455
5456 // The operation stats.
5457 // The package_name, package_uid, package_version, service_name will not be set to save space.
5458 repeated PackageServiceOperationStatsProto operation_stats = 2;
5459}
5460
5461message PackageAssociationSourceProcessStatsProto {
5462 // Uid of the process.
5463 optional int32 process_uid = 1;
5464 // Process name.
5465 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005466 // Package name.
5467 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005468 // Total count of the times this association appeared.
5469 optional int32 total_count = 3;
5470
5471 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005472 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005473
5474 // Total count of the times this association became actively impacting its target process.
5475 optional int32 active_count = 5;
5476
5477 // Information on one source in this association.
5478 message StateStats {
5479 // Process state enum.
5480 optional android.service.procstats.ProcessState process_state = 1;
5481 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005482 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005483 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005484 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005485 }
5486 repeated StateStats active_state_stats = 6;
5487}
5488
5489message PackageAssociationProcessStatsProto {
5490 // Name of the target component.
5491 optional string component_name = 1;
5492 // Information on one source in this association.
5493 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5494}
5495
5496
5497message ProcessStatsPackageProto {
5498 // Name of package.
5499 optional string package = 1;
5500
5501 // Uid of the package.
5502 optional int32 uid = 2;
5503
5504 // Version of the package.
5505 optional int64 version = 3;
5506
5507 // Stats for each process running with the package loaded in to it.
5508 repeated ProcessStatsProto process_stats = 4;
5509
5510 // Stats for each of the package's services.
5511 repeated PackageServiceStatsProto service_stats = 5;
5512
5513 // Stats for each association with the package.
5514 repeated PackageAssociationProcessStatsProto association_stats = 6;
5515}
5516
5517message ProcessStatsSectionProto {
5518 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005519 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005520
5521 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005522 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005523
5524 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005525 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005526
5527 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005528 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005529
5530 // System runtime library. e.g. "libdvm.so", "libart.so".
5531 optional string runtime = 5;
5532
5533 // whether kernel reports swapped pss.
5534 optional bool has_swapped_pss = 6;
5535
5536 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5537 enum Status {
5538 STATUS_UNKNOWN = 0;
5539 STATUS_COMPLETE = 1;
5540 STATUS_PARTIAL = 2;
5541 STATUS_SHUTDOWN = 3;
5542 STATUS_SYSPROPS = 4;
5543 }
5544 repeated Status status = 7;
5545
Chenjie Yub2ecc792019-01-17 10:27:26 -08005546 // Number of pages available of various types and sizes, representation fragmentation.
5547 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5548
Yangsteraf9aee72018-10-12 09:26:16 -07005549 // Stats for each process.
5550 repeated ProcessStatsProto process_stats = 8;
5551
5552 // Stats for each package.
5553 repeated ProcessStatsPackageProto package_stats = 9;
5554}
5555
Chenjie Yub2ecc792019-01-17 10:27:26 -08005556message ProcessStatsAvailablePagesProto {
5557 // Node these pages are in (as per /proc/pagetypeinfo)
5558 optional int32 node = 1;
5559
5560 // Zone these pages are in (as per /proc/pagetypeinfo)
5561 optional string zone = 2;
5562
5563 // Label for the type of these pages (as per /proc/pagetypeinfo)
5564 optional string label = 3;
5565
5566 // Distribution of number of pages available by order size. First entry in array is
5567 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5568 repeated int32 pages_per_order = 4;
5569}
5570
Chenjie Yu12e5e672018-09-14 15:54:59 -07005571/**
5572 * Pulled from ProcessStatsService.java
5573 */
5574message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005575 optional ProcessStatsSectionProto proc_stats_section = 1;
5576}
5577
Chenjie Yuf910b7802019-01-11 16:08:20 -08005578/**
5579 * Pulled from ProcessStatsService.java
5580 */
5581message ProcStatsPkgProc {
5582 optional ProcessStatsSectionProto proc_stats_section = 1;
5583}
5584
Chris Wrencdea3b72019-11-22 16:58:17 -05005585// Next Tag: 2
5586message PackageRemoteViewInfoProto {
5587 optional string package_name = 1;
5588 // add per-package additional info here (like channels)
5589}
5590
5591// Next Tag: 2
5592message NotificationRemoteViewsProto {
5593 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5594}
5595
5596/**
5597 * Pulled from NotificationManagerService.java
5598 */
5599message NotificationRemoteViews {
5600 optional NotificationRemoteViewsProto notification_remote_views = 1;
5601}
5602
Yotam Aron74299972020-01-16 16:20:58 +02005603/**
5604 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5605 */
5606message PackageNotificationPreferences {
5607 // Uid under which the package is installed.
5608 optional int32 uid = 1;
5609 // Notification importance, which specifies when and how a notification is displayed.
5610 // Specified under core/java/android/app/NotificationManager.java.
5611 optional int32 importance = 2;
5612 // Lockscreen visibility as set by the user.
5613 optional int32 visibility = 3;
5614 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5615 // PreferencesHelper.java)
5616 optional int32 user_locked_fields = 4;
5617}
5618
5619/**
5620 * Atom that contains a list of a package's channel preferences, pulled from
5621 * NotificationManagerService.java.
5622 */
5623message PackageNotificationChannelPreferences {
5624 // Uid under which the package is installed.
5625 optional int32 uid = 1;
5626 // Channel's ID. Should always be available.
5627 optional string channel_id = 2;
5628 // Channel's name. Should always be available.
5629 optional string channel_name = 3;
5630 // Channel's description. Optionally set by the channel creator.
5631 optional string description = 4;
5632 // Notification importance, which specifies when and how a notification is displayed. Specified
5633 // under core/java/android/app/NotificationManager.java.
5634 optional int32 importance = 5;
5635 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5636 // at core/java/android/app/NotificationChannel.java
5637 optional int32 user_locked_fields = 6;
5638 // Indicates if the channel was deleted by the app.
5639 optional bool is_deleted = 7;
5640}
5641
5642/**
5643 * Atom that contains a list of a package's channel group preferences, pulled from
5644 * NotificationManagerService.java.
5645 */
5646message PackageNotificationChannelGroupPreferences {
5647 // Uid under which the package is installed.
5648 optional int32 uid = 1;
5649 // Channel Group's ID. Should always be available.
5650 optional string group_id = 2;
5651 // Channel Group's name. Should always be available.
5652 optional string group_name = 3;
5653 // Channel Group's description. Optionally set by group creator.
5654 optional string description = 4;
5655 // Indicates if notifications from this channel group are blocked.
5656 optional bool is_blocked = 5;
5657 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5658 // at core/java/android/app/NotificationChannelGroup.java
5659 optional int32 user_locked_fields = 6;
5660}
5661
Yangsteraf9aee72018-10-12 09:26:16 -07005662message PowerProfileProto {
5663 optional double cpu_suspend = 1;
5664
5665 optional double cpu_idle = 2;
5666
5667 optional double cpu_active = 3;
5668
5669 message CpuCluster {
5670 optional int32 id = 1;
5671 optional double cluster_power = 2;
5672 optional int32 cores = 3;
5673 repeated int64 speed = 4;
5674 repeated double core_power = 5;
5675 }
5676
5677 repeated CpuCluster cpu_cluster = 40;
5678
5679 optional double wifi_scan = 4;
5680
5681 optional double wifi_on = 5;
5682
5683 optional double wifi_active = 6;
5684
5685 optional double wifi_controller_idle = 7;
5686
5687 optional double wifi_controller_rx = 8;
5688
5689 optional double wifi_controller_tx = 9;
5690
5691 repeated double wifi_controller_tx_levels = 10;
5692
5693 optional double wifi_controller_operating_voltage = 11;
5694
5695 optional double bluetooth_controller_idle = 12;
5696
5697 optional double bluetooth_controller_rx = 13;
5698
5699 optional double bluetooth_controller_tx = 14;
5700
5701 optional double bluetooth_controller_operating_voltage = 15;
5702
5703 optional double modem_controller_sleep = 16;
5704
5705 optional double modem_controller_idle = 17;
5706
5707 optional double modem_controller_rx = 18;
5708
5709 repeated double modem_controller_tx = 19;
5710
5711 optional double modem_controller_operating_voltage = 20;
5712
5713 optional double gps_on = 21;
5714
5715 repeated double gps_signal_quality_based = 22;
5716
5717 optional double gps_operating_voltage = 23;
5718
5719 optional double bluetooth_on = 24;
5720
5721 optional double bluetooth_active = 25;
5722
5723 optional double bluetooth_at_cmd = 26;
5724
5725 optional double ambient_display = 27;
5726
5727 optional double screen_on = 28;
5728
5729 optional double radio_on = 29;
5730
5731 optional double radio_scanning = 30;
5732
5733 optional double radio_active = 31;
5734
5735 optional double screen_full = 32;
5736
5737 optional double audio = 33;
5738
5739 optional double video = 34;
5740
5741 optional double flashlight = 35;
5742
5743 optional double memory = 36;
5744
5745 optional double camera = 37;
5746
5747 optional double wifi_batched_scan = 38;
5748
5749 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005750}
Chenjie Yuab530202018-09-26 12:39:20 -07005751
5752/**
5753 * power_profile.xml and other constants for power model calculations.
5754 * Pulled from PowerProfile.java
5755 */
5756message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005757 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005758}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005759
5760/**
arangelovd5db50e2018-10-12 20:24:39 +01005761 * Logs when a user restriction was added or removed.
5762 *
5763 * Logged from:
5764 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5765 */
5766message UserRestrictionChanged {
5767 // The raw string of the user restriction as defined in UserManager.
5768 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5769 optional string restriction = 1;
5770 // Whether the restriction is enabled or disabled.
5771 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005772}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005773
5774/**
5775 * Pulls process user time and system time. Puller takes a snapshot of all pids
5776 * in the system and returns cpu stats for those that are working at the time.
5777 * Dead pids will be dropped. Kernel processes are excluded.
5778 * Min cool-down is 5 sec.
5779 */
5780message ProcessCpuTime {
5781 optional int32 uid = 1 [(is_uid) = true];
5782
5783 optional string process_name = 2;
5784 // Process cpu time in user space, cumulative from boot/process start
5785 optional int64 user_time_millis = 3;
5786 // Process cpu time in system space, cumulative from boot/process start
5787 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005788}
Misha Wagner5a51e002018-10-03 15:04:09 +01005789
5790/**
5791 * Pulls the CPU usage for each thread.
5792 *
5793 * Read from /proc/$PID/task/$TID/time_in_state files.
5794 *
5795 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5796 * time_in_state files not being present on some phones, have not been addressed. These should be
5797 * considered before a public release.
5798 */
5799message CpuTimePerThreadFreq {
5800 // UID that owns the process.
5801 optional int32 uid = 1 [(is_uid) = true];
5802 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005803 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005804 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005805 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005806 // Name of the process taken from `/proc/$PID/cmdline`.
5807 optional string process_name = 4;
5808 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5809 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005810
5811 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5812 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5813 // frequencies are given here as the alternative is sending eight separate atoms. This method
5814 // significantly reduces the amount of data created
5815 optional int32 frequency1_khz = 6;
5816 optional int32 time1_millis = 7;
5817 optional int32 frequency2_khz = 8;
5818 optional int32 time2_millis = 9;
5819 optional int32 frequency3_khz = 10;
5820 optional int32 time3_millis = 11;
5821 optional int32 frequency4_khz = 12;
5822 optional int32 time4_millis = 13;
5823 optional int32 frequency5_khz = 14;
5824 optional int32 time5_millis = 15;
5825 optional int32 frequency6_khz = 16;
5826 optional int32 time6_millis = 17;
5827 optional int32 frequency7_khz = 18;
5828 optional int32 time7_millis = 19;
5829 optional int32 frequency8_khz = 20;
5830 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005831}
Bookatz75ee60422018-11-09 12:27:37 -08005832
5833/**
Bookatz366a4432018-11-20 09:42:33 -08005834 * Pulls information about the device's build.
5835 */
5836message BuildInformation {
5837 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5838 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5839 optional string fingerprint = 1;
5840
5841 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5842 optional string brand = 2;
5843
5844 // Build.PRODUCT. The name of the overall product.
5845 optional string product = 3;
5846
5847 // Build.DEVICE. The name of the industrial design.
5848 optional string device = 4;
5849
5850 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5851 optional string version_release = 5;
5852
5853 // Build.ID. E.g. a label like "M4-rc20".
5854 optional string id = 6;
5855
5856 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5857 // represent this build.
5858 optional string version_incremental = 7;
5859
5860 // Build.TYPE. The type of build, like "user" or "eng".
5861 optional string type = 8;
5862
5863 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5864 optional string tags = 9;
5865}
5866
5867/**
Adam He420947c2019-01-23 15:59:09 -08005868 * Logs information about mismatched caller for content capture.
5869 *
5870 * Logged from:
5871 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5872 */
5873message ContentCaptureCallerMismatchReported {
5874 optional string intended_package = 1;
5875 optional string calling_package = 2;
5876}
5877
5878/**
5879 * Logs information about content capture service events.
5880 *
5881 * Logged from:
5882 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5883 */
5884message ContentCaptureServiceEvents {
5885 // The type of event.
5886 enum Event {
5887 UNKNOWN = 0;
5888 ON_CONNECTED = 1;
5889 ON_DISCONNECTED = 2;
5890 SET_WHITELIST = 3;
5891 SET_DISABLED = 4;
5892 ON_USER_DATA_REMOVED = 5;
5893 }
5894 optional Event event = 1;
5895 // component/package of content capture service.
5896 optional string service_info = 2;
5897 // component/package of target.
5898 // it's a concatenated list of component/package for SET_WHITELIST event
5899 // separated by " ".
5900 optional string target_info = 3;
5901}
5902
5903/**
5904 * Logs information about content capture session events.
5905 *
5906 * Logged from:
5907 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5908 */
5909message ContentCaptureSessionEvents {
5910 // The type of event.
5911 enum Event {
5912 UNKNOWN = 0;
5913 ON_SESSION_STARTED = 1;
5914 ON_SESSION_FINISHED = 2;
5915 SESSION_NOT_CREATED = 3;
5916 }
5917 optional int32 session_id = 1;
5918 optional Event event = 2;
5919 // (n/a on session finished)
5920 optional int32 state_flags = 3;
5921 // component/package of content capture service.
5922 optional string service_info = 4;
5923 // component/package of app.
5924 // (n/a on session finished)
5925 optional string app_info = 5;
5926 optional bool is_child_session = 6;
5927}
5928
5929/**
5930 * Logs information about session being flushed.
5931 *
5932 * Logged from:
5933 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5934 */
5935message ContentCaptureFlushed {
5936 optional int32 session_id = 1;
5937 // component/package of content capture service.
5938 optional string service_info = 2;
5939 // component/package of app.
5940 optional string app_info = 3;
5941 // session start/finish events
5942 optional int32 child_session_started = 4;
5943 optional int32 child_session_finished = 5;
5944 // count of view events.
5945 optional int32 view_appeared_count = 6;
5946 optional int32 view_disappeared_count = 7;
5947 optional int32 view_text_changed_count = 8;
5948
5949 // Flush stats.
5950 optional int32 max_events = 9;
5951 optional int32 idle_flush_freq = 10;
5952 optional int32 text_flush_freq = 11;
5953 optional int32 flush_reason = 12;
5954}
5955
5956/**
Bookatz75ee60422018-11-09 12:27:37 -08005957 * Pulls on-device BatteryStats power use calculations for the overall device.
5958 */
5959message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005960 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5961 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5962 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5963 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005964}
5965
5966/**
5967 * Pulls on-device BatteryStats power use calculations broken down by uid.
5968 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5969 * that is attributed to non-uid items. They must all be included to get the total power use.
5970 */
5971message DeviceCalculatedPowerBlameUid {
5972 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5973 optional int32 uid = 1 [(is_uid) = true];
5974
Bookatz3dbc13a2018-12-21 12:16:51 -08005975 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5976 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5977 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005978}
5979
5980/**
5981 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5982 * drain type.
5983 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5984 * is attributed uids. They must all be included to get the total power use.
5985 */
5986message DeviceCalculatedPowerBlameOther {
5987 // The type of item whose power use is being reported.
5988 enum DrainType {
5989 AMBIENT_DISPLAY = 0;
5990 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5991 BLUETOOTH = 2;
5992 CAMERA = 3;
5993 // Cell-standby
5994 CELL = 4;
5995 FLASHLIGHT = 5;
5996 IDLE = 6;
5997 MEMORY = 7;
5998 // Amount that total computed drain exceeded the drain estimated using the
5999 // battery level changes and capacity.
6000 OVERCOUNTED = 8;
6001 PHONE = 9;
6002 SCREEN = 10;
6003 // Amount that total computed drain was below the drain estimated using the
6004 // battery level changes and capacity.
6005 UNACCOUNTED = 11;
6006 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6007 WIFI = 13;
6008 }
6009 optional DrainType drain_type = 1;
6010
Bookatz3dbc13a2018-12-21 12:16:51 -08006011 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6012 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6013 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006014}
arangelov4e994062018-11-13 16:12:38 +00006015
6016/**
6017 * Logs device policy features.
6018 *
6019 * Logged from:
6020 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6021 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6022 */
6023message DevicePolicyEvent {
6024 // The event id - unique for each event.
6025 optional android.stats.devicepolicy.EventId event_id = 1;
6026 // The admin package name.
6027 optional string admin_package_name = 2;
6028 // A generic integer parameter.
6029 optional int32 integer_value = 3;
6030 // A generic boolean parameter.
6031 optional bool boolean_value = 4;
6032 // A parameter specifying a time period in milliseconds.
6033 optional uint64 time_period_millis = 5;
6034 // A parameter specifying a list of package names, bundle extras or string parameters.
6035 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6036}
shawnlinea5b66b2018-11-13 15:05:29 +08006037
6038/**
6039 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6040 *
6041 * Logged from:
6042 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6043 */
6044message DocsUILaunchReported {
6045 optional android.stats.docsui.LaunchAction launch_action = 1;
6046 optional bool has_initial_uri = 2;
6047 optional android.stats.docsui.MimeType mime_type = 3;
6048 optional android.stats.docsui.Root initial_root = 4;
6049}
6050
6051/**
6052 * Logs root/app visited event in file managers/picker. Call this when the user
6053 * taps on root/app in hamburger menu.
6054 *
6055 * Logged from:
6056 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6057 */
6058message DocsUIRootVisitedReported {
6059 optional android.stats.docsui.ContextScope scope = 1;
6060 optional android.stats.docsui.Root root = 2;
6061}
6062
6063/**
6064 * Logs file operation stats. Call this when a file operation has completed.
6065 *
6066 * Logged from:
6067 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6068 */
6069message DocsUIFileOperationReported {
6070 optional android.stats.docsui.Provider provider = 1;
6071 optional android.stats.docsui.FileOperation file_op = 2;
6072}
6073
6074/**
6075 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6076 * mode.
6077 *
6078 * Logged from:
6079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6080 */
6081message DocsUIFileOperationCopyMoveModeReported {
6082 optional android.stats.docsui.FileOperation file_op = 1;
6083 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6084}
6085
6086
6087/**
6088 * Logs file sub operation stats. Call this when a file operation has failed.
6089 *
6090 * Logged from:
6091 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6092 */
6093message DocsUIFileOperationFailureReported {
6094 optional android.stats.docsui.Authority authority = 1;
6095 optional android.stats.docsui.SubFileOperation sub_op = 2;
6096}
6097
6098/**
6099* Logs the cancellation of a file operation. Call this when a job is canceled
6100*
6101* Logged from:
6102* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6103*/
6104message DocsUIFileOperationCanceledReported {
6105 optional android.stats.docsui.FileOperation file_op = 1;
6106}
6107
6108/**
6109 * Logs startup time in milliseconds.
6110 *
6111 * Logged from:
6112 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6113 */
6114message DocsUIStartupMsReported {
6115 optional int32 startup_millis = 1;
6116}
6117
6118/**
6119 * Logs the action that was started by user.
6120 *
6121 * Logged from:
6122 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6123 */
6124message DocsUIUserActionReported {
6125 optional android.stats.docsui.UserAction action = 1;
6126}
6127
6128/**
6129 * Logs the invalid type when invalid scoped access is requested.
6130 *
6131 * Logged from:
6132 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6133 */
6134message DocsUIInvalidScopedAccessRequestReported {
6135 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006136}
Ben Murdochbab399f62018-12-06 11:01:38 +00006137
6138/**
shawnlina75e82d2019-01-07 10:31:12 +08006139 * Logs the package name that launches docsui picker mode.
6140 *
6141 * Logged from:
6142 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6143 */
6144message DocsUIPickerLaunchedFromReported {
6145 optional string package_name = 1;
6146}
6147
6148/**
6149 * Logs the search type.
6150 *
6151 * Logged from:
6152 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6153 */
6154message DocsUISearchTypeReported {
6155 optional android.stats.docsui.SearchType search_type = 1;
6156}
6157
6158/**
6159 * Logs the search mode.
6160 *
6161 * Logged from:
6162 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6163 */
6164message DocsUISearchModeReported {
6165 optional android.stats.docsui.SearchMode search_mode = 1;
6166}
6167
6168/**
6169 * Logs the pick result information.
6170 *
6171 * Logged from:
6172 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6173 */
6174message DocsUIPickResultReported {
6175 optional int32 total_action_count = 1;
6176 optional int64 duration_millis = 2;
6177 optional int32 file_count= 3;
6178 optional bool is_searching = 4;
6179 optional android.stats.docsui.Root picked_from = 5;
6180 optional android.stats.docsui.MimeType mime_type = 6;
6181 optional int32 repeatedly_pick_times = 7;
6182}
6183
6184/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006185 * Logs when an app's memory is compacted.
6186 *
6187 * Logged from:
6188 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6189 */
6190message AppCompacted {
6191 // The pid of the process being compacted.
6192 optional int32 pid = 1;
6193
6194 // The name of the process being compacted.
6195 optional string process_name = 2;
6196
6197 // The type of compaction.
6198 enum Action {
6199 UNKNOWN = 0;
6200 SOME = 1;
6201 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006202 PERSISTENT = 3;
6203 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006204 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006205 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006206
6207 // Total RSS in kilobytes consumed by the process prior to compaction.
6208 optional int64 before_rss_total_kilobytes = 4;
6209
6210 // File RSS in kilobytes consumed by the process prior to compaction.
6211 optional int64 before_rss_file_kilobytes = 5;
6212
6213 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6214 optional int64 before_rss_anon_kilobytes = 6;
6215
6216 // Swap in kilobytes consumed by the process prior to compaction.
6217 optional int64 before_swap_kilobytes = 7;
6218
6219 // Total RSS in kilobytes consumed by the process after compaction.
6220 optional int64 after_rss_total_kilobytes = 8;
6221
6222 // File RSS in kilobytes consumed by the process after compaction.
6223 optional int64 after_rss_file_kilobytes = 9;
6224
6225 // Anonymous RSS in kilobytes consumed by the process after compaction.
6226 optional int64 after_rss_anon_kilobytes = 10;
6227
6228 // Swap in kilobytes consumed by the process after compaction.
6229 optional int64 after_swap_kilobytes = 11;
6230
6231 // The time taken to perform compaction in milliseconds.
6232 optional int64 time_to_compact_millis = 12;
6233
6234 // The last compaction action performed for this app.
6235 optional Action last_action = 13;
6236
Ben Murdoch01720b82018-12-19 18:03:44 +00006237 // The last time that compaction was attempted on this process in milliseconds
6238 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6239 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006240
Ben Murdoch885c21b2019-03-15 18:02:04 +00006241 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006242 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006243
6244 // The process state at the time of compaction.
6245 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006246
6247 // Free ZRAM in kilobytes before compaction.
6248 optional int64 before_zram_free_kilobytes = 17;
6249
6250 // Free ZRAM in kilobytes after compaction.
6251 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006252}
lifr157fc552018-12-12 16:38:04 +08006253
6254/**
lifrb6b90b62019-03-29 00:40:17 +08006255 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6256 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6257 *
lifr1f74b052019-04-16 22:16:30 +08006258 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6259 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6260 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6261 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006262 */
6263message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006264 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006265
lifr1f74b052019-04-16 22:16:30 +08006266 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006267
6268 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006269 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006270
lifr1f74b052019-04-16 22:16:30 +08006271 // Only valid for event_type = EVENT_GETADDRINFO.
6272 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006273
lifr1f74b052019-04-16 22:16:30 +08006274 // Flags passed to android_res_nsend() defined in multinetwork.h
6275 // Only valid for event_type = EVENT_RESNSEND.
6276 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006277
lifrad9becc2019-05-20 11:04:41 +08006278 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006279
6280 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006281 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006282
6283 // Additional pass-through fields opaque to statsd.
6284 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006285 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006286
6287 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6288 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006289}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006290
6291/**
6292 * Logs when a data stall event occurs.
6293 *
6294 * Log from:
6295 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6296 */
6297message DataStallEvent {
6298 // Data stall evaluation type.
6299 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6300 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6301 optional int32 evaluation_type = 1;
6302 // See definition in data_stall_event.proto.
6303 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6304 // See definition in data_stall_event.proto.
6305 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6306 // See definition in data_stall_event.proto.
6307 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6308 // See definition in data_stall_event.proto.
6309 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6310 // See definition in data_stall_event.proto.
6311 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6312}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006313
6314/*
6315 * Logs when RescueParty resets some set of experiment flags.
6316 *
6317 * Logged from:
6318 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6319 */
6320message RescuePartyResetReported {
6321 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6322 optional int32 rescue_level = 1;
6323}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006324
6325/**
6326 * Logs when signed config is received from an APK, and if that config was applied successfully.
6327 * Logged from:
6328 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6329 */
6330message SignedConfigReported {
6331 enum Type {
6332 UNKNOWN_TYPE = 0;
6333 GLOBAL_SETTINGS = 1;
6334 }
6335 optional Type type = 1;
6336
6337 // The final status of the signed config received.
6338 enum Status {
6339 UNKNOWN_STATUS = 0;
6340 APPLIED = 1;
6341 BASE64_FAILURE_CONFIG = 2;
6342 BASE64_FAILURE_SIGNATURE = 3;
6343 SECURITY_EXCEPTION = 4;
6344 INVALID_CONFIG = 5;
6345 OLD_CONFIG = 6;
6346 SIGNATURE_CHECK_FAILED = 7;
6347 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006348 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006349 }
6350 optional Status status = 2;
6351
6352 // The version of the signed config processed.
6353 optional int32 version = 3;
6354
6355 // The package name that the config was extracted from.
6356 optional string from_package = 4;
6357
6358 enum Key {
6359 NO_KEY = 0;
6360 DEBUG = 1;
6361 PRODUCTION = 2;
6362 }
6363 // Which key was used to verify the config.
6364 optional Key verified_with = 5;
6365}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006366
6367/*
6368 * Logs GNSS Network-Initiated (NI) location events.
6369 *
6370 * Logged from:
6371 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6372 */
6373message GnssNiEventReported {
6374 // The type of GnssNiEvent.
6375 enum EventType {
6376 UNKNOWN = 0;
6377 NI_REQUEST = 1;
6378 NI_RESPONSE = 2;
6379 }
6380 optional EventType event_type = 1;
6381
6382 // An ID generated by HAL to associate NI notifications and UI responses.
6383 optional int32 notification_id = 2;
6384
6385 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006386 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006387
6388 // NI requires notification.
6389 optional bool need_notify = 4;
6390
6391 // NI requires verification.
6392 optional bool need_verify = 5;
6393
6394 // NI requires privacy override, no notification/minimal trace.
6395 optional bool privacy_override = 6;
6396
6397 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6398 // seconds.
6399 optional int32 timeout = 7;
6400
6401 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006402 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006403
6404 // String representing the requester of the network inititated location request.
6405 optional string requestor_id = 9;
6406
6407 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6408 // network initiated location request.
6409 optional string text = 10;
6410
6411 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006412 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006413
6414 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006415 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006416
6417 // True if SUPL ES is enabled.
6418 optional bool is_supl_es_enabled = 13;
6419
6420 // True if GNSS location is enabled.
6421 optional bool is_location_enabled = 14;
6422
6423 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006424 optional android.server.location.GnssUserResponseType user_response = 15;
6425}
6426
6427/**
6428 * Logs GNSS non-framework (NFW) location notification.
6429 *
6430 * Logged from:
6431 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6432 */
6433message GnssNfwNotificationReported {
6434 // Package name of the Android proxy application representing the non-framework entity that
6435 // requested location. Set to empty string if unknown.
6436 optional string proxy_app_package_name = 1;
6437
6438 // Protocol stack that initiated the non-framework location request.
6439 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6440
6441 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6442 // set to empty string. This field is opaque to the framework and used for logging purposes.
6443 optional string other_protocol_stack_name = 3;
6444
6445 // Source initiating/receiving the location information.
6446 optional android.server.location.NfwRequestor requestor = 4;
6447
6448 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6449 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6450 // and used for logging purposes.
6451 optional string requestor_id = 5;
6452
6453 // Indicates whether location information was provided for this request.
6454 optional android.server.location.NfwResponseType response_type = 6;
6455
6456 // True if the device is in user initiated emergency session.
6457 optional bool in_emergency_mode = 7;
6458
6459 // True if cached location is provided.
6460 optional bool is_cached_location = 8;
6461
6462 // True if proxy app permission mismatch between framework and GNSS HAL.
6463 optional bool is_permission_mismatched = 9;
6464}
6465
6466/**
6467 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6468 *
6469 * Logged from:
6470 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6471 */
6472message GnssConfigurationReported {
6473 // SUPL host name.
6474 optional string supl_host = 1;
6475
6476 // SUPL port number.
6477 optional int32 supl_port = 2;
6478
6479 // C2K host name.
6480 optional string c2k_host = 3;
6481
6482 // C2K port number.
6483 optional int32 c2k_port = 4;
6484
6485 // The SUPL version requested by Carrier.
6486 optional int32 supl_ver = 5;
6487
6488 // The SUPL mode.
6489 optional android.server.location.SuplMode supl_mode = 6;
6490
6491 // True if NI emergency SUPL restrictions is enabled.
6492 optional bool supl_es = 7;
6493
6494 // LTE Positioning Profile settings
6495 optional android.server.location.LppProfile lpp_profile = 8;
6496
6497 // Positioning protocol on A-Glonass system.
6498 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6499
6500 // True if emergency PDN is used. Otherwise, regular PDN is used.
6501 optional bool use_emergency_pdn_for_emergency_supl= 10;
6502
6503 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6504 optional android.server.location.GpsLock gps_lock = 11;
6505
6506 // Number of seconds to extend the emergency session duration post emergency call.
6507 optional int32 es_extension_sec = 12;
6508
6509 // The full list of package names of proxy Android applications representing the non-framework
6510 // location access entities (on/off the device) for which the framework user has granted
6511 // non-framework location access permission. The package names are concatenated in one string
6512 // with spaces as separators.
6513 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006514}
Jack Yu95b64f32018-12-13 18:26:11 +08006515
6516/**
6517 * Logs when a NFC device's error occurred.
6518 * Logged from:
6519 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6520 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6521 */
6522message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006523 enum Type {
6524 UNKNOWN = 0;
6525 CMD_TIMEOUT = 1;
6526 ERROR_NOTIFICATION = 2;
6527 AID_OVERFLOW = 3;
6528 }
6529 optional Type type = 1;
6530 // If it's nci cmd timeout, log the timeout command.
6531 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006532
Alex Salod7c3eef2019-01-25 14:43:27 -08006533 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006534}
6535
6536/**
6537 * Logs when a NFC device's state changed event
6538 * Logged from:
6539 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6540 */
6541message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006542 enum State {
6543 UNKNOWN = 0;
6544 OFF = 1;
6545 ON = 2;
6546 ON_LOCKED = 3; // Secure Nfc enabled.
6547 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6548 }
6549 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006550}
6551
6552/**
6553 * Logs when a NFC Beam Transaction occurred.
6554 * Logged from:
6555 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6556 */
6557message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006558 enum Operation {
6559 UNKNOWN = 0;
6560 SEND = 1;
6561 RECEIVE = 2;
6562 }
6563 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006564}
6565
6566/**
6567 * Logs when a NFC Card Emulation Transaction occurred.
6568 * Logged from:
6569 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6570 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6571 */
6572message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006573 enum Category {
6574 UNKNOWN = 0;
6575 HCE_PAYMENT = 1;
6576 HCE_OTHER = 2;
6577 OFFHOST = 3;
6578 }
6579 // Transaction belongs to HCE payment or HCE other category, or offhost.
6580 optional Category category = 1;
6581 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6582 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006583}
6584
6585/**
6586 * Logs when a NFC Tag event occurred.
6587 * Logged from:
6588 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6589 */
6590message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006591 enum Type {
6592 UNKNOWN = 0;
6593 URL = 1;
6594 BT_PAIRING = 2;
6595 PROVISION = 3;
6596 WIFI_CONNECT = 4;
6597 APP_LAUNCH = 5;
6598 OTHERS = 6;
6599 }
6600 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006601}
6602
6603/**
6604 * Logs when Hce transaction triggered
6605 * Logged from:
6606 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6607 */
6608message NfcHceTransactionOccurred {
6609 // The latency period(in microseconds) it took for the first HCE data
6610 // exchange.
6611 optional uint32 latency_micros = 1;
6612}
6613
6614/**
6615 * Logs when SecureElement state event changed
6616 * Logged from:
6617 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6618 */
6619message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006620 enum State {
6621 UNKNOWN = 0;
6622 INITIALIZED = 1;
6623 DISCONNECTED = 2;
6624 CONNECTED = 3;
6625 HALCRASH = 4;
6626 }
6627 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006628
Alex Salod7c3eef2019-01-25 14:43:27 -08006629 optional string state_change_reason = 2;
6630 // SIMx or eSEx.
6631 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006632}
6633
6634/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006635 * Information about a permission grant request
6636 */
6637message PermissionGrantRequestResultReported {
6638 // unique value identifying an API call. A API call might result in multiple of these atoms
6639 optional int64 request_id = 1;
6640
6641 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006642 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006643
6644 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006645 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006646
6647 // The permission to be granted
6648 optional string permission_name = 4;
6649
6650 // If the permission was explicitly requested via the API or added by the system
6651 optional bool is_implicit = 5;
6652
6653 enum Result {
6654 UNDEFINED = 0;
6655 // permission request was ignored
6656 IGNORED = 1;
6657 // permission request was ignored because it was user fixed
6658 IGNORED_USER_FIXED = 2;
6659 // permission request was ignored because it was policy fixed
6660 IGNORED_POLICY_FIXED = 3;
6661 // permission was granted by user action
6662 USER_GRANTED = 4;
6663 // permission was automatically granted
6664 AUTO_GRANTED = 5;
6665 // permission was denied by user action
6666 USER_DENIED = 6;
6667 // permission was denied with prejudice by the user
6668 USER_DENIED_WITH_PREJUDICE = 7;
6669 // permission was automatically denied
6670 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006671 // permission request was ignored because permission is restricted
6672 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006673 // one time permission was granted by user action
6674 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006675 // user ignored request by leaving the request screen without choosing any option
6676 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006677 // user granted the permission after being linked to settings
6678 USER_GRANTED_IN_SETTINGS = 12;
6679 // user denied the permission after being linked to settings
6680 USER_DENIED_IN_SETTINGS = 13;
6681 // user denied the permission with prejudice after being linked to settings
6682 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6683 // permission was automatically revoked after one-time permission expired
6684 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006685 // permission was automatically revoked for unused app
6686 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006687 }
6688 // The result of the permission grant
6689 optional Result result = 6;
6690}
6691
6692/**
Jack Yu95b64f32018-12-13 18:26:11 +08006693 * Logs when Omapi API used
6694 * Logged from:
6695 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6696 */
6697message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006698 enum Operation {
6699 UNKNOWN = 0;
6700 OPEN_CHANNEL = 1;
6701 }
6702 optional Operation operation = 1;
6703 // SIMx or eSEx.
6704 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006705
Alex Salod7c3eef2019-01-25 14:43:27 -08006706 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006707}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006708
6709/**
Alex Saloa060aee2019-01-21 14:36:41 -08006710 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6711 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006712 * Logged from:
6713 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6714 */
6715message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006716 optional int64 dispatch_latency_millis = 1;
6717}
6718
6719/**
6720 * Logs AttentionManagerService attention check result.
6721 *
6722 * Logged from:
6723 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6724 */
6725message AttentionManagerServiceResultReported {
6726 // See core/java/android/service/attention/AttentionService.java
6727 enum AttentionCheckResult {
6728 UNKNOWN = 20;
6729 ATTENTION_SUCCESS_ABSENT = 0;
6730 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006731 ATTENTION_FAILURE_UNKNOWN = 2;
6732 ATTENTION_FAILURE_CANCELLED = 3;
6733 ATTENTION_FAILURE_PREEMPTED = 4;
6734 ATTENTION_FAILURE_TIMED_OUT = 5;
6735 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006736 }
6737 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006738}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006739
6740/**
6741 * Logs when an adb connection changes state.
6742 *
6743 * Logged from:
6744 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6745 */
6746message AdbConnectionChanged {
6747 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6748 // previously selected for this system.
6749 optional int64 last_connection_time_millis = 1;
6750
6751 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6752 // to reconnect via adb without user interaction.
6753 optional int64 auth_window_millis = 2;
6754
6755 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6756 optional android.debug.AdbConnectionStateEnum state = 3;
6757
6758 // True if the 'always allow' option was selected for this system.
6759 optional bool always_allow = 4;
6760}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006761
6762/*
6763 * Logs the reported speech DSP status.
6764 *
6765 * Logged from:
6766 * Vendor audio implementation.
6767 */
6768message SpeechDspStatReported {
6769 // The total Speech DSP uptime in milliseconds.
6770 optional int32 total_uptime_millis = 1;
6771 // The total Speech DSP downtime in milliseconds.
6772 optional int32 total_downtime_millis = 2;
6773 optional int32 total_crash_count = 3;
6774 optional int32 total_recover_count = 4;
6775}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006776
6777/**
6778 * Logs USB connector contaminant status.
6779 *
6780 * Logged from: USB Service.
6781 */
6782message UsbContaminantReported {
6783 optional string id = 1;
6784 optional android.service.usb.ContaminantPresenceStatus status = 2;
6785}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006786
6787/**
6788 * This atom is for debugging purpose.
6789 */
6790message DebugElapsedClock {
6791 // Monotically increasing value for each pull.
6792 optional int64 pull_count = 1;
6793 // Time from System.elapsedRealtime.
6794 optional int64 elapsed_clock_millis = 2;
6795 // Time from System.elapsedRealtime.
6796 optional int64 same_elapsed_clock_millis = 3;
6797 // Diff between current elapsed time and elapsed time from previous pull.
6798 optional int64 elapsed_clock_diff_millis = 4;
6799
6800 enum Type {
6801 TYPE_UNKNOWN = 0;
6802 ALWAYS_PRESENT = 1;
6803 PRESENT_ON_ODD_PULLS = 2;
6804 }
6805 // Type of behavior for the pulled data.
6806 optional Type type = 5;
6807}
6808
6809/**
6810 * This atom is for debugging purpose.
6811 */
6812message DebugFailingElapsedClock {
6813 // Monotically increasing value for each pull.
6814 optional int64 pull_count = 1;
6815 // Time from System.elapsedRealtime.
6816 optional int64 elapsed_clock_millis = 2;
6817 // Time from System.elapsedRealtime.
6818 optional int64 same_elapsed_clock_millis = 3;
6819 // Diff between current elapsed time and elapsed time from previous pull.
6820 optional int64 elapsed_clock_diff_millis = 4;
6821}
Steven Wuacef6bb2019-01-23 14:21:17 -05006822
6823/** Logs System UI bubbles event changed.
6824 *
6825 * Logged from:
6826 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6827 */
6828message BubbleUIChanged {
6829
6830 // The app package that is posting the bubble.
6831 optional string package_name = 1;
6832
6833 // The notification channel that is posting the bubble.
6834 optional string notification_channel = 2;
6835
6836 // The notification id associated with the posted bubble.
6837 optional int32 notification_id = 3;
6838
6839 // The position of the bubble within the bubble stack.
6840 optional int32 position = 4;
6841
6842 // The total number of bubbles within the bubble stack.
6843 optional int32 total_number = 5;
6844
6845 // User interactions with the bubble.
6846 enum Action {
6847 UNKNOWN = 0;
6848 POSTED = 1;
6849 UPDATED = 2;
6850 EXPANDED = 3;
6851 COLLAPSED = 4;
6852 DISMISSED = 5;
6853 STACK_DISMISSED = 6;
6854 STACK_MOVED = 7;
6855 HEADER_GO_TO_APP = 8;
6856 HEADER_GO_TO_SETTINGS = 9;
6857 PERMISSION_OPT_IN = 10;
6858 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006859 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006860 SWIPE_LEFT = 13;
6861 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006862 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006863 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006864 }
6865 optional Action action = 6;
6866
6867 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6868 optional float normalized_x_position = 7;
6869 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006870
6871 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6872 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006873
6874 // Whether the bubble is an on-going one.
6875 optional bool is_ongoing = 10;
6876
6877 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006878 // This is deprecated and the value should be ignored.
6879 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006880}
Kweku Adams8845d012018-12-11 20:06:45 -08006881
6882/**
Steven Wu552f63f2019-02-05 13:41:36 -05006883 * Logs System UI bubbles developer errors.
6884 *
6885 * Logged from:
6886 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6887 */
6888message BubbleDeveloperErrorReported {
6889
6890 // The app package that is posting the bubble.
6891 optional string package_name = 1;
6892
6893 // Bubble developer error type enums.
6894 enum Error {
6895 UNKNOWN = 0;
6896 ACTIVITY_INFO_MISSING = 1;
6897 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6898 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6899 }
6900 optional Error error = 2 [default = UNKNOWN];
6901}
6902
6903/**
Kweku Adams8845d012018-12-11 20:06:45 -08006904 * Logs that a constraint for a scheduled job has changed.
6905 *
6906 * Logged from:
6907 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6908 */
6909message ScheduledJobConstraintChanged {
6910 repeated AttributionNode attribution_node = 1;
6911
6912 // Name of the job.
6913 optional string job_name = 2;
6914
6915 optional com.android.server.job.ConstraintEnum constraint = 3;
6916
6917 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006918 UNKNOWN = 0;
6919 UNSATISFIED = 1;
6920 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006921 }
6922 optional State state = 4;
6923}
Alex Salod7c3eef2019-01-25 14:43:27 -08006924
6925/**
6926 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6927 * returns true.
6928 *
6929 * Logged from:
6930 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6931 */
6932message ScreenTimeoutExtensionReported {
6933 // Describes how many times in a row did the power manager reset the screen off timeout.
6934 optional uint32 consecutive_timeout_extended_count = 1;
6935}
Hui Yu885aca12019-01-10 17:11:34 -08006936
6937/*
6938* Logs number of milliseconds it takes to start a process.
6939* The definition of app process start time is from the app launch time to
6940* the time that Zygote finished forking the app process and loaded the
6941* application package's java classes.
6942
6943* This metric is different from AppStartOccurred which is for foreground
6944* activity only.
6945
6946* ProcessStartTime can report all processes (both foreground and background)
6947* start time.
6948*
6949* Logged from:
6950* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6951*/
6952message ProcessStartTime {
6953 // The uid of the ProcessRecord.
6954 optional int32 uid = 1 [(is_uid) = true];
6955
6956 // The process pid.
6957 optional int32 pid = 2;
6958
6959 // The process name.
6960 // Usually package name, "system" for system server.
6961 // Provided by ActivityManagerService.
6962 optional string process_name = 3;
6963
6964 enum StartType {
6965 UNKNOWN = 0;
6966 WARM = 1;
6967 HOT = 2;
6968 COLD = 3;
6969 }
6970
6971 // The start type.
6972 optional StartType type = 4;
6973
6974 // The elapsed realtime at the start of the process.
6975 optional int64 process_start_time_millis = 5;
6976
6977 // Number of milliseconds it takes to reach bind application.
6978 optional int32 bind_application_delay_millis = 6;
6979
6980 // Number of milliseconds it takes to finish start of the process.
6981 optional int32 process_start_delay_millis = 7;
6982
6983 // hostingType field in ProcessRecord, the component type such as "activity",
6984 // "service", "content provider", "broadcast" or other strings.
6985 optional string hosting_type = 8;
6986
6987 // hostingNameStr field in ProcessRecord. The component class name that runs
6988 // in this process.
6989 optional string hosting_name = 9;
6990}
6991
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006992/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006993 * Track Media Codec usage
6994 * Logged from:
6995 * frameworks/av/media/libstagefright/MediaCodec.cpp
6996 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6997 */
6998message MediametricsCodecReported {
6999 optional int64 timestamp_nanos = 1;
7000 optional string package_name = 2;
7001 optional int64 package_version_code = 3;
7002 optional int64 media_apex_version = 4;
7003
7004 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7005}
7006
7007/**
7008 * Track Media Extractor (pulling video/audio streams out of containers) usage
7009 * Logged from:
7010 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7011 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7012 */
7013message MediametricsExtractorReported {
7014 optional int64 timestamp_nanos = 1;
7015 optional string package_name = 2;
7016 optional int64 package_version_code = 3;
7017 optional int64 media_apex_version = 4;
7018
7019 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7020}
7021
7022/**
7023 * Track how we arbitrate between microphone/input requests.
7024 * Logged from
7025 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7026 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7027 */
7028message MediametricsAudiopolicyReported {
7029 optional int64 timestamp_nanos = 1;
7030 optional string package_name = 2;
7031 optional int64 package_version_code = 3;
7032 optional int64 media_apex_version = 4;
7033
7034 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7035}
7036
7037/**
7038 * Track how we arbitrate between microphone requests.
7039 * Logged from
7040 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7041 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7042 */
7043message MediametricsAudiorecordReported {
7044 optional int64 timestamp_nanos = 1;
7045 optional string package_name = 2;
7046 optional int64 package_version_code = 3;
7047 optional int64 media_apex_version = 4;
7048
7049 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7050}
7051
7052/**
7053 * Track how we arbitrate between microphone/input requests.
7054 * Logged from
7055 * frameworks/av/media/libnblog/ReportPerformance.cpp
7056 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7057 */
7058message MediametricsAudiothreadReported {
7059 optional int64 timestamp_nanos = 1;
7060 optional string package_name = 2;
7061 optional int64 package_version_code = 3;
7062 optional int64 media_apex_version = 4;
7063
7064 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7065}
7066
7067/**
7068 * Track how we arbitrate between microphone/input requests.
7069 * Logged from
7070 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7071 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7072 */
7073message MediametricsAudiotrackReported {
7074 optional int64 timestamp_nanos = 1;
7075 optional string package_name = 2;
7076 optional int64 package_version_code = 3;
7077 optional int64 media_apex_version = 4;
7078
7079 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7080}
7081
7082/**
7083 * Track information about DRM framework performance
7084 * Logged from
7085 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7086 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7087 */
7088message MediametricsMediadrmReported {
7089 optional int64 timestamp_nanos = 1;
7090 optional string package_name = 2;
7091 optional int64 package_version_code = 3;
7092 optional int64 media_apex_version = 4;
7093
7094 // vendor+description tell about which DRM plugin is in use on this device
7095 optional string vendor = 5;
7096 optional string description = 6;
7097 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7098 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7099}
7100
7101/**
7102 * Track information about the widevine DRM plugin performance
7103 * Logged from
7104 * vendor/widevine/libwvdrmengine/cdm/metrics
7105 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7106 */
7107message MediametricsDrmWidevineReported {
7108 optional int64 timestamp_nanos = 1;
7109 optional string package_name = 2;
7110 optional int64 package_version_code = 3;
7111 optional int64 media_apex_version = 4;
7112
7113 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7114}
7115
7116/**
7117 * Track information about recordings (e.g. camcorder)
7118 * Logged from
7119 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7120 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7121 */
7122message MediametricsRecorderReported {
7123 optional int64 timestamp_nanos = 1;
7124 optional string package_name = 2;
7125 optional int64 package_version_code = 3;
7126 optional int64 media_apex_version = 4;
7127
7128 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7129}
7130
7131/**
7132 * Track Media Player usage
7133 * Logged from:
7134 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7135 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7136 */
7137message MediametricsNuPlayerReported {
7138 optional int64 timestamp_nanos = 1;
7139 optional string package_name = 2;
7140 optional int64 package_version_code = 3;
7141 optional int64 media_apex_version = 4;
7142
7143 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7144}
7145
7146/**
Robert Shiha4beed32019-08-19 14:15:23 -07007147 * Track Legacy DRM usage
7148 * Logged from
7149 * frameworks/av/drm/drmserver/DrmManager.cpp
7150 */
7151message MediametricsDrmManagerReported {
7152 optional int64 timestamp_nanos = 1;
7153 optional string package_name = 2;
7154 optional int64 package_version_code = 3;
7155 optional int64 media_apex_version = 4;
7156
7157 enum Method {
7158 METHOD_NOT_FOUND = -1;
7159 GET_CONSTRAINTS = 0;
7160 GET_METADATA = 1;
7161 CAN_HANDLE = 2;
7162 PROCESS_DRM_INFO = 3;
7163 ACQUIRE_DRM_INFO = 4;
7164 SAVE_RIGHTS = 5;
7165 GET_ORIGINAL_MIME_TYPE = 6;
7166 GET_DRM_OBJECT_TYPE = 7;
7167 CHECK_RIGHTS_STATUS = 8;
7168 REMOVE_RIGHTS = 9;
7169 REMOVE_ALL_RIGHTS = 10;
7170 OPEN_CONVERT_SESSION = 11;
7171 OPEN_DECRYPT_SESSION = 12;
7172 }
7173
7174 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7175 optional string plugin_id = 5;
7176 optional string description = 6;
7177 optional Method method = 7;
7178 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007179
7180 optional int64 get_constraints_count = 9;
7181 optional int64 get_metadata_count = 10;
7182 optional int64 can_handle_count = 11;
7183 optional int64 process_drm_info_count = 12;
7184 optional int64 acquire_drm_info_count = 13;
7185 optional int64 save_rights_count = 14;
7186 optional int64 get_original_mime_type_count = 15;
7187 optional int64 get_drm_object_type_count = 16;
7188 optional int64 check_rights_status_count = 17;
7189 optional int64 remove_rights_count = 18;
7190 optional int64 remove_all_rights_count = 19;
7191 optional int64 open_convert_session_count = 20;
7192 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007193}
7194
7195/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007196 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007197 * Pulled from: StatsCompanionService
7198*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007199message DangerousPermissionState {
7200 // Name of the permission
7201 optional string permission_name = 1;
7202
7203 // Uid of the package
7204 optional int32 uid = 2 [(is_uid) = true];
7205
7206 // Package requesting the permission
7207 optional string package_name = 3;
7208
7209 // If the permission is granted to the uid
7210 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007211
7212 // Permission flags as per android.content.pm.PermissionFlags
7213 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007214}
7215
Michael Groover4a0ca942019-01-24 17:41:25 -08007216/**
7217 * Logs when a package is denied access to a device identifier based on the new access requirements.
7218 *
7219 * Logged from:
7220 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7221 */
7222message DeviceIdentifierAccessDenied {
7223 // The name of the package denied access to the requested device identifier.
7224 optional string package_name = 1;
7225
7226 // The name of the device identifier method the package attempted to invoke.
7227 optional string method_name = 2;
7228
7229 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007230 // Starting from Android 11, this boolean is not set and will always be false.
7231 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007232
7233 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007234 // Starting from Android 11, this boolean is not set and will always be false.
7235 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007236}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007237
7238/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007239 * Pulls the ongoing mainline install train version code.
7240 * Pulled from StatsCompanionService
7241 */
7242message TrainInfo {
7243 optional int64 train_version_code = 1;
7244
7245 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007246
7247 optional string train_name = 3;
7248
7249 enum Status {
7250 UNKNOWN = 0;
7251 INSTALL_REQUESTED = 1;
7252 INSTALL_STARTED = 2;
7253 INSTALL_STAGED_NOT_READY = 3;
7254 INSTALL_STAGED_READY = 4;
7255 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007256 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7257 // and INSTALL_FAILURE_COMMIT.
7258 INSTALL_FAILURE = 6 [deprecated = true];
7259 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007260 INSTALL_CANCELLED = 7;
7261 INSTALLER_ROLLBACK_REQUESTED = 8;
7262 INSTALLER_ROLLBACK_INITIATED = 9;
7263 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7264 INSTALLER_ROLLBACK_STAGED = 11;
7265 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7266 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7267 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7268 INSTALLER_ROLLBACK_SUCCESS = 15;
7269 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007270 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7271 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7272 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7273 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7274 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7275 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007276 INSTALL_FAILURE_DOWNLOAD = 23;
7277 INSTALL_FAILURE_STATE_MISMATCH = 24;
7278 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007279 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007280 }
7281 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007282}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007283
7284/**
7285 * Logs the gesture stage changed event.
7286 *
7287 * Logged from:
7288 * frameworks/base/packages/SystemUI/
7289 */
7290message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007291 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007292}
7293
7294/**
7295 * Logs the feedback type.
7296 *
7297 * Logged from:
7298 * frameworks/base/packages/SystemUI/
7299 */
7300message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007301 // Whether or not the gesture was used.
7302 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007303}
7304
7305/**
7306 * Logs the progress.
7307 *
7308 * Logged from:
7309 * frameworks/base/packages/SystemUI/
7310 */
7311message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007312 // [0,100] progress for the assist gesture.
7313 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007314}
Neil Fullerdb14b482019-02-05 19:44:44 +00007315
7316/*
7317 * Information about the time zone data on a device.
7318 */
7319message TimeZoneDataInfo {
7320 // A version identifier for the data set on device. e.g. "2018i"
7321 optional string tzdb_version = 1;
7322}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007323
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007324/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007325 * Logs the GPU stats global health information.
7326 *
7327 * Logged from:
7328 * frameworks/native/services/gpuservice/gpustats/
7329 */
7330message GpuStatsGlobalInfo {
7331 // Package name of the gpu driver.
7332 optional string driver_package_name = 1;
7333
7334 // Version name of the gpu driver.
7335 optional string driver_version_name = 2;
7336
7337 // Version code of the gpu driver.
7338 optional int64 driver_version_code = 3;
7339
7340 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7341 optional int64 driver_build_time = 4;
7342
7343 // Total count of the gl driver gets loaded.
7344 optional int64 gl_loading_count = 5;
7345
7346 // Total count of the gl driver fails to be loaded.
7347 optional int64 gl_loading_failure_count = 6;
7348
7349 // Total count of the Vulkan driver gets loaded.
7350 optional int64 vk_loading_count = 7;
7351
7352 // Total count of the Vulkan driver fails to be loaded.
7353 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007354
7355 // Api version of the system Vulkan driver.
7356 optional int32 vulkan_version = 9;
7357
7358 // Api version of the system CPU Vulkan driver.
7359 optional int32 cpu_vulkan_version = 10;
7360
7361 // Api version of the system GLES driver.
7362 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007363
7364 // Total count of the angle driver gets loaded.
7365 optional int64 angle_loading_count = 12;
7366
7367 // Total count of the angle driver fails to be loaded.
7368 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007369}
7370
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007371/**
7372 * GPU driver loading time info.
7373 */
7374message GpuDriverLoadingTime {
7375 // List of all the driver loading times for this app. The list size is
7376 // capped at 50.
7377 repeated int64 driver_loading_time = 1;
7378}
7379
7380/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007381 * Logs the GPU stats per app health information.
7382 *
7383 * Logged from:
7384 * frameworks/native/services/gpuservice/gpustats/
7385 */
7386message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007387 // Package name of the application that loads the gpu driver. Total number
7388 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007389 optional string app_package_name = 1;
7390
7391 // Version code of the gpu driver this app loads.
7392 optional int64 driver_version_code = 2;
7393
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007394 // gl driver loading time info.
7395 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7396 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007397
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007398 // Vulkan driver loading time info.
7399 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7400 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007401
7402 // Angle driver loading time info.
7403 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7404 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007405
7406 // CPU Vulkan implementation is in use.
7407 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007408
7409 // App is not doing pre-rotation correctly.
7410 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007411
7412 // App creates GLESv1 context.
7413 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007414}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007415
7416/*
7417 * Logs the size of the system ion heap.
7418 *
7419 * Pulled from StatsCompanionService.
7420 */
7421message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007422 // Deprecated due to limited support of ion stats in debugfs.
7423 // Use `IonHeapSize` instead.
7424 option deprecated = true;
7425
Rafal Slawikd4e87572019-03-12 13:08:38 +00007426 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007427 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007428 optional int64 size_in_bytes = 1;
7429}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007430
Rafal Slawik77987ed2019-06-17 12:28:23 +01007431/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007432 * Logs the total size of the ion heap.
7433 *
7434 * Pulled from StatsCompanionService.
7435 */
7436message IonHeapSize {
7437 // Total size of all ion heaps in kilobytes.
7438 // Read from: /sys/kernel/ion/total_heaps_kb.
7439 optional int32 total_size_kb = 1;
7440}
7441
7442/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007443 * Logs the per-process size of the system ion heap.
7444 *
7445 * Pulled from StatsCompanionService.
7446 */
7447message ProcessSystemIonHeapSize {
7448 // The uid if available. -1 means not available.
7449 optional int32 uid = 1 [(is_uid) = true];
7450
7451 // The process name (from /proc/PID/cmdline).
7452 optional string process_name = 2;
7453
7454 // Sum of sizes of all allocations.
7455 optional int32 total_size_in_kilobytes = 3;
7456
7457 // Number of allocations.
7458 optional int32 allocation_count = 4;
7459
7460 // Size of the largest allocation.
7461 optional int32 max_size_in_kilobytes = 5;
7462}
7463
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007464/**
7465 * Push network stack events.
7466 *
7467 * Log from:
7468 * frameworks/base/packages/NetworkStack/
7469 */
7470message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007471 // The id that indicates the event reported from NetworkStack.
7472 optional int32 event_id = 1;
7473 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007474 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7475}
Carmen Agimofa769c152019-03-04 14:39:14 +00007476
7477/**
7478 * Logs the apps that are installed on the external storage.
7479 * Pulled from:
7480 * StatsCompanionService
7481 */
7482message AppsOnExternalStorageInfo {
7483 // The type of the external storage.
7484 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7485 // The name of the package that is installed on the external storage.
7486 optional string package_name = 2;
7487}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007488
7489/**
7490 * Logs the settings related to Face.
7491 * Logged from:
7492 * frameworks/base/services/core/java/com/android/server/stats
7493 */
7494message FaceSettings {
7495 // Whether or not face unlock is allowed on Keyguard.
7496 optional bool unlock_keyguard_enabled = 1;
7497 // Whether or not face unlock dismisses the Keyguard.
7498 optional bool unlock_dismisses_keyguard = 2;
7499 // Whether or not face unlock requires attention.
7500 optional bool unlock_attention_required = 3;
7501 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7502 optional bool unlock_app_enabled = 4;
7503 // Whether or not face unlock always requires user confirmation.
7504 optional bool unlock_always_require_confirmation = 5;
7505 // Whether or not a diverse set of poses are required during enrollment.
7506 optional bool unlock_diversity_required = 6;
7507}
Maggie White442b6312019-04-05 16:26:44 -07007508
7509/**
7510 * Logs cooling devices maintained by the kernel.
7511 *
7512 * Pulled from StatsCompanionService.java
7513 */
7514message CoolingDevice {
7515 // The type of cooling device being reported. Eg. CPU, GPU...
7516 optional android.os.CoolingTypeEnum device_location = 1;
7517 // The name of the cooling device source. Eg. CPU0
7518 optional string device_name = 2;
7519 // Current throttle state of the cooling device. The value can any unsigned
7520 // integer between 0 and max_state defined in its driver. 0 means device is
7521 // not in throttling, higher value means deeper throttling.
7522 optional int32 state = 3;
7523}
Ben Blount763a5d52019-04-10 11:48:58 -07007524
7525/**
7526 * Intelligence has several counter-type events that don't warrant a
7527 * full separate atom. These are primarily API call counters but also include
7528 * counters for feature usage and specific failure modes.
7529 *
7530 * Logged from the Intelligence mainline module.
7531 */
7532message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007533 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007534 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007535 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007536 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007537 // How many times the event occured (to report a batch of high frequency events).
7538 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007539 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007540 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007541}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007542
7543/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007544 * Logs when Car Power state changed.
7545 *
7546 * Logged from:
7547 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7548 */
7549message CarPowerStateChanged {
7550 // States come from CpmsState in CarPowerManagementService.java.
7551 enum State {
7552 WAIT_FOR_VHAL = 0;
7553 ON = 1;
7554 SHUTDOWN_PREPARE = 2;
7555 WAIT_FOR_FINISH = 3;
7556 SUSPEND = 4;
7557 SIMULATE_SLEEP = 5;
7558 }
7559 optional State state = 1;
7560}
7561
7562/**
7563 * Logs whether GarageMode is entered.
7564 *
7565 * Logged from:
7566 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7567 */
7568message GarageModeInfo {
7569 // Whether GarageMode is entered.
7570 optional bool is_garage_mode = 1;
7571}
Martijn Coenencd95d462019-04-25 17:09:45 +02007572
7573/**
7574 * Historical app ops data per package.
7575 */
7576message AppOps {
7577 // Uid of the package requesting the op
7578 optional int32 uid = 1 [(is_uid) = true];
7579
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007580 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007581 optional string package_name = 2;
7582
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007583 // operation id
7584 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007585
7586 // The number of times the op was granted while the app was in the
7587 // foreground (only for trusted requests)
7588 optional int64 trusted_foreground_granted_count = 4;
7589
7590 // The number of times the op was granted while the app was in the
7591 // background (only for trusted requests)
7592 optional int64 trusted_background_granted_count = 5;
7593
7594 // The number of times the op was rejected while the app was in the
7595 // foreground (only for trusted requests)
7596 optional int64 trusted_foreground_rejected_count = 6;
7597
7598 // The number of times the op was rejected while the app was in the
7599 // background (only for trusted requests)
7600 optional int64 trusted_background_rejected_count = 7;
7601
7602 // For long-running operations, total duration of the operation
7603 // while the app was in the foreground (only for trusted requests)
7604 optional int64 trusted_foreground_duration_millis = 8;
7605
7606 // For long-running operations, total duration of the operation
7607 // while the app was in the background (only for trusted requests)
7608 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007609
7610 // Whether AppOps is guarded by Runtime permission
7611 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007612}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007613
7614/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007615 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007616 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007617message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007618 // Uid of the package requesting the op
7619 optional int32 uid = 1 [(is_uid) = true];
7620
7621 // Name of the package performing the op
7622 optional string package_name = 2;
7623
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007624 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7625 // Attributions must be provided through manifest using <attribution> tag available in R and
7626 // above.
7627 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007628
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007629 // operation id
7630 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007631
7632 // The number of times the op was granted while the app was in the
7633 // foreground (only for trusted requests)
7634 optional int64 trusted_foreground_granted_count = 5;
7635
7636 // The number of times the op was granted while the app was in the
7637 // background (only for trusted requests)
7638 optional int64 trusted_background_granted_count = 6;
7639
7640 // The number of times the op was rejected while the app was in the
7641 // foreground (only for trusted requests)
7642 optional int64 trusted_foreground_rejected_count = 7;
7643
7644 // The number of times the op was rejected while the app was in the
7645 // background (only for trusted requests)
7646 optional int64 trusted_background_rejected_count = 8;
7647
7648 // For long-running operations, total duration of the operation
7649 // while the app was in the foreground (only for trusted requests)
7650 optional int64 trusted_foreground_duration_millis = 9;
7651
7652 // For long-running operations, total duration of the operation
7653 // while the app was in the background (only for trusted requests)
7654 optional int64 trusted_background_duration_millis = 10;
7655
7656 // Whether AppOps is guarded by Runtime permission
7657 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007658
7659 // Sampling rate used on device, from 0 to 100
7660 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007661}
7662
7663/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007664 * Location Manager API Usage information(e.g. API under usage,
7665 * API call's parameters).
7666 * Logged from:
7667 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7668 */
7669message LocationManagerApiUsageReported {
7670
7671 // Indicating if usage starts or usage ends.
7672 optional android.stats.location.UsageState state = 1;
7673
7674 // LocationManagerService's API in use.
7675 // We can identify which API from LocationManager is
7676 // invoking current LMS API by the combination of
7677 // API parameter(e.g. is_listener_null, is_intent_null,
7678 // is_location_request_null)
7679 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7680
7681 // Name of the package calling the API.
7682 optional string calling_package_name = 3;
7683
7684 // Type of the location provider.
7685 optional android.stats.location.ProviderType provider = 4;
7686
7687 // Quality of the location request
7688 optional android.stats.location.LocationRequestQuality quality = 5;
7689
7690 // The desired interval for active location updates, in milliseconds.
7691 // Bucketized to reduce cardinality.
7692 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7693
7694 // Minimum distance between location updates, in meters.
7695 // Bucketized to reduce cardinality.
7696 optional android.stats.location.SmallestDisplacementBucket
7697 bucketized_smallest_displacement = 7;
7698
7699 // The number of location updates.
7700 optional int64 num_updates = 8;
7701
7702 // The request expiration time, in millisecond since boot.
7703 // Bucketized to reduce cardinality.
7704 optional android.stats.location.ExpirationBucket
7705 bucketized_expire_in = 9;
7706
7707 // Type of Callback passed in for this API.
7708 optional android.stats.location.CallbackType callback_type = 10;
7709
7710 // The radius of the central point of the alert
7711 // region, in meters. Only for API REQUEST_GEOFENCE.
7712 // Bucketized to reduce cardinality.
7713 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7714
7715 // Activity Importance of API caller.
7716 // Categorized to 3 types that are interesting from location's perspective.
7717 optional android.stats.location.ActivityImportance activiy_importance = 12;
7718}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007719
7720/**
7721 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7722 */
7723message ReviewPermissionsFragmentResultReported {
7724 // unique value identifying a permission group change. A permission group change might result
7725 // in multiple of these atoms
7726 optional int64 change_id = 1;
7727
7728 // UID of package the permission belongs to
7729 optional int32 uid = 2 [(is_uid) = true];
7730
7731 // Name of package the permission belongs to
7732 optional string package_name = 3;
7733
7734 // The permission to be granted
7735 optional string permission_name = 4;
7736
7737 // The result of the permission grant
7738 optional bool permission_granted = 5;
7739}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007740
7741/**
7742* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7743* Logged from: RuntimePermissionUpdgradeController
7744*/
7745message RuntimePermissionsUpgradeResult {
7746 // Permission granted as result of upgrade
7747 optional string permission_name = 1;
7748
7749 // UID of package granted permission
7750 optional int32 uid = 2 [(is_uid) = true];
7751
7752 // Name of package granted permission
7753 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007754}
7755
7756/**
7757* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7758*/
7759message GrantPermissionsActivityButtonActions {
7760 // Permission granted as result of upgrade
7761 optional string permission_group_name = 1;
7762
7763 // UID of package granted permission
7764 optional int32 uid = 2 [(is_uid) = true];
7765
7766 // Name of package requesting permission
7767 optional string package_name = 3;
7768
7769 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7770 // LABEL_ constants in GrantPermissionActivity.java
7771 optional int32 buttons_presented = 4;
7772
7773 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7774 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007775
7776 // id which identifies single session of user interacting with permission controller
7777 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007778}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007779
7780/**
7781 * Information about LocationAccessCheck notification presented to user
7782 */
7783message LocationAccessCheckNotificationAction {
7784
7785 // id which identifies single session of user interacting with permission controller
7786 optional int64 session_id = 1;
7787
7788 // Uid of package for which location access check is presented
7789 optional int32 package_uid = 2;
7790
7791 // Name of package for which location access check is presented
7792 optional string package_name = 3;
7793
7794 enum Result {
7795 UNDEFINED = 0;
7796 // notification was presented to the user
7797 NOTIFICATION_PRESENTED = 1;
7798 // notification was declined by the user
7799 NOTIFICATION_DECLINED = 2;
7800 // notification was clicked by the user
7801 NOTIFICATION_CLICKED = 3;
7802 }
7803
7804 // View / interaction recorded
7805 optional Result result = 4;
7806}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007807
7808/**
7809 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7810 */
7811message AppPermissionFragmentActionReported {
7812 // id which identifies single session of user interacting with permission controller
7813 optional int64 session_id = 1;
7814
7815 // unique value identifying a permission group change. A permission group change might result
7816 // in multiple of these atoms
7817 optional int64 change_id = 2;
7818
7819 // UID of package the permission belongs to
7820 optional int32 uid = 3 [(is_uid) = true];
7821
7822 // Name of package the permission belongs to
7823 optional string package_name = 4;
7824
7825 // The permission to be granted
7826 optional string permission_name = 5;
7827
7828 // The result of the permission grant
7829 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007830
7831 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7832 optional int32 permission_flags = 7;
7833
7834 enum Button {
7835 UNDEFINED = 0;
7836 // Allow button
7837 ALLOW = 1;
7838 // Deny button
7839 DENY = 2;
7840 // Ask every time button
7841 ASK_EVERY_TIME = 3;
7842 // Allow all the time button
7843 ALLOW_ALWAYS = 4;
7844 // Allow only while using the app button
7845 ALLOW_FOREGROUND = 5;
7846 // Same is Deny button but shown in while in use dialog
7847 DENY_FOREGROUND = 6;
7848 }
7849
7850 // Button pressed in the dialog
7851 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007852}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007853
7854/**
7855* Information about a AppPermissionFragment viewed by user
7856*/
7857message AppPermissionFragmentViewed {
7858 // id which identifies single session of user interacting with permission controller
7859 optional int64 session_id = 1;
7860
7861 // UID of package for which permissions are viewed
7862 optional int32 uid = 2 [(is_uid) = true];
7863
7864 // Name of package for which permissions are viewed
7865 optional string package_name = 3;
7866
7867 // Permission group viewed
7868 optional string permission_group_name = 4;
7869}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007870
7871/**
7872* Information about a AppPermissionsFragment viewed by user
7873*/
7874message AppPermissionsFragmentViewed {
7875 // id which identifies single session of user interacting with permission controller
7876 optional int64 session_id = 1;
7877
7878 // id which identifies single view as every view might have several logging records
7879 // with different package information attached
7880 optional int64 view_id = 2;
7881
7882 // Permission group viewed
7883 optional string permission_group_name = 3;
7884
7885 // UID of package for which permissions are viewed
7886 optional int32 uid = 4 [(is_uid) = true];
7887
7888 // Name of package for which permissions are viewed
7889 optional string package_name = 5;
7890
7891 // Category in which permission is included
7892 enum Category {
7893 UNDEFINED = 0;
7894 ALLOWED = 1;
7895 ALLOWED_FOREGROUND = 2;
7896 DENIED = 3;
7897 }
7898 optional Category category = 6;
7899}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007900
7901/**
7902* Information about a PermissionAppsFragment viewed by user.
7903* Logged from ui/handheld/PermissionAppsFragment.java
7904*/
7905message PermissionAppsFragmentViewed {
7906 // id which identifies single session of user interacting with permission controller
7907 optional int64 session_id = 1;
7908
7909 // id which identifies single view as every view might have several logging records
7910 // with different package information attached
7911 optional int64 view_id = 2;
7912
7913 // Permission group viewed
7914 optional string permission_group_name = 3;
7915
7916 // UID of package for which permissions are viewed
7917 optional int32 uid = 4 [(is_uid) = true];
7918
7919 // Name of package for which permissions are viewed
7920 optional string package_name = 5;
7921
7922 // Category in which app is included
7923 enum Category {
7924 UNDEFINED = 0;
7925 ALLOWED = 1;
7926 ALLOWED_FOREGROUND = 2;
7927 DENIED = 3;
7928 }
7929 optional Category category = 6;
7930}
Tony Make2b1b672019-07-29 16:59:47 +01007931
7932/**
7933 * Logs when there is a smart selection related event.
7934 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7935 * Logged from: TextClassifierEventLogger.java
7936 */
7937message TextSelectionEvent {
7938 // A session ID.
7939 optional string session_id = 1;
7940
7941 // Event type of this event.
7942 optional android.stats.textclassifier.EventType event_type = 2;
7943
Tony Mak9c84bd22019-12-09 07:27:25 +00007944 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007945 optional string model_name = 3;
7946
7947 // Type of widget that was involved in triggering this event.
7948 optional android.stats.textclassifier.WidgetType widget_type = 4;
7949
7950 // Index of this event in a session.
7951 optional int32 event_index = 5;
7952
7953 // Entity type that is involved.
7954 optional string entity_type = 6;
7955
7956 // Relative word index of the start of the selection.
7957 optional int32 relative_word_start_index = 7;
7958
7959 // Relative word (exclusive) index of the end of the selection.
7960 optional int32 relative_word_end_index = 8;
7961
7962 // Relative word index of the start of the smart selection.
7963 optional int32 relative_suggested_word_start_index = 9;
7964
7965 // Relative word (exclusive) index of the end of the smart selection.
7966 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007967
7968 // Name of source package.
7969 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007970}
7971
7972/**
7973 * Logs when there is a smart linkify related event.
7974 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7975 * Logged from: TextClassifierEventLogger.java
7976 */
7977message TextLinkifyEvent {
7978 // A session ID.
7979 optional string session_id = 1;
7980
7981 // Event type of this event.
7982 optional android.stats.textclassifier.EventType event_type = 2;
7983
Tony Mak9c84bd22019-12-09 07:27:25 +00007984 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007985 optional string model_name = 3;
7986
7987 // Type of widget that was involved in triggering this event.
7988 optional android.stats.textclassifier.WidgetType widget_type = 4;
7989
7990 // Index of this event in a session.
7991 optional int32 event_index = 5;
7992
7993 // Entity type that is involved.
7994 optional string entity_type = 6;
7995
7996 // Number of links detected.
7997 optional int32 num_links = 7;
7998
7999 // The total length of all links.
8000 optional int32 linked_text_length = 8;
8001
8002 // Length of input text.
8003 optional int32 text_length = 9;
8004
8005 // Time spent on generating links in ms.
8006 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008007
8008 // Name of source package.
8009 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008010}
8011
8012/**
8013 * Logs when there is a conversation actions related event.
8014 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8015 * Logged from: TextClassifierEventLogger.java
8016 */
8017message ConversationActionsEvent {
8018 // A session ID.
8019 optional string session_id = 1;
8020
8021 // Event type of this event.
8022 optional android.stats.textclassifier.EventType event_type = 2;
8023
Tony Mak9c84bd22019-12-09 07:27:25 +00008024 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008025 optional string model_name = 3;
8026
8027 // Type of widget that was involved in triggering this event.
8028 optional android.stats.textclassifier.WidgetType widget_type = 4;
8029
8030 // The first entity type that is involved.
8031 optional string first_entity_type = 5;
8032
8033 // The second entity type that is involved.
8034 optional string second_entity_type = 6;
8035
8036 // The third entity type that is involved.
8037 optional string third_entity_type = 7;
8038
8039 // The score of the first entity type.
8040 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008041
8042 // Name of source package.
8043 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008044
8045 // Name of the annotator model that is involved in this event.
8046 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008047}
8048
8049/**
8050 * Logs when there is a language detection related event.
8051 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8052 * Logged from: TextClassifierEventLogger.java
8053 */
8054message LanguageDetectionEvent {
8055 // A session ID.
8056 optional string session_id = 1;
8057
8058 // Event type of this event.
8059 optional android.stats.textclassifier.EventType event_type = 2;
8060
Tony Mak9c84bd22019-12-09 07:27:25 +00008061 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008062 optional string model_name = 3;
8063
8064 // Type of widget that was involved in triggering this event.
8065 optional android.stats.textclassifier.WidgetType widget_type = 4;
8066
8067 // Detected language.
8068 optional string language_tag = 5;
8069
8070 // Score of the detected language.
8071 optional float score = 6;
8072
8073 // Position of this action.
8074 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008075
8076 // Name of source package.
8077 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008078}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008079
8080/**
8081 * Information about an OTA update attempt by update_engine.
8082 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8083 */
8084message UpdateEngineUpdateAttemptReported {
8085 // The number of attempts for the update engine to apply a given payload.
8086 optional int32 attempt_number = 1;
8087
8088 optional android.stats.otaupdate.PayloadType payload_type = 2;
8089
8090 // The total time in minutes for the update engine to apply a given payload.
8091 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8092 // it's increased when the system is sleeping.
8093 optional int32 duration_boottime_in_minutes = 3;
8094
8095 // The total time in minutes for the update engine to apply a given payload.
8096 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8097 // and it's not increased when the system is sleeping.
8098 optional int32 duration_monotonic_in_minutes = 4;
8099
8100 // The size of the payload in MiBs.
8101 optional int32 payload_size_mib = 5;
8102
8103 // The attempt result reported by the update engine for an OTA update.
8104 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8105
8106 // The error code reported by the update engine after an OTA update attempt
8107 // on A/B devices.
8108 optional android.stats.otaupdate.ErrorCode error_code = 7;
8109
8110 // The build fingerprint of the source system. The value is read from a
8111 // system property when the device takes the update. e.g.
8112 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8113 optional string source_fingerprint = 8;
8114}
8115
8116/**
8117 * Information about all the attempts the device make before finishing the
8118 * successful update.
8119 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8120 */
8121message UpdateEngineSuccessfulUpdateReported {
8122 // The number of attempts for the update engine to apply the payload for a
8123 // successful update.
8124 optional int32 attempt_count = 1;
8125
8126 optional android.stats.otaupdate.PayloadType payload_type = 2;
8127
8128 optional int32 payload_size_mib = 3;
8129
8130 // The total number of bytes downloaded by update_engine since the last
8131 // successful update.
8132 optional int32 total_bytes_downloaded_mib = 4;
8133
8134 // The ratio in percentage of the over-downloaded bytes compared to the
8135 // total bytes needed to successfully install the update. e.g. 200 if we
8136 // download 200MiB in total for a 100MiB package.
8137 optional int32 download_overhead_percentage = 5;
8138
8139 // The total time in minutes for the update engine to apply the payload for a
8140 // successful update.
8141 optional int32 total_duration_minutes = 6;
8142
8143 // The number of reboot of the device during a successful update.
8144 optional int32 reboot_count = 7;
8145}
Alec Mourie088e762019-07-02 13:10:55 -07008146
8147/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008148 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8149 * key to indicate whether it was successful or not.
8150 *
8151 * Logged from:
8152 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8153 */
8154message RebootEscrowRecoveryReported {
8155 optional bool successful = 1;
8156}
8157
8158/**
Alec Mourie088e762019-07-02 13:10:55 -07008159 * Global display pipeline metrics reported by SurfaceFlinger.
8160 * Pulled from:
8161 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8162 */
8163message SurfaceflingerStatsGlobalInfo {
8164 // Total number of frames presented during the tracing period
8165 optional int64 total_frames = 1;
8166 // Total number of frames missed
8167 optional int64 missed_frames = 2;
8168 // Total number of frames that fell back to client composition
8169 optional int64 client_composition_frames = 3;
8170 // Total time the display was turned on
8171 optional int64 display_on_millis = 4;
8172 // Total time that was spent performing animations.
8173 // This is derived from the present-to-present layer histogram
8174 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008175 // Total number of event connections tracked by SurfaceFlinger at the time
8176 // of this pull. If this number grows prohibitively large, then this can
8177 // cause jank due to resource contention.
8178 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008179 // Set of timings measured from when SurfaceFlinger began compositing a
8180 // frame, until the frame was requested to be presented to the display. This
8181 // measures SurfaceFlinger's total CPU walltime on the critical path per
8182 // frame.
8183 optional FrameTimingHistogram frame_duration = 7
8184 [(android.os.statsd.log_mode) = MODE_BYTES];
8185 // Set of timings measured from when SurfaceFlinger first began using the
8186 // GPU to composite a frame, until the GPU has finished compositing that
8187 // frame. This measures the total additional time SurfaceFlinger needed to
8188 // perform due to falling back into GPU composition.
8189 optional FrameTimingHistogram render_engine_timing = 8
8190 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008191}
8192
8193/**
8194 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8195 * The number of layers uploaded will be restricted due to size limitations.
8196 * Pulled from:
8197 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8198 */
8199message SurfaceflingerStatsLayerInfo {
8200 // The layer for this set of metrics
8201 // For now we can infer that the package name is included in the layer
8202 // name.
8203 optional string layer_name = 1;
8204 // Total number of frames presented
8205 optional int64 total_frames = 2;
8206 // Total number of dropped frames while latching a buffer for this layer.
8207 optional int64 dropped_frames = 3;
8208 // Set of timings measured between successive presentation timestamps.
8209 optional FrameTimingHistogram present_to_present = 4
8210 [(android.os.statsd.log_mode) = MODE_BYTES];
8211 // Set of timings measured from when an app queued a buffer for
8212 // presentation, until the buffer was actually presented to the
8213 // display.
8214 optional FrameTimingHistogram post_to_present = 5
8215 [(android.os.statsd.log_mode) = MODE_BYTES];
8216 // Set of timings measured from when a buffer is ready to be presented,
8217 // until the buffer was actually presented to the display.
8218 optional FrameTimingHistogram acquire_to_present = 6
8219 [(android.os.statsd.log_mode) = MODE_BYTES];
8220 // Set of timings measured from when a buffer was latched by
8221 // SurfaceFlinger, until the buffer was presented to the display
8222 optional FrameTimingHistogram latch_to_present = 7
8223 [(android.os.statsd.log_mode) = MODE_BYTES];
8224 // Set of timings measured from the desired presentation to the actual
8225 // presentation time
8226 optional FrameTimingHistogram desired_to_present = 8
8227 [(android.os.statsd.log_mode) = MODE_BYTES];
8228 // Set of timings measured from when an app queued a buffer for
8229 // presentation, until the buffer was ready to be presented.
8230 optional FrameTimingHistogram post_to_acquire = 9
8231 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008232 // Frames missed latch because the acquire fence didn't fire
8233 optional int64 late_acquire_frames = 10;
8234 // Frames latched early because the desired present time was bad
8235 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008236}
8237
8238/**
8239 * Histogram of frame counts bucketed by time in milliseconds.
8240 * Because of size limitations, we hard-cap the number of buckets, with
8241 * buckets for corresponding to larger milliseconds being less precise.
8242 */
8243message FrameTimingHistogram {
8244 // Timings in milliseconds that describes a set of histogram buckets
8245 repeated int32 time_millis_buckets = 1;
8246 // Number of frames that match to each time_millis, i.e. the bucket
8247 // contents
8248 // It's required that len(time_millis) == len(frame_count)
8249 repeated int64 frame_counts = 2;
8250}
Emilian Peev6729f372019-08-29 09:14:09 -07008251
Emilian Peev6729f372019-08-29 09:14:09 -07008252/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008253 * Janky event as reported by SurfaceFlinger.
8254 * This event is intended to be consumed by a Perfetto subscriber for
8255 * automated trace collection.
8256 *
8257 * Logged from:
8258 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8259 */
8260message DisplayJankReported {
8261 // Informational field for how long the janky event lasted in milliseconds
8262 optional int64 event_duration_millis = 1;
8263 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8264 // the display on time.
8265 optional int32 present_deadlines_missed = 2;
8266}
8267
8268/**
Emilian Peev6729f372019-08-29 09:14:09 -07008269 * Information about camera facing and API level usage.
8270 * Logged from:
8271 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8272 */
8273message CameraActionEvent {
8274 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008275 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008276
8277 // Camera API level used
8278 optional int32 api_level = 2;
8279
8280 // Name of client package
8281 optional string package_name = 3;
8282
8283 // Camera facing
8284 enum Facing {
8285 UNKNOWN = 0;
8286 BACK = 1;
8287 FRONT = 2;
8288 EXTERNAL = 3;
8289 }
8290 optional Facing facing = 4;
8291}
atrost01a20932019-08-28 15:40:37 +01008292
8293/**
8294 * Logs when a compatibility change is affecting an app.
8295 *
8296 * Logged from:
8297 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8298 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8299 */
8300message AppCompatibilityChangeReported {
8301 // The UID of the app being affected by the compatibilty change.
8302 optional int32 uid = 1 [(is_uid) = true];
8303
8304 // The ID of the change affecting the app.
8305 optional int64 change_id = 2;
8306
8307 enum State {
8308 UNKNOWN_STATE = 0;
8309 ENABLED = 1;
8310 DISABLED = 2;
8311 LOGGED = 3;
8312 }
8313
8314 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8315 // logged otherwise.
8316 optional State state = 3;
8317
8318 enum Source {
8319 UNKNOWN_SOURCE = 0;
8320 APP_PROCESS = 1;
8321 SYSTEM_SERVER = 2;
8322 }
8323
8324 // Where it was logged from.
8325 optional Source source = 4;
8326
8327}
Hector Dearman40579f62019-11-01 13:19:30 +00008328
8329/**
8330 * Logged from
8331 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8332 */
8333message PerfettoUploaded {
8334 enum Event {
8335 PERFETTO_UNDEFINED = 0;
8336 PERFETTO_TRACE_BEGIN = 1;
8337 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8338 PERFETTO_ON_CONNECT = 3;
8339 PERFETTO_ON_TRACING_DISABLED = 4;
8340 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8341 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8342 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8343 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8344 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8345 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8346 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8347 PERFETTO_TRIGGER_BEGIN = 12;
8348 PERFETTO_TRIGGER_SUCCESS = 13;
8349 PERFETTO_TRIGGER_FAILURE = 14;
8350 PERFETTO_HIT_GUARDRAILS = 15;
8351 PERFETTO_ON_TIMEOUT = 16;
8352 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8353 }
8354
8355 // Which stage of the pipeline we are reporting from.
8356 optional Event event = 1;
8357
8358 // UUID matching the one set inside the SystemInfo trace packet.
8359 optional int64 trace_uuid_lsb = 2;
8360 optional int64 trace_uuid_msb = 3;
8361}
Mark Tabrya824a642019-11-05 12:26:12 -08008362
8363/**
8364 * Pulls client metrics on data transferred via Vehicle Maps Service.
8365 * Metrics are keyed by uid + layer.
8366 *
8367 * Pulled from:
8368 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8369 */
8370message VmsClientStats {
8371 // UID of the VMS client app
8372 optional int32 uid = 1 [(is_uid) = true];
8373
8374 // VMS layer definition
8375 optional int32 layer_type = 2;
8376 optional int32 layer_channel = 3;
8377 optional int32 layer_version = 4;
8378
8379 // Bytes and packets sent by the client for the layer
8380 optional int64 tx_bytes = 5;
8381 optional int64 tx_packets = 6;
8382
8383 // Bytes and packets received by the client for the layer
8384 optional int64 rx_bytes = 7;
8385 optional int64 rx_packets = 8;
8386
8387 // Bytes and packets dropped due to client error
8388 optional int64 dropped_bytes = 9;
8389 optional int64 dropped_packets = 10;
8390}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008391
8392/**
8393 * State of a dangerous permission requested by a package - sampled
8394 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8395*/
8396message DangerousPermissionStateSampled {
8397 // Name of the permission
8398 optional string permission_name = 1;
8399
8400 // Uid of the package
8401 optional int32 uid = 2 [(is_uid) = true];
8402
8403 // If the permission is granted to the uid
8404 optional bool is_granted = 3;
8405
8406 // Permission flags as per android.content.pm.PermissionFlags
8407 optional int32 permission_flags = 4;
8408}
8409
Stan Iliev637ba5e2019-08-16 13:43:08 -04008410/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008411 * HWUI stats for a given app.
8412 */
8413message GraphicsStats {
8414 // The package name of the app
8415 optional string package_name = 1;
8416
8417 // The version code of the app
8418 optional int64 version_code = 2;
8419
8420 // The start & end timestamps in UTC as
8421 // milliseconds since January 1, 1970
8422 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008423 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008424
Stan Ilievb6517192020-02-18 10:12:42 -05008425 optional int64 end_millis = 4;
8426
8427 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8428 enum PipelineType {
8429 UNKNOWN = 0;
8430 GL = 1;
8431 VULKAN = 2;
8432 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008433
8434 // HWUI renders pipeline type: GL or Vulkan.
8435 optional PipelineType pipeline = 5;
8436
8437 // Distinct frame count.
8438 optional int32 total_frames = 6;
8439
8440 // Number of "missed vsync" events.
8441 optional int32 missed_vsync_count = 7;
8442
8443 // Number of frames in triple-buffering scenario (high input latency)
8444 optional int32 high_input_latency_count = 8;
8445
8446 // Number of "slow UI thread" events.
8447 optional int32 slow_ui_thread_count = 9;
8448
8449 // Number of "slow bitmap upload" events.
8450 optional int32 slow_bitmap_upload_count = 10;
8451
8452 // Number of "slow draw" events.
8453 optional int32 slow_draw_count = 11;
8454
8455 // Number of frames that missed their deadline (aka, visibly janked)
8456 optional int32 missed_deadline_count = 12;
8457
8458 // The frame time histogram for the package
8459 optional FrameTimingHistogram cpu_histogram = 13
8460 [(android.os.statsd.log_mode) = MODE_BYTES];
8461
8462 // The gpu frame time histogram for the package
8463 optional FrameTimingHistogram gpu_histogram = 14
8464 [(android.os.statsd.log_mode) = MODE_BYTES];
8465
8466 // UI mainline module version.
8467 optional int64 version_ui_module = 15;
8468
8469 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8470 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8471 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8472 // more apps are running / rendering.
8473 optional bool is_today = 16;
8474}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008475
8476/**
8477 * Message related to dangerous (runtime) app ops access
8478 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008479message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008480 // Uid of the package accessing app op
8481 optional int32 uid = 1 [(is_uid) = true];
8482
8483 // Name of the package accessing app op
8484 optional string package_name = 2;
8485
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008486 // operation string id per OPSTR_ constants in AppOpsManager.java
8487 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008488
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008489 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8490 // API.
8491 // Attributions must be provided through manifest using <attribution> tag available in R and
8492 // above.
8493 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008494
8495 // message related to app op access, limited to 600 chars by API
8496 optional string message = 5;
8497
8498 enum SamplingStrategy {
8499 DEFAULT = 0;
8500 UNIFORM = 1;
8501 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008502 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008503 }
8504
8505 // sampling strategy used to collect this message
8506 optional SamplingStrategy sampling_strategy = 6;
8507}
8508
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008509/*
8510 * Logs userspace reboot outcome and duration.
8511 *
8512 * Logged from:
8513 * frameworks/base/core/java/com/android/server/BootReceiver.java
8514 */
8515message UserspaceRebootReported {
8516 // Possible outcomes of userspace reboot.
8517 enum Outcome {
8518 // Default value in case platform failed to determine the outcome.
8519 OUTCOME_UNKNOWN = 0;
8520 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8521 SUCCESS = 1;
8522 // Userspace reboot shutdown sequence was aborted.
8523 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8524 // Remounting userdata into checkpointing mode failed.
8525 FAILED_USERDATA_REMOUNT = 3;
8526 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8527 // reboot.
8528 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8529 }
8530 // Outcome of userspace reboot. Always set.
8531 optional Outcome outcome = 1;
8532 // Duration of userspace reboot in case it has a successful outcome.
8533 // Duration is measured as time between userspace reboot was initiated and until boot completed
8534 // (e.g. sys.boot_completed=1).
8535 optional int64 duration_millis = 2;
8536 // State of primary user's (user0) credential encryption storage.
8537 enum UserEncryptionState {
8538 // Default value.
8539 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8540 // Credential encrypted storage is unlocked.
8541 UNLOCKED = 1;
8542 // Credential encrypted storage is locked.
8543 LOCKED = 2;
8544 }
8545 // State of primary user's encryption storage at the moment boot completed. Always set.
8546 optional UserEncryptionState user_encryption_state = 3;
8547}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008548
8549/*
8550 * Logs integrity check information during each install.
8551 *
8552 * Logged from:
8553 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8554 */
8555message IntegrityCheckResultReported {
8556 optional string package_name = 1;
8557 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008558 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008559 optional string installer_package_name = 4;
8560 enum Response {
8561 UNKNOWN = 0;
8562 ALLOWED = 1;
8563 REJECTED = 2;
8564 FORCE_ALLOWED = 3;
8565 }
8566 optional Response response = 5;
8567 // An estimate on the cause of the response. This will only be populated for
8568 // REJECTED and FORCE_ALLOWED
8569 optional bool caused_by_app_cert_rule = 6;
8570 optional bool caused_by_installer_rule = 7;
8571}
8572
8573/**
8574 * Logs the information about the rules and the provider whenever rules are
8575 * pushed into AppIntegrityManager.
8576 *
8577 * Logged from:
8578 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8579 */
8580message IntegrityRulesPushed {
8581 optional bool success = 1;
8582 // Package name of the app that pushed the rules.
8583 optional string rule_provider = 2;
8584 // Version string of arbitrary format provided by the rule provider to
8585 // identify the rules.
8586 optional string rule_version = 3;
8587}
Jordan Liubedfa702019-12-20 15:08:45 -08008588
8589/**
8590 * Logs when a cell broadcast message is received on the device.
8591 *
8592 * Logged from CellBroadcastService module:
8593 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8594 */
8595message CellBroadcastMessageReported {
8596 // The type of Cell Broadcast message
8597 enum CbType {
8598 UNKNOWN_TYPE = 0;
8599 GSM = 1;
8600 CDMA = 2;
8601 CDMA_SPC = 3;
8602 }
8603
8604 // GSM, CDMA, CDMA-SCP
8605 optional CbType type = 1;
8606}
8607
8608/**
8609 * Logs when an error occurs while handling a cell broadcast message;
8610 *
8611 * Logged from CellBroadcastService module:
8612 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8613 */
8614message CellBroadcastMessageError {
8615 // The type of error raised when trying to handle a cell broadcast message
8616 enum ErrorType {
8617 UNKNOWN_TYPE = 0;
8618 CDMA_DECODING_ERROR = 1;
8619 CDMA_SCP_EMPTY = 2;
8620 CDMA_SCP_HANDLING_ERROR = 3;
8621 GSM_INVALID_HEADER_LENGTH = 4;
8622 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8623 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8624 GSM_INVALID_PDU = 7;
8625 GSM_INVALID_GEO_FENCING_DATA = 8;
8626 GSM_UMTS_INVALID_WAC = 9;
8627 FAILED_TO_INSERT_TO_DB = 10;
8628 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8629 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8630 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8631 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8632 }
8633
8634 // What kind of error occurred
8635 optional ErrorType type = 1;
8636
8637 // Exception message (or log message) associated with the error (max 1000 chars)
8638 optional string exception_message = 2;
8639}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008640
8641/**
8642 * Logs when the SDK Extensions test app has polled the current version.
8643 * This is atom ID 354.
8644 *
8645 * Logged from:
8646 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8647 */
8648message SdkExtensionStatus {
8649 enum ApiCallStatus {
8650 CALL_NOT_ATTEMPTED = 0;
8651 CALL_SUCCESSFUL = 1;
8652 CALL_FAILED = 2;
8653 }
8654
8655 optional ApiCallStatus result = 1;
8656
8657 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8658 optional int32 r_extension_version = 2;
8659
8660 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8661 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8662 optional int32 failed_call_symbol = 3;
8663}
Marco Ballesio497aff42020-01-24 08:39:42 -08008664
8665/**
8666 * Logs when an app is frozen or unfrozen.
8667 *
8668 * Logged from:
8669 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8670 */
8671message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008672 // The type of event.
8673 enum Action {
8674 UNKNOWN = 0;
8675 FREEZE_APP = 1;
8676 UNFREEZE_APP = 2;
8677 }
8678 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008679
Blake Kragten6ce382a2020-01-16 20:20:46 -08008680 // Pid of the process being frozen.
8681 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008682
Blake Kragten6ce382a2020-01-16 20:20:46 -08008683 // Name of the process being frozen.
8684 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008685
Blake Kragten6ce382a2020-01-16 20:20:46 -08008686 // Time since last unfrozen.
8687 optional int64 time_unfrozen_millis = 4;
8688}
8689
8690/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008691 * Pulls information for a single voice call.
8692 *
8693 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8694 *
8695 * Pulled from:
8696 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8697 */
8698message VoiceCallSession {
8699 // Bearer (IMS or CS) when the call started.
8700 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8701
8702 // Bearer (IMS or CS) when the call ended.
8703 // The bearer may change during the call, e.g. due to SRVCC.
8704 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8705
8706 // Direction of the call (incoming or outgoing).
8707 optional android.telephony.CallDirectionEnum direction = 3;
8708
8709 // Time spent setting up the call.
8710 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8711
8712 // Whether the call ended before the setup was completed.
8713 optional bool setup_failed = 5;
8714
8715 // IMS reason code or CS disconnect cause.
8716 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8717 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8718 optional int32 disconnect_reason_code = 6;
8719
8720 // IMS extra code or CS precise disconnect cause.
8721 // For IMS, this code is vendor-specific
8722 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8723 optional int32 disconnect_extra_code = 7;
8724
8725 // IMS extra message or CS vendor cause.
8726 optional string disconnect_extra_message = 8;
8727
8728 // Radio access technology (RAT) used when call started.
8729 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8730
8731 // Radio access technology (RAT) used when call terminated.
8732 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8733
8734 // Number of times RAT changed during the call.
8735 optional int64 rat_switch_count = 11;
8736
8737 // A bitmask of all codecs used during the call.
8738 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8739 optional int64 codec_bitmask = 12;
8740
8741 // Number of other calls going on during call setup, for the same SIM slot.
8742 optional int32 concurrent_call_count_at_start = 13;
8743
8744 // Number of other calls going on during call termination, for the same SIM slot.
8745 optional int32 concurrent_call_count_at_end = 14;
8746
8747 // Index of the SIM is used, 0 for single-SIM devices.
8748 optional int32 sim_slot_index = 15;
8749
8750 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8751 optional bool is_multi_sim = 16;
8752
8753 // Whether the call was made with an eSIM profile.
8754 optional bool is_esim = 17;
8755
8756 // Carrier ID of the SIM card.
8757 // See https://source.android.com/devices/tech/config/carrierid.
8758 optional int32 carrier_id = 18;
8759
8760 // Whether an SRVCC has been completed successfully.
8761 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8762 // events once the call is switched to CS.
8763 optional bool srvcc_completed = 19;
8764
8765 // Number of SRVCC failures.
8766 optional int64 srvcc_failure_count = 20;
8767
8768 // Number of SRVCC cancellations.
8769 optional int64 srvcc_cancellation_count = 21;
8770
8771 // Whether the Real-Time Text (RTT) was ever used in the call.
8772 optional bool rtt_enabled = 22;
8773
8774 // Whether this was an emergency call.
8775 optional bool is_emergency = 23;
8776
8777 // Whether the call was performed while roaming.
8778 optional bool is_roaming = 24;
8779}
8780
8781/**
8782 * Pulls voice call radio access technology (RAT) usage.
8783 *
8784 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8785 * time. The atom will be skipped if not enough data is available.
8786 *
8787 * Pulled from:
8788 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8789 */
8790message VoiceCallRatUsage {
8791 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8792 optional int32 carrier_id = 1;
8793
8794 // Radio access technology.
8795 optional android.telephony.NetworkTypeEnum rat = 2;
8796
8797 // Total duration that voice calls spent on this carrier and RAT.
8798 optional int64 total_duration_seconds = 3;
8799
8800 // Total number of calls using this carrier and RAT.
8801 // A call is counted once even if it used the RAT multiple times.
8802 optional int64 call_count = 4;
8803}
8804
8805/**
8806 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8807 *
8808 * Pulled from:
8809 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8810 */
8811message SimSlotState {
8812 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8813 optional int32 active_slot_count = 1;
8814
8815 // Number of SIM cards (both physical and active eSIM profiles).
8816 // This number is always equal to or less than the number of active SIM slots.
8817 optional int32 sim_count = 2;
8818
8819 // Number of active eSIM profiles.
8820 // This number is always equal to or less than the number of SIMs.
8821 optional int32 esim_count = 3;
8822}
8823
8824/**
8825 * Pulls supported cellular radio access technologies.
8826 *
8827 * This atom reports the capabilities of the device, rather than the network it has access to.
8828 *
8829 * Pulled from:
8830 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8831 */
8832message SupportedRadioAccessFamily {
8833 // A bitmask of supported radio technologies.
8834 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8835 optional int64 network_type_bitmask = 1;
8836}
8837
8838/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008839 * Logs gnss stats from location service provider
8840 *
8841 * Pulled from:
8842 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8843 */
8844
8845message GnssStats {
8846 // Number of location reports since boot
8847 optional int64 location_reports = 1;
8848
8849 // Total pulled reports of Location failures since boot
8850 optional int64 location_failure_reports = 2;
8851
8852 // Number of time to first fix reports since boot
8853 optional int64 time_to_first_fix_reports = 3;
8854
8855 // Total pulled reported time to first fix (in milli-seconds) since boot
8856 optional int64 time_to_first_fix_milli_s = 4;
8857
8858 // Number of position accuracy reports since boot
8859 optional int64 position_accuracy_reports = 5;
8860
8861 // Total pulled reported position accuracy (in meters) since boot
8862 optional int64 position_accuracy_meters = 6;
8863
8864 // Number of top 4 average CN0 reports since boot
8865 optional int64 top_four_average_cn0_reports = 7;
8866
8867 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8868 optional int64 top_four_average_cn0_db_mhz = 8;
8869
8870 // Number of l5 top 4 average CN0 reports since boot
8871 optional int64 l5_top_four_average_cn0_reports = 9;
8872
8873 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8874 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8875
8876 // Total number of sv status messages reports since boot
8877 optional int64 sv_status_reports = 11;
8878
8879 // Total number of sv status messages reports, where sv is used in fix since boot
8880 optional int64 sv_status_reports_used_in_fix = 12;
8881
8882 // Total number of L5 sv status messages reports since boot
8883 optional int64 l5_sv_status_reports = 13;
8884
8885 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8886 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008887}
Kweku Adams12752132020-02-18 15:36:48 -08008888
8889/**
8890 * Logs when an app is moved to a different standby bucket.
8891 *
8892 * Logged from:
8893 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8894 */
8895message AppStandbyBucketChanged {
8896 optional string package_name = 1;
8897
8898 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8899 optional int32 user_id = 2;
8900
8901 // These enum values match the constants defined in UsageStatsManager.java.
8902 enum Bucket {
8903 BUCKET_UNKNOWN = 0;
8904 BUCKET_EXEMPTED = 5;
8905 BUCKET_ACTIVE = 10;
8906 BUCKET_WORKING_SET = 20;
8907 BUCKET_FREQUENT = 30;
8908 BUCKET_RARE = 40;
8909 BUCKET_RESTRICTED = 45;
8910 BUCKET_NEVER = 50;
8911 }
8912 optional Bucket bucket = 3;
8913
8914 enum MainReason {
8915 MAIN_UNKNOWN = 0;
8916 MAIN_DEFAULT = 0x0100;
8917 MAIN_TIMEOUT = 0x0200;
8918 MAIN_USAGE = 0x0300;
8919 MAIN_FORCED_BY_USER = 0x0400;
8920 MAIN_PREDICTED = 0x0500;
8921 MAIN_FORCED_BY_SYSTEM = 0x0600;
8922 }
8923 optional MainReason main_reason = 4;
8924
8925 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8926 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8927 // UsageStatsManager.java.
8928 optional int32 sub_reason = 5;
8929}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05008930
8931/**
8932* Reports a started sharesheet transaction.
8933*
8934* Logged from:
8935* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8936*/
8937message SharesheetStarted {
8938 // The event_id (as for UiEventReported).
8939 optional int32 event_id = 1;
8940 // The calling app's package name.
8941 optional string package_name = 2;
8942 // An identifier to tie together multiple logs relating to the same share event
8943 optional int32 instance_id = 3;
8944 // The mime type of the share
8945 optional string mime_type = 4;
8946 // The number of direct targets the calling app is providing that will be shown.
8947 optional int32 num_app_provided_direct_targets = 5;
8948 // The number of app targets the calling app is providing that will be shown.
8949 optional int32 num_app_provided_app_targets = 6;
8950 // True if the share originates from the workprofile
8951 optional bool is_workprofile = 7;
8952
8953 enum SharesheetPreviewType { // Constants from ChooserActivity.java
8954 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
8955 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
8956 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
8957 }
8958 // How the sharesheet preview is presented.
8959 optional SharesheetPreviewType previewType = 8;
8960
8961 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
8962 INTENT_DEFAULT = 0;
8963 INTENT_ACTION_VIEW = 1;
8964 INTENT_ACTION_EDIT = 2;
8965 INTENT_ACTION_SEND = 3;
8966 INTENT_ACTION_SENDTO = 4;
8967 INTENT_ACTION_SEND_MULTIPLE = 5;
8968 INTENT_ACTION_IMAGE_CAPTURE = 6;
8969 INTENT_ACTION_MAIN = 7;
8970 }
8971 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
8972 optional ResolverActivityIntent intentType = 9;
8973}
8974
8975/**
8976 * Reports a ranking selection event.
8977 *
8978 * Logged from:
8979 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
8980 */
8981message RankingSelected {
8982 // The event_id (as for UiEventReported).
8983 optional int32 event_id = 1;
8984 // The relevant app's package name (can be source or picked package).
8985 optional string package_name = 2;
8986 // An identifier to tie together multiple logs relating to the same share event.
8987 optional int32 instance_id = 3;
8988 // Which of the ranked targets got picked, default starting position 0.
8989 optional int32 position_picked = 4;
8990}