blob: 979f950f277039b47bc66402f266f7b0c69cb347 [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.
tsaichristinea3d2ed82020-03-19 20:53:36 -070081 BleScanStateChanged ble_scan_state_changed = 2
82 [(module) = "bluetooth", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080083 ProcessStateChanged process_state_changed = 3 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -080084 BleScanResultReceived ble_scan_result_received = 4 [(module) = "bluetooth"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070085 SensorStateChanged sensor_state_changed =
86 5 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080087 GpsScanStateChanged gps_scan_state_changed = 6 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -070088 SyncStateChanged sync_state_changed = 7 [(module) = "framework", (module) = "statsdtest"];
89 ScheduledJobStateChanged scheduled_job_state_changed =
90 8 [(module) = "framework", (module) = "statsdtest"];
91 ScreenBrightnessChanged screen_brightness_changed =
92 9 [(module) = "framework", (module) = "statsdtest"];
93 WakelockStateChanged wakelock_state_changed =
94 10 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080095 LongPartialWakelockStateChanged long_partial_wakelock_state_changed =
96 11 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -070097 MobileRadioPowerStateChanged mobile_radio_power_state_changed =
98 12 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -080099 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13 [(module) = "framework"];
100 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed =
101 14 [(module) = "framework"];
102 MemoryFactorStateChanged memory_factor_state_changed = 15 [(module) = "framework"];
103 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16 [(module) = "framework"];
104 CachedKillReported cached_kill_reported = 17 [(module) = "framework"];
105 ProcessMemoryStatReported process_memory_stat_reported = 18 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800106 LauncherUIChanged launcher_event = 19 [(module) = "sysui"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700107 BatterySaverModeStateChanged battery_saver_mode_state_changed =
108 20 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800109 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21 [(module) = "framework"];
110 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700111 AudioStateChanged audio_state_changed =
112 23 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800113 MediaCodecStateChanged media_codec_state_changed = 24 [(module) = "framework"];
114 CameraStateChanged camera_state_changed = 25 [(module) = "framework"];
115 FlashlightStateChanged flashlight_state_changed = 26 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700116 UidProcessStateChanged uid_process_state_changed =
117 27 [(module) = "framework", (module) = "statsdtest"];
118 ProcessLifeCycleStateChanged process_life_cycle_state_changed =
119 28 [(module) = "framework", (module) = "statsdtest"];
120 ScreenStateChanged screen_state_changed =
121 29 [(module) = "framework", (module) = "statsdtest"];
122 BatteryLevelChanged battery_level_changed =
123 30 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800124 ChargingStateChanged charging_state_changed = 31 [(module) = "framework"];
125 PluggedStateChanged plugged_state_changed = 32 [(module) = "framework"];
126 InteractiveStateChanged interactive_state_changed = 33 [(module) = "framework"];
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800127 TouchEventReported touch_event_reported = 34;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800128 WakeupAlarmOccurred wakeup_alarm_occurred = 35 [(module) = "framework"];
129 KernelWakeupReported kernel_wakeup_reported = 36 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800130 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
131 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
132 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700133 PhoneSignalStrengthChanged phone_signal_strength_changed =
134 40 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800135 SettingChanged setting_changed = 41 [(module) = "framework"];
136 ActivityForegroundStateChanged activity_foreground_state_changed =
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700137 42 [(module) = "framework", (module) = "statsdtest"];
138 IsolatedUidChanged isolated_uid_changed =
139 43 [(module) = "framework", (module) = "statsd", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800140 PacketWakeupOccurred packet_wakeup_occurred = 44 [(module) = "framework"];
141 WallClockTimeShifted wall_clock_time_shifted = 45 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800142 AnomalyDetected anomaly_detected = 46 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800143 AppBreadcrumbReported app_breadcrumb_reported =
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800144 47 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700145 AppStartOccurred app_start_occurred = 48 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800146 AppStartCanceled app_start_canceled = 49 [(module) = "framework"];
147 AppStartFullyDrawn app_start_fully_drawn = 50 [(module) = "framework"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800148 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800149 PictureInPictureStateChanged picture_in_picture_state_changed = 52 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800150 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800151 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800152 AppStartMemoryStateCaptured app_start_memory_state_captured = 55 [(module) = "framework"];
153 ShutdownSequenceReported shutdown_sequence_reported = 56 [(module) = "framework"];
Tej Singh6483ea42018-01-25 17:45:49 -0800154 BootSequenceReported boot_sequence_reported = 57;
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800155 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true, (module) = "statsd"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700156 OverlayStateChanged overlay_state_changed =
157 59 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800158 ForegroundServiceStateChanged foreground_service_state_changed
159 = 60 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700160 CallStateChanged call_state_changed =
161 61 [(module) = "telecom", (truncate_timestamp) = true];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800162 KeyguardStateChanged keyguard_state_changed = 62 [(module) = "sysui"];
163 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63 [(module) = "sysui"];
164 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800165 AppDied app_died = 65 [(module) = "framework"];
166 ResourceConfigurationChanged resource_configuration_changed = 66 [(module) = "framework"];
167 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800168 BluetoothConnectionStateChanged bluetooth_connection_state_changed =
169 68 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800170 GpsSignalQualityChanged gps_signal_quality_changed = 69 [(module) = "framework"];
171 UsbConnectorStateChanged usb_connector_state_changed = 70 [(module) = "framework"];
Andrew Chant28d627e2018-02-22 15:17:05 -0800172 SpeakerImpedanceReported speaker_impedance_reported = 71;
173 HardwareFailed hardware_failed = 72;
174 PhysicalDropDetected physical_drop_detected = 73;
175 ChargeCyclesReported charge_cycles_reported = 74;
Muhammad Qureshia4efed82020-01-23 13:53:51 -0800176 MobileConnectionStateChanged mobile_connection_state_changed = 75 [(module) = "telephony"];
177 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76 [(module) = "telephony"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800178 UsbDeviceAttached usb_device_attached = 77 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700179 AppCrashOccurred app_crash_occurred = 78 [(module) = "framework", (module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800180 ANROccurred anr_occurred = 79 [(module) = "framework"];
181 WTFOccurred wtf_occurred = 80 [(module) = "framework"];
182 LowMemReported low_mem_reported = 81 [(module) = "framework"];
Howard Rocb767f62018-06-19 19:58:05 -0700183 GenericAtom generic_atom = 82;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800184 KeyValuePairsAtom key_value_pairs_atom =
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800185 83 [(allow_from_any_uid) = true, (module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800186 VibratorStateChanged vibrator_state_changed = 84 [(module) = "framework"];
187 DeferredJobStatsReported deferred_job_stats_reported = 85 [(module) = "framework"];
Tej Singha72344992019-04-17 18:55:08 -0700188 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800189 BiometricAcquired biometric_acquired = 87 [(module) = "framework"];
190 BiometricAuthenticated biometric_authenticated = 88 [(module) = "framework"];
191 BiometricErrorOccurred biometric_error_occurred = 89 [(module) = "framework"];
192 UiEventReported ui_event_reported = 90 [(module) = "framework"];
Howard Roa46b6582018-09-18 16:45:02 -0700193 BatteryHealthSnapshot battery_health_snapshot = 91;
194 SlowIo slow_io = 92;
195 BatteryCausedShutdown battery_caused_shutdown = 93;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800196 PhoneServiceStateChanged phone_service_state_changed = 94 [(module) = "framework"];
197 PhoneStateChanged phone_state_changed = 95 [(module) = "framework"];
arangelovd5db50e2018-10-12 20:24:39 +0100198 UserRestrictionChanged user_restriction_changed = 96;
Muhammad Qureshi9afad812020-01-23 15:04:59 -0800199 SettingsUIChanged settings_ui_changed = 97 [(module) = "settings"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800200 ConnectivityStateChanged connectivity_state_changed = 98 [(module) = "framework"];
Chenjie Yu75b3c492018-10-06 21:45:19 -0700201 // TODO: service state change is very noisy shortly after boot, as well
202 // as at other transitions - coming out of doze, device plugged in, etc.
203 // Consider removing this if it becomes a problem
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800204 ServiceStateChanged service_state_changed = 99 [(module) = "framework"];
205 ServiceLaunchReported service_launch_reported = 100 [(module) = "framework"];
206 FlagFlipUpdateOccurred flag_flip_update_occurred = 101 [(module) = "framework"];
Muhammad Qureshicefc8822020-02-09 11:46:23 -0800207 BinaryPushStateChanged binary_push_state_changed = 102 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800208 DevicePolicyEvent device_policy_event = 103 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800209 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
210 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
211 105 [(module) = "docsui"];
212 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
213 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
214 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
215 108 [(module) = "docsui"];
216 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
217 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
218 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
219 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800220 WifiEnabledStateChanged wifi_enabled_state_changed = 113 [(module) = "framework"];
tsaichristinececebdc2020-02-04 14:05:56 -0800221 WifiRunningStateChanged wifi_running_state_changed = 114
222 [(module) = "framework", deprecated = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800223 AppCompacted app_compacted = 115 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800224 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800225 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800226 117 [(module) = "docsui"];
227 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
228 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
229 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
230 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800231 RescuePartyResetReported rescue_party_reset_reported = 122 [(module) = "framework"];
232 SignedConfigReported signed_config_reported = 123 [(module) = "framework"];
233 GnssNiEventReported gnss_ni_event_reported = 124 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800234 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event =
235 125 [(module) = "bluetooth"];
236 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed =
237 126 [(module) = "bluetooth"];
238 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed =
239 127 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800240 AppDowngraded app_downgraded = 128 [(module) = "framework"];
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000241 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800242 LowStorageStateChanged low_storage_state_changed = 130 [(module) = "framework"];
243 GnssNfwNotificationReported gnss_nfw_notification_reported = 131 [(module) = "framework"];
244 GnssConfigurationReported gnss_configuration_reported = 132 [(module) = "framework"];
Maggie Whitefc1aa592018-11-28 21:55:23 -0800245 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Muhammad Qureshif9a5ab02020-01-25 19:43:27 -0800246 NfcErrorOccurred nfc_error_occurred = 134 [(module) = "nfc"];
247 NfcStateChanged nfc_state_changed = 135 [(module) = "nfc"];
248 NfcBeamOccurred nfc_beam_occurred = 136 [(module) = "nfc"];
249 NfcCardemulationOccurred nfc_cardemulation_occurred = 137 [(module) = "nfc"];
250 NfcTagOccurred nfc_tag_occurred = 138 [(module) = "nfc"];
251 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139 [(module) = "nfc"];
Muhammad Qureshi70dfeb42020-01-24 20:11:44 -0800252 SeStateChanged se_state_changed = 140 [(module) = "secure_element"];
253 SeOmapiReported se_omapi_reported = 141 [(module) = "secure_element"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800254 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported =
255 142 [(module) = "framework"];
256 AttentionManagerServiceResultReported attention_manager_service_result_reported =
257 143 [(module) = "framework"];
258 AdbConnectionChanged adb_connection_changed = 144 [(module) = "framework"];
Carter Hsub8fd1e92019-01-11 15:24:45 +0800259 SpeechDspStatReported speech_dsp_stat_reported = 145;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800260 UsbContaminantReported usb_contaminant_reported = 146 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800261 WatchdogRollbackOccurred watchdog_rollback_occurred =
262 147 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800263 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected =
264 148 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800265 BubbleUIChanged bubble_ui_changed = 149 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800266 ScheduledJobConstraintChanged scheduled_job_constraint_changed =
267 150 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800268 BluetoothActiveDeviceChanged bluetooth_active_device_changed =
269 151 [(module) = "bluetooth"];
270 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed =
271 152 [(module) = "bluetooth"];
272 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed =
273 153 [(module) = "bluetooth"];
274 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed =
275 154 [(module) = "bluetooth"];
276 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported =
277 155 [(module) = "bluetooth"];
278 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported =
279 156 [(module) = "bluetooth"];
280 BluetoothDeviceRssiReported bluetooth_device_rssi_reported =
281 157 [(module) = "bluetooth"];
282 BluetoothDeviceFailedContactCounterReported
283 bluetooth_device_failed_contact_counter_reported = 158 [(module) = "bluetooth"];
284 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported =
285 159 [(module) = "bluetooth"];
286 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported =
287 160 [(module) = "bluetooth"];
288 BluetoothQualityReportReported bluetooth_quality_report_reported =
289 161 [(module) = "bluetooth"];
290 BluetoothDeviceInfoReported bluetooth_device_info_reported =
291 162 [(module) = "bluetooth"];
292 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported =
293 163 [(module) = "bluetooth"];
294 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported =
295 164 [(module) = "bluetooth"];
296 BluetoothBondStateChanged bluetooth_bond_state_changed =
297 165 [(module) = "bluetooth"];
298 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported =
299 166 [(module) = "bluetooth"];
300 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported =
301 167 [(module) = "bluetooth"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800302 ScreenTimeoutExtensionReported screen_timeout_extension_reported =
303 168 [(module) = "framework"];
304 ProcessStartTime process_start_time = 169 [(module) = "framework"];
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700305 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800306 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800307 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Muhammad Qureshied8bca02020-01-24 16:07:49 -0800308 DeviceIdentifierAccessDenied device_identifier_access_denied =
309 172 [(module) = "telephony_common"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800310 BubbleDeveloperErrorReported bubble_developer_error_reported = 173 [(module) = "framework"];
Muhammad Qureshi76b25242020-01-25 19:02:08 -0800311 AssistGestureStageReported assist_gesture_stage_reported = 174 [(module) = "sysui"];
312 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175 [(module) = "sysui"];
313 AssistGestureProgressReported assist_gesture_progress_reported = 176 [(module) = "sysui"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800314 TouchGestureClassified touch_gesture_classified = 177 [(module) = "framework"];
315 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800316 StyleUIChanged style_ui_changed = 179 [(module) = "sysui"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700317 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800318 180 [(module) = "permissioncontroller"];
319 AppInstallOnExternalStorageReported app_install_on_external_storage_reported =
320 181 [(module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800321 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800322 AppMovedStorageReported app_moved_storage_reported = 183 [(module) = "framework"];
323 BiometricEnrolled biometric_enrolled = 184 [(module) = "framework"];
324 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185 [(module) = "framework"];
325 TombStoneOccurred tomb_stone_occurred = 186 [(module) = "framework"];
Muhammad Qureshi100d2b62020-01-23 10:30:41 -0800326 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported =
327 187 [(module) = "bluetooth"];
Ben Blount763a5d52019-04-10 11:48:58 -0700328 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800329 188 [(module) = "intelligence"];
330 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed =
331 189 [(module) = "framework"];
Hai Zhang5d3328d2019-04-13 21:25:06 +0800332 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800333 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800334 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
335 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
336 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
337 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
338 MediametricsCodecReported mediametrics_codec_reported = 195;
339 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
340 MediametricsExtractorReported mediametrics_extractor_reported = 197;
341 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
342 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
343 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700344 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800345 CarPowerStateChanged car_power_state_changed = 203 [(module) = "car"];
346 GarageModeInfo garage_mode_info = 204 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800347 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800348 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported =
349 206 [(module) = "framework"];
350 ContentCaptureServiceEvents content_capture_service_events = 207 [(module) = "framework"];
351 ContentCaptureSessionEvents content_capture_session_events = 208 [(module) = "framework"];
352 ContentCaptureFlushed content_capture_flushed = 209 [(module) = "framework"];
353 LocationManagerApiUsageReported location_manager_api_usage_reported =
354 210 [(module) = "framework"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100355 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800356 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100357 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800358 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100359 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800360 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100361 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800362 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100363 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800364 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100365 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800366 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100367 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800368 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100369 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800370 218 [(module) = "permissioncontroller"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800371 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
372 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
373 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
374 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800375 ExclusionRectStateChanged exclusion_rect_state_changed = 223 [(module) = "framework"];
Muhammad Qureshi9bced7d2020-01-16 15:22:12 -0800376 BackGesture back_gesture_reported_reported = 224 [(module) = "sysui"];
Tianjie Xu167c3db2019-07-22 14:25:14 -0700377 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
378 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800379 CameraActionEvent camera_action_event = 227 [(module) = "framework"];
atrost01a20932019-08-28 15:40:37 +0100380 AppCompatibilityChangeReported app_compatibility_change_reported =
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800381 228 [(allow_from_any_uid) = true, (module) = "framework"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800382 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800383 VmsClientConnectionStateChanged vms_client_connection_state_changed =
384 230 [(module) = "car"];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800385 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
386 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700387 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800388 235 [(module) = "mediaprovider"];
389 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700390 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800391 237 [(module) = "mediaprovider"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800392 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238 [(module) = "framework"];
393 BootTimeEventDuration boot_time_event_duration_reported = 239 [(module) = "framework"];
394 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported =
395 240 [(module) = "framework"];
Keun young Park3e033cb2019-12-18 11:27:35 -0800396 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800397 BootTimeEventErrorCode boot_time_event_error_code_reported = 242 [(module) = "framework"];
Nikita Ioffe779d6be2020-02-06 23:17:17 +0000398 UserspaceRebootReported userspace_reboot_reported = 243 [(module) = "framework"];
Muhammad Qureshi550b84c2020-02-03 14:17:59 -0800399 NotificationReported notification_reported = 244 [(module) = "framework"];
Will Brockman7fb79442020-02-27 14:34:24 -0500400 NotificationPanelReported notification_panel_reported = 245 [(module) = "sysui"];
401 NotificationChannelModified notification_channel_modified = 246 [(module) = "framework"];
Muhammad Qureshie2b24322020-01-28 10:54:17 -0800402 IntegrityCheckResultReported integrity_check_result_reported = 247 [(module) = "framework"];
403 IntegrityRulesPushed integrity_rules_pushed = 248 [(module) = "framework"];
Jordan Liubedfa702019-12-20 15:08:45 -0800404 CellBroadcastMessageReported cb_message_reported =
405 249 [(module) = "cellbroadcast"];
406 CellBroadcastMessageError cb_message_error =
407 250 [(module) = "cellbroadcast"];
xshu2c3d9e42019-09-26 17:54:02 -0700408 WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
409 WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
410 WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
Marco Ballesio497aff42020-01-24 08:39:42 -0800411 AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
Alessio Balsini628fb8d2020-01-15 15:44:48 +0000412 SnapshotMergeReported snapshot_merge_reported = 255;
Adam Bookatz38767932020-02-05 12:13:40 -0800413 ForegroundServiceAppOpSessionEnded foreground_service_app_op_session_ended =
414 256 [(module) = "framework"];
Alec Mouri5ac32622020-02-06 08:44:25 -0800415 DisplayJankReported display_jank_reported = 257;
Kweku Adams12752132020-02-18 15:36:48 -0800416 AppStandbyBucketChanged app_standby_bucket_changed = 258 [(module) = "framework"];
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -0500417 SharesheetStarted sharesheet_started = 259 [(module) = "framework"];
418 RankingSelected ranking_selected = 260 [(module) = "framework"];
Anton Hansson5a48e4b2020-02-06 14:50:35 +0000419 SdkExtensionStatus sdk_extension_status = 354;
Yao Chend54f9dd2017-10-17 17:37:48 +0000420 }
David Chenc8a43242017-10-17 16:23:28 -0700421
David Chen6e3e6cb2018-01-03 16:14:06 -0800422 // Pulled events will start at field 10000.
Chi Zhangbb9ed922020-03-11 10:16:47 -0700423 // Next: 10080
David Chenc8a43242017-10-17 16:23:28 -0700424 oneof pulled {
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800425 WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
426 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
Muhammad Qureshi9b995802020-03-20 13:55:51 -0700427 MobileBytesTransfer mobile_bytes_transfer =
428 10002 [(module) = "framework", (truncate_timestamp) = true];
429 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg =
430 10003 [(module) = "framework", (truncate_timestamp) = true];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800431 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006 [(module) = "framework"];
432 KernelWakelock kernel_wakelock = 10004 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700433 SubsystemSleepState subsystem_sleep_state = 10005 [(module) = "statsdtest"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800434 CpuTimePerFreq cpu_time_per_freq = 10008 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700435 CpuTimePerUid cpu_time_per_uid = 10009 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800436 CpuTimePerUidFreq cpu_time_per_uid_freq =
437 10010 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800438 WifiActivityInfo wifi_activity_info = 10011 [(module) = "framework"];
439 ModemActivityInfo modem_activity_info = 10012 [(module) = "framework"];
440 BluetoothActivityInfo bluetooth_activity_info = 10007 [(module) = "framework"];
441 ProcessMemoryState process_memory_state = 10013 [(module) = "framework"];
442 SystemElapsedRealtime system_elapsed_realtime = 10014 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700443 SystemUptime system_uptime = 10015 [(module) = "framework", (module) = "statsdtest"];
tsaichristinea3d2ed82020-03-19 20:53:36 -0700444 CpuActiveTime cpu_active_time = 10016 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700445 CpuClusterTime cpu_cluster_time = 10017 [(module) = "framework", (module) = "statsdtest"];
446 DiskSpace disk_space = 10018 [deprecated=true, (module) = "statsdtest"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800447 RemainingBatteryCapacity remaining_battery_capacity = 10019 [(module) = "framework"];
448 FullBatteryCapacity full_battery_capacity = 10020 [(module) = "framework"];
Jeffrey Huang3eb84d42020-03-17 10:31:22 -0700449 Temperature temperature = 10021 [(module) = "framework", (module) = "statsdtest"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800450 BinderCalls binder_calls = 10022 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800451 BinderCallsExceptions binder_calls_exceptions = 10023 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800452 LooperStats looper_stats = 10024 [(module) = "framework", (module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800453 DiskStats disk_stats = 10025 [(module) = "framework"];
454 DirectoryUsage directory_usage = 10026 [(module) = "framework"];
455 AppSize app_size = 10027 [(module) = "framework"];
456 CategorySize category_size = 10028 [(module) = "framework"];
457 ProcStats proc_stats = 10029 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800458 BatteryVoltage battery_voltage = 10030 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800459 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031 [(module) = "framework"];
460 DiskIo disk_io = 10032 [(module) = "framework"];
461 PowerProfile power_profile = 10033 [(module) = "framework"];
462 ProcStatsPkgProc proc_stats_pkg_proc = 10034 [(module) = "framework"];
463 ProcessCpuTime process_cpu_time = 10035 [(module) = "framework"];
464 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037 [(module) = "framework"];
Bookatz92da2832018-11-01 18:10:03 -0700465 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800466 DeviceCalculatedPowerUse device_calculated_power_use = 10039 [(module) = "framework"];
467 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid =
468 10040 [(module) = "framework"];
469 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other =
470 10041 [(module) = "framework"];
471 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042 [(module) = "framework"];
Jeffrey Huang9a3c1b62020-01-27 17:33:13 -0800472 BatteryLevel battery_level = 10043 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800473 BuildInformation build_information = 10044 [(module) = "framework"];
Jeffrey Huang43f4d262020-01-30 14:03:31 -0800474 BatteryCycleCount battery_cycle_count = 10045 [(module) = "framework"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800475 DebugElapsedClock debug_elapsed_clock = 10046 [(module) = "framework"];
476 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047 [(module) = "framework"];
477 NumFacesEnrolled num_faces_enrolled = 10048 [(module) = "framework"];
478 RoleHolder role_holder = 10049 [(module) = "framework"];
479 DangerousPermissionState dangerous_permission_state = 10050 [(module) = "framework"];
Jeffrey Huang74fc4352020-03-06 15:18:33 -0800480 TrainInfo train_info = 10051 [(module) = "statsd"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800481 TimeZoneDataInfo time_zone_data_info = 10052 [(module) = "framework"];
482 ExternalStorageInfo external_storage_info = 10053 [(module) = "framework"];
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800483 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
484 GpuStatsAppInfo gpu_stats_app_info = 10055;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800485 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true, (module) = "framework"];
486 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057 [(module) = "framework"];
487 FaceSettings face_settings = 10058 [(module) = "framework"];
488 CoolingDevice cooling_device = 10059 [(module) = "framework"];
489 AppOps app_ops = 10060 [(module) = "framework"];
490 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061 [(module) = "framework"];
Alec Mourie088e762019-07-02 13:10:55 -0700491 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
492 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800493 ProcessMemorySnapshot process_memory_snapshot = 10064 [(module) = "framework"];
Muhammad Qureshi4ba4bac2020-01-25 23:48:53 -0800494 VmsClientStats vms_client_stats = 10065 [(module) = "car"];
Muhammad Qureshi1f6dc942020-01-27 16:36:45 -0800495 NotificationRemoteViews notification_remote_views = 10066 [(module) = "framework"];
496 DangerousPermissionStateSampled dangerous_permission_state_sampled =
497 10067 [(module) = "framework"];
Stan Iliev637ba5e2019-08-16 13:43:08 -0400498 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin88c6f322020-01-29 14:48:11 +0000499 RuntimeAppOpAccess runtime_app_op_access = 10069 [(module) = "framework"];
Kenny Root6c218db2020-02-02 17:43:44 +0000500 IonHeapSize ion_heap_size = 10070 [(module) = "framework"];
Yotam Aron74299972020-01-16 16:20:58 +0200501 PackageNotificationPreferences package_notification_preferences =
502 10071 [(module) = "framework"];
503 PackageNotificationChannelPreferences package_notification_channel_preferences =
504 10072 [(module) = "framework"];
505 PackageNotificationChannelGroupPreferences package_notification_channel_group_preferences =
506 10073 [(module) = "framework"];
Blake Kragten6ce382a2020-01-16 20:20:46 -0800507 GnssStats gnss_stats = 10074 [(module) = "framework"];
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -0800508 AttributedAppOps attributed_app_ops = 10075 [(module) = "framework"];
Chi Zhangbb9ed922020-03-11 10:16:47 -0700509 VoiceCallSession voice_call_session = 10076 [(module) = "telephony"];
510 VoiceCallRatUsage voice_call_rat_usage = 10077 [(module) = "telephony"];
511 SimSlotState sim_slot_state = 10078 [(module) = "telephony"];
512 SupportedRadioAccessFamily supported_radio_access_family = 10079 [(module) = "telephony"];
Raff Tsaiea4db182020-03-06 07:45:43 +0800513 SettingSnapshot setting_snapshot = 10080 [(module) = "framework"];
David Chenc8a43242017-10-17 16:23:28 -0700514 }
yroa1fe77c2018-02-26 14:22:54 -0800515
Bookatz76aafcf2018-09-17 16:17:10 -0700516 // DO NOT USE field numbers above 100,000 in AOSP.
517 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
518 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100519
520 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700521}
522
Yao Chend54f9dd2017-10-17 17:37:48 +0000523/**
Yangster-mac20877162017-12-22 17:19:39 -0800524 * This proto represents a node of an attribution chain.
525 * Note: All attribution chains are represented as a repeated field of type
526 * AttributionNode. It is understood that in such arrays, the order is that
527 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000528 */
Yangster-mac20877162017-12-22 17:19:39 -0800529message AttributionNode {
530 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800531 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800532
Yangster-mac20877162017-12-22 17:19:39 -0800533 // The (optional) string tag for an element in the attribution chain. If the
534 // element has no tag, it is encoded as an empty string.
535 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700536}
537
Yangster-mac48b3d622018-08-18 12:38:11 -0700538message KeyValuePair {
539 optional int32 key = 1;
540 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700541 int32 value_int = 2;
542 int64 value_long = 3;
543 string value_str = 4;
544 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700545 }
546}
547
548message KeyValuePairsAtom {
549 optional int32 uid = 1;
550 repeated KeyValuePair pairs = 2;
551}
552
Yao Chend54f9dd2017-10-17 17:37:48 +0000553/*
554 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800555 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000556 *
557 * RULES:
558 * - The field ids for each atom must start at 1, and count upwards by 1.
559 * Skipping field ids is not allowed.
560 * - These form an API, so renaming, renumbering or removing fields is
561 * not allowed between android releases. (This is not currently enforced,
562 * but there will be a tool to enforce this restriction).
563 * - The types must be built-in protocol buffer types, namely, no sub-messages
564 * are allowed (yet). The bytes type is also not allowed.
565 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800566 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000567 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800568 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000569 * - A field that is a uid should be a string field, tagged with the [xxx]
570 * annotation. The generated code on android will be represented by UIDs,
571 * and those UIDs will be translated in xxx to those strings.
572 *
573 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700574 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000575 * - If there is a UID, it goes first. Think in an object-oriented fashion.
576 * *****************************************************************************
577 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700578
Yao Chend54f9dd2017-10-17 17:37:48 +0000579/**
Tej Singha72344992019-04-17 18:55:08 -0700580 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700581 * Logs when the Thermal service HAL notifies the throttling start/stop events.
582 *
583 * Logged from:
584 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
585 */
586message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700587 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700588 optional android.os.TemperatureTypeEnum sensor_type = 1;
589
Maggie White442b6312019-04-05 16:26:44 -0700590 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700591 enum State {
592 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700593 START = 1; // START indicated that throttling was triggered.
594 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700595 }
Yangster-mace16189a2018-08-26 12:20:16 -0700596 optional State state = 2;
597
598 optional float temperature = 3;
599}
600
601/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000602 * Logs when the screen state changes.
603 *
604 * Logged from:
605 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
606 */
607message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800608 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800609 optional android.view.DisplayStateEnum state = 1
610 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700611}
Yao Chend54f9dd2017-10-17 17:37:48 +0000612
613/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700614 * Logs that the process state of the uid, as determined by ActivityManager
615 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000616 *
617 * Logged from:
618 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
619 */
Bookatzc1a050a2017-10-10 15:49:28 -0700620message UidProcessStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800621 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000622
Bookatzdb026a22018-01-10 19:01:56 -0800623 // The state, from frameworks/base/core/proto/android/app/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -0800624 optional android.app.ProcessStateEnum state = 2
625 [(state_field_option).option = EXCLUSIVE_STATE, (state_field_option).nested = false];
Yao Chend54f9dd2017-10-17 17:37:48 +0000626}
627
628/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629 * Logs process state change of a process, as per the activity manager.
630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
633 */
634message ProcessStateChanged {
635 optional int32 uid = 1;
636 optional string process_name = 2;
637 optional string package_name = 3;
638 // TODO: remove this when validation is done
639 optional int64 version = 5;
640 // The state, from frameworks/base/core/proto/android/app/enums.proto.
641 optional android.app.ProcessStateEnum state = 4;
642}
643
644/**
645 * Logs when ActivityManagerService sleep state is changed.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
649 */
650message ActivityManagerSleepStateChanged {
651 // TODO: import frameworks proto
652 enum State {
653 UNKNOWN = 0;
654 ASLEEP = 1;
655 AWAKE = 2;
656 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800657 optional State state = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700658}
659
660/**
661 * Logs when system memory state changes.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
665 */
666message MemoryFactorStateChanged {
667 // TODO: import frameworks proto
668 enum State {
669 MEMORY_UNKNOWN = 0;
670 NORMAL = 1; // normal.
671 MODERATE = 2; // moderate memory pressure.
672 LOW = 3; // low memory.
673 CRITICAL = 4; // critical memory.
674
675 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800676 optional State factor = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700677}
678
679/**
680 * Logs when app is using too much cpu, according to ActivityManagerService.
681 *
682 * Logged from:
683 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
684 */
685message ExcessiveCpuUsageReported {
686 optional int32 uid = 1;
687 optional string process_name = 2;
688 optional string package_name = 3;
689 // package version. TODO: remove this when validation is done
690 optional int64 version = 4;
691}
692
693/**
694 * Logs when a cached process is killed, along with its pss.
695 *
696 * Logged from:
697 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
698 */
699message CachedKillReported {
700 optional int32 uid = 1;
701 optional string process_name = 2;
702 optional string package_name = 3;
703 // TODO: remove this when validation is done
704 optional int64 version = 5;
705 optional int64 pss = 4;
706}
707
708/**
xshu2c3d9e42019-09-26 17:54:02 -0700709 * Logs the change in wifi health.
710 *
711 * Logged from:
712 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDataStall.java
713 */
714message WifiHealthStatReported {
xshu39bfd932020-02-14 15:49:24 -0800715 enum Band {
716 UNKNOWN = 0;
717 // All of 2.4GHz band
718 BAND_2G = 1;
719 // Frequencies in the range of [5150, 5250) GHz
720 BAND_5G_LOW = 2;
721 // Frequencies in the range of [5250, 5725) GHz
722 BAND_5G_MIDDLE = 3;
723 // Frequencies in the range of [5725, 5850) GHz
724 BAND_5G_HIGH = 4;
725 // Frequencies in the range of [5925, 6425) GHz
726 BAND_6G_LOW = 5;
727 // Frequencies in the range of [6425, 6875) GHz
728 BAND_6G_MIDDLE = 6;
729 // Frequencies in the range of [6875, 7125) GHz
730 BAND_6G_HIGH = 7;
731 }
xshu2c3d9e42019-09-26 17:54:02 -0700732 // duration this stat is obtained over in milliseconds
733 optional int32 duration_millis = 1;
734 // whether wifi is classified as sufficient for the user's data traffic, determined
735 // by whether the calculated throughput exceeds the average demand within |duration_millis|
736 optional bool is_sufficient = 2;
xshu2c3d9e42019-09-26 17:54:02 -0700737 // whether cellular data is available
xshu39bfd932020-02-14 15:49:24 -0800738 optional bool is_cell_data_available = 3;
739 // the Band bucket the connected network is on
740 optional Band band = 4;
xshu2c3d9e42019-09-26 17:54:02 -0700741}
742
743/**
744 * Logged when wifi detects a significant change in connection failure rate.
745 *
746 * Logged from: frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiHealthMonitor.java
747 *
748 */
749message WifiFailureStatReported {
750 enum AbnormalityType {
751 UNKNOWN = 0;
752 SIGNIFICANT_INCREASE = 1;
753 SIGNIFICANT_DECREASE = 2;
754 SIMPLY_HIGH = 3;
755 }
756 enum FailureType {
757 FAILURE_UNKNOWN = 0;
758 FAILURE_CONNECTION = 1;
759 FAILURE_ASSOCIATION_REJECTION = 2;
760 FAILURE_ASSOCIATION_TIMEOUT = 3;
761 FAILURE_AUTHENTICATION = 4;
762 FAILURE_NON_LOCAL_DISCONNECTION = 5;
763 FAILURE_SHORT_CONNECTION_DUE_TO_NON_LOCAL_DISCONNECTION = 6;
764 }
765 // Reason for uploading this stat
766 optional AbnormalityType abnormality_type = 1;
767 // The particular type of failure
768 optional FailureType failure_type = 2;
769 // How many times we have encountered this combination of AbnormalityType and FailureType
770 optional int32 failure_count = 3;
771}
772
773/**
774 * Logs whether a wifi connection is successful and reasons for failure if it isn't.
775 *
776 * Logged from:
777 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
778 */
779message WifiConnectionResultReported {
780 enum FailureCode {
781 FAILURE_UNKNOWN = 0;
782 FAILURE_ASSOCIATION_TIMEOUT = 1;
783 FAILURE_ASSOCIATION_REJECTION = 2;
784 FAILURE_AUTHENTICATION_GENERAL = 3;
785 FAILURE_AUTHENTICATION_EAP = 4;
786 FAILURE_DHCP = 5;
787 FAILURE_NETWORK_DISCONNECTION = 6;
788 FAILURE_ROAM_TIMEOUT = 7;
789 }
790 // true represents a successful connection
791 optional bool connection_result = 1;
792 // reason for the connection failure
793 optional FailureCode failure_code = 2;
794 // scan rssi before the connection attempt
795 optional int32 rssi = 3;
796}
797
798/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700799 * Logs when memory stats of a process is reported.
800 *
801 * Logged from:
802 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
803 */
804message ProcessMemoryStatReported {
805 optional int32 uid = 1;
806 optional string process_name = 2;
807 optional string package_name = 3;
808 //TODO: remove this when validation is done
809 optional int64 version = 9;
810 optional int64 pss = 4;
811 optional int64 uss = 5;
812 optional int64 rss = 6;
813 enum Type {
814 ADD_PSS_INTERNAL_SINGLE = 0;
815 ADD_PSS_INTERNAL_ALL_MEM = 1;
816 ADD_PSS_INTERNAL_ALL_POLL = 2;
817 ADD_PSS_EXTERNAL = 3;
818 ADD_PSS_EXTERNAL_SLOW = 4;
819 }
820 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800821 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700822}
823
824/**
Bookatzc1a050a2017-10-10 15:49:28 -0700825 * Logs that a process started, finished, crashed, or ANRed.
826 *
827 * Logged from:
828 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
829 */
830message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700831 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700832
David Chen0b5c90c2018-01-25 16:51:49 -0800833 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800834 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700835
Bookatzddccf0a2017-11-28 16:48:14 -0800836 // What lifecycle state the process changed to.
837 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838 enum State {
839 FINISHED = 0;
840 STARTED = 1;
841 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800842 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800843 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700844}
845
Bookatzc1a050a2017-10-10 15:49:28 -0700846/**
847 * Logs when the ble scan state changes.
848 *
849 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700850 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700851 */
852message BleScanStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -0800853 repeated AttributionNode attribution_node = 1
854 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Bookatzc1a050a2017-10-10 15:49:28 -0700855
856 enum State {
857 OFF = 0;
858 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700859 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
860 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861 }
tsaichristine5adc7e02020-01-14 17:07:39 -0800862 optional State state = 2 [
863 (state_field_option).option = EXCLUSIVE_STATE,
864 (state_field_option).default_state_value = 0 /* State.OFF */,
865 (state_field_option).reset_state_value = 2 /* State.RESET */,
866 (state_field_option).nested = true
867 ];
Bookatzc1a050a2017-10-10 15:49:28 -0700868
Bookatze5ec0b42018-03-26 13:34:56 -0700869 // Does the scan have a filter.
tsaichristine5adc7e02020-01-14 17:07:39 -0800870 optional bool is_filtered = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700871 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
tsaichristine5adc7e02020-01-14 17:07:39 -0800872 optional bool is_first_match = 4 [(state_field_option).option = PRIMARY_FIELD];
Bookatze5ec0b42018-03-26 13:34:56 -0700873 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
tsaichristine5adc7e02020-01-14 17:07:39 -0800874 optional bool is_opportunistic = 5 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -0700875}
876
877/**
878 * Logs reporting of a ble scan finding results.
879 *
880 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700881 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700882 */
Bookatzae6738e2018-09-13 11:38:56 -0700883// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700884message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800885 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700886
887 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800888 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700889}
890
891/**
892 * Logs when a sensor state changes.
893 *
894 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700895 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
897message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
Bookatzc1a050a2017-10-10 15:49:28 -0700900 // The id (int) of the sensor.
901 optional int32 sensor_id = 2;
902
903 enum State {
904 OFF = 0;
905 ON = 1;
906 }
907 optional State state = 3;
908}
909
Bookatzc1a050a2017-10-10 15:49:28 -0700910/**
911 * Logs when GPS state changes.
912 *
913 * Logged from:
914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
915 */
916message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800917 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700918
919 enum State {
920 OFF = 0;
921 ON = 1;
922 }
923 optional State state = 2;
924}
925
Bookatz48d362e2018-11-06 15:49:08 -0800926/**
927 * Logs when GPS signal quality.
928 *
929 * Logged from:
930 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
931 */
932message GpsSignalQualityChanged {
933 optional android.server.location.GpsSignalQualityEnum level = 1;
934}
935
Bookatzc1a050a2017-10-10 15:49:28 -0700936
937/**
938 * Logs when a sync manager sync state changes.
939 *
940 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700941 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700942 */
943message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945
David Chen0b5c90c2018-01-25 16:51:49 -0800946 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800947 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 3;
954}
955
Yangster-mac96353002018-09-05 11:18:55 -0700956/*
957 * Deferred job stats.
958 *
959 * Logged from:
960 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
961*/
962message DeferredJobStatsReported {
963 repeated AttributionNode attribution_node = 1;
964
965 // Number of jobs deferred.
966 optional int32 num_jobs_deferred = 2;
967
968 // Time since the last job runs.
969 optional int64 time_since_last_job_millis = 3;
970}
971
Bookatzc1a050a2017-10-10 15:49:28 -0700972/**
973 * Logs when a job scheduler job state changes.
974 *
975 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700976 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700977 */
978message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800979 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980
981 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800982 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700983
984 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800985 FINISHED = 0;
986 STARTED = 1;
987 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700988 }
989 optional State state = 3;
990
Tej Singh33a412b2018-03-16 18:43:59 -0700991 // The reason a job has stopped.
992 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700993 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700994 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100995
996 // The standby bucket of the app that scheduled the job. These match the framework constants
997 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
998 // already assigned 0.
999 enum Bucket {
1000 UNKNOWN = -1;
1001 ACTIVE = 0;
1002 WORKING_SET = 1;
1003 FREQUENT = 2;
1004 RARE = 3;
1005 NEVER = 4;
Kweku Adamsae9d6be2020-01-14 16:10:14 -08001006 RESTRICTED = 5;
Ben Murdoch741e3352019-05-09 11:27:28 +01001007 }
1008 optional Bucket standby_bucket = 5 [default = UNKNOWN];
1009
1010 // The job id (as assigned by the app).
1011 optional int32 job_id = 6;
Suprabh Shukla1b5778d2020-02-18 16:39:02 -08001012
1013 // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
1014 // constraints as they are always assumed to be set.
1015 optional bool has_charging_constraint = 7;
1016 optional bool has_battery_not_low_constraint = 8;
1017 optional bool has_storage_not_low_constraint = 9;
1018 optional bool has_timing_delay_constraint = 10;
1019 optional bool has_deadline_constraint = 11;
1020 optional bool has_idle_constraint = 12;
1021 optional bool has_connectivity_constraint = 13;
1022 optional bool has_content_trigger_constraint = 14;
Bookatzc1a050a2017-10-10 15:49:28 -07001023}
1024
1025/**
1026 * Logs when the audio state changes.
1027 *
1028 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001029 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001030 */
1031message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001032 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001037 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
1038 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001039 }
1040 optional State state = 2;
1041}
1042
1043/**
1044 * Logs when the video codec state changes.
1045 *
1046 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001047 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001048 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001049message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001050 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001051
1052 enum State {
1053 OFF = 0;
1054 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001055 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
1056 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001057 }
1058 optional State state = 2;
1059}
1060
1061/**
1062 * Logs when the flashlight state changes.
1063 *
1064 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001065 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001066 */
1067message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001068 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001069
1070 enum State {
1071 OFF = 0;
1072 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001073 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
1074 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001075 }
1076 optional State state = 2;
1077}
1078
1079/**
1080 * Logs when the camera state changes.
1081 *
1082 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -07001083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -07001084 */
1085message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001087
1088 enum State {
1089 OFF = 0;
1090 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -07001091 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
1092 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -07001093 }
1094 optional State state = 2;
1095}
1096
1097/**
1098 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +00001099 *
1100 * Logged from:
1101 * TODO
1102 */
Bookatzd6746242017-10-24 18:39:35 -07001103message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -08001104 repeated AttributionNode attribution_node = 1
1105 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +00001106
Bookatz1a1b0462018-01-12 11:47:03 -08001107 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
1108 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristine5adc7e02020-01-14 17:07:39 -08001109 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY_FIELD];
tsaichristineed615642020-01-02 12:53:41 -08001110 ;
Bookatzc1a050a2017-10-10 15:49:28 -07001111
1112 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristine5adc7e02020-01-14 17:07:39 -08001113 optional string tag = 3 [(state_field_option).option = PRIMARY_FIELD];
Bookatzc1a050a2017-10-10 15:49:28 -07001114
1115 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -08001116 RELEASE = 0;
1117 ACQUIRE = 1;
1118 CHANGE_RELEASE = 2;
1119 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -07001120 }
tsaichristine5adc7e02020-01-14 17:07:39 -08001121 optional State state = 4 [
1122 (state_field_option).option = EXCLUSIVE_STATE,
1123 (state_field_option).default_state_value = 0,
1124 (state_field_option).nested = true
1125 ];
Bookatzc1a050a2017-10-10 15:49:28 -07001126}
1127
1128/**
Bookatzc1a050a2017-10-10 15:49:28 -07001129 * Logs when a partial wakelock is considered 'long' (over 1 min).
1130 *
1131 * Logged from:
1132 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1133 */
1134message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001135 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001136
Yao Chend54f9dd2017-10-17 17:37:48 +00001137 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
1138 optional string tag = 2;
1139
Bookatzc1a050a2017-10-10 15:49:28 -07001140 // TODO: I have no idea what this is.
1141 optional string history_tag = 3;
1142
1143 enum State {
1144 OFF = 0;
1145 ON = 1;
1146 }
1147 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +00001148}
1149
Bookatzc1a050a2017-10-10 15:49:28 -07001150/**
Bookatza66083f2018-09-20 17:24:00 -07001151 * Logs when the device is interactive, according to the PowerManager Notifier.
1152 *
1153 * Logged from:
1154 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
1155 */
1156message InteractiveStateChanged {
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 1;
1162}
1163
1164/**
Bookatzc1a050a2017-10-10 15:49:28 -07001165 * Logs Battery Saver state change.
1166 *
1167 * Logged from:
1168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1169 */
1170message BatterySaverModeStateChanged {
1171 enum State {
1172 OFF = 0;
1173 ON = 1;
1174 }
1175 optional State state = 1;
1176}
1177
1178/**
1179 * Logs Doze mode state change.
1180 *
1181 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -08001182 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001183 */
1184message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001185 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001186}
1187
1188
1189/**
1190 * Logs state change of Doze mode including maintenance windows.
1191 *
1192 * Logged from:
1193 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1194 */
1195message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001196 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001197}
1198
1199/**
1200 * Logs screen brightness level.
1201 *
1202 * Logged from:
1203 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1204 */
1205message ScreenBrightnessChanged {
1206 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1207 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001208}
1209
1210/**
1211 * Logs battery level (percent full, from 0 to 100).
1212 *
1213 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001214 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001215 */
1216message BatteryLevelChanged {
1217 // Battery level. Should be in [0, 100].
1218 optional int32 battery_level = 1;
1219}
1220
1221/**
1222 * Logs change in charging status of the device.
1223 *
1224 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001225 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001226 */
1227message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001228 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1229 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001230}
1231
1232/**
1233 * Logs whether the device is plugged in, and what power source it is using.
1234 *
1235 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001236 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001237 */
1238message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001239 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1240 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001241}
1242
Bookatz8c6571b2017-10-24 15:04:41 -07001243/**
1244 * Logs when an app's wakeup alarm fires.
1245 *
1246 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001247 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001248 */
1249message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001250 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001251
1252 // Name of the wakeup alarm.
1253 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001254
1255 // Name of source package (for historical reasons, since BatteryStats tracked it).
1256 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001257
Ben Murdoch3389f1522019-05-21 15:05:34 +01001258 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
Kweku Adams12752132020-02-18 15:36:48 -08001259 optional AppStandbyBucketChanged.Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001260}
1261
1262/**
1263 * Logs when an an app causes the mobile radio to change state.
1264 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1265 *
1266 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001267 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001268 */
1269message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001270 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001271
Bookatz1a1b0462018-01-12 11:47:03 -08001272 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1273 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001274}
1275
1276/**
1277 * Logs when an an app causes the wifi radio to change state.
1278 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1279 *
1280 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001281 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001282 */
1283message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001284 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001285
Bookatz1a1b0462018-01-12 11:47:03 -08001286 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1287 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001288}
1289
1290/**
1291 * Logs kernel wakeup reasons and aborts.
1292 *
1293 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001294 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001295 */
1296message KernelWakeupReported {
1297 // Name of the kernel wakeup reason (or abort).
1298 optional string wakeup_reason_name = 1;
1299
1300 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001301 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001302}
1303
1304/**
Bookatzda1798c2018-12-13 14:16:00 -08001305 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001306 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001307 *
1308 * Logged from:
1309 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1310 */
1311message WifiEnabledStateChanged {
1312 enum State {
1313 OFF = 0;
1314 ON = 1;
1315 }
1316 optional State state = 1;
1317}
1318
1319/**
tsaichristinececebdc2020-02-04 14:05:56 -08001320 * This atom is deprecated starting in R.
1321 *
Bookatzda1798c2018-12-13 14:16:00 -08001322 * 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 -08001323 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1324 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001325 *
1326 * Logged from:
1327 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1328 */
1329message WifiRunningStateChanged {
1330 repeated AttributionNode attribution_node = 1;
1331
1332 enum State {
1333 OFF = 0;
1334 ON = 1;
1335 }
1336 optional State state = 2;
1337}
1338
1339/**
Bookatze5885242017-10-24 20:10:31 -07001340 * Logs wifi locks held by an app.
1341 *
1342 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001343 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001344 */
1345message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001346 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001347
1348 enum State {
1349 OFF = 0;
1350 ON = 1;
1351 }
1352 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001353
1354 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1355 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001356}
1357
1358/**
1359 * Logs wifi signal strength changes.
1360 *
1361 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001362 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001363 */
1364message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001365 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1366 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001367}
1368
1369/**
1370 * Logs wifi scans performed by an app.
1371 *
1372 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001373 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001374 */
1375message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001376 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001377
1378 enum State {
1379 OFF = 0;
1380 ON = 1;
1381 }
1382 optional State state = 2;
1383}
1384
1385/**
Tej Singh4503e102018-01-04 14:35:01 -08001386 * Logs wifi multicast locks held by an app
1387 *
1388 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001389 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001390 */
1391message WifiMulticastLockStateChanged {
1392 repeated AttributionNode attribution_node = 1;
1393
1394 enum State {
1395 OFF = 0;
1396 ON = 1;
1397 }
1398 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001399
1400 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001401}
1402
1403/**
Tej Singh1ea42892018-01-19 09:27:00 -08001404 * Logs shutdown reason and duration on next boot.
1405 *
1406 * Logged from:
1407 * frameworks/base/core/java/com/android/server/BootReceiver.java
1408 */
1409message ShutdownSequenceReported {
1410 // True if shutdown is for a reboot. Default: false if we do not know.
1411 optional bool reboot = 1;
1412
1413 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1414 optional string reason = 2;
1415
1416 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1417 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001418 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001419
1420 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001421 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001422}
1423
Tej Singh6483ea42018-01-25 17:45:49 -08001424
1425/**
1426 * Logs boot reason and duration.
1427 *
1428 * Logged from:
1429 * system/core/bootstat/bootstat.cpp
1430 */
1431message BootSequenceReported {
1432 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1433 // Default: "<EMPTY>" if not available.
1434 optional string bootloader_reason = 1;
1435
1436 // Reason for system boot. Eg. bootloader, reboot,userrequested
1437 // Default: "<EMPTY>" if not available.
1438 optional string system_reason = 2;
1439
1440 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001441 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001442
1443 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001444 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001445
1446 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001447 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001448
1449 // Time since last boot in ms. Default: 0 if not available.
1450 optional int64 time_since_last_boot = 6;
1451}
1452
Tej Singhc477d9c2018-02-05 18:31:39 -08001453
1454/**
1455 * Logs call state and disconnect cause (if applicable).
1456 *
1457 * Logged from:
1458 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1459 */
1460message CallStateChanged {
1461 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1462 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1463 optional android.telecom.CallStateEnum call_state = 1;
1464
1465 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1466 // This value is only applicable when the call_state is DISCONNECTED, and
1467 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1468 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1469 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1470
1471 // True if the call is self-managed, which are apps that use the
1472 // telecom infrastructure to make their own calls.
1473 optional bool self_managed = 3;
1474
1475 // True if call is external. External calls are calls on connected Wear
1476 // devices but show up in Telecom so the user can pull them onto the device.
1477 optional bool external_call = 4;
1478}
1479
Tej Singh1ea42892018-01-19 09:27:00 -08001480/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001481 * Logs keyguard state. The keyguard is the lock screen.
1482 *
1483 * Logged from:
1484 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1485 */
1486message KeyguardStateChanged {
1487 enum State {
1488 UNKNOWN = 0;
1489 // The keyguard is hidden when the phone is unlocked.
1490 HIDDEN = 1;
1491 // The keyguard is shown when the phone is locked (screen turns off).
1492 SHOWN= 2;
1493 // The keyguard is occluded when something is overlaying the keyguard.
1494 // Eg. Opening the camera while on the lock screen.
1495 OCCLUDED = 3;
1496 }
1497 optional State state = 1;
1498}
1499
1500/**
1501 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1502 * prompts the user to enter a password (pattern, pin, etc).
1503 *
1504 * Logged from:
1505 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1506 */
1507
1508message KeyguardBouncerStateChanged {
1509 enum State {
1510 UNKNOWN = 0;
1511 // Bouncer is hidden, either as a result of successfully entering the
1512 // password, screen timing out, or user going back to lock screen.
1513 HIDDEN = 1;
1514 // This is when the user is being prompted to enter the password.
1515 SHOWN = 2;
1516 }
1517 optional State state = 1;
1518}
1519
1520/**
1521 * Logs the result of entering a password into the keyguard bouncer.
1522 *
1523 * Logged from:
1524 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1525 */
1526message KeyguardBouncerPasswordEntered {
1527 enum BouncerResult {
1528 UNKNOWN = 0;
1529 // The password entered was incorrect.
1530 FAILURE = 1;
1531 // The password entered was correct.
1532 SUCCESS = 2;
1533 }
1534 optional BouncerResult result = 1;
1535}
1536
Tej Singha883b372018-02-15 11:30:01 -08001537/*
1538 * Logs changes to the configuration of the device. The configuration is defined
1539 * in frameworks/base/core/java/android/content/res/Configuration.java
1540 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1541 * Please go there to interpret the possible values each field can be.
1542 *
1543 * Logged from:
1544 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1545 */
1546message ResourceConfigurationChanged {
1547 // Bit mask of color capabilities of the screen.
1548 // Contains information about the color gamut and hdr mode of the screen.
1549 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001550 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001551
1552 // The target screen density being rendered to.
1553 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001554 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001555
1556 // Current user preference for the scaling factor for fonts,
1557 // relative to the base density scaling.
1558 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001559 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001560
1561 // Flag indicating whether the hard keyboard is hidden.
1562 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001563 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001564
1565 // The type of keyboard attached to the device.
1566 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1567 optional int32 keyboard = 5;
1568
1569 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1570 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001571 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001572
1573 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1574 // 0 if undefined.
1575 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1576 optional int32 mcc = 7;
1577
1578 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1579 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1580 // MNC_ZERO symbol defined in Configuration.java.
1581 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1582 optional int32 mnc = 8;
1583
1584 // The kind of navigation available on the device.
1585 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1586 optional int32 navigation = 9;
1587
1588 // Flag indicating whether the navigation is available.
1589 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001590 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001591
1592 // Overall orientation of the screen.
1593 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1594 optional int32 orientation = 11;
1595
1596 // The current height of the available screen space, in dp units.
1597 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001598 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001599
1600 // Bit mask of overall layout of the screen.
1601 // Contains information about screen size, whether the screen is wider/taller
1602 // than normal, whether the screen layout is right-tl-left or left-to-right,
1603 // and whether the screen has a rounded shape.
1604 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001605 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001606
1607 // Current width of the available screen space, in dp units.
1608 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001609 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001610
1611 // The smallest screen size an application will see in normal operation.
1612 // This is the smallest value of both screenWidthDp and screenHeightDp
1613 // in portrait and landscape.
1614 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001615 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001616
1617 // The type of touch screen attached to the device.
1618 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1619 optional int32 touchscreen = 16;
1620
1621 // Bit mask of the ui mode.
1622 // Contains information about the overall ui mode of the device.
1623 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1624 // Also contains information about whether the device is in night mode.
1625 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001626 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001627}
1628
Tej Singheee317b2018-03-07 19:28:05 -08001629
1630/**
1631 * Logs changes in the connection state of the mobile radio.
1632 *
1633 * Logged from:
1634 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1635 */
1636message MobileConnectionStateChanged {
1637 // States are from the state machine DataConnection.java.
1638 enum State {
1639 UNKNOWN = 0;
1640 // The connection is inactive, or disconnected.
1641 INACTIVE = 1;
1642 // The connection is being activated, or connecting.
1643 ACTIVATING = 2;
1644 // The connection is active, or connected.
1645 ACTIVE = 3;
1646 // The connection is disconnecting.
1647 DISCONNECTING = 4;
1648 // The connection is disconnecting after creating a connection.
1649 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1650 }
1651 optional State state = 1;
1652 // For multi-sim phones, this distinguishes between the sim cards.
1653 optional int32 sim_slot_index = 2;
1654 // Used to identify the connection. Starts at 0 and increments by 1 for
1655 // every new network created. Resets whenever the device reboots.
1656 optional int32 data_connection_id = 3;
1657 // A bitmask for the capabilities of this connection.
1658 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1659 // Default value (if we have no information): 0
1660 optional int64 capabilities = 4;
1661 // If this connection has internet.
1662 // This just checks if the DEFAULT bit of capabilities is set.
1663 optional bool has_internet = 5;
1664}
1665
1666/**
1667 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1668 *
1669 * Logged from:
1670 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1671 */
1672message MobileRadioTechnologyChanged {
1673 optional android.telephony.NetworkTypeEnum state = 1;
1674 // For multi-sim phones, this distinguishes between the sim cards.
1675 optional int32 sim_slot_index = 2;
1676}
1677
Andrew Chantb56388b2018-03-22 21:07:33 -07001678/**
1679 * Logs the VID and PID of any connected USB devices.
1680 *
1681 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1682 *
1683 * Logged by Vendor.
1684 */
1685message UsbDeviceAttached {
1686 optional int32 vid = 1;
1687 optional int32 pid = 2;
1688 optional bool has_audio = 3;
1689 optional bool has_hid = 4;
1690 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001691 enum State {
1692 STATE_DISCONNECTED = 0;
1693 STATE_CONNECTED = 1;
1694 }
1695 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001696 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001697}
1698
Tej Singheee317b2018-03-07 19:28:05 -08001699
Tej Singhdd7bd352018-02-09 19:33:15 -08001700/**
Tej Singh5d991e12018-03-09 19:48:11 -08001701 * Logs when Bluetooth is enabled and disabled.
1702 *
1703 * Logged from:
1704 * services/core/java/com/android/server/BluetoothManagerService.java
1705 */
1706message BluetoothEnabledStateChanged {
1707 repeated AttributionNode attribution_node = 1;
1708 // Whether or not bluetooth is enabled on the device.
1709 enum State {
1710 UNKNOWN = 0;
1711 ENABLED = 1;
1712 DISABLED = 2;
1713 }
1714 optional State state = 2;
1715 // The reason for being enabled/disabled.
1716 // Eg. Airplane mode, crash, application request.
1717 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1718 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001719 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001720}
1721
1722/**
Jack Hed9837c82019-01-09 01:19:13 -08001723 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001724 *
1725 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001726 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1727 *
1728 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001729 */
1730message BluetoothConnectionStateChanged {
1731 // The state of the connection.
1732 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1733 optional android.bluetooth.ConnectionStateEnum state = 1;
1734 // An identifier that can be used to match connect and disconnect events.
1735 // Currently is last two bytes of a hash of a device level ID and
1736 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001737 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001738 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001739 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1740 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001741 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001742 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001749 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001750}
1751
1752/**
1753 * Logs when a Bluetooth device connects and disconnects over ACL
1754 *
1755 * Logged from:
1756 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1757 *
1758 * Next Tag: 3
1759 */
1760message BluetoothAclConnectionStateChanged {
1761 // An identifier that can be used to match events for this device.
1762 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1763 // Salt: Randomly generated 256 bit value
1764 // Hash algorithm: HMAC-SHA256
1765 // Size: 32 byte
1766 // Default: null or empty if the device identifier is not known
1767 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1768 // The state of the connection.
1769 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1770 optional android.bluetooth.ConnectionStateEnum state = 2;
1771}
1772
1773/**
1774 * Logs when a Bluetooth device connects and disconnects over SCO
1775 *
1776 * Logged from:
1777 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1778 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1779 *
1780 * Next Tag: 4
1781 */
1782message BluetoothScoConnectionStateChanged {
1783 // An identifier that can be used to match events for this device.
1784 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1785 // Salt: Randomly generated 256 bit value
1786 // Hash algorithm: HMAC-SHA256
1787 // Size: 32 byte
1788 // Default: null or empty if the device identifier is not known
1789 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1790 // The state of the connection.
1791 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1792 optional android.bluetooth.ConnectionStateEnum state = 2;
1793 // Codec used for this SCO connection
1794 // Default: UNKNOWN
1795 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001796}
1797
Jack Hec27040a2019-01-09 20:54:41 -08001798/**
1799 * Logged when active device of a profile changes
1800 *
1801 * Logged from:
1802 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1803 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1804 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1805 */
1806message BluetoothActiveDeviceChanged {
1807 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1808 // From android.bluetooth.BluetoothProfile
1809 optional int32 bt_profile = 1;
1810 // An identifier that can be used to match events for this new active device.
1811 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1812 // Salt: Randomly generated 256 bit value
1813 // Hash algorithm: HMAC-SHA256
1814 // Size: 32 byte
1815 // Default: null or empty if there is no active device for this profile
1816 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1817}
1818
Jack Heab86dbd22018-12-18 15:43:27 -08001819// Logs when there is an event affecting Bluetooth device's link layer connection.
1820// - This event is triggered when there is a related HCI command or event
1821// - Users of this metrics can deduce Bluetooth device's connection state from these events
1822// - HCI commands are logged before the command is sent, after receiving command status, and after
1823// receiving command complete
1824// - HCI events are logged when they arrive
1825//
1826// Low level log from system/bt
1827//
1828// Bluetooth classic commands:
1829// - CMD_CREATE_CONNECTION
1830// - CMD_DISCONNECT
1831// - CMD_CREATE_CONNECTION_CANCEL
1832// - CMD_ACCEPT_CONNECTION_REQUEST
1833// - CMD_REJECT_CONNECTION_REQUEST
1834// - CMD_SETUP_ESCO_CONNECTION
1835// - CMD_ACCEPT_ESCO_CONNECTION
1836// - CMD_REJECT_ESCO_CONNECTION
1837// - CMD_ENH_SETUP_ESCO_CONNECTION
1838// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1839//
1840// Bluetooth low energy commands:
1841// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1842// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1843// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1844// - CMD_BLE_CLEAR_WHITE_LIST
1845// - CMD_BLE_ADD_WHITE_LIST
1846// - CMD_BLE_REMOVE_WHITE_LIST
1847//
1848// Bluetooth classic events:
1849// - EVT_CONNECTION_COMP
1850// - EVT_CONNECTION_REQUEST
1851// - EVT_DISCONNECTION_COMP
1852// - EVT_ESCO_CONNECTION_COMP
1853// - EVT_ESCO_CONNECTION_CHANGED
1854//
1855// Bluetooth low energy meta events:
1856// - BLE_EVT_CONN_COMPLETE_EVT
1857// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1858//
1859// Next tag: 10
1860message BluetoothLinkLayerConnectionEvent {
1861 // An identifier that can be used to match events for this device.
1862 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1863 // Salt: Randomly generated 256 bit value
1864 // Hash algorithm: HMAC-SHA256
1865 // Size: 32 byte
1866 // Default: null or empty if the device identifier is not known
1867 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1868 // Connection handle of this connection if available
1869 // Range: 0x0000 - 0x0EFF (12 bits)
1870 // Default: 0xFFFF if the handle is unknown
1871 optional int32 connection_handle = 2;
1872 // Direction of the link
1873 // Default: DIRECTION_UNKNOWN
1874 optional android.bluetooth.DirectionEnum direction = 3;
1875 // Type of this link
1876 // Default: LINK_TYPE_UNKNOWN
1877 optional android.bluetooth.LinkTypeEnum type = 4;
1878
1879 // Reason metadata for this link layer connection event, rules for interpretation:
1880 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1881 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1882 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1883 // set and valid, ignore hci_ble_event
1884
1885 // HCI command associated with this event
1886 // Default: CMD_UNKNOWN
1887 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1888 // HCI event associated with this event
1889 // Default: EVT_UNKNOWN
1890 optional android.bluetooth.hci.EventEnum hci_event = 6;
1891 // HCI BLE meta event associated with this event
1892 // Default: BLE_EVT_UNKNOWN
1893 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1894 // HCI command status code if this is triggerred by hci_cmd
1895 // Default: STATUS_UNKNOWN
1896 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1897 // HCI reason code associated with this event
1898 // Default: STATUS_UNKNOWN
1899 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1900}
1901
Howard Roe103fe22019-01-17 16:52:16 -08001902/**
1903 * Logs when a module is rolled back by Watchdog.
1904 *
1905 * Logged from: Rollback Manager
1906 */
1907message WatchdogRollbackOccurred {
1908 enum RollbackType {
1909 UNKNOWN = 0;
1910 ROLLBACK_INITIATE = 1;
1911 ROLLBACK_SUCCESS = 2;
1912 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001913 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001914 }
1915 optional RollbackType rollback_type = 1;
1916
1917 optional string package_name = 2;
1918
1919 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001920
1921 enum RollbackReasonType {
1922 REASON_UNKNOWN = 0;
1923 REASON_NATIVE_CRASH = 1;
1924 REASON_EXPLICIT_HEALTH_CHECK = 2;
1925 REASON_APP_CRASH = 3;
1926 REASON_APP_NOT_RESPONDING = 4;
Gavin Corkery3285d222020-01-17 19:24:22 +00001927 REASON_NATIVE_CRASH_DURING_BOOT = 5;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001928 }
1929 optional RollbackReasonType rollback_reason = 4;
1930
1931 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1932 // is initiated. Empty if the package is unknown.
1933 optional string failing_package_name = 5;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08001934
1935 optional TrainExperimentIds experiment_ids = 6 [(log_mode) = MODE_BYTES];
Howard Roe103fe22019-01-17 16:52:16 -08001936}
1937
Jack Hec27040a2019-01-09 20:54:41 -08001938/**
1939 * Logs when there is a change in Bluetooth A2DP playback state
1940 *
1941 * Logged from:
1942 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1943 */
1944message BluetoothA2dpPlaybackStateChanged {
1945 // An identifier that can be used to match events for this device.
1946 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1947 // Salt: Randomly generated 256 bit value
1948 // Hash algorithm: HMAC-SHA256
1949 // Size: 32 byte
1950 // Default: null or empty if the device identifier is not known
1951 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1952 // Current playback state
1953 // Default: PLAYBACK_STATE_UNKNOWN
1954 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1955 // Current audio coding mode
1956 // Default: AUDIO_CODING_MODE_UNKNOWN
1957 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1958}
1959
1960/**
1961 * Logs when there is a change in A2DP codec config for a particular remote device
1962 *
1963 * Logged from:
1964 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1965 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1966 */
1967message BluetoothA2dpCodecConfigChanged {
1968 // An identifier that can be used to match events for this device.
1969 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1970 // Salt: Randomly generated 256 bit value
1971 // Hash algorithm: HMAC-SHA256
1972 // Size: 32 byte
1973 // Default: null or empty if the device identifier is not known
1974 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1975 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1976 // Default SOURCE_CODEC_TYPE_INVALID
1977 optional int32 codec_type = 2;
1978 // Codec priroity, the higher the more preferred, -1 for disabled
1979 // Default: CODEC_PRIORITY_DEFAULT
1980 optional int32 codec_priority = 3;
1981 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1982 // Default: SAMPLE_RATE_NONE
1983 optional int32 sample_rate = 4;
1984 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1985 // Default: BITS_PER_SAMPLE_NONE
1986 optional int32 bits_per_sample = 5;
1987 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1988 // Default: CHANNEL_MODE_NONE
1989 optional int32 channel_mode = 6;
1990 // Codec specific values
1991 // Default 0
1992 optional int64 codec_specific_1 = 7;
1993 optional int64 codec_specific_2 = 8;
1994 optional int64 codec_specific_3 = 9;
1995 optional int64 codec_specific_4 = 10;
1996}
1997
1998/**
1999 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
2000 * Each codec's capability is logged separately due to statsd restriction
2001 *
2002 * Logged from:
2003 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
2004 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
2005 */
2006message BluetoothA2dpCodecCapabilityChanged {
2007 // An identifier that can be used to match events for this device.
2008 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2009 // Salt: Randomly generated 256 bit value
2010 // Hash algorithm: HMAC-SHA256
2011 // Size: 32 byte
2012 // Default: null or empty if the device identifier is not known
2013 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2014 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
2015 // Default SOURCE_CODEC_TYPE_INVALID
2016 optional int32 codec_type = 2;
2017 // Codec priroity, the higher the more preferred, -1 for disabled
2018 // Default: CODEC_PRIORITY_DEFAULT
2019 optional int32 codec_priority = 3;
2020 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
2021 // in BluetoothCodecConfig
2022 // Default: empty and SAMPLE_RATE_NONE for individual item
2023 optional int32 sample_rate = 4;
2024 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
2025 // in BluetoothCodecConfig
2026 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
2027 optional int32 bits_per_sample = 5;
2028 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
2029 // BluetoothCodecConfig
2030 // Default: empty and CHANNEL_MODE_NONE for individual item
2031 optional int32 channel_mode = 6;
2032 // Codec specific values
2033 // Default 0
2034 optional int64 codec_specific_1 = 7;
2035 optional int64 codec_specific_2 = 8;
2036 optional int64 codec_specific_3 = 9;
2037 optional int64 codec_specific_4 = 10;
2038}
2039
2040/**
2041 * Logs when A2DP failed to read from PCM source.
2042 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
2043 *
2044 * Logged from:
2045 * system/bt
2046 */
2047message BluetoothA2dpAudioUnderrunReported {
2048 // An identifier that can be used to match events for this device.
2049 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2050 // Salt: Randomly generated 256 bit value
2051 // Hash algorithm: HMAC-SHA256
2052 // Size: 32 byte
2053 // Default: null or empty if the device identifier is not known
2054 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2055 // Encoding interval in nanoseconds
2056 // Default: 0
2057 optional int64 encoding_interval_nanos = 2;
2058 // Number of bytes of PCM data that could not be read from the source
2059 // Default: 0
2060 optional int32 num_missing_pcm_bytes = 3;
2061}
2062
2063/**
2064 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
2065 * buffer queue is full and we have to drop data
2066 *
2067 * Logged from:
2068 * system/bt
2069 */
2070message BluetoothA2dpAudioOverrunReported {
2071 // An identifier that can be used to match events for this device.
2072 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2073 // Salt: Randomly generated 256 bit value
2074 // Hash algorithm: HMAC-SHA256
2075 // Size: 32 byte
2076 // Default: null or empty if the device identifier is not known
2077 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2078 // Encoding interval in nanoseconds
2079 // Default: 0
2080 optional int64 encoding_interval_nanos = 2;
2081 // Number of buffers dropped in this event
2082 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
2083 // Default: 0
2084 optional int32 num_dropped_buffers = 3;
2085 // Number of encoded buffers dropped in this event
2086 // Default 0
2087 optional int32 num_dropped_encoded_frames = 4;
2088 // Number of encoded bytes dropped in this event
2089 // Default: 0
2090 optional int32 num_dropped_encoded_bytes = 5;
2091}
2092
2093/**
2094 * Logs when we receive reports regarding a device's RSSI value
2095 *
2096 * Logged from:
2097 * system/bt
2098 */
2099message BluetoothDeviceRssiReported {
2100 // An identifier that can be used to match events for this device.
2101 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2102 // Salt: Randomly generated 256 bit value
2103 // Hash algorithm: HMAC-SHA256
2104 // Size: 32 byte
2105 // Default: null or empty if the device identifier is not known
2106 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2107 // Connection handle of this connection if available
2108 // Range: 0x0000 - 0x0EFF (12 bits)
2109 // Default: 0xFFFF if the handle is unknown
2110 optional int32 connection_handle = 2;
2111 // HCI command status code if this is triggerred by hci_cmd
2112 // Default: STATUS_UNKNOWN
2113 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2114 // BR/EDR
2115 // Range: -128 ≤ N ≤ 127 (signed integer)
2116 // Units: dB
2117 // LE:
2118 // Range: -127 to 20, 127 (signed integer)
2119 // Units: dBm
2120 // Invalid when an out of range value is reported
2121 optional int32 rssi = 4;
2122}
2123
2124/**
2125 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
2126 *
2127 * Logged from:
2128 * system/bt
2129 */
2130message BluetoothDeviceFailedContactCounterReported {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Connection handle of this connection if available
2139 // Range: 0x0000 - 0x0EFF (12 bits)
2140 // Default: 0xFFFF if the handle is unknown
2141 optional int32 connection_handle = 2;
2142 // HCI command status code if this is triggerred by hci_cmd
2143 // Default: STATUS_UNKNOWN
2144 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
2145 // Number of consecutive failed contacts for a connection corresponding to the Handle
2146 // Range: uint16_t, 0-0xFFFF
2147 // Default: 0xFFFFF
2148 optional int32 failed_contact_counter = 4;
2149}
2150
2151/**
2152 * Logs when we receive reports regarding the tranmit power level used for a specific connection
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothDeviceTxPowerLevelReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 // Size: 32 byte
2163 // Default: null or empty if the device identifier is not known
2164 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2165 // Connection handle of this connection if available
2166 // Range: 0x0000 - 0x0EFF (12 bits)
2167 // Default: 0xFFFF if the handle is unknown
2168 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08002169 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08002170 // Default: STATUS_UNKNOWN
2171 optional android.bluetooth.hci.StatusEnum hci_status = 3;
2172 // Range: -30 ≤ N ≤ 20
2173 // Units: dBm
2174 // Invalid when an out of range value is reported
2175 optional int32 transmit_power_level = 4;
2176}
Jack Heab86dbd22018-12-18 15:43:27 -08002177
Tej Singh5d991e12018-03-09 19:48:11 -08002178/**
Jack He1021a612019-01-20 21:22:46 -08002179 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
2180 * receiving an HCI command from the host
2181 *
2182 * Logged from: system/bt
2183 */
2184message BluetoothHciTimeoutReported {
2185 // HCI command associated with this event
2186 // Default: CMD_UNKNOWN
2187 optional android.bluetooth.hci.CommandEnum hci_command = 1;
2188}
2189
2190/**
2191 * Logs when we receive Bluetooth Link Quality Report event from the controller
2192 * See Android Bluetooth HCI specification for more details
2193 *
2194 * Note: all count and bytes field are counted since last event
2195 *
2196 * Logged from: system/bt
2197 */
2198message BluetoothQualityReportReported {
2199 // Quality report ID
2200 // Original type: uint8_t
2201 // Default: BQR_ID_UNKNOWN
2202 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2203 // Packet type of the connection
2204 // Original type: uint8_t
2205 // Default: BQR_PACKET_TYPE_UNKNOWN
2206 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2207 // Connection handle of the connection
2208 // Original type: uint16_t
2209 optional int32 connection_handle = 3;
2210 // Performing Role for the connection
2211 // Original type: uint8_t
2212 optional int32 connection_role = 4;
2213 // Current Transmit Power Level for the connection. This value is the same as the controller's
2214 // response to the HCI_Read_Transmit_Power_Level HCI command
2215 // Original type: uint8_t
2216 optional int32 tx_power_level = 5;
2217 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2218 // absolute receiver signal strength value
2219 // Original type: int8_t
2220 optional int32 rssi = 6;
2221 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2222 // channels used by the link currently
2223 // Original type: uint8_t
2224 optional int32 snr = 7;
2225 // Indicates the number of unused channels in AFH_channel_map
2226 // Original type: uint8_t
2227 optional int32 unused_afh_channel_count = 8;
2228 // Indicates the number of the channels which are interfered and quality is bad but are still
2229 // selected for AFH
2230 // Original type: uint8_t
2231 optional int32 afh_select_unideal_channel_count = 9;
2232 // Current Link Supervision Timeout Setting
2233 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2234 // Original type: uint16_t
2235 optional int32 lsto = 10;
2236 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2237 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2238 // 0x01 (Piconet Clock)
2239 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2240 // Original type: uint32_t
2241 optional int64 connection_piconet_clock = 11;
2242 // The count of retransmission
2243 // Original type: uint32_t
2244 optional int64 retransmission_count = 12;
2245 // The count of no RX
2246 // Original type: uint32_t
2247 optional int64 no_rx_count = 13;
2248 // The count of NAK (Negative Acknowledge)
2249 // Original type: uint32_t
2250 optional int64 nak_count = 14;
2251 // Controller timestamp of last TX ACK
2252 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2253 // Original type: uint32_t
2254 optional int64 last_tx_ack_timestamp = 15;
2255 // The count of Flow-off (STOP)
2256 // Original type: uint32_t
2257 optional int64 flow_off_count = 16;
2258 // Controller timestamp of last Flow-on (GO)
2259 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2260 // Original type: uint32_t
2261 optional int64 last_flow_on_timestamp = 17;
2262 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2263 // Original type: uint32_t
2264 optional int64 buffer_overflow_bytes = 18;
2265 // Buffer underflow count (in byte) since last event
2266 // Original type: uint32_t
2267 optional int64 buffer_underflow_bytes = 19;
2268}
2269
2270/**
2271 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2272 *
2273 * Notes:
2274 * - Each event can be partially filled as we might learn different pieces of device
2275 * information at different time
2276 * - Multiple device info events can be combined to give more complete picture
2277 * - When multiple device info events tries to describe the same information, the
2278 * later one wins
2279 *
2280 * Logged from:
2281 * packages/apps/Bluetooth
2282 */
Jack Heaea26982019-04-04 11:19:48 -07002283message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002284 // An identifier that can be used to match events for this device.
2285 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2286 // Salt: Randomly generated 256 bit value
2287 // Hash algorithm: HMAC-SHA256
2288 // Size: 32 byte
2289 // Default: null or empty if the device identifier is not known
2290 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2291 // Where is this device info obtained from
2292 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2293 // Name of the data source
2294 // For EXTERNAL: package name of the data source
2295 // For INTERNAL: null for general case, component name otherwise
2296 optional string source_name = 3;
2297 // Name of the manufacturer of this device
2298 optional string manufacturer = 4;
2299 // Model of this device
2300 optional string model = 5;
2301 // Hardware version of this device
2302 optional string hardware_version = 6;
2303 // Software version of this device
2304 optional string software_version = 7;
2305}
2306
2307/**
2308 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2309 * device, as documented by the Bluetooth Core HCI specification
2310 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2311 * Vol 2, Part E, Page 1118
2312 *
2313 * Logged from:
2314 * system/bt
2315 */
2316message BluetoothRemoteVersionInfoReported {
2317 // Connection handle of the connection
2318 // Original type: uint16_t
2319 optional int32 connection_handle = 1;
2320 // HCI command status code
2321 // Default: STATUS_UNKNOWN
2322 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2323 // 1 byte Version of current LMP in the remote controller
2324 optional int32 lmp_version = 3;
2325 // 2 bytes LMP manufacturer code of the remote controller
2326 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2327 optional int32 lmp_manufacturer_code = 4;
2328 // 4 bytes subversion of the LMP in the remote controller
2329 optional int32 lmp_subversion = 5;
2330}
2331
2332/**
2333 * Logs when certain Bluetooth SDP attributes are discovered
2334 * Constant definitions are from:
2335 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2336 *
2337 * Current logged attributes:
2338 * - BluetoothProfileDescriptorList
2339 * - Supported Features Bitmask
2340 *
2341 * Logged from:
2342 * system/bt
2343 */
2344message BluetoothSdpAttributeReported {
2345 // An identifier that can be used to match events for this device.
2346 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2347 // Salt: Randomly generated 256 bit value
2348 // Hash algorithm: HMAC-SHA256
2349 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2350 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2351 // Original type: uint16_t
2352 optional int32 protocol_uuid = 2;
2353 // Short form UUIDs used to identify Bluetooth SDP attribute types
2354 // Original type: uint16_t
2355 optional int32 attribute_id = 3;
2356 // Attribute value for the particular attribute
2357 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2358}
2359
2360/**
2361 * Logs when bond state of a Bluetooth device changes
2362 *
2363 * Logged from:
2364 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2365 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2366 */
2367message BluetoothBondStateChanged {
2368 // An identifier that can be used to match events for this device.
2369 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2370 // Salt: Randomly generated 256 bit value
2371 // Hash algorithm: HMAC-SHA256
2372 // Size: 32 byte
2373 // Default: null or empty if the device identifier is not known
2374 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2375 // Preferred transport type to remote dual mode device
2376 // Default: TRANSPORT_AUTO means no preference
2377 optional android.bluetooth.TransportTypeEnum transport = 2;
2378 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2379 // Default: UNKNOWN
2380 optional android.bluetooth.DeviceTypeEnum type = 3;
2381 // Current bond state (NONE, BONDING, BONDED)
2382 // Default: BOND_STATE_UNKNOWN
2383 optional android.bluetooth.BondStateEnum bond_state = 4;
2384 // Bonding sub state
2385 // Default: BOND_SUB_STATE_UNKNOWN
2386 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2387 // Unbond Reason
2388 // Default: UNBOND_REASON_UNKNOWN
2389 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2390}
2391
2392/**
2393 * Logs there is an event related Bluetooth classic pairing
2394 *
2395 * Logged from:
2396 * system/bt
2397 */
2398message BluetoothClassicPairingEventReported {
2399 // An identifier that can be used to match events for this device.
2400 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2401 // Salt: Randomly generated 256 bit value
2402 // Hash algorithm: HMAC-SHA256
2403 // Size: 32 byte
2404 // Default: null or empty if the device identifier is not known
2405 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2406 // Connection handle of this connection if available
2407 // Range: 0x0000 - 0x0EFF (12 bits)
2408 // Default: 0xFFFF if the handle is unknown
2409 optional int32 connection_handle = 2;
2410 // HCI command associated with this event
2411 // Default: CMD_UNKNOWN
2412 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2413 // HCI event associated with this event
2414 // Default: EVT_UNKNOWN
2415 optional android.bluetooth.hci.EventEnum hci_event = 4;
2416 // HCI command status code if this is triggerred by hci_cmd
2417 // Default: STATUS_UNKNOWN
2418 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2419 // HCI reason code associated with this event
2420 // Default: STATUS_UNKNOWN
2421 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002422 // A status value related to this specific event
2423 // Default: 0
2424 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002425}
2426
2427/**
2428 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2429 *
2430 * Logged from:
2431 * system/bt
2432 */
2433message BluetoothSmpPairingEventReported {
2434 // An identifier that can be used to match events for this device.
2435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2436 // Salt: Randomly generated 256 bit value
2437 // Hash algorithm: HMAC-SHA256
2438 // Size: 32 byte
2439 // Default: null or empty if the device identifier is not known
2440 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2441 // SMP command sent or received over L2CAP
2442 // Default: CMD_UNKNOWN
2443 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2444 // Whether this command is sent or received
2445 // Default: DIRECTION_UNKNOWN
2446 optional android.bluetooth.DirectionEnum direction = 3;
2447 // SMP failure reason code
2448 // Default: PAIRING_FAIL_REASON_DEFAULT
2449 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2450}
2451
2452/**
Jack He815cdba2019-01-30 17:24:55 -08002453 * Logs when a Bluetooth socket’s connection state changed
2454 *
2455 * Logged from:
2456 * system/bt
2457 */
2458message BluetoothSocketConnectionStateChanged {
2459 // An identifier that can be used to match events for this device.
2460 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2461 // Salt: Randomly generated 256 bit value
2462 // Hash algorithm: HMAC-SHA256
2463 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002464 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002465 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002466 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002467 // Default 0 when unknown or don't care
2468 optional int32 port = 2;
2469 // Socket type as mentioned in
2470 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2471 // Default: SOCKET_TYPE_UNKNOWN
2472 optional android.bluetooth.SocketTypeEnum type = 3;
2473 // Socket connection state
2474 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2475 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2476 // Number of bytes sent to remote device during this connection
2477 optional int64 tx_bytes = 5;
2478 // Number of bytes received from remote device during this connection
2479 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002480 // Socket owner's UID
2481 optional int32 uid = 7 [(is_uid) = true];
2482 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2483 // |port| must be spawned by |server_port|
2484 // Default 0 when unknown or don't care
2485 optional int32 server_port = 8;
2486 // Whether this is a server listener socket
2487 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002488}
2489
2490/**
Jack He71426802019-04-02 13:32:52 -07002491 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2492 *
2493 * Logged from:
2494 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2495 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2496 *
2497 */
2498message BluetoothClassOfDeviceReported {
2499 // An identifier that can be used to match events for this device.
2500 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2501 // Salt: Randomly generated 256 bit value
2502 // Hash algorithm: HMAC-SHA256
2503 // Size: 32 byte
2504 // Default: null or empty if this is a server listener socket
2505 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2506 // Class of Device (CoD) value including both Major, Minor device class and service class
2507 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2508 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2509 // Default: 0
2510 optional int32 class_of_device = 2;
2511}
2512
2513/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002514 * Logs when something is plugged into or removed from the USB-C connector.
2515 *
2516 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002517 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002518 */
2519message UsbConnectorStateChanged {
2520 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002521 STATE_DISCONNECTED = 0;
2522 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002523 }
2524 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002525 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002526 // Last active session in ms.
2527 // 0 when the port is in connected state.
2528 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002529}
2530
2531/**
2532 * Logs the reported speaker impedance.
2533 *
2534 * Logged from:
2535 * Vendor audio implementation.
2536 */
2537message SpeakerImpedanceReported {
2538 optional int32 speaker_location = 1;
2539 optional int32 impedance = 2;
2540}
2541
2542/**
2543 * Logs the report of a failed hardware.
2544 *
2545 * Logged from:
2546 * Vendor HALs.
2547 *
2548 */
2549message HardwareFailed {
2550 enum HardwareType {
2551 HARDWARE_FAILED_UNKNOWN = 0;
2552 HARDWARE_FAILED_MICROPHONE = 1;
2553 HARDWARE_FAILED_CODEC = 2;
2554 HARDWARE_FAILED_SPEAKER = 3;
2555 HARDWARE_FAILED_FINGERPRINT = 4;
2556 }
2557 optional HardwareType hardware_type = 1;
2558
Maggie White6dcd8572019-01-31 14:11:50 -08002559 /**
2560 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002561 * the same hardware_type. The specific locations are vendor defined integers,
2562 * referring to board-specific numbering schemes.
2563 */
2564 optional int32 hardware_location = 2;
2565
Maggie White6dcd8572019-01-31 14:11:50 -08002566 /**
2567 * failure_code is specific to the HardwareType of the failed hardware.
2568 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002569 */
Maggie White6dcd8572019-01-31 14:11:50 -08002570 enum HardwareErrorCode {
2571 UNKNOWN = 0;
2572 COMPLETE = 1;
2573 SPEAKER_HIGH_Z = 2;
2574 SPEAKER_SHORT = 3;
2575 FINGERPRINT_SENSOR_BROKEN = 4;
2576 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002577 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002578 }
2579 optional int32 failure_code = 3;
2580}
2581
2582/**
2583 * Log an event when the device has been physically dropped.
2584 * Reported from the /vendor partition.
2585 */
2586message PhysicalDropDetected {
2587 // Confidence that the event was actually a drop, 0 -> 100
2588 optional int32 confidence_pctg = 1;
2589 // Peak acceleration of the drop, in 1/1000s of a g.
2590 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002591 // Duration of freefall in ms
2592 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002593}
2594
2595/**
2596 * Log bucketed battery charge cycles.
2597 *
2598 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002599 * a given charge point. For example, if 10 cycle buckets are
2600 * initialized, bucket 1 is the lowest 1/10th of the battery,
2601 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002602 *
2603 * Logged from:
2604 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2605 */
2606message ChargeCyclesReported {
2607 optional int32 cycle_bucket_1 = 1;
2608 optional int32 cycle_bucket_2 = 2;
2609 optional int32 cycle_bucket_3 = 3;
2610 optional int32 cycle_bucket_4 = 4;
2611 optional int32 cycle_bucket_5 = 5;
2612 optional int32 cycle_bucket_6 = 6;
2613 optional int32 cycle_bucket_7 = 7;
2614 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002615 optional int32 cycle_bucket_9 = 9;
2616 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002617}
2618
2619/**
Howard Roa46b6582018-09-18 16:45:02 -07002620 * Log battery health snapshot.
2621 *
2622 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2623 * are snapshotted periodically over 24hrs.
2624 */
2625message BatteryHealthSnapshot {
2626 enum BatterySnapshotType {
2627 UNKNOWN = 0;
2628 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2629 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2630 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2631 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2632 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2633 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2634 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2635 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2636 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2637 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2638 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2639 }
2640 optional BatterySnapshotType type = 1;
2641 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002642 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002643 // Voltage Battery Voltage, in microVolts.
2644 optional int32 voltage_micro_volt = 3;
2645 // Current Battery current, in microAmps.
2646 optional int32 current_micro_amps = 4;
2647 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2648 optional int32 open_circuit_micro_volt = 5;
2649 // Resistance Battery Resistance, in microOhms.
2650 optional int32 resistance_micro_ohm = 6;
2651 // Level Battery Level, as % of full.
2652 optional int32 level_percent = 7;
2653}
2654
2655/**
2656 * Log slow I/O operations on the primary storage.
2657 */
2658message SlowIo {
2659 // Classifications of IO Operations.
2660 enum IoOperation {
2661 UNKNOWN = 0;
2662 READ = 1;
2663 WRITE = 2;
2664 UNMAP = 3;
2665 SYNC = 4;
2666 }
2667 optional IoOperation operation = 1;
2668
2669 // The number of slow IO operations of this type over 24 hours.
2670 optional int32 count = 2;
2671}
2672
2673/**
2674 * Log battery caused shutdown with the last recorded voltage.
2675 */
2676message BatteryCausedShutdown {
2677 // The last recorded battery voltage prior to shutdown.
2678 optional int32 last_recorded_micro_volt = 1;
2679}
2680
2681/**
Tej Singha72344992019-04-17 18:55:08 -07002682 * Logs when ThermalService receives throttling events.
2683 *
2684 * Logged from:
2685 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2686 */
2687message ThermalThrottlingSeverityStateChanged {
2688 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2689 optional android.os.TemperatureTypeEnum sensor_type = 1;
2690
2691 // The name of the temperature source. Eg. CPU0
2692 optional string sensor_name = 2;
2693
2694 // Temperature in tenths of a degree C.
2695 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2696 optional int32 temperature_deci_celsius = 3;
2697
2698 // Relative severity of the throttling, see enum definition.
2699 optional android.os.ThrottlingSeverityEnum severity = 4;
2700}
2701
2702/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002703 * Logs the duration of a davey (jank of >=700ms) when it occurs
2704 *
2705 * Logged from:
2706 * frameworks/base/libs/hwui/JankTracker.cpp
2707 */
2708message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002709 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002710 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002711
Tej Singhbb8554a2018-01-26 11:59:14 -08002712 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002713 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002714}
2715
2716/**
Bookatze5885242017-10-24 20:10:31 -07002717 * Logs phone signal strength changes.
2718 *
2719 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002720 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002721 */
2722message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002723 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2724 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002725}
2726
Yangster4ccebea2018-10-09 17:09:02 -07002727
2728/**
2729 * Logs when the phone state, sim state or signal strength changes
2730 *
2731 * Logged from:
2732 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2733 */
2734message PhoneServiceStateChanged {
2735 optional android.telephony.ServiceStateEnum state = 1;
2736 optional android.telephony.SimStateEnum sim_state = 2;
2737 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2738}
2739
2740/**
2741 * Logs when the phone becomes on or off.
2742 *
2743 * Logged from:
2744 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2745 */
2746message PhoneStateChanged {
2747 enum State {
2748 OFF = 0;
2749 ON = 1;
2750 }
2751 optional State state = 1;
2752}
2753
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002754message BackGesture {
2755 enum BackType {
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002756 DEFAULT_BACK_TYPE = 0;
2757 COMPLETED = 1;
2758 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2759 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2760 INCOMPLETE = 4; // Unsuccessful, for reasons other than below.
2761 INCOMPLETE_FAR_FROM_EDGE = 5; // Unsuccessful, far from the edge.
2762 INCOMPLETE_MULTI_TOUCH = 6; // Unsuccessful, multi touch.
2763 INCOMPLETE_LONG_PRESS = 7; // Unsuccessful, long press.
2764 INCOMPLETE_VERTICAL_MOVE = 8; // Unsuccessful, move vertically.
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002765 }
2766 optional BackType type = 1;
2767
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002768 optional int32 y_coordinate = 2 [deprecated = true]; // y coordinate for ACTION_DOWN event
2769 optional int32 start_x = 4; // X coordinate for ACTION_DOWN event.
2770 optional int32 start_y = 5; // Y coordinate for ACTION_DOWN event.
2771 optional int32 end_x = 6; // X coordinate for ACTION_MOVE event.
2772 optional int32 end_y = 7; // Y coordinate for ACTION_MOVE event.
2773 optional int32 left_boundary = 8; // left edge width + left inset
2774 optional int32 right_boundary = 9; // screen width - (right edge width + right inset)
2775
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002776 enum WindowHorizontalLocation {
2777 DEFAULT_LOCATION = 0;
2778 LEFT = 1;
2779 RIGHT = 2;
2780 }
Maryam Karimzadehgan4f9ab822020-03-09 14:51:07 -07002781 optional WindowHorizontalLocation x_location = 3 [deprecated = true];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002782}
2783
2784message ExclusionRectStateChanged {
2785 optional string component_name = 1; // if not available, simply packageName
2786 optional int32 requested_height = 2; // px
2787 optional int32 rejected_height = 3; // px
2788
2789 enum WindowHorizontalLocation {
2790 DEFAULT_LOCATION = 0;
2791 LEFT = 1;
2792 RIGHT = 2;
2793 }
2794 optional WindowHorizontalLocation x_location = 4;
2795 optional bool landscape = 5;
2796 optional bool splitscreen = 6;
2797 optional int32 duration_millis = 7;
2798}
2799
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002800message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002801 optional android.stats.launcher.LauncherAction action = 1;
2802 optional android.stats.launcher.LauncherState src_state = 2;
2803 optional android.stats.launcher.LauncherState dst_state = 3;
2804 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002805 optional bool is_swipe_up_enabled = 5;
2806}
2807
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002808message StyleUIChanged {
2809 optional android.stats.style.Action action = 1;
2810 optional int32 color_package_hash = 2;
2811 optional int32 font_package_hash = 3;
2812 optional int32 shape_package_hash = 4;
2813 optional int32 clock_package_hash = 5;
2814 optional int32 launcher_grid = 6;
2815 optional int32 wallpaper_category_hash = 7;
2816 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002817 optional int32 color_preference = 9;
2818 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002819}
2820
David Chenc28b2bb2017-10-24 12:52:52 -07002821/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002822 * Logs when Settings UI has changed.
2823 *
2824 * Logged from:
2825 * packages/apps/Settings
2826 */
2827message SettingsUIChanged {
2828 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002829 * Where this SettingsUIChange event comes from. For example, if
2830 * it's a PAGE_VISIBLE event, where the page is opened from.
2831 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002832 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002833
2834 /**
2835 * What the UI action is.
2836 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002837 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002838
2839 /**
2840 * Where the action is happening
2841 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002842 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002843
2844 /**
2845 * What preference changed in this event.
2846 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002847 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002848
2849 /**
2850 * The new value of the changed preference.
2851 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002852 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002853}
2854
2855/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002856 * Logs basic timing information about touch events.
2857 * Reported at most every 5 minutes while device is being interacted with.
2858 *
2859 * Logged from:
2860 * frameworks/native/services/inputflinger
2861 */
2862message TouchEventReported {
2863 /**
2864 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002865 * and the standard deviation of the time spent processing touchscreen events
2866 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002867 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002868 * On supported devices, the starting point is taken during the hard interrupt inside the
2869 * kernel touch driver. On all other devices, the starting point is taken inside
2870 * the kernel's input event subsystem upon receipt of the input event.
2871 * The ending point is taken inside InputDispatcher, just after the input event
2872 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002873 */
2874 // Minimum value
2875 optional float latency_min_micros = 1;
2876 // Maximum value
2877 optional float latency_max_micros = 2;
2878 // Average value
2879 optional float latency_mean_micros = 3;
2880 // Standard deviation
2881 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002882 // Number of touch events (input_event) in this report
2883 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002884}
2885
2886/**
Philip Quinn0eded622019-01-29 12:46:28 -08002887 * Logs gesture classification and timing information for touch events.
2888 *
2889 * Logged from:
2890 * frameworks/base/core/java/android/view/GestureDetector.java
2891 * frameworks/base/core/java/android/view/View.java
2892 */
2893message TouchGestureClassified {
2894 // The source of the classification (e.g. Java class name).
2895 optional string source = 1;
2896
2897 enum Classification {
2898 UNKNOWN_CLASSIFICATION = 0;
2899 SINGLE_TAP = 1;
2900 DOUBLE_TAP = 2;
2901 LONG_PRESS = 3;
2902 DEEP_PRESS = 4;
2903 SCROLL = 5;
2904 }
2905 // The classification of the gesture.
2906 optional Classification classification = 2;
2907
2908 // The interval from the start of a touch event stream until the
2909 // classification was made.
2910 optional int32 latency_millis = 3;
2911
2912 // The distance from the location of the first touch event to the
2913 // location of the touch event when the classification was made.
2914 optional float displacement_px = 4;
2915}
2916
2917/**
David Chenc28b2bb2017-10-24 12:52:52 -07002918 * Logs that a setting was updated.
2919 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002920 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002921 * The tag and is_default allow resetting of settings to default values based on the specified
2922 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2923 */
2924message SettingChanged {
2925 // The name of the setting.
2926 optional string setting = 1;
2927
2928 // The change being imposed on this setting. May represent a number, eg "3".
2929 optional string value = 2;
2930
2931 // The new value of this setting. For most settings, this is same as value. For some settings,
2932 // value is +X or -X where X represents an element in a set. For example, if the previous value
2933 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2934 // The +/- feature is currently only used for location_providers_allowed.
2935 optional string new_value = 3;
2936
2937 // The previous value of this setting.
2938 optional string prev_value = 4;
2939
2940 // The tag used with the is_default for resetting sets of settings. This is generally null.
2941 optional string tag = 5;
2942
Bookatz90867622018-01-31 15:05:57 -08002943 // True if this setting with tag should be resettable.
2944 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002945
David Chenbd789912018-03-16 17:19:55 -07002946 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002947 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002948
2949 enum ChangeReason {
2950 UPDATED = 1; // Updated can be an insertion or an update.
2951 DELETED = 2;
2952 }
2953 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002954}
Chenjie Yub3dda412017-10-24 13:41:59 -07002955
Chenjie Yu05013b32017-11-21 10:21:41 -08002956/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002957 * Logs activity going to foreground or background
2958 *
2959 * Logged from:
2960 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2961 */
2962message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002963 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002964 optional string pkg_name = 2;
2965 optional string class_name = 3;
2966
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002967 enum State {
2968 BACKGROUND = 0;
2969 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002970 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002971 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002972}
David Chenc8a43242017-10-17 16:23:28 -07002973
2974/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002975 * Logs when a volume entered low Storage state.
2976 * Logged from:
2977 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2978 */
2979message LowStorageStateChanged {
2980 // Volume that ran out of storage.
2981 optional string volume_description = 1;
2982
2983 enum State {
2984 UNKNOWN = 0;
2985 OFF = 1;
2986 ON = 2;
2987 }
2988 optional State state = 2;
2989}
2990
2991/**
2992 * Logs when an app is downgraded.
2993 * Logged from:
2994 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2995 */
2996message AppDowngraded {
2997 optional string package_name = 1;
2998 // Size of the package (all data) before being downgraded.
2999 optional int64 size_in_bytes_before = 2;
3000 // Size of the package (all data) after being downgraded.
3001 optional int64 size_in_bytes_after = 3;
3002
3003 optional bool aggressive = 4;
3004}
3005
3006/**
3007 * Logs when an app is optimized after being downgraded.
3008 * Logged from:
3009 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
3010 */
3011message AppOptimizedAfterDowngraded {
3012 optional string package_name = 1;
3013}
3014
3015/**
Carmen Agimof6688a352019-01-30 19:36:04 +00003016 * Logs whenever an app is installed on external storage.
3017 * Logged from:
3018 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3019 */
3020message AppInstallOnExternalStorageReported {
3021 // The type of external storage.
3022 optional android.stats.storage.ExternalStorageType storage_type = 1;
3023 // The name of the package that is installed on the sd card.
3024 optional string package_name = 2;
3025}
3026
3027/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003028 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08003029 * Logged from:
3030 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3031 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003032message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07003033 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003036
3037 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003038 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08003039 optional string process_name = 3;
3040
3041 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003042 optional int32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003043
3044 optional string package_name = 5;
3045
3046 enum InstantApp {
3047 UNAVAILABLE = 0;
3048 FALSE = 1;
3049 TRUE = 2;
3050 }
3051 optional InstantApp is_instant_app = 6;
3052
3053 enum ForegroundState {
3054 UNKNOWN = 0;
3055 BACKGROUND = 1;
3056 FOREGROUND = 2;
3057 }
3058 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08003059
3060 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003061}
David Chen9e3808c2017-11-20 17:25:34 -08003062
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003063/**
3064 * Logs when a WTF (What a Terrible Failure) happened.
3065 * Logged from:
3066 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3067 */
3068message WTFOccurred {
3069 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08003070
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003071 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08003072
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003073 // The name of the process.
3074 // system_server if it is not by an app
3075 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08003076
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003077 // The pid if available. -1 means not available.
Howard Ro8e051742020-03-20 15:07:20 -07003078 optional int32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08003079
3080 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003081}
3082
3083/**
3084 * Logs when system server reports low memory.
3085 * Logged from:
3086 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3087 */
3088message LowMemReported {
3089}
3090
3091/**
3092 * Logs when an app ANR (App Not Responding) occurs.
3093 * Logged from:
3094 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
3095 */
3096message ANROccurred {
3097 optional int32 uid = 1 [(is_uid) = true];
3098
3099 optional string process_name = 2;
3100
3101 optional string short_component_name = 3;
3102
3103 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07003104
3105 enum InstantApp {
3106 UNAVAILABLE = 0;
3107 FALSE = 1;
3108 TRUE = 2;
3109 }
3110 optional InstantApp is_instant_app = 5;
3111
3112 enum ForegroundState {
3113 UNKNOWN = 0;
3114 BACKGROUND = 1;
3115 FOREGROUND = 2;
3116 }
3117 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08003118
3119 optional android.server.ErrorSource error_source = 7;
3120
3121 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08003122}
3123
Bookatza7020bd2018-08-28 16:29:35 -07003124/**
3125 * Logs when the vibrator state changes.
3126 * Logged from:
3127 * frameworks/base/services/core/java/com/android/server/VibratorService.java
3128 */
3129message VibratorStateChanged {
3130 repeated AttributionNode attribution_node = 1;
3131
3132 enum State {
3133 OFF = 0;
3134 ON = 1;
3135 }
3136 optional State state = 2;
3137
3138 // Duration (in milliseconds) requested to keep the vibrator on.
3139 // Only applicable for State == ON.
3140 optional int64 duration_millis = 3;
3141}
3142
David Chen0a368b22017-12-06 16:28:16 -08003143/*
3144 * Allows other apps to push events into statsd.
3145 * Logged from:
3146 * frameworks/base/core/java/android/util/StatsLog.java
3147 */
David Chen0b5c90c2018-01-25 16:51:49 -08003148message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08003149 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07003150 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08003151
3152 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
3153 optional int32 label = 2;
3154
3155 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
3156 // predicates for the metrics).
3157 enum State {
3158 UNKNOWN = 0;
3159 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
3160 STOP = 2;
3161 START = 3;
3162 }
3163 optional State state = 3;
3164}
3165
David Chen9e3808c2017-11-20 17:25:34 -08003166/**
Bookatz7948c872018-09-04 12:58:33 -07003167 * Logs the wall-clock time when a significant wall-clock time shift occurs.
3168 * For example, this could be due to the user manually changing the time.
3169 *
3170 * Logged from:
3171 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
3172 */
3173message WallClockTimeShifted {
3174 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
3175 optional int64 wall_clock_timestamp_millis = 1;
3176}
3177
3178/**
Bookatz8fcd09a2017-12-18 13:01:10 -08003179 * Logs when statsd detects an anomaly.
3180 *
3181 * Logged from:
3182 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
3183 */
3184message AnomalyDetected {
3185 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07003186 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08003187
Yangster-mac94e197c2018-01-02 16:03:03 -08003188 // Id of the config whose anomaly detection alert fired.
3189 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08003190
Yangster-mac94e197c2018-01-02 16:03:03 -08003191 // Id of the alert (i.e. name of the anomaly that was detected).
3192 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08003193}
3194
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003195message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003196 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003197 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003198
3199 // The app package name.
3200 optional string pkg_name = 2;
3201
3202 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003203 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003204 WARM = 1;
3205 HOT = 2;
3206 COLD = 3;
3207 }
3208 // The transition type.
3209 optional TransitionType type = 3;
3210
3211 // The activity name.
3212 optional string activity_name = 4;
3213
3214 // The name of the calling app. Empty if not set.
3215 optional string calling_pkg_name = 5;
3216
3217 // Whether the app is an instant app.
3218 optional bool is_instant_app = 6;
3219
3220 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003221 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003222
Bookatz80d11a02018-01-16 10:46:35 -08003223 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003224
David Chen0b5c90c2018-01-25 16:51:49 -08003225 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003226 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003227 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003228 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003229 optional int32 bind_application_delay_millis = 11;
3230 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003231
3232 // Empty if not set.
3233 optional string launch_token = 13;
3234
Calin Juravle759fbda2018-02-20 19:52:30 +00003235 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003236 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003237
3238 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003239 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003240}
3241
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003242message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003243 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003244 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003245
3246 // The app package name.
3247 optional string pkg_name = 2;
3248
3249 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003250 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003251 WARM = 1;
3252 HOT = 2;
3253 COLD = 3;
3254 }
3255 // The transition type.
3256 optional TransitionType type = 3;
3257
3258 // The activity name.
3259 optional string activity_name = 4;
3260}
3261
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003262message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003263 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003264 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003265
3266 // The app package name.
3267 optional string pkg_name = 2;
3268
3269 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003270 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003271 WITH_BUNDLE = 1;
3272 WITHOUT_BUNDLE = 2;
3273 }
3274 // The transition type.
3275 optional TransitionType type = 3;
3276
3277 // The activity name.
3278 optional string activity_name = 4;
3279
3280 optional bool transition_process_running = 5;
3281
3282 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003283 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003284}
3285
Bookatz8fcd09a2017-12-18 13:01:10 -08003286/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003287 * Logs a picture-in-picture action
3288 * Logged from:
3289 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3290 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3291 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3292 */
3293message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003294 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003295 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003296
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003297 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003298
Chenjie Yu52cacc62017-12-08 18:11:45 -08003299 enum State {
3300 ENTERED = 1;
3301 EXPANDED_TO_FULL_SCREEN = 2;
3302 MINIMIZED = 3;
3303 DISMISSED = 4;
3304 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003305 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003306}
3307
3308/**
Chenjie Yue8904192017-12-08 19:12:57 -08003309 * Logs overlay action
3310 * Logged from:
3311 * services/core/java/com/android/server/wm/Session.java
3312 */
3313message OverlayStateChanged {
tsaichristine5adc7e02020-01-14 17:07:39 -08003314 optional int32 uid = 1 [(state_field_option).option = PRIMARY_FIELD, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003315
tsaichristine5adc7e02020-01-14 17:07:39 -08003316 optional string package_name = 2 [(state_field_option).option = PRIMARY_FIELD];
Chenjie Yue8904192017-12-08 19:12:57 -08003317
3318 optional bool using_alert_window = 3;
3319
3320 enum State {
3321 ENTERED = 1;
3322 EXITED = 2;
3323 }
tsaichristine5adc7e02020-01-14 17:07:39 -08003324 optional State state = 4 [
3325 (state_field_option).option = EXCLUSIVE_STATE,
3326 (state_field_option).nested = false,
3327 (state_field_option).default_state_value = 2
3328 ];
Chenjie Yue8904192017-12-08 19:12:57 -08003329}
3330
Adam Bookatz38767932020-02-05 12:13:40 -08003331/**
Chenjie Yuccfe6452018-01-30 11:33:21 -08003332 * Logs foreground service starts and stops.
3333 * Note that this is not when a service starts or stops, but when it is
3334 * considered foreground.
3335 * Logged from
Adam Bookatz38767932020-02-05 12:13:40 -08003336 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
Chenjie Yuccfe6452018-01-30 11:33:21 -08003337 */
3338message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003339 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003340 // package_name + "/" + class_name
3341 optional string short_name = 2;
3342
3343 enum State {
3344 ENTER = 1;
3345 EXIT = 2;
3346 }
3347 optional State state = 3;
Adam Bookatz38767932020-02-05 12:13:40 -08003348
3349 // Whether the fgs is allowed while-in-use permissions, i.e. is considered 'in-use' to the user.
3350 // (If the fgs was started while the app wasn't TOP it usually will be denied these permissions)
3351 optional bool allow_while_in_use_permission = 4;
3352}
3353
3354/**
3355 * Logs the number of times a uid accesses a sensitive AppOp during a foreground service session.
3356 * A foreground service session is any continuous period during which the uid holds at least one
3357 * foreground service; the atom will be pushed when the uid no longer holds any foreground services.
3358 * Accesses initiated while the uid is in the TOP state are ignored.
3359 * Sessions with no attempted accesses are not logged.
3360 * Logged from
3361 * frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3362 */
3363message ForegroundServiceAppOpSessionEnded {
3364 optional int32 uid = 1 [(is_uid) = true];
3365
3366 // The operation's name.
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00003367 // Only following four ops are logged
3368 // COARSE_LOCATION = 0
3369 // FINE_LOCATION = 1
3370 // CAMERA = 26
3371 // RECORD_AUDIO = 27
3372 optional android.app.AppOpEnum app_op_name = 2 [default = APP_OP_NONE];
Adam Bookatz38767932020-02-05 12:13:40 -08003373
3374 // The uid's permission mode for accessing the AppOp during this fgs session.
3375 enum Mode {
3376 MODE_UNKNOWN = 0;
3377 MODE_ALLOWED = 1; // Always allowed
3378 MODE_IGNORED = 2; // Denied
3379 MODE_FOREGROUND = 3; // Allow-while-in-use (or allowed-one-time)
3380 }
3381 optional Mode app_op_mode = 3;
3382
3383 // Number of times this AppOp was requested and allowed.
3384 optional int32 count_ops_accepted = 4;
3385 // Number of times this AppOp was requested but denied.
3386 optional int32 count_ops_rejected = 5;
Chenjie Yuccfe6452018-01-30 11:33:21 -08003387}
3388
Chenjie Yue8904192017-12-08 19:12:57 -08003389/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003390 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3391 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3392 * attributed back to the parent (host) uid. One example is Chrome.
3393 *
3394 * Logged from:
3395 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3396 */
3397message IsolatedUidChanged {
3398 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003399 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003400 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003401 optional int32 parent_uid = 1;
3402
3403 optional int32 isolated_uid = 2;
3404
3405 // We expect an isolated uid to be removed before if it's used for another parent uid.
3406 enum Event {
3407 REMOVED = 0;
3408 CREATED = 1;
3409 }
3410 optional Event event = 3;
3411}
3412
3413/*
3414 * Logs the reception of an incoming network packet causing the main system to wake up for
3415 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3416 * and processed by WakeupController.cpp.
3417 */
3418message PacketWakeupOccurred {
3419 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3420 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003421 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003422 // The interface name on which the packet was received.
3423 optional string iface = 2;
3424 // The ethertype value of the packet.
3425 optional int32 ethertype = 3;
3426 // String representation of the destination MAC address of the packet.
3427 optional string destination_hardware_address = 4;
3428 // String representation of the source address of the packet if this was an IP packet.
3429 optional string source_ip = 5;
3430 // String representation of the destination address of the packet if this was an IP packet.
3431 optional string destination_ip = 6;
3432 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3433 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3434 // families.
3435 optional int32 ip_next_header = 7;
3436 // The source port if this was a TCP or UDP packet.
3437 optional int32 source_port = 8;
3438 // The destination port if this was a TCP or UDP packet.
3439 optional int32 destination_port = 9;
3440}
3441
3442/*
3443 * Logs the memory stats for an app on startup.
3444 * Logged from:
3445 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3446 */
3447message AppStartMemoryStateCaptured {
3448 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003449 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003450
3451 // The process name.
3452 optional string process_name = 2;
3453
3454 // The activity name.
3455 optional string activity_name = 3;
3456
3457 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003458 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003459
3460 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003461 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003462
3463 // RSS
3464 optional int64 rss_in_bytes = 6;
3465
3466 // CACHE
3467 optional int64 cache_in_bytes = 7;
3468
3469 // SWAP
3470 optional int64 swap_in_bytes = 8;
3471}
3472
3473/*
3474 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3475 * for LMK event.
3476 * Logged from:
3477 * system/core/lmkd/lmkd.c
3478 */
3479message LmkStateChanged {
3480 enum State {
3481 UNKNOWN = 0;
3482 START = 1;
3483 STOP = 2;
3484 }
3485 optional State state = 1;
3486}
3487
3488/*
3489 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3490 * Logged from:
3491 * system/core/lmkd/lmkd.c
3492 */
3493message LmkKillOccurred {
3494 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003496
3497 // The process name.
3498 optional string process_name = 2;
3499
3500 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003501 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003502
3503 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003504 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003505
3506 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003507 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003508
3509 // RSS
3510 optional int64 rss_in_bytes = 6;
3511
3512 // CACHE
3513 optional int64 cache_in_bytes = 7;
3514
3515 // SWAP
3516 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003517
3518 // The elapsed real time of start of the process.
3519 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003520
3521 // Min oom adj score considered by lmkd.
3522 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003523}
3524
Rajeev Kumar51b54602018-03-01 12:18:26 -08003525/*
3526 * Logs when the ActivityManagerService detects that an app died.
3527 *
3528 * Logged from:
3529 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3530 */
3531message AppDied {
3532 // timestamp(elapsedRealtime) of record creation
tsaichristine5adc7e02020-01-14 17:07:39 -08003533 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003534}
3535
Howard Ro21a039c2018-08-06 14:55:47 -07003536/**
3537 * An atom for generic metrics logging. Available from Android Q.
3538 */
3539message GenericAtom {
3540 // The uid of the application that sent this custom atom.
3541 optional int32 uid = 1 [(is_uid) = true];
3542
3543 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003544 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003545}
3546
Tej Singhd6d6d772018-09-05 17:41:25 -07003547/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003548 * Atom for simple logging of user interaction and impression events, such as "the user touched
3549 * this button" or "this dialog was displayed".
3550 * Keep the UI event stream clean: don't use for system or background events.
3551 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003552 *
3553 * Logged from:
3554 * frameworks/base/services/core/java/com/android/server/
3555 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003556 */
3557message UiEventReported {
3558 // The event_id.
3559 optional int32 event_id = 1;
3560 // The event's source or target uid and package, if applicable.
3561 // For example, the package posting a notification, or the destination package of a share.
3562 optional int32 uid = 2 [(is_uid) = true];
3563 optional string package_name = 3;
Will Brockman12282ac2019-12-20 09:37:42 -05003564 // An identifier used to disambiguate which logs refer to a particular instance of some
3565 // UI element. Useful when there might be multiple instances simultaneously active.
3566 optional int32 instance_id = 4;
Will Brockmanfbaa7912019-10-24 15:15:09 -04003567}
3568
3569/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003570 * Reports a notification was created or updated.
3571 *
3572 * Logged from:
3573 * frameworks/base/services/core/java/com/android/server/notification/
3574 */
3575message NotificationReported {
3576 // The event_id (as for UiEventReported).
3577 optional int32 event_id = 1;
3578 // The notifying app's uid and package.
3579 optional int32 uid = 2 [(is_uid) = true];
3580 optional string package_name = 3;
3581 // A small system-assigned identifier for the notification.
3582 // Locally probably-unique, but expect collisions across users and/or days.
3583 optional int32 instance_id = 4;
Will Brockman7614f6962020-02-10 19:43:03 -05003584 optional int32 notification_id_hash = 5; // Small hash of the app-assigned notif ID + tag
3585 optional int32 channel_id_hash = 6; // Small hash of app-assigned channel ID
Will Brockman079fdaa2020-01-12 16:45:03 -05003586
3587 // Grouping information
Will Brockman7614f6962020-02-10 19:43:03 -05003588 optional int32 group_id_hash = 7; // Small hash of the group ID of the notification
3589 optional int32 group_instance_id = 8; // Instance_id of the group-summary notification
3590 optional bool is_group_summary = 9; // Tags the group-summary notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003591
3592 // Attributes
Will Brockman7614f6962020-02-10 19:43:03 -05003593 optional string category = 10; // App-assigned notification category (API-defined strings)
3594 optional int32 style = 11; // App-assigned notification style
3595 optional int32 num_people = 12; // Number of Person records attached to the notification
Will Brockman079fdaa2020-01-12 16:45:03 -05003596
3597 // Ordering, importance and interruptiveness
3598
Will Brockman7614f6962020-02-10 19:43:03 -05003599 optional int32 position = 13; // Position in NotificationManager's list
Will Brockman079fdaa2020-01-12 16:45:03 -05003600
Will Brockman7614f6962020-02-10 19:43:03 -05003601 optional android.stats.sysui.NotificationImportance importance = 14;
3602 optional int32 alerting = 15; // Bitfield, 1=buzz 2=beep 4=blink
Will Brockman079fdaa2020-01-12 16:45:03 -05003603
3604 enum NotificationImportanceExplanation {
3605 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3606 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3607 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3608 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3609 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3610 // Like _APP, but based on pre-channels priority signal.
3611 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3612 }
3613
Will Brockman7614f6962020-02-10 19:43:03 -05003614 optional NotificationImportanceExplanation importance_source = 16;
3615 optional android.stats.sysui.NotificationImportance importance_initial = 17;
3616 optional NotificationImportanceExplanation importance_initial_source = 18;
3617 optional android.stats.sysui.NotificationImportance importance_asst = 19;
3618 optional int32 assistant_hash = 20;
3619 optional float assistant_ranking_score = 21;
Will Brockman079fdaa2020-01-12 16:45:03 -05003620}
3621
3622message Notification {
3623 // The notifying app's uid and package.
3624 optional int32 uid = 1 [(is_uid) = true];
3625 optional string package_name = 2;
3626 // A small system-assigned identifier for the notification.
3627 optional int32 instance_id = 3;
3628
3629 // Grouping information.
3630 optional int32 group_instance_id = 4;
3631 optional bool is_group_summary = 5;
3632
3633 // The section of the shade that the notification is in.
3634 // See NotificationSectionsManager.PriorityBucket.
3635 enum NotificationSection {
3636 SECTION_UNKNOWN = 0;
Will Brockmane3753842020-03-03 16:29:34 -05003637 SECTION_HEADS_UP = 1;
3638 SECTION_PEOPLE = 2;
3639 SECTION_ALERTING = 3;
3640 SECTION_SILENT = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003641 }
3642 optional NotificationSection section = 6;
3643}
3644
3645message NotificationList {
3646 repeated Notification notifications = 1; // An ordered sequence of notifications.
3647}
3648
3649/**
3650 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3651 *
3652 * Logged from:
3653 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3654 */
3655message NotificationPanelReported {
3656 // The event_id (as for UiEventReported).
3657 optional int32 event_id = 1;
3658 optional int32 num_notifications = 2;
3659 // The notifications in the panel, in the order that they appear there.
3660 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3661}
3662
3663/**
3664 * Reports a notification channel, or channel group, was created, updated, or deleted.
3665 *
3666 * Logged from:
3667 * frameworks/base/services/core/java/com/android/server/notification/
3668 */
3669message NotificationChannelModified {
3670 // The event_id (as for UiEventReported).
3671 optional int32 event_id = 1;
3672 // The notifying app's uid and package.
3673 optional int32 uid = 2 [(is_uid) = true];
3674 optional string package_name = 3;
Will Brockman7fb79442020-02-27 14:34:24 -05003675 // Hash of app-assigned notification channel ID or channel-group ID
3676 optional int32 channel_id_hash = 4;
Will Brockman079fdaa2020-01-12 16:45:03 -05003677 // Previous importance setting, if applicable
3678 optional android.stats.sysui.NotificationImportance old_importance = 5;
3679 // New importance setting
3680 optional android.stats.sysui.NotificationImportance importance = 6;
3681}
3682
3683
3684/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003685 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003686 *
3687 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003688 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003689 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003690message BiometricAcquired {
3691 // Biometric modality that was acquired.
3692 optional android.hardware.biometrics.ModalityEnum modality = 1;
3693 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3694 optional int32 user = 2;
3695 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3696 optional bool is_crypto = 3;
3697 // Action that the device is performing. Acquired messages are only expected for enroll and
3698 // authenticate. Other actions may indicate an error.
3699 optional android.hardware.biometrics.ActionEnum action = 4;
3700 // The client that this acquisition was received for.
3701 optional android.hardware.biometrics.ClientEnum client = 5;
3702 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3703 optional int32 acquire_info = 6;
3704 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3705 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003706 // Dictates if this message should trigger additional debugging.
3707 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003708}
3709
3710/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003711 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003712 *
3713 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003714 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003715 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003716message BiometricAuthenticated {
3717 // Biometric modality that was used.
3718 optional android.hardware.biometrics.ModalityEnum modality = 1;
3719 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3720 optional int32 user = 2;
3721 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3722 // storage.
3723 optional bool is_crypto = 3;
3724 // The client that this acquisition was received for.
3725 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003726 // If authentication requires user confirmation. See BiometricPrompt's
3727 // setRequireConfirmation(bool) method.
3728 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003729
Kevin Chyn1741a072019-01-17 11:54:40 -08003730 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003731 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003732 REJECTED = 1;
3733 PENDING_CONFIRMATION = 2;
3734 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003735 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003736
3737 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003738 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003739 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3740 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3741 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3742 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003743 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003744 // Dictates if this message should trigger additional debugging.
3745 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003746}
3747
3748/**
3749 * Logs when a biometric error occurs.
3750 *
3751 * Logged from:
3752 * frameworks/base/services/core/java/com/android/server/biometrics
3753 */
3754message BiometricErrorOccurred {
3755 // Biometric modality that was used.
3756 optional android.hardware.biometrics.ModalityEnum modality = 1;
3757 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3758 optional int32 user = 2;
3759 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3760 optional bool is_crypto = 3;
3761 // Action that the device is performing.
3762 optional android.hardware.biometrics.ActionEnum action = 4;
3763 // The client that this acquisition was received for.
3764 optional android.hardware.biometrics.ClientEnum client = 5;
3765 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3766 // are unique to modality.
3767 optional int32 error_info = 6;
3768 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3769 // by the vendor and not specified by the HIDL interface.
3770 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003771 // Dictates if this message should trigger additional debugging.
3772 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003773 // Time spent during the authentication attempt.
3774 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003775}
3776
3777/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003778 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003779 * Logged from:
3780 * frameworks/base/services/core/java/com/android/server/biometrics
3781 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003782message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003783 // Biometric modality.
3784 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003785 // Type of issue detected.
3786 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003787 // Dictates if this message should trigger additional debugging.
3788 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003789}
Howard Ro688ae182018-09-25 00:09:36 -07003790
joshmccloskey6f952b22019-03-25 20:59:35 -07003791/**
3792 * Logs when a biometric enrollment occurs.
3793 *
3794 * Logged from:
3795 * frameworks/base/services/core/java/com/android/server/biometrics
3796 */
3797message BiometricEnrolled {
3798 // Biometric modality that was used.
3799 optional android.hardware.biometrics.ModalityEnum modality = 1;
3800 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3801 optional int32 user = 2;
3802 // The amount of time the enrollment took in milliseconds.
3803 optional int64 latency_millis = 3;
3804 // Whether or not the enrollment was successful.
3805 optional bool success = 4;
3806}
3807
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003808/*
Tej Singh0d176952019-01-16 19:10:54 -08003809 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003810 */
Tej Singh0d176952019-01-16 19:10:54 -08003811message FlagFlipUpdateOccurred {
3812 // If the event is from a flag config package, specify the package name.
3813 optional string flag_flip_package_name = 1;
3814
3815 // The order id of the package
3816 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003817}
3818
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003819/**
3820 * Potential experiment ids that goes with a train install.
Jonathan Nguyena0e6de12020-01-28 18:33:55 -08003821 * Should be kept in sync with experiment_ids.proto.
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003822 */
3823message TrainExperimentIds {
3824 repeated int64 experiment_id = 1;
3825}
3826
Yangster-macb89807e2018-11-15 21:10:57 -08003827/*
3828 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003829 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003830 */
3831message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003832 // Name of the train.
3833 optional string train_name = 1;
3834 // Version code for a "train" of packages that need to be installed atomically
3835 optional int64 train_version_code = 2;
3836 // After installation of this package, device requires a restart.
3837 optional bool requires_staging = 3;
3838 // Rollback should be enabled for this install.
3839 optional bool rollback_enabled = 4;
3840 // Requires low latency monitoring if possible.
3841 optional bool requires_low_latency_monitor = 5;
3842
Yangster-macb89807e2018-11-15 21:10:57 -08003843 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003844 UNKNOWN = 0;
3845 INSTALL_REQUESTED = 1;
3846 INSTALL_STARTED = 2;
3847 INSTALL_STAGED_NOT_READY = 3;
3848 INSTALL_STAGED_READY = 4;
3849 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003850 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3851 // and INSTALL_FAILURE_COMMIT.
3852 INSTALL_FAILURE = 6 [deprecated = true];
3853 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003854 INSTALL_CANCELLED = 7;
3855 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003856 INSTALLER_ROLLBACK_INITIATED = 9;
3857 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3858 INSTALLER_ROLLBACK_STAGED = 11;
3859 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3860 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3861 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3862 INSTALLER_ROLLBACK_SUCCESS = 15;
3863 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003864 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3865 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3866 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3867 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3868 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3869 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003870 INSTALL_FAILURE_DOWNLOAD = 23;
3871 INSTALL_FAILURE_STATE_MISMATCH = 24;
3872 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003873 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003874 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003875 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003876 // Possible experiment ids for monitoring this push.
3877 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3878 // user id
3879 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003880 optional int32 reason = 9;
Jonathan Nguyen703c42f2020-02-04 15:54:26 -08003881 // Whether or not this is a rollback event
3882 optional bool is_rollback = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003883}
3884
Tej Singhc9203082019-05-03 13:42:23 -07003885/* Test atom, is not logged anywhere */
3886message TestAtomReported {
3887 repeated AttributionNode attribution_node = 1;
3888 optional int32 int_field = 2;
3889 optional int64 long_field = 3;
3890 optional float float_field = 4;
3891 optional string string_field = 5;
3892 optional bool boolean_field = 6;
3893 enum State {
3894 UNKNOWN = 0;
3895 OFF = 1;
3896 ON = 2;
3897 }
3898 optional State state = 7;
3899 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3900}
3901
Maggie Whitefc1aa592018-11-28 21:55:23 -08003902/** Represents USB port overheat event. */
3903message UsbPortOverheatEvent {
3904 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3905 optional int32 plug_temperature_deci_c = 1;
3906
3907 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3908 optional int32 max_temperature_deci_c = 2;
3909
3910 /* Time between USB plug event and overheat threshold trip, in seconds. */
3911 optional int32 time_to_overheat_secs = 3;
3912
3913 /* Time between overheat threshold trip and hysteresis, in seconds. */
3914 optional int32 time_to_hysteresis_secs = 4;
3915
3916 /* Time between hysteresis and active mitigation ending, in seconds. */
3917 optional int32 time_to_inactive_secs = 5;
3918};
3919
Maggie White8735b852019-01-18 11:40:49 -08003920/**
3921 * Logs total effective full charge and discharge cycles on a battery.
3922 * Here are some examples of one effective cycle:
3923 * 1) the battery charges from 0% to 100% and drains back to 0%,
3924 * 2) charging from 50% to 100% and draining back to 50% twice.
3925 * Pulled from:
3926 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3927 */
3928message BatteryCycleCount {
3929 /* Number of total charge and discharge cycles on the system battery. */
3930 optional int32 cycle_count = 1;
3931}
3932
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003933/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003934 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3935 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003936 * Pulled from:
3937 * StatsCompanionService
3938 */
3939
Carmen Agimof12dec122019-03-06 16:14:38 +00003940message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003941
Carmen Agimof12dec122019-03-06 16:14:38 +00003942 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003943 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003944 PUBLIC = 1;
3945 PRIVATE = 2;
3946 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003947 }
3948
Carmen Agimof12dec122019-03-06 16:14:38 +00003949 // The type of external storage.
3950 optional android.stats.storage.ExternalStorageType storage_type = 1;
3951 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3952 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003953 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003954 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003955}
3956
Yangster-macb89807e2018-11-15 21:10:57 -08003957/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003958 * Logs when a connection becomes available and lost.
3959 * Logged in StatsCompanionService.java
3960 */
3961message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003962 // Id of the network.
3963 optional int32 net_id = 1;
3964
3965 enum State {
3966 UNKNOWN = 0;
3967 CONNECTED = 1;
3968 DISCONNECTED = 2;
3969 }
3970 // Connected state of a network.
3971 optional State state = 2;
3972}
3973
3974/**
3975 * Logs when a service starts and stops.
3976 * Logged from:
3977 * services/core/java/com/android/server/am/ActiveServices.java
3978 */
3979message ServiceStateChanged {
3980
3981 optional int32 uid = 1 [(is_uid) = true];
3982
3983 optional string package_name = 2;
3984
3985 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003986
3987 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003988 START = 1;
3989 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003990 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003991
3992 optional State state = 4;
3993}
3994
3995/**
3996 * Logs when a service is launched.
3997 * Logged from:
3998 * services/core/java/com/android/server/am/ActiveServices.java
3999 */
4000message ServiceLaunchReported {
4001
4002 optional int32 uid = 1 [(is_uid) = true];
4003
4004 optional string package_name = 2;
4005
4006 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07004007}
Howard Ro688ae182018-09-25 00:09:36 -07004008
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00004009/**
4010 * Logs when a hidden API is used.
4011 *
4012 * Logged from:
4013 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
4014 */
4015message HiddenApiUsed {
4016 // The uid of the app making the hidden access.
4017 optional int32 uid = 1 [(is_uid) = true];
4018
4019 // Signature of the method or field accessed.
4020 optional string signature = 2;
4021
4022 enum AccessMethod {
4023 NONE = 0;
4024 REFLECTION = 1;
4025 JNI = 2;
4026 LINKING = 3;
4027 }
4028
4029 // Type of access.
4030 optional AccessMethod access_method = 3;
4031
4032 // Whether the access was prevented or not.
4033 optional bool access_denied = 4;
4034}
4035
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004036/**
4037 * Logs user interaction with the Privacy Indicators added in Q. In particular:
4038 * - When user sees privacy chip
4039 * - When user clicks privacy chip
4040 * - How does the user exit the Privacy Dialog
4041 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004042 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
4043 */
4044message PrivacyIndicatorsInteracted {
4045
4046 enum Type {
4047 UNKNOWN = 0;
4048 CHIP_VIEWED = 1;
4049 CHIP_CLICKED = 2;
4050 DIALOG_PRIVACY_SETTINGS = 3;
4051 DIALOG_DISMISS = 4;
4052 DIALOG_LINE_ITEM = 5;
4053 }
4054
tsaichristine5adc7e02020-01-14 17:07:39 -08004055 optional Type type = 1 [(state_field_option).option = EXCLUSIVE_STATE];
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05004056
4057 // Used if the type is LINE_ITEM
4058 optional string package_name = 2;
4059}
4060
Carmen Agimof6dcc5032019-03-01 16:20:09 +00004061/**
4062 * Logs information about a package that is moved from the internal to external storage and vice
4063 * versa.
4064 * It logs the package name, the type of the external storage where the package is installed
4065 * (if moved to external storage, or UNKNOWN if moved to internal storage),
4066 * and the move type: if it's from internal to external or the other way around.
4067 *
4068 * Logged from:
4069 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
4070 */
4071message AppMovedStorageReported {
4072 enum MoveType {
4073 UNKNOWN = 0;
4074 TO_EXTERNAL = 1;
4075 TO_INTERNAL = 2;
4076 }
4077 // The type of the external storage.
4078 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
4079 // The type of move.
4080 optional MoveType move_type = 2;
4081 // The name of the package that was moved.
4082 optional string package_name = 3;
4083}
4084
jianjin8f2dee02019-03-29 14:03:08 -07004085/**
4086 * Logs when system server watchdog occurs.
4087 * Logged from:
4088 * frameworks/base/services/core/java/com/android/server/Watchdog.java
4089 */
4090message SystemServerWatchdogOccurred {
4091 optional string subject = 1;
4092}
4093
4094/**
4095 * Logs when new file added to tombstones.
4096 * Logged from:
4097 * frameworks/base/core/java/com/android/server/BootReceiver.java
4098 */
4099message TombStoneOccurred {
4100}
4101
Hai Zhang5d3328d2019-04-13 21:25:06 +08004102/*
4103 * Information about a role request
4104 *
4105 * Logged from:
4106 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
4107 */
4108message RoleRequestResultReported {
4109 // UID of application requesting the role
4110 optional int32 requesting_uid = 1;
4111
4112 // Package name of application requesting the role
4113 optional string requesting_package_name = 2;
4114
4115 // The role to be granted
4116 optional string role_name = 3;
4117
4118 // The count of applications qualifying for the role
4119 optional int32 qualifying_count = 4;
4120
4121 // UID of application current granted the role
4122 optional int32 current_uid = 5;
4123
4124 // Package name of application current granted the role
4125 optional string current_package_name = 6;
4126
4127 // UID of another application that user chose to grant the role to, instead of the requesting
4128 // application
4129 optional int32 granted_another_uid = 7;
4130
4131 // Package name of another application that user chose to grant the role to, instead of the
4132 // requesting application
4133 optional string granted_another_package_name = 8;
4134
4135 enum Result {
4136 UNDEFINED = 0;
4137 // role request was ignored
4138 IGNORED = 1;
4139 // role request was ignored because it's already granted
4140 IGNORED_ALREADY_GRANTED = 2;
4141 // role request was ignored because the application isn't qualified
4142 IGNORED_NOT_QUALIFIED = 3;
4143 // role request was ignored because user said it should be always denied
4144 IGNORED_USER_ALWAYS_DENIED = 4;
4145 // role was granted by user action
4146 USER_GRANTED = 5;
4147 // role was denied by user action
4148 USER_DENIED = 6;
4149 // role was denied by user granting another application the role
4150 USER_DENIED_GRANTED_ANOTHER = 7;
4151 // role was denied and set to be always denied by the user
4152 USER_DENIED_WITH_ALWAYS = 8;
4153 }
4154 // The result of the role request
4155 optional Result result = 9;
4156}
4157
Mark Tabrya824a642019-11-05 12:26:12 -08004158/**
4159 * Logs when a Vehicle Maps Service client's connection state has changed
4160 *
4161 * Logged from:
4162 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
4163 */
4164message VmsClientConnectionStateChanged {
4165 // The UID of the VMS client app
4166 optional int32 uid = 1 [(is_uid) = true];
4167
4168 enum State {
4169 UNKNOWN = 0;
4170 // Attempting to connect to the client
4171 CONNECTING = 1;
4172 // Client connection established
4173 CONNECTED = 2;
4174 // Client connection closed unexpectedly
4175 DISCONNECTED = 3;
4176 // Client connection closed by VMS
4177 TERMINATED = 4;
4178 // Error establishing the client connection
4179 CONNECTION_ERROR = 5;
4180 }
4181
4182 optional State state = 2;
4183}
4184
Jeff Sharkey6bd21572019-11-15 20:45:33 -07004185/**
4186 * Logs when MediaProvider has successfully finished scanning a storage volume.
4187 *
4188 * Logged from:
4189 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
4190 */
4191message MediaProviderScanEvent {
4192 enum Reason {
4193 // Scan triggered due to unknown reason
4194 UNKNOWN = 0;
4195 // Scan triggered due to storage volume being mounted
4196 MOUNTED = 1;
4197 // Scan triggered due to explicit user action or app request
4198 DEMAND = 2;
4199 // Scan triggered due to idle maintenance
4200 IDLE = 3;
4201 }
4202
4203 // Volume type that this event pertains to
4204 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4205 // Reason why this scan was triggered
4206 optional Reason reason = 2;
4207 // Total number of files scanned
4208 optional int64 item_count = 3;
4209 // Duration of scan, normalized per file
4210 optional float normalized_duration_millis = 4;
4211 // Number of database inserts, normalized per file
4212 optional float normalized_insert_count = 5;
4213 // Number of database updates, normalized per file
4214 optional float normalized_update_count = 6;
4215 // Number of database deletes, normalized per file
4216 optional float normalized_delete_count = 7;
4217}
4218
4219/**
4220 * Logs when an app has asked MediaProvider to delete media belonging to the user.
4221 *
4222 * Logged from:
4223 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4224 */
4225message MediaProviderDeletionEvent {
4226 // Volume type that this event pertains to
4227 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4228 // Device timestamp when this deletion event occurred
4229 optional int64 timestamp_millis = 2;
4230 // App that requested deletion
4231 optional string package_name = 3;
4232 // Number of items that were deleted
4233 optional int32 item_count = 4;
4234}
4235
4236/**
4237 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
4238 *
4239 * Logged from:
4240 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
4241 */
4242message MediaProviderPermissionEvent {
4243 enum Result {
4244 UNKNOWN = 0;
4245 USER_GRANTED = 1;
4246 AUTO_GRANTED = 2;
4247 USER_DENIED = 3;
4248 USER_DENIED_WITH_PREJUDICE = 4;
4249 AUTO_DENIED = 5;
4250 }
4251
4252 // Volume type that this event pertains to
4253 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4254 // Device timestamp when this permission event occurred
4255 optional int64 timestamp_millis = 2;
4256 // App that requested permission
4257 optional string package_name = 3;
4258 // Number of items that were requested
4259 optional int32 item_count = 4;
4260 // Result of this request
4261 optional Result result = 5;
4262}
4263
4264/**
4265 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4266 *
4267 * Logged from:
4268 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4269 */
4270message MediaProviderSchemaChange {
4271 // Volume type that this event pertains to
4272 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4273 // Old database version code
4274 optional int32 version_from = 2;
4275 // New database version code
4276 optional int32 version_to = 3;
4277 // Total number of files in database
4278 optional int64 item_count = 4;
4279 // Duration of schema change, normalized per file
4280 optional float normalized_duration_millis = 5;
4281}
4282
4283/**
4284 * Logs when MediaProvider has finished an idle maintenance job.
4285 *
4286 * Logged from:
4287 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4288 */
4289message MediaProviderIdleMaintenance {
4290 // Volume type that this event pertains to
4291 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4292
4293 // Total number of files in database
4294 optional int64 item_count = 2;
4295 // Duration of idle maintenance, normalized per file
4296 optional float normalized_duration_millis = 3;
4297 // Number of thumbnails found to be stale, normalized per file
4298 optional float normalized_stale_thumbnails = 4;
4299 // Number of items found to be expired, normalized per file
4300 optional float normalized_expired_media = 5;
4301}
4302
Keun young Park3e033cb2019-12-18 11:27:35 -08004303/**
4304 * Represents boot time event with duration in ms.
4305 *
4306 * Logged from: bootstat and various system server components. Check each enums for details.
4307 */
4308message BootTimeEventDuration {
4309 enum DurationEvent {
4310 UNKNOWN = 0;
4311 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4312 ABSOLUTE_BOOT_TIME = 1;
4313 // Bootloader's 1st stage execution time.
4314 // Logged from bootstat.
4315 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4316 // Bootloader's 1st stage loading time.
4317 // Logged from bootstat.
4318 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4319 // Bootloader's kernel loading time.
4320 // Logged from bootstat.
4321 BOOTLOADER_KERNEL_LOAD = 4;
4322 // Bootloader's 2nd stage execution time.
4323 // Logged from bootstat.
4324 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4325 // Bootloader's 2nd stage loading time.
4326 // Logged from bootstat.
4327 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4328 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4329 // for locked device.
4330 // Logged from bootstat.
4331 BOOTLOADER_UI_WAIT = 7;
4332 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4333 // Logged from bootstat.
4334 BOOTLOADER_TOTAL = 8;
4335 // Shutdown duration inside init for the reboot before the current boot up.
4336 // Logged from f/b/services/.../BootReceiver.java.
4337 SHUTDOWN_DURATION = 9;
4338 // Total time for mounting of disk devices during bootup.
4339 // Logged from f/b/services/.../BootReceiver.java.
4340 MOUNT_DEFAULT_DURATION = 10;
4341 // Total time for early stage mounting of disk devices during bootup.
4342 // Logged from f/b/services/.../BootReceiver.java.
4343 MOUNT_EARLY_DURATION = 11;
4344 // Total time for late stage mounting of disk devices during bootup.
4345 // Logged from f/b/services/.../BootReceiver.java.
4346 MOUNT_LATE_DURATION = 12;
4347 // Average time to scan non-system app after OTA
4348 // Logged from f/b/services/.../PackageManagerService.java
4349 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4350 // Time to initialize Package manager after OTA
4351 // Logged from f/b/services/.../PackageManagerService.java
4352 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4353 // Time to scan all system app from Package manager after OTA
4354 // Logged from f/b/services/.../PackageManagerService.java
4355 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4356 // Init's total time for cold boot stage.
4357 // Logged from bootstat.
4358 COLDBOOT_WAIT = 16;
4359 // Init's total time for initializing selinux.
4360 // Logged from bootstat.
4361 SELINUX_INIT = 17;
4362 // Time since last factory reset.
4363 // Logged from bootstat.
4364 FACTORY_RESET_TIME_SINCE_RESET = 18;
Keun young Parka5a696a2020-02-03 09:42:36 -08004365 // Init's total time spent for completing the 1st stage.
4366 // Logged from bootstat.
4367 ANDROID_INIT_STAGE_1 = 19;
Keun young Park3e033cb2019-12-18 11:27:35 -08004368 }
4369
4370 // Type of the event.
4371 optional DurationEvent event = 1;
4372 // Duration of the event in ms.
4373 optional int64 duration_millis = 2;
4374}
4375
4376/**
4377 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4378 * since boot-up.
4379 *
4380 * Logged from: bootstat and various system server components. Check each enums for details.
4381 */
4382message BootTimeEventElapsedTime {
4383 enum ElapsedTimeEvent {
4384 UNKNOWN = 0;
4385 // Time when init starts 1st stage. Logged from bootstat.
4386 ANDROID_INIT_STAGE_1 = 1;
4387 // Time when sys.boot_completed prop is set.
4388 // Logged from bootstat.
4389 BOOT_COMPLETE = 2;
4390 // BOOT_COMPLETE for encrypted device.
4391 BOOT_COMPLETE_ENCRYPTION = 3;
4392 // BOOT_COMPLETE for device with no encryption.
4393 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4394 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
Keun young Parka5a696a2020-02-03 09:42:36 -08004395 BOOT_COMPLETE_POST_DECRYPT = 5;
Keun young Park3e033cb2019-12-18 11:27:35 -08004396 // BOOT_COMPLETE after factory reset.
4397 FACTORY_RESET_BOOT_COMPLETE = 6;
4398 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4399 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
Keun young Parka5a696a2020-02-03 09:42:36 -08004400 // BOOT_COMPLETE_POST_DECRYPT after factory reset.
4401 FACTORY_RESET_BOOT_COMPLETE_POST_DECRYPT = 8;
Keun young Park3e033cb2019-12-18 11:27:35 -08004402 // BOOT_COMPLETE after OTA.
4403 OTA_BOOT_COMPLETE = 9;
4404 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4405 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
Keun young Parka5a696a2020-02-03 09:42:36 -08004406 // BOOT_COMPLETE_POST_DECRYPT after OTA.
4407 OTA_BOOT_COMPLETE_POST_DECRYPT = 11;
Keun young Park3e033cb2019-12-18 11:27:35 -08004408 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4409 // Logged from f/b/services/.../UserController.java
4410 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4411 // Time when the system starts sending BOOT_COMPLETED broadcast.
4412 // Logged from f/b/services/.../UserController.java
4413 FRAMEWORK_BOOT_COMPLETED = 13;
4414 // Time when the package manager starts init.
4415 // Logged from f/b/services/.../SystemServer.java
4416 PACKAGE_MANAGER_INIT_START = 14;
4417 // Time when package manager is ready
4418 // Logged from f/b/services/.../SystemServer.java
4419 PACKAGE_MANAGER_INIT_READY = 15;
4420 // Represents the time when user has entered unlock credential for system with user pin.
4421 // Logged from bootstat.
4422 POST_DECRYPT = 16;
4423 // Represents the start of zygote's init.
4424 // Logged from zygote itself.
4425 ZYGOTE_INIT_START = 17;
4426 // Represents the start of secondary zygote's init.
4427 // TODO: add logging to zygote
4428 SECONDARY_ZYGOTE_INIT_START = 18;
4429 // Represents the start of system server's init.
4430 // Logged from f/b/services/.../SystemServer.java
4431 SYSTEM_SERVER_INIT_START = 19;
4432 // Represents the completion of system server's init.
4433 // Logged from f/b/services/.../SystemServer.java
4434 SYSTEM_SERVER_READY = 20;
4435 // Represents the start of launcher during boot-up.
4436 // TODO: add logging
4437 LAUNCHER_START = 21;
4438 // Represents the completion of launcher's initial rendering. User can use other apps from
4439 // launcher from this point.
4440 // TODO: add logging
4441 LAUNCHER_SHOWN = 22;
4442 }
4443
4444 // Type of the event.
4445 optional ElapsedTimeEvent event = 1;
4446 // Time since bootup for the event.
4447 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4448 optional int64 time_millis = 2;
4449}
4450
4451/**
4452 * Boot time events with UTC time.
4453 *
4454 * Logged from: bootstat and various system server components. Check each enums for details.
4455 */
4456message BootTimeEventUtcTime {
4457 enum UtcTimeEvent {
4458 UNKNOWN = 0;
4459 // Time of the bootstat's marking of 1st boot after the last factory reset.
4460 // Logged from bootstat.
4461 FACTORY_RESET_RESET_TIME = 1;
4462 // The time when bootstat records FACTORY_RESET_* events. This is close to
4463 // BOOT_COMPLETE time for the current bootup.
4464 // Logged from bootstat.
4465 FACTORY_RESET_CURRENT_TIME = 2;
4466 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4467 // Logged from bootstat.
4468 FACTORY_RESET_RECORD_VALUE = 3;
4469 }
4470
4471 // Type of the event.
4472 optional UtcTimeEvent event = 1;
4473 // UTC time for the event.
4474 optional int64 utc_time_secs = 2;
4475}
4476
4477/**
4478 * Boot time events representing specific error code during bootup.
4479 * Meaning of error code can be different per each event type.
4480 *
4481 * Logged from: bootstat and various system server components. Check each enums for details.
4482 */
4483message BootTimeEventErrorCode {
4484 enum ErrorCodeEvent {
4485 UNKNOWN = 0;
4486 // Linux error code for time() call to get the current UTC time.
4487 // Logged from bootstat.
4488 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4489 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4490 // as UMOUNT_STAT_* from init/reboot.cpp.
4491 // Logged from f/b/services/.../BootReceiver.java.
4492 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004493 // Reprepsents fie system mounting error code of /data partition for the current boot.
4494 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004495 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004496 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004497 }
4498
4499 // Type of the event.
4500 optional ErrorCodeEvent event = 1;
4501 // error code defined per each event type.
4502 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4503 // FS_MGR_FS_STAT.
4504 optional int32 error_code = 2;
4505}
4506
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004507/**
4508 * Collects Virtual A/B statistics related to the use of dm-snapshot performed
4509 * after an OTA.
4510 *
4511 * Logged from:
Yifan Hong36137f02020-03-11 10:35:08 -07004512 * - system/update_engine/cleanup_previous_update_action.cc
Alessio Balsini628fb8d2020-01-15 15:44:48 +00004513 */
4514message SnapshotMergeReported {
4515 // Keep in sync with
4516 // system/core/fs_mgr/libsnapshot/android/snapshot/snapshot.proto
4517 enum UpdateState {
4518 // No update or merge is in progress.
4519 NONE = 0;
4520 // An update is applying; snapshots may already exist.
4521 INITIATED = 1;
4522 // An update is pending, but has not been successfully booted yet.
4523 UNVERIFIED = 2;
4524 // The kernel is merging in the background.
4525 MERGING = 3;
4526 // Post-merge cleanup steps could not be completed due to a transient
4527 // error, but the next reboot will finish any pending operations.
4528 MERGE_NEEDS_REBOOT = 4;
4529 // Merging is complete, and needs to be acknowledged.
4530 MERGE_COMPLETED = 5;
4531 // Merging failed due to an unrecoverable error.
4532 MERGE_FAILED = 6;
4533 // The update was implicitly cancelled, either by a rollback or a flash
4534 // operation via fastboot. This state can only be returned by WaitForMerge.
4535 CANCELLED = 7;
4536 };
4537
4538 // Status of the update after the merge attempts.
4539 optional UpdateState final_state = 1;
4540
4541 // Time to complete a merge operation in milliseconds.
4542 // A negative value corresponds to the case in which the merge operation
4543 // was interrupted and resumed (e.g. in case of a system reboot during the
4544 // merge).
4545 optional int64 duration_millis = 2;
4546
4547 // Number of reboots that occurred after issuing and before completing the
4548 // merge of all the snapshot devices.
4549 optional int32 intermediate_reboots = 3;
4550}
4551
Chenjie Yubbcbc602018-02-05 16:51:52 -08004552//////////////////////////////////////////////////////////////////////
4553// Pulled atoms below this line //
4554//////////////////////////////////////////////////////////////////////
4555
4556/**
David Chenc8a43242017-10-17 16:23:28 -07004557 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4558 *
4559 * Pulled from:
4560 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4561 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004562message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004563 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004564
4565 optional int64 rx_bytes = 2;
4566
4567 optional int64 rx_packets = 3;
4568
4569 optional int64 tx_bytes = 4;
4570
4571 optional int64 tx_packets = 5;
4572}
4573
4574/**
4575 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4576 *
4577 * Pulled from:
4578 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4579 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004580message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004581 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004582
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004583 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4584 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004585
4586 optional int64 rx_bytes = 3;
4587
4588 optional int64 rx_packets = 4;
4589
4590 optional int64 tx_bytes = 5;
4591
4592 optional int64 tx_packets = 6;
4593}
4594
4595/**
4596 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4597 *
4598 * Pulled from:
4599 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4600 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004601message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004602 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004603
4604 optional int64 rx_bytes = 2;
4605
4606 optional int64 rx_packets = 3;
4607
4608 optional int64 tx_bytes = 4;
4609
4610 optional int64 tx_packets = 5;
junyulaif8893302019-12-11 21:18:11 +08004611
4612 optional int32 rat_type = 6;
David Chenc8a43242017-10-17 16:23:28 -07004613}
4614
4615/**
4616 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4617 *
4618 * Pulled from:
4619 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4620 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004621message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004622 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004623
Yao Chenc40a19d2018-03-15 16:48:25 -07004624 // 1 denotes foreground and 0 denotes background. This is called Set in
4625 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004626 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004627
4628 optional int64 rx_bytes = 3;
4629
4630 optional int64 rx_packets = 4;
4631
4632 optional int64 tx_bytes = 5;
4633
4634 optional int64 tx_packets = 6;
junyulaif8893302019-12-11 21:18:11 +08004635
4636 optional int32 rat_type = 7;
David Chenc8a43242017-10-17 16:23:28 -07004637}
4638
4639/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004640 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4641 *
4642 * Pulled from:
4643 * StatsCompanionService
4644 */
4645message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004646 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004647
4648 optional int64 rx_bytes = 2;
4649
4650 optional int64 tx_bytes = 3;
4651}
4652
4653/**
David Chenc8a43242017-10-17 16:23:28 -07004654 * Pulls the kernel wakelock durations. This atom is adapted from
4655 * android/internal/os/KernelWakelockStats.java
4656 *
4657 * Pulled from:
4658 * StatsCompanionService using KernelWakelockReader.
4659 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004660message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004661 optional string name = 1;
4662
4663 optional int32 count = 2;
4664
4665 optional int32 version = 3;
4666
Yangster-maca8a30442018-10-13 23:46:34 -07004667 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004668}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004669
Chenjie Yu05013b32017-11-21 10:21:41 -08004670/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004671 * Pulls low power state information. If power.stats HAL is not available, this
4672 * includes platform and subsystem sleep state information,
4673 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4674 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004675 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004676 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004677 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4678 * as defined in:
4679 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004680 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004681message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004682 // Subsystem name
4683 optional string subsystem_name = 1;
4684 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4685 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004686 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4687 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004688 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004689 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004690 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004691 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004692 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004693}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004694
Chenjie Yu05013b32017-11-21 10:21:41 -08004695/**
Bookatz92da2832018-11-01 18:10:03 -07004696 * Pulls on-device power measurement information.
4697 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4698 * Pulled from:
4699 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4700 */
4701message OnDevicePowerMeasurement {
4702 // Name of the subsystem (to which the rail belongs).
4703 optional string subsystem_name = 1;
4704
4705 // Rail name. The rail lies within the subsystem.
4706 optional string rail_name = 2;
4707
4708 // Time (in ms since boot) at which the rail energy value was measured.
4709 // This may differ slightly from the time that statsd logs this information.
4710 optional uint64 measurement_timestamp_millis = 3;
4711
4712 // Accumulated energy used via the rail since device boot in uWs.
4713 optional uint64 energy_microwatt_secs = 4;
4714}
4715
4716/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004717 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004718 * Pulls the time the cpu spend on the frequency index. Frequency index
4719 * starts from highest to lowest. The value should be monotonically
4720 * increasing since boot. However, if there is a cpu
4721 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004722 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004723message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004724 optional uint32 cluster = 1;
4725 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004726 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004727}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004728
Chenjie Yu05013b32017-11-21 10:21:41 -08004729/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004730 * Pulls Cpu Time Per Uid.
4731 * Note that isolated process uid time should be attributed to host uids.
4732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004733message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004734 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004735 optional uint64 user_time_micros = 2;
4736 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004737}
4738
4739/**
4740 * Pulls Cpu Time Per Uid per frequency.
4741 * Note that isolated process uid time should be attributed to host uids.
4742 * For each uid, we order the time by descending frequencies.
4743 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004744message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004745 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004746 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004747 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004748}
Hugo Benichi884970e2017-11-14 22:42:46 +09004749
Chenjie Yu05013b32017-11-21 10:21:41 -08004750/**
4751 * Pulls Wifi Controller Activity Energy Info
4752 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004753message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004754 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004755 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004756 // stack reported state
4757 // TODO: replace this with proto enum
4758 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004759 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004760 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004761 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004762 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004763 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004764 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004765 // product of current(mA), voltage(V) and time(ms)
4766 optional uint64 controller_energy_used = 6;
4767}
4768
4769/**
4770 * Pulls Modem Activity Energy Info
4771 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004772message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004773 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004774 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004775 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004776 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004777 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004778 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004779 /**
4780 * Tx power index
4781 * index 0 = tx_power < 0dBm
4782 * index 1 = 0dBm < tx_power < 5dBm
4783 * index 2 = 5dBm < tx_power < 15dBm
4784 * index 3 = 15dBm < tx_power < 20dBm
4785 * index 4 = tx_power > 20dBm
4786 */
4787 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004788 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004789 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004790 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004791 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004792 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004793 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004794 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004795 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004796 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004797 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004798 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004799 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004800 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004801}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004802
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004803/**
4804 * Pulls Bluetooth Activity Energy Info
4805 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4806 */
4807message BluetoothActivityInfo {
4808 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004809 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004810 // bluetooth stack state
4811 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004812 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004813 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004814 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004815 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004816 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004817 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004818 // product of current(mA), voltage(V) and time(ms)
4819 optional uint64 energy_used = 6;
4820}
4821
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004822/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004823 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004824 *
4825 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004826 */
4827message ProcessMemoryState {
4828 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004829 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004830
4831 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004832 // Usually package name, "system" for system server.
4833 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004834 optional string process_name = 2;
4835
Rafal Slawikda51b932018-12-13 16:31:33 +00004836 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004837 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004838
4839 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004840 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004841
4842 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004843 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004844
Rajeev Kumar90235992018-01-29 11:06:48 -08004845 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004846 // Value is read from memory.stat, field total_rss if per-app memory
4847 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004848 optional int64 rss_in_bytes = 6;
4849
4850 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004851 // Value is read from memory.stat, field total_cache if per-app memory
4852 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004853 optional int64 cache_in_bytes = 7;
4854
4855 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004856 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004857 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004858 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004859
Rafal Slawik203c3db2019-09-25 19:53:01 +01004860 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004861 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004862
Rafal Slawik203c3db2019-09-25 19:53:01 +01004863 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4864 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004865
Rafal Slawik203c3db2019-09-25 19:53:01 +01004866 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4867 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004868}
4869
4870/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004871 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004872 *
4873 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4874 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004875 *
4876 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004877 */
4878message ProcessMemoryHighWaterMark {
4879 // The uid if available. -1 means not available.
4880 optional int32 uid = 1 [(is_uid) = true];
4881
Rafal Slawikda51b932018-12-13 16:31:33 +00004882 // The process name.
4883 // Usually package name or process cmdline.
4884 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004885 optional string process_name = 2;
4886
Rafal Slawik239b6802019-09-09 18:46:01 +01004887 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4888 // computed by converting kilobytes to bytes.
4889 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4890
Rafal Slawik3bea8952018-11-15 12:39:33 +00004891 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4892 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004893 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004894}
4895
4896/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004897 * Logs the memory stats for a process.
4898 *
4899 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4900 * and for selected native processes.
4901 */
4902message ProcessMemorySnapshot {
4903 // The uid if available. -1 means not available.
4904 optional int32 uid = 1 [(is_uid) = true];
4905
4906 // The process name.
4907 // Usually package name or process cmdline.
4908 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4909 optional string process_name = 2;
4910
4911 // The pid of the process.
4912 // Allows to disambiguate instances of the process.
4913 optional int32 pid = 3;
4914
4915 // The current OOM score adjustment value.
4916 // Read from ProcessRecord for managed processes.
4917 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4918 optional int32 oom_score_adj = 4;
4919
4920 // The current RSS of the process.
4921 // VmRSS from /proc/pid/status.
4922 optional int32 rss_in_kilobytes = 5;
4923
4924 // The current anon RSS of the process.
4925 // RssAnon from /proc/pid/status.
4926 optional int32 anon_rss_in_kilobytes = 6;
4927
4928 // The current swap size of the process.
4929 // VmSwap from /proc/pid/status.
4930 optional int32 swap_in_kilobytes = 7;
4931
4932 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4933 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4934}
4935
4936/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004937 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004938 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004939message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004940 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004941}
4942
4943/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004944 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004945 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004946message SystemUptime {
4947 // Milliseconds since the system was booted.
4948 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4949 // for external input).
4950 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004951 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004952}
4953
4954/*
4955 * Reads from /proc/uid_concurrent_active_time which has the format:
4956 * active: X (X is # cores)
4957 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4958 * [uid1]: [time-0] [time-1] [time-2] ... ...
4959 * ...
4960 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4961 * The file contains a monotonically increasing count of time for a single boot.
4962 */
4963message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004964 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004965 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004966}
4967
4968/**
4969 * Reads from /proc/uid_concurrent_policy_time which has the format:
4970 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4971 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4972 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4973 * ...
4974 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4975 * The file contains a monotonically increasing count of time for a single boot.
4976 */
4977message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004978 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004979 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004980 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004981}
4982
4983/*
4984 * Pulls free disk space, for data, system partition and temporary directory.
4985 */
4986message DiskSpace {
4987 // available bytes in data partition
4988 optional uint64 data_available_bytes = 1;
4989 // available bytes in system partition
4990 optional uint64 system_available_bytes = 2;
4991 // available bytes in download cache or temp directories
4992 optional uint64 temp_available_bytes = 3;
4993}
Tej Singhbf972d92018-01-10 20:51:13 -08004994
4995/**
4996 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004997 *
4998 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004999 */
5000message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005001 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08005002}
5003
5004/**
5005 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08005006 * Pulled from:
5007 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08005008 */
5009message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07005010 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08005011}
5012
5013/**
Bookatz17f0d8a2018-09-13 12:56:32 -07005014 * Pulls battery voltage.
5015 * Pulled from:
5016 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5017 */
5018message BatteryVoltage {
5019 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07005020 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07005021}
5022
5023/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08005024 * Pulls battery level (percent full, from 0 to 100).
5025 *
5026 * Pulled from:
5027 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
5028 */
5029message BatteryLevel {
5030 // Battery level. Should be in [0, 100].
5031 optional int32 battery_level = 1;
5032}
5033
5034/**
Tej Singhd89137e2018-03-26 14:51:40 -07005035 * Pulls the temperature of various parts of the device.
5036 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08005037 *
Maggie White442b6312019-04-05 16:26:44 -07005038 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08005039 */
5040message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08005041 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08005042 optional android.os.TemperatureTypeEnum sensor_location = 1;
5043
5044 // The name of the temperature source. Eg. CPU0
5045 optional string sensor_name = 2;
5046
Tej Singhd89137e2018-03-26 14:51:40 -07005047 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08005048 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07005049 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07005050
5051 // Relative severity of the throttling, see enum definition.
5052 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08005053}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005054
5055/**
5056 * Pulls the statistics of calls to Binder.
5057 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01005058 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
5059 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005060 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005061 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005062 */
5063message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005064 // UID of the process responsible for the binder transaction. It will be set if the process
5065 // executing the binder transaction attribute the transaction to another uid using
5066 // Binder.setThreadWorkSource().
5067 //
5068 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005069 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00005070 // UID of the process executing the binder transaction.
5071 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01005072 // Fully qualified class name of the API call.
5073 //
5074 // This is a system server class name.
5075 //
5076 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
5077 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
5078 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
5079 // commonly used APIs.
5080 optional string service_class_name = 2;
5081 // Method name of the API call. It can also be a transaction code if we cannot
5082 // resolve it to a name. See Binder#getTransactionName.
5083 //
5084 // This is a system server method name.
5085 optional string service_method_name = 3;
5086 // Total number of API calls.
5087 optional int64 call_count = 4;
5088 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5089 optional bool screen_interactive = 13;
5090 // Total number of API calls we have data recorded for. If we collected data for all the calls,
5091 // call_count will be equal to recorded_call_count.
5092 //
5093 // If recorded_call_count is different than call_count, it means data collection has been
5094 // sampled. All the fields below will be sampled in this case.
5095 optional int64 recorded_call_count = 12;
5096 // Number of exceptions thrown by the API.
5097 optional int64 recorded_exception_count = 5;
5098 // Total latency of all API calls.
5099 // Average can be computed using total_latency_micros / recorded_call_count.
5100 optional int64 recorded_total_latency_micros = 6;
5101 // Maximum latency of one API call.
5102 optional int64 recorded_max_latency_micros = 7;
5103 // Total CPU usage of all API calls.
5104 // Average can be computed using total_cpu_micros / recorded_call_count.
5105 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
5106 optional int64 recorded_total_cpu_micros = 8;
5107 // Maximum CPU usage of one API call.
5108 optional int64 recorded_max_cpu_micros = 9;
5109 // Maximum parcel reply size of one API call.
5110 optional int64 recorded_max_reply_size_bytes = 10;
5111 // Maximum parcel request size of one API call.
5112 optional int64 recorded_max_request_size_bytes = 11;
5113}
5114
5115/**
5116 * Pulls the statistics of exceptions during calls to Binder.
5117 *
5118 * Binder stats are cumulative from boot unless somebody reset the data using
5119 * > adb shell dumpsys binder_calls_stats --reset
5120 */
5121message BinderCallsExceptions {
5122 // Exception class name, e.g. java.lang.IllegalArgumentException.
5123 //
5124 // This is an exception class name thrown by the system server.
5125 optional string exception_class_name = 1;
5126 // Total number of exceptions.
5127 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01005128}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005129
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005130/**
5131 * Pulls the statistics of message dispatching on HandlerThreads.
5132 *
5133 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
5134 * config on the device.
5135 *
5136 * Next tag: 11
5137 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005138message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01005139 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005140 optional int32 uid = 1 [(is_uid) = true];
5141
5142 // Fully qualified class name of the handler target class.
5143 //
5144 // This field does not contain PII. This is a system server class name.
5145 optional string handler_class_name = 2;
5146
5147 // The name of the thread that runs the Looper.
5148 //
5149 // This field does not contain PII. This is a system server thread name.
5150 optional string looper_thread_name = 3;
5151
5152 // The name of the dispatched message.
5153 //
5154 // This field does not contain PII. This is a system server constant or class
5155 // name.
5156 optional string message_name = 4;
5157
5158 // Total number of successfully dispatched messages.
5159 optional int64 message_count = 5;
5160
5161 // Total number of messages that failed dispatching.
5162 optional int64 exception_count = 6;
5163
5164 // Total number of processed messages we have data recorded for. If we
5165 // collected data for all the messages, message_count will be equal to
5166 // recorded_message_count.
5167 //
5168 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005169 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005170 optional int64 recorded_message_count = 7;
5171
5172 // Total latency of all processed messages.
5173 // Average can be computed using recorded_total_latency_micros /
5174 // recorded_message_count.
5175 optional int64 recorded_total_latency_micros = 8;
5176
5177 // Total CPU usage of all processed message.
5178 // Average can be computed using recorded_total_cpu_micros /
5179 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005180 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005181 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01005182
5183 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
5184 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01005185
5186 // Max recorded CPU usage of all processed messages.
5187 optional int64 recorded_max_cpu_micros = 11;
5188
5189 // Max recorded latency of all processed messages.
5190 optional int64 recorded_max_latency_micros = 12;
5191
5192 // Total number of messages we tracked the dispatching delay for. If we
5193 // collected data for all the messages, message_count will be equal to
5194 // recorded_delay_message_count.
5195 //
5196 // If recorded_delay_message_count is different than message_count, it means data
5197 // collection has been sampled or/and not all messages specified the target dispatch time.
5198 // The fields below will be sampled in this case.
5199 optional int64 recorded_delay_message_count = 13;
5200
5201 // Total dispatching delay of all processed messages.
5202 // Calculated as a difference between the target dispatching time (Message.when)
5203 // and the actual dispatching time.
5204 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
5205 optional int64 recorded_total_delay_millis = 14;
5206
5207 // Max dispatching delay of all processed messages.
5208 // Calculated as a difference between the target dispatching time (Message.when)
5209 // and the actual dispatching time.
5210 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01005211}
Tej Singh86dc9db2018-09-06 00:39:57 +00005212
5213/**
5214 * Pulls disk information, such as write speed and latency.
5215 */
5216message DiskStats {
5217 // Time taken to open, write 512B to, and close a file.
5218 // -1 if error performing the check.
5219 optional int64 data_write_latency_millis = 1;
5220
5221 optional bool file_based_encryption = 2;
5222
5223 // Recent disk write speed in kB/s.
5224 // -1 if error querying storageed.
5225 // 0 if data is unavailable.
5226 optional int32 recent_disk_write_speed = 3;
5227}
5228
5229
5230/**
5231 * Free and total bytes of the Data, Cache, and System partition.
5232 */
5233message DirectoryUsage {
5234 enum Directory {
5235 UNKNOWN = 0;
5236 DATA = 1;
5237 CACHE = 2;
5238 SYSTEM = 3;
5239 }
5240 optional Directory directory = 1;
5241 optional int64 free_bytes = 2;
5242 optional int64 total_bytes = 3;
5243}
5244
5245
5246/**
5247 * Size of an application: apk size, data size, and cache size.
5248 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5249 * Information is only reported for apps with the primary user (user 0).
5250 * Sizes are aggregated by package name.
5251 */
5252message AppSize {
5253 // Including uids will involve modifying diskstats logic.
5254 optional string package_name = 1;
5255 // App size in bytes. -1 if unavailable.
5256 optional int64 app_size_bytes = 2;
5257 // App data size in bytes. -1 if unavailable.
5258 optional int64 app_data_size_bytes = 3;
5259 // App cache size in bytes. -1 if unavailable.
5260 optional int64 app_cache_size_bytes = 4;
5261 // Time that the cache file was produced.
5262 // Uses System.currentTimeMillis(), which is wall clock time.
5263 optional int64 cache_time_millis = 5;
5264}
5265
5266
5267/**
5268 * Size of a particular category. Eg: photos, videos.
5269 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
5270 */
5271message CategorySize {
5272 enum Category {
5273 UNKNOWN = 0;
5274 APP_SIZE = 1;
5275 APP_DATA_SIZE = 2;
5276 APP_CACHE_SIZE = 3;
5277 PHOTOS = 4;
5278 VIDEOS = 5;
5279 AUDIO = 6;
5280 DOWNLOADS = 7;
5281 SYSTEM = 8;
5282 OTHER = 9;
5283 }
5284 optional Category category = 1;
5285 // Category size in bytes.
5286 optional int64 size_bytes = 2;
5287 // Time that the cache file was produced.
5288 // Uses System.currentTimeMillis(), which is wall clock time.
5289 optional int64 cache_time_millis = 3;
5290}
Tej Singhd6d6d772018-09-05 17:41:25 -07005291
5292/**
Tej Singhe7726dc2018-09-21 11:42:12 -07005293 * Pulls per uid I/O stats. The stats are cumulative since boot.
5294 *
5295 * Read/write bytes are I/O events from a storage device
5296 * Read/write chars are data requested by read/write syscalls, and can be
5297 * satisfied by caching.
5298 *
5299 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
5300 */
5301message DiskIo {
5302 optional int32 uid = 1 [(is_uid) = true];
5303 optional int64 fg_chars_read = 2;
5304 optional int64 fg_chars_write = 3;
5305 optional int64 fg_bytes_read = 4;
5306 optional int64 fg_bytes_write = 5;
5307 optional int64 bg_chars_read = 6;
5308 optional int64 bg_chars_write = 7;
5309 optional int64 bg_bytes_read = 8;
5310 optional int64 bg_bytes_write = 9;
5311 optional int64 fg_fsync = 10;
5312 optional int64 bg_fsync= 11;
5313}
5314
5315
5316/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005317 * Pulls the number of fingerprints for each user.
5318 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005319 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005320 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005321message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005322 // The associated user. Eg: 0 for owners, 10+ for others.
5323 // Defined in android/os/UserHandle.java
5324 optional int32 user = 1;
5325 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005326 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005327}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005328
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005329/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005330 * Pulls the number of faces for each user.
5331 *
5332 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5333 */
5334message NumFacesEnrolled {
5335 // The associated user. Eg: 0 for owners, 10+ for others.
5336 // Defined in android/os/UserHandle.java
5337 optional int32 user = 1;
5338 // Number of faces registered to that user.
5339 optional int32 num_faces_enrolled = 2;
5340}
5341/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005342 * A mapping of role holder -> role
5343 */
5344message RoleHolder {
5345 // uid of the role holder
5346 optional int32 uid = 1 [(is_uid) = true];
5347
5348 // package name of the role holder
5349 optional string package_name = 2;
5350
5351 // the role held
5352 optional string role = 3;
5353}
5354
Yangsteraf9aee72018-10-12 09:26:16 -07005355message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005356 // These are all in byte resolution.
5357 optional int64 min = 1 [deprecated = true];
5358 optional int64 average = 2 [deprecated = true];
5359 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005360
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005361 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5362 // int64 fields.
5363 optional int32 mean_kb = 4;
5364 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005365}
5366
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005367// A reduced subset of process states; reducing the number of possible states allows more
5368// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5369enum ProcessStateAggregated {
5370 PROCESS_STATE_UNKNOWN = 0;
5371 // Persistent system process.
5372 PROCESS_STATE_PERSISTENT = 1;
5373 // Top activity; actually any visible activity.
5374 PROCESS_STATE_TOP = 2;
5375 // Process binding to top or a foreground service.
5376 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5377 // Processing running a foreground service.
5378 PROCESS_STATE_FGS = 4;
5379 // Important foreground process (ime, wallpaper, etc).
5380 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5381 // Important background process.
5382 PROCESS_STATE_BACKGROUND = 6;
5383 // Process running a receiver.
5384 PROCESS_STATE_RECEIVER = 7;
5385 // All kinds of cached processes.
5386 PROCESS_STATE_CACHED = 8;
5387}
5388
5389// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005390message ProcessStatsStateProto {
5391 optional android.service.procstats.ScreenState screen_state = 1;
5392
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005393 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005394
5395 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5396 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005397 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5398
5399 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005400
5401 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005402 optional int64 duration_millis = 4 [deprecated = true];
5403 // Same as above, but with minute resolution so it fits into an int32.
5404 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005405
5406 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005407 optional int64 realtime_duration_millis = 9 [deprecated = true];
5408 // Same as above, but with minute resolution so it fits into an int32.
5409 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005410
5411 // # of samples taken
5412 optional int32 sample_size = 5;
5413
5414 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005415 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005416
5417 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005418 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005419
5420 // RSS is memory resident for this process
5421 optional AggStats rss = 8;
5422}
5423
5424// Next Tag: 7
5425message ProcessStatsProto {
5426 // Name of process.
5427 optional string process = 1;
5428
5429 // Uid of the process.
5430 optional int32 uid = 2;
5431
5432 // Information about how often kills occurred
5433 message Kill {
5434 // Count of excessive CPU kills
5435 optional int32 cpu = 1;
5436
5437 // Count of kills when cached
5438 optional int32 cached = 2;
5439
5440 // PSS stats during cached kill
5441 optional AggStats cached_pss = 3;
5442 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005443 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005444
5445 // Time and memory spent in various states.
5446 repeated ProcessStatsStateProto states = 5;
5447
5448 // Total time process has been running... screen_state, memory_state, and process_state
5449 // will not be set.
5450 optional ProcessStatsStateProto total_running_state = 6;
5451}
5452
5453message PackageServiceOperationStatsProto {
5454 // Operate enum: Started, Foreground, Bound, Executing
5455 optional android.service.procstats.ServiceOperationState operation = 1;
5456
5457 // Number of times the service was in this operation.
5458 optional int32 count = 2;
5459
5460 // Information about a state the service can be in.
5461 message StateStats {
5462 // Screen state enum.
5463 optional android.service.procstats.ScreenState screen_state = 1;
5464 // Memory state enum.
5465 optional android.service.procstats.MemoryState memory_state = 2;
5466
5467 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005468 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005469 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005470 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005471 }
5472 repeated StateStats state_stats = 3;
5473}
5474
5475message PackageServiceStatsProto {
5476 // Name of service component.
5477 optional string service_name = 1;
5478
5479 // The operation stats.
5480 // The package_name, package_uid, package_version, service_name will not be set to save space.
5481 repeated PackageServiceOperationStatsProto operation_stats = 2;
5482}
5483
5484message PackageAssociationSourceProcessStatsProto {
5485 // Uid of the process.
5486 optional int32 process_uid = 1;
5487 // Process name.
5488 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005489 // Package name.
5490 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005491 // Total count of the times this association appeared.
5492 optional int32 total_count = 3;
5493
5494 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005495 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005496
5497 // Total count of the times this association became actively impacting its target process.
5498 optional int32 active_count = 5;
5499
5500 // Information on one source in this association.
5501 message StateStats {
5502 // Process state enum.
5503 optional android.service.procstats.ProcessState process_state = 1;
5504 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005505 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005506 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005507 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005508 }
5509 repeated StateStats active_state_stats = 6;
5510}
5511
5512message PackageAssociationProcessStatsProto {
5513 // Name of the target component.
5514 optional string component_name = 1;
5515 // Information on one source in this association.
5516 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5517}
5518
5519
5520message ProcessStatsPackageProto {
5521 // Name of package.
5522 optional string package = 1;
5523
5524 // Uid of the package.
5525 optional int32 uid = 2;
5526
5527 // Version of the package.
5528 optional int64 version = 3;
5529
5530 // Stats for each process running with the package loaded in to it.
5531 repeated ProcessStatsProto process_stats = 4;
5532
5533 // Stats for each of the package's services.
5534 repeated PackageServiceStatsProto service_stats = 5;
5535
5536 // Stats for each association with the package.
5537 repeated PackageAssociationProcessStatsProto association_stats = 6;
5538}
5539
5540message ProcessStatsSectionProto {
5541 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005542 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005543
5544 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005545 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005546
5547 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005548 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005549
5550 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005551 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005552
5553 // System runtime library. e.g. "libdvm.so", "libart.so".
5554 optional string runtime = 5;
5555
5556 // whether kernel reports swapped pss.
5557 optional bool has_swapped_pss = 6;
5558
5559 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5560 enum Status {
5561 STATUS_UNKNOWN = 0;
5562 STATUS_COMPLETE = 1;
5563 STATUS_PARTIAL = 2;
5564 STATUS_SHUTDOWN = 3;
5565 STATUS_SYSPROPS = 4;
5566 }
5567 repeated Status status = 7;
5568
Chenjie Yub2ecc792019-01-17 10:27:26 -08005569 // Number of pages available of various types and sizes, representation fragmentation.
5570 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5571
Yangsteraf9aee72018-10-12 09:26:16 -07005572 // Stats for each process.
5573 repeated ProcessStatsProto process_stats = 8;
5574
5575 // Stats for each package.
5576 repeated ProcessStatsPackageProto package_stats = 9;
5577}
5578
Chenjie Yub2ecc792019-01-17 10:27:26 -08005579message ProcessStatsAvailablePagesProto {
5580 // Node these pages are in (as per /proc/pagetypeinfo)
5581 optional int32 node = 1;
5582
5583 // Zone these pages are in (as per /proc/pagetypeinfo)
5584 optional string zone = 2;
5585
5586 // Label for the type of these pages (as per /proc/pagetypeinfo)
5587 optional string label = 3;
5588
5589 // Distribution of number of pages available by order size. First entry in array is
5590 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5591 repeated int32 pages_per_order = 4;
5592}
5593
Chenjie Yu12e5e672018-09-14 15:54:59 -07005594/**
5595 * Pulled from ProcessStatsService.java
5596 */
5597message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005598 optional ProcessStatsSectionProto proc_stats_section = 1;
5599}
5600
Chenjie Yuf910b7802019-01-11 16:08:20 -08005601/**
5602 * Pulled from ProcessStatsService.java
5603 */
5604message ProcStatsPkgProc {
5605 optional ProcessStatsSectionProto proc_stats_section = 1;
5606}
5607
Chris Wrencdea3b72019-11-22 16:58:17 -05005608// Next Tag: 2
5609message PackageRemoteViewInfoProto {
5610 optional string package_name = 1;
5611 // add per-package additional info here (like channels)
5612}
5613
5614// Next Tag: 2
5615message NotificationRemoteViewsProto {
5616 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5617}
5618
5619/**
5620 * Pulled from NotificationManagerService.java
5621 */
5622message NotificationRemoteViews {
5623 optional NotificationRemoteViewsProto notification_remote_views = 1;
5624}
5625
Yotam Aron74299972020-01-16 16:20:58 +02005626/**
5627 * Atom that contains a list of a package's preferences, pulled from NotificationManagerService.java
5628 */
5629message PackageNotificationPreferences {
5630 // Uid under which the package is installed.
5631 optional int32 uid = 1;
5632 // Notification importance, which specifies when and how a notification is displayed.
5633 // Specified under core/java/android/app/NotificationManager.java.
5634 optional int32 importance = 2;
5635 // Lockscreen visibility as set by the user.
5636 optional int32 visibility = 3;
5637 // Bitfield mask indicating what fields were locked by the user (see LockableAppfields in
5638 // PreferencesHelper.java)
5639 optional int32 user_locked_fields = 4;
5640}
5641
5642/**
5643 * Atom that contains a list of a package's channel preferences, pulled from
5644 * NotificationManagerService.java.
5645 */
5646message PackageNotificationChannelPreferences {
5647 // Uid under which the package is installed.
5648 optional int32 uid = 1;
5649 // Channel's ID. Should always be available.
5650 optional string channel_id = 2;
5651 // Channel's name. Should always be available.
5652 optional string channel_name = 3;
5653 // Channel's description. Optionally set by the channel creator.
5654 optional string description = 4;
5655 // Notification importance, which specifies when and how a notification is displayed. Specified
5656 // under core/java/android/app/NotificationManager.java.
5657 optional int32 importance = 5;
5658 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5659 // at core/java/android/app/NotificationChannel.java
5660 optional int32 user_locked_fields = 6;
5661 // Indicates if the channel was deleted by the app.
5662 optional bool is_deleted = 7;
5663}
5664
5665/**
5666 * Atom that contains a list of a package's channel group preferences, pulled from
5667 * NotificationManagerService.java.
5668 */
5669message PackageNotificationChannelGroupPreferences {
5670 // Uid under which the package is installed.
5671 optional int32 uid = 1;
5672 // Channel Group's ID. Should always be available.
5673 optional string group_id = 2;
5674 // Channel Group's name. Should always be available.
5675 optional string group_name = 3;
5676 // Channel Group's description. Optionally set by group creator.
5677 optional string description = 4;
5678 // Indicates if notifications from this channel group are blocked.
5679 optional bool is_blocked = 5;
5680 // Bitmask representing which fields have been set by the user. See field bitmask descriptions
5681 // at core/java/android/app/NotificationChannelGroup.java
5682 optional int32 user_locked_fields = 6;
5683}
5684
Yangsteraf9aee72018-10-12 09:26:16 -07005685message PowerProfileProto {
5686 optional double cpu_suspend = 1;
5687
5688 optional double cpu_idle = 2;
5689
5690 optional double cpu_active = 3;
5691
5692 message CpuCluster {
5693 optional int32 id = 1;
5694 optional double cluster_power = 2;
5695 optional int32 cores = 3;
5696 repeated int64 speed = 4;
5697 repeated double core_power = 5;
5698 }
5699
5700 repeated CpuCluster cpu_cluster = 40;
5701
5702 optional double wifi_scan = 4;
5703
5704 optional double wifi_on = 5;
5705
5706 optional double wifi_active = 6;
5707
5708 optional double wifi_controller_idle = 7;
5709
5710 optional double wifi_controller_rx = 8;
5711
5712 optional double wifi_controller_tx = 9;
5713
5714 repeated double wifi_controller_tx_levels = 10;
5715
5716 optional double wifi_controller_operating_voltage = 11;
5717
5718 optional double bluetooth_controller_idle = 12;
5719
5720 optional double bluetooth_controller_rx = 13;
5721
5722 optional double bluetooth_controller_tx = 14;
5723
5724 optional double bluetooth_controller_operating_voltage = 15;
5725
5726 optional double modem_controller_sleep = 16;
5727
5728 optional double modem_controller_idle = 17;
5729
5730 optional double modem_controller_rx = 18;
5731
5732 repeated double modem_controller_tx = 19;
5733
5734 optional double modem_controller_operating_voltage = 20;
5735
5736 optional double gps_on = 21;
5737
5738 repeated double gps_signal_quality_based = 22;
5739
5740 optional double gps_operating_voltage = 23;
5741
5742 optional double bluetooth_on = 24;
5743
5744 optional double bluetooth_active = 25;
5745
5746 optional double bluetooth_at_cmd = 26;
5747
5748 optional double ambient_display = 27;
5749
5750 optional double screen_on = 28;
5751
5752 optional double radio_on = 29;
5753
5754 optional double radio_scanning = 30;
5755
5756 optional double radio_active = 31;
5757
5758 optional double screen_full = 32;
5759
5760 optional double audio = 33;
5761
5762 optional double video = 34;
5763
5764 optional double flashlight = 35;
5765
5766 optional double memory = 36;
5767
5768 optional double camera = 37;
5769
5770 optional double wifi_batched_scan = 38;
5771
5772 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005773}
Chenjie Yuab530202018-09-26 12:39:20 -07005774
5775/**
5776 * power_profile.xml and other constants for power model calculations.
5777 * Pulled from PowerProfile.java
5778 */
5779message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005780 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005781}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005782
5783/**
arangelovd5db50e2018-10-12 20:24:39 +01005784 * Logs when a user restriction was added or removed.
5785 *
5786 * Logged from:
5787 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5788 */
5789message UserRestrictionChanged {
5790 // The raw string of the user restriction as defined in UserManager.
5791 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5792 optional string restriction = 1;
5793 // Whether the restriction is enabled or disabled.
5794 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005795}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005796
5797/**
5798 * Pulls process user time and system time. Puller takes a snapshot of all pids
5799 * in the system and returns cpu stats for those that are working at the time.
5800 * Dead pids will be dropped. Kernel processes are excluded.
5801 * Min cool-down is 5 sec.
5802 */
5803message ProcessCpuTime {
5804 optional int32 uid = 1 [(is_uid) = true];
5805
5806 optional string process_name = 2;
5807 // Process cpu time in user space, cumulative from boot/process start
5808 optional int64 user_time_millis = 3;
5809 // Process cpu time in system space, cumulative from boot/process start
5810 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005811}
Misha Wagner5a51e002018-10-03 15:04:09 +01005812
5813/**
5814 * Pulls the CPU usage for each thread.
5815 *
5816 * Read from /proc/$PID/task/$TID/time_in_state files.
5817 *
5818 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5819 * time_in_state files not being present on some phones, have not been addressed. These should be
5820 * considered before a public release.
5821 */
5822message CpuTimePerThreadFreq {
5823 // UID that owns the process.
5824 optional int32 uid = 1 [(is_uid) = true];
5825 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005826 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005827 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005828 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005829 // Name of the process taken from `/proc/$PID/cmdline`.
5830 optional string process_name = 4;
5831 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5832 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005833
5834 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5835 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5836 // frequencies are given here as the alternative is sending eight separate atoms. This method
5837 // significantly reduces the amount of data created
5838 optional int32 frequency1_khz = 6;
5839 optional int32 time1_millis = 7;
5840 optional int32 frequency2_khz = 8;
5841 optional int32 time2_millis = 9;
5842 optional int32 frequency3_khz = 10;
5843 optional int32 time3_millis = 11;
5844 optional int32 frequency4_khz = 12;
5845 optional int32 time4_millis = 13;
5846 optional int32 frequency5_khz = 14;
5847 optional int32 time5_millis = 15;
5848 optional int32 frequency6_khz = 16;
5849 optional int32 time6_millis = 17;
5850 optional int32 frequency7_khz = 18;
5851 optional int32 time7_millis = 19;
5852 optional int32 frequency8_khz = 20;
5853 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005854}
Bookatz75ee60422018-11-09 12:27:37 -08005855
5856/**
Bookatz366a4432018-11-20 09:42:33 -08005857 * Pulls information about the device's build.
5858 */
5859message BuildInformation {
5860 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5861 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5862 optional string fingerprint = 1;
5863
5864 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5865 optional string brand = 2;
5866
5867 // Build.PRODUCT. The name of the overall product.
5868 optional string product = 3;
5869
5870 // Build.DEVICE. The name of the industrial design.
5871 optional string device = 4;
5872
5873 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5874 optional string version_release = 5;
5875
5876 // Build.ID. E.g. a label like "M4-rc20".
5877 optional string id = 6;
5878
5879 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5880 // represent this build.
5881 optional string version_incremental = 7;
5882
5883 // Build.TYPE. The type of build, like "user" or "eng".
5884 optional string type = 8;
5885
5886 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5887 optional string tags = 9;
5888}
5889
5890/**
Adam He420947c2019-01-23 15:59:09 -08005891 * Logs information about mismatched caller for content capture.
5892 *
5893 * Logged from:
5894 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5895 */
5896message ContentCaptureCallerMismatchReported {
5897 optional string intended_package = 1;
5898 optional string calling_package = 2;
5899}
5900
5901/**
5902 * Logs information about content capture service events.
5903 *
5904 * Logged from:
5905 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5906 */
5907message ContentCaptureServiceEvents {
5908 // The type of event.
5909 enum Event {
5910 UNKNOWN = 0;
5911 ON_CONNECTED = 1;
5912 ON_DISCONNECTED = 2;
5913 SET_WHITELIST = 3;
5914 SET_DISABLED = 4;
5915 ON_USER_DATA_REMOVED = 5;
5916 }
5917 optional Event event = 1;
5918 // component/package of content capture service.
5919 optional string service_info = 2;
5920 // component/package of target.
5921 // it's a concatenated list of component/package for SET_WHITELIST event
5922 // separated by " ".
5923 optional string target_info = 3;
5924}
5925
5926/**
5927 * Logs information about content capture session events.
5928 *
5929 * Logged from:
5930 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5931 */
5932message ContentCaptureSessionEvents {
5933 // The type of event.
5934 enum Event {
5935 UNKNOWN = 0;
5936 ON_SESSION_STARTED = 1;
5937 ON_SESSION_FINISHED = 2;
5938 SESSION_NOT_CREATED = 3;
5939 }
5940 optional int32 session_id = 1;
5941 optional Event event = 2;
5942 // (n/a on session finished)
5943 optional int32 state_flags = 3;
5944 // component/package of content capture service.
5945 optional string service_info = 4;
5946 // component/package of app.
5947 // (n/a on session finished)
5948 optional string app_info = 5;
5949 optional bool is_child_session = 6;
5950}
5951
5952/**
5953 * Logs information about session being flushed.
5954 *
5955 * Logged from:
5956 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5957 */
5958message ContentCaptureFlushed {
5959 optional int32 session_id = 1;
5960 // component/package of content capture service.
5961 optional string service_info = 2;
5962 // component/package of app.
5963 optional string app_info = 3;
5964 // session start/finish events
5965 optional int32 child_session_started = 4;
5966 optional int32 child_session_finished = 5;
5967 // count of view events.
5968 optional int32 view_appeared_count = 6;
5969 optional int32 view_disappeared_count = 7;
5970 optional int32 view_text_changed_count = 8;
5971
5972 // Flush stats.
5973 optional int32 max_events = 9;
5974 optional int32 idle_flush_freq = 10;
5975 optional int32 text_flush_freq = 11;
5976 optional int32 flush_reason = 12;
5977}
5978
5979/**
Bookatz75ee60422018-11-09 12:27:37 -08005980 * Pulls on-device BatteryStats power use calculations for the overall device.
5981 */
5982message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005983 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5984 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5985 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5986 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005987}
5988
5989/**
5990 * Pulls on-device BatteryStats power use calculations broken down by uid.
5991 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5992 * that is attributed to non-uid items. They must all be included to get the total power use.
5993 */
5994message DeviceCalculatedPowerBlameUid {
5995 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5996 optional int32 uid = 1 [(is_uid) = true];
5997
Bookatz3dbc13a2018-12-21 12:16:51 -08005998 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5999 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6000 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08006001}
6002
6003/**
6004 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
6005 * drain type.
6006 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
6007 * is attributed uids. They must all be included to get the total power use.
6008 */
6009message DeviceCalculatedPowerBlameOther {
6010 // The type of item whose power use is being reported.
6011 enum DrainType {
6012 AMBIENT_DISPLAY = 0;
6013 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
6014 BLUETOOTH = 2;
6015 CAMERA = 3;
6016 // Cell-standby
6017 CELL = 4;
6018 FLASHLIGHT = 5;
6019 IDLE = 6;
6020 MEMORY = 7;
6021 // Amount that total computed drain exceeded the drain estimated using the
6022 // battery level changes and capacity.
6023 OVERCOUNTED = 8;
6024 PHONE = 9;
6025 SCREEN = 10;
6026 // Amount that total computed drain was below the drain estimated using the
6027 // battery level changes and capacity.
6028 UNACCOUNTED = 11;
6029 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
6030 WIFI = 13;
6031 }
6032 optional DrainType drain_type = 1;
6033
Bookatz3dbc13a2018-12-21 12:16:51 -08006034 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
6035 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
6036 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00006037}
arangelov4e994062018-11-13 16:12:38 +00006038
6039/**
6040 * Logs device policy features.
6041 *
6042 * Logged from:
6043 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
6044 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
6045 */
6046message DevicePolicyEvent {
6047 // The event id - unique for each event.
6048 optional android.stats.devicepolicy.EventId event_id = 1;
6049 // The admin package name.
6050 optional string admin_package_name = 2;
6051 // A generic integer parameter.
6052 optional int32 integer_value = 3;
6053 // A generic boolean parameter.
6054 optional bool boolean_value = 4;
6055 // A parameter specifying a time period in milliseconds.
6056 optional uint64 time_period_millis = 5;
6057 // A parameter specifying a list of package names, bundle extras or string parameters.
6058 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
6059}
shawnlinea5b66b2018-11-13 15:05:29 +08006060
6061/**
6062 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
6063 *
6064 * Logged from:
6065 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6066 */
6067message DocsUILaunchReported {
6068 optional android.stats.docsui.LaunchAction launch_action = 1;
6069 optional bool has_initial_uri = 2;
6070 optional android.stats.docsui.MimeType mime_type = 3;
6071 optional android.stats.docsui.Root initial_root = 4;
6072}
6073
6074/**
6075 * Logs root/app visited event in file managers/picker. Call this when the user
6076 * taps on root/app in hamburger menu.
6077 *
6078 * Logged from:
6079 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6080 */
6081message DocsUIRootVisitedReported {
6082 optional android.stats.docsui.ContextScope scope = 1;
6083 optional android.stats.docsui.Root root = 2;
6084}
6085
6086/**
6087 * Logs file operation stats. Call this when a file operation has completed.
6088 *
6089 * Logged from:
6090 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6091 */
6092message DocsUIFileOperationReported {
6093 optional android.stats.docsui.Provider provider = 1;
6094 optional android.stats.docsui.FileOperation file_op = 2;
6095}
6096
6097/**
6098 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
6099 * mode.
6100 *
6101 * Logged from:
6102 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6103 */
6104message DocsUIFileOperationCopyMoveModeReported {
6105 optional android.stats.docsui.FileOperation file_op = 1;
6106 optional android.stats.docsui.CopyMoveOpMode mode = 2;
6107}
6108
6109
6110/**
6111 * Logs file sub operation stats. Call this when a file operation has failed.
6112 *
6113 * Logged from:
6114 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6115 */
6116message DocsUIFileOperationFailureReported {
6117 optional android.stats.docsui.Authority authority = 1;
6118 optional android.stats.docsui.SubFileOperation sub_op = 2;
6119}
6120
6121/**
6122* Logs the cancellation of a file operation. Call this when a job is canceled
6123*
6124* Logged from:
6125* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6126*/
6127message DocsUIFileOperationCanceledReported {
6128 optional android.stats.docsui.FileOperation file_op = 1;
6129}
6130
6131/**
6132 * Logs startup time in milliseconds.
6133 *
6134 * Logged from:
6135 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6136 */
6137message DocsUIStartupMsReported {
6138 optional int32 startup_millis = 1;
6139}
6140
6141/**
6142 * Logs the action that was started by user.
6143 *
6144 * Logged from:
6145 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6146 */
6147message DocsUIUserActionReported {
6148 optional android.stats.docsui.UserAction action = 1;
6149}
6150
6151/**
6152 * Logs the invalid type when invalid scoped access is requested.
6153 *
6154 * Logged from:
6155 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
6156 */
6157message DocsUIInvalidScopedAccessRequestReported {
6158 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00006159}
Ben Murdochbab399f62018-12-06 11:01:38 +00006160
6161/**
shawnlina75e82d2019-01-07 10:31:12 +08006162 * Logs the package name that launches docsui picker mode.
6163 *
6164 * Logged from:
6165 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6166 */
6167message DocsUIPickerLaunchedFromReported {
6168 optional string package_name = 1;
6169}
6170
6171/**
6172 * Logs the search type.
6173 *
6174 * Logged from:
6175 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6176 */
6177message DocsUISearchTypeReported {
6178 optional android.stats.docsui.SearchType search_type = 1;
6179}
6180
6181/**
6182 * Logs the search mode.
6183 *
6184 * Logged from:
6185 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6186 */
6187message DocsUISearchModeReported {
6188 optional android.stats.docsui.SearchMode search_mode = 1;
6189}
6190
6191/**
6192 * Logs the pick result information.
6193 *
6194 * Logged from:
6195 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
6196 */
6197message DocsUIPickResultReported {
6198 optional int32 total_action_count = 1;
6199 optional int64 duration_millis = 2;
6200 optional int32 file_count= 3;
6201 optional bool is_searching = 4;
6202 optional android.stats.docsui.Root picked_from = 5;
6203 optional android.stats.docsui.MimeType mime_type = 6;
6204 optional int32 repeatedly_pick_times = 7;
6205}
6206
6207/**
Ben Murdochbab399f62018-12-06 11:01:38 +00006208 * Logs when an app's memory is compacted.
6209 *
6210 * Logged from:
6211 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6212 */
6213message AppCompacted {
6214 // The pid of the process being compacted.
6215 optional int32 pid = 1;
6216
6217 // The name of the process being compacted.
6218 optional string process_name = 2;
6219
6220 // The type of compaction.
6221 enum Action {
6222 UNKNOWN = 0;
6223 SOME = 1;
6224 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01006225 PERSISTENT = 3;
6226 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00006227 }
Ben Murdoch01720b82018-12-19 18:03:44 +00006228 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00006229
6230 // Total RSS in kilobytes consumed by the process prior to compaction.
6231 optional int64 before_rss_total_kilobytes = 4;
6232
6233 // File RSS in kilobytes consumed by the process prior to compaction.
6234 optional int64 before_rss_file_kilobytes = 5;
6235
6236 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
6237 optional int64 before_rss_anon_kilobytes = 6;
6238
6239 // Swap in kilobytes consumed by the process prior to compaction.
6240 optional int64 before_swap_kilobytes = 7;
6241
6242 // Total RSS in kilobytes consumed by the process after compaction.
6243 optional int64 after_rss_total_kilobytes = 8;
6244
6245 // File RSS in kilobytes consumed by the process after compaction.
6246 optional int64 after_rss_file_kilobytes = 9;
6247
6248 // Anonymous RSS in kilobytes consumed by the process after compaction.
6249 optional int64 after_rss_anon_kilobytes = 10;
6250
6251 // Swap in kilobytes consumed by the process after compaction.
6252 optional int64 after_swap_kilobytes = 11;
6253
6254 // The time taken to perform compaction in milliseconds.
6255 optional int64 time_to_compact_millis = 12;
6256
6257 // The last compaction action performed for this app.
6258 optional Action last_action = 13;
6259
Ben Murdoch01720b82018-12-19 18:03:44 +00006260 // The last time that compaction was attempted on this process in milliseconds
6261 // since boot, not including sleep (see SystemClock.uptimeMillis()).
6262 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00006263
Ben Murdoch885c21b2019-03-15 18:02:04 +00006264 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00006265 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00006266
6267 // The process state at the time of compaction.
6268 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00006269
6270 // Free ZRAM in kilobytes before compaction.
6271 optional int64 before_zram_free_kilobytes = 17;
6272
6273 // Free ZRAM in kilobytes after compaction.
6274 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00006275}
lifr157fc552018-12-12 16:38:04 +08006276
6277/**
lifrb6b90b62019-03-29 00:40:17 +08006278 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
6279 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
6280 *
lifr1f74b052019-04-16 22:16:30 +08006281 * The NetworkDnsEventReported message represents the entire lookup operation, which may
6282 * result one or more queries to the recursive DNS resolvers. Those are individually logged
6283 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
6284 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08006285 */
6286message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08006287 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08006288
lifr1f74b052019-04-16 22:16:30 +08006289 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08006290
6291 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08006292 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08006293
lifr1f74b052019-04-16 22:16:30 +08006294 // Only valid for event_type = EVENT_GETADDRINFO.
6295 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08006296
lifr1f74b052019-04-16 22:16:30 +08006297 // Flags passed to android_res_nsend() defined in multinetwork.h
6298 // Only valid for event_type = EVENT_RESNSEND.
6299 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08006300
lifrad9becc2019-05-20 11:04:41 +08006301 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08006302
6303 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08006304 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08006305
6306 // Additional pass-through fields opaque to statsd.
6307 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08006308 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08006309
6310 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
6311 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08006312}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08006313
6314/**
6315 * Logs when a data stall event occurs.
6316 *
6317 * Log from:
6318 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6319 */
6320message DataStallEvent {
6321 // Data stall evaluation type.
6322 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
6323 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
6324 optional int32 evaluation_type = 1;
6325 // See definition in data_stall_event.proto.
6326 optional com.android.server.connectivity.ProbeResult validation_result = 2;
6327 // See definition in data_stall_event.proto.
6328 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
6329 // See definition in data_stall_event.proto.
6330 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
6331 // See definition in data_stall_event.proto.
6332 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
6333 // See definition in data_stall_event.proto.
6334 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
6335}
Christian Brunschenf86039e2018-12-21 12:26:14 +00006336
6337/*
6338 * Logs when RescueParty resets some set of experiment flags.
6339 *
6340 * Logged from:
6341 * frameworks/base/services/core/java/com/android/server/RescueParty.java
6342 */
6343message RescuePartyResetReported {
6344 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
6345 optional int32 rescue_level = 1;
6346}
Mathew Inwoodb375be52019-01-04 11:36:25 +00006347
6348/**
6349 * Logs when signed config is received from an APK, and if that config was applied successfully.
6350 * Logged from:
6351 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
6352 */
6353message SignedConfigReported {
6354 enum Type {
6355 UNKNOWN_TYPE = 0;
6356 GLOBAL_SETTINGS = 1;
6357 }
6358 optional Type type = 1;
6359
6360 // The final status of the signed config received.
6361 enum Status {
6362 UNKNOWN_STATUS = 0;
6363 APPLIED = 1;
6364 BASE64_FAILURE_CONFIG = 2;
6365 BASE64_FAILURE_SIGNATURE = 3;
6366 SECURITY_EXCEPTION = 4;
6367 INVALID_CONFIG = 5;
6368 OLD_CONFIG = 6;
6369 SIGNATURE_CHECK_FAILED = 7;
6370 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00006371 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00006372 }
6373 optional Status status = 2;
6374
6375 // The version of the signed config processed.
6376 optional int32 version = 3;
6377
6378 // The package name that the config was extracted from.
6379 optional string from_package = 4;
6380
6381 enum Key {
6382 NO_KEY = 0;
6383 DEBUG = 1;
6384 PRODUCTION = 2;
6385 }
6386 // Which key was used to verify the config.
6387 optional Key verified_with = 5;
6388}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006389
6390/*
6391 * Logs GNSS Network-Initiated (NI) location events.
6392 *
6393 * Logged from:
6394 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6395 */
6396message GnssNiEventReported {
6397 // The type of GnssNiEvent.
6398 enum EventType {
6399 UNKNOWN = 0;
6400 NI_REQUEST = 1;
6401 NI_RESPONSE = 2;
6402 }
6403 optional EventType event_type = 1;
6404
6405 // An ID generated by HAL to associate NI notifications and UI responses.
6406 optional int32 notification_id = 2;
6407
6408 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006409 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006410
6411 // NI requires notification.
6412 optional bool need_notify = 4;
6413
6414 // NI requires verification.
6415 optional bool need_verify = 5;
6416
6417 // NI requires privacy override, no notification/minimal trace.
6418 optional bool privacy_override = 6;
6419
6420 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6421 // seconds.
6422 optional int32 timeout = 7;
6423
6424 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006425 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006426
6427 // String representing the requester of the network inititated location request.
6428 optional string requestor_id = 9;
6429
6430 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6431 // network initiated location request.
6432 optional string text = 10;
6433
6434 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006435 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006436
6437 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006438 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006439
6440 // True if SUPL ES is enabled.
6441 optional bool is_supl_es_enabled = 13;
6442
6443 // True if GNSS location is enabled.
6444 optional bool is_location_enabled = 14;
6445
6446 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006447 optional android.server.location.GnssUserResponseType user_response = 15;
6448}
6449
6450/**
6451 * Logs GNSS non-framework (NFW) location notification.
6452 *
6453 * Logged from:
6454 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6455 */
6456message GnssNfwNotificationReported {
6457 // Package name of the Android proxy application representing the non-framework entity that
6458 // requested location. Set to empty string if unknown.
6459 optional string proxy_app_package_name = 1;
6460
6461 // Protocol stack that initiated the non-framework location request.
6462 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6463
6464 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6465 // set to empty string. This field is opaque to the framework and used for logging purposes.
6466 optional string other_protocol_stack_name = 3;
6467
6468 // Source initiating/receiving the location information.
6469 optional android.server.location.NfwRequestor requestor = 4;
6470
6471 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6472 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6473 // and used for logging purposes.
6474 optional string requestor_id = 5;
6475
6476 // Indicates whether location information was provided for this request.
6477 optional android.server.location.NfwResponseType response_type = 6;
6478
6479 // True if the device is in user initiated emergency session.
6480 optional bool in_emergency_mode = 7;
6481
6482 // True if cached location is provided.
6483 optional bool is_cached_location = 8;
6484
6485 // True if proxy app permission mismatch between framework and GNSS HAL.
6486 optional bool is_permission_mismatched = 9;
6487}
6488
6489/**
6490 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6491 *
6492 * Logged from:
6493 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6494 */
6495message GnssConfigurationReported {
6496 // SUPL host name.
6497 optional string supl_host = 1;
6498
6499 // SUPL port number.
6500 optional int32 supl_port = 2;
6501
6502 // C2K host name.
6503 optional string c2k_host = 3;
6504
6505 // C2K port number.
6506 optional int32 c2k_port = 4;
6507
6508 // The SUPL version requested by Carrier.
6509 optional int32 supl_ver = 5;
6510
6511 // The SUPL mode.
6512 optional android.server.location.SuplMode supl_mode = 6;
6513
6514 // True if NI emergency SUPL restrictions is enabled.
6515 optional bool supl_es = 7;
6516
6517 // LTE Positioning Profile settings
6518 optional android.server.location.LppProfile lpp_profile = 8;
6519
6520 // Positioning protocol on A-Glonass system.
6521 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6522
6523 // True if emergency PDN is used. Otherwise, regular PDN is used.
6524 optional bool use_emergency_pdn_for_emergency_supl= 10;
6525
6526 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6527 optional android.server.location.GpsLock gps_lock = 11;
6528
6529 // Number of seconds to extend the emergency session duration post emergency call.
6530 optional int32 es_extension_sec = 12;
6531
6532 // The full list of package names of proxy Android applications representing the non-framework
6533 // location access entities (on/off the device) for which the framework user has granted
6534 // non-framework location access permission. The package names are concatenated in one string
6535 // with spaces as separators.
6536 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006537}
Jack Yu95b64f32018-12-13 18:26:11 +08006538
6539/**
6540 * Logs when a NFC device's error occurred.
6541 * Logged from:
6542 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6543 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6544 */
6545message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006546 enum Type {
6547 UNKNOWN = 0;
6548 CMD_TIMEOUT = 1;
6549 ERROR_NOTIFICATION = 2;
6550 AID_OVERFLOW = 3;
6551 }
6552 optional Type type = 1;
6553 // If it's nci cmd timeout, log the timeout command.
6554 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006555
Alex Salod7c3eef2019-01-25 14:43:27 -08006556 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006557}
6558
6559/**
6560 * Logs when a NFC device's state changed event
6561 * Logged from:
6562 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6563 */
6564message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006565 enum State {
6566 UNKNOWN = 0;
6567 OFF = 1;
6568 ON = 2;
6569 ON_LOCKED = 3; // Secure Nfc enabled.
6570 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6571 }
6572 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006573}
6574
6575/**
6576 * Logs when a NFC Beam Transaction occurred.
6577 * Logged from:
6578 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6579 */
6580message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006581 enum Operation {
6582 UNKNOWN = 0;
6583 SEND = 1;
6584 RECEIVE = 2;
6585 }
6586 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006587}
6588
6589/**
6590 * Logs when a NFC Card Emulation Transaction occurred.
6591 * Logged from:
6592 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6593 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6594 */
6595message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006596 enum Category {
6597 UNKNOWN = 0;
6598 HCE_PAYMENT = 1;
6599 HCE_OTHER = 2;
6600 OFFHOST = 3;
6601 }
6602 // Transaction belongs to HCE payment or HCE other category, or offhost.
6603 optional Category category = 1;
6604 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6605 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006606}
6607
6608/**
6609 * Logs when a NFC Tag event occurred.
6610 * Logged from:
6611 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6612 */
6613message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006614 enum Type {
6615 UNKNOWN = 0;
6616 URL = 1;
6617 BT_PAIRING = 2;
6618 PROVISION = 3;
6619 WIFI_CONNECT = 4;
6620 APP_LAUNCH = 5;
6621 OTHERS = 6;
6622 }
6623 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006624}
6625
6626/**
6627 * Logs when Hce transaction triggered
6628 * Logged from:
6629 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6630 */
6631message NfcHceTransactionOccurred {
6632 // The latency period(in microseconds) it took for the first HCE data
6633 // exchange.
6634 optional uint32 latency_micros = 1;
6635}
6636
6637/**
6638 * Logs when SecureElement state event changed
6639 * Logged from:
6640 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6641 */
6642message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006643 enum State {
6644 UNKNOWN = 0;
6645 INITIALIZED = 1;
6646 DISCONNECTED = 2;
6647 CONNECTED = 3;
6648 HALCRASH = 4;
6649 }
6650 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006651
Alex Salod7c3eef2019-01-25 14:43:27 -08006652 optional string state_change_reason = 2;
6653 // SIMx or eSEx.
6654 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006655}
6656
6657/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006658 * Information about a permission grant request
6659 */
6660message PermissionGrantRequestResultReported {
6661 // unique value identifying an API call. A API call might result in multiple of these atoms
6662 optional int64 request_id = 1;
6663
6664 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006665 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006666
6667 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006668 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006669
6670 // The permission to be granted
6671 optional string permission_name = 4;
6672
6673 // If the permission was explicitly requested via the API or added by the system
6674 optional bool is_implicit = 5;
6675
6676 enum Result {
6677 UNDEFINED = 0;
6678 // permission request was ignored
6679 IGNORED = 1;
6680 // permission request was ignored because it was user fixed
6681 IGNORED_USER_FIXED = 2;
6682 // permission request was ignored because it was policy fixed
6683 IGNORED_POLICY_FIXED = 3;
6684 // permission was granted by user action
6685 USER_GRANTED = 4;
6686 // permission was automatically granted
6687 AUTO_GRANTED = 5;
6688 // permission was denied by user action
6689 USER_DENIED = 6;
6690 // permission was denied with prejudice by the user
6691 USER_DENIED_WITH_PREJUDICE = 7;
6692 // permission was automatically denied
6693 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006694 // permission request was ignored because permission is restricted
6695 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006696 // one time permission was granted by user action
6697 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006698 // user ignored request by leaving the request screen without choosing any option
6699 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006700 // user granted the permission after being linked to settings
6701 USER_GRANTED_IN_SETTINGS = 12;
6702 // user denied the permission after being linked to settings
6703 USER_DENIED_IN_SETTINGS = 13;
6704 // user denied the permission with prejudice after being linked to settings
6705 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6706 // permission was automatically revoked after one-time permission expired
6707 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Eugene Susla6db4be52020-01-09 11:02:09 -08006708 // permission was automatically revoked for unused app
6709 AUTO_UNUSED_APP_PERMISSION_REVOKED = 16;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006710 }
6711 // The result of the permission grant
6712 optional Result result = 6;
6713}
6714
6715/**
Jack Yu95b64f32018-12-13 18:26:11 +08006716 * Logs when Omapi API used
6717 * Logged from:
6718 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6719 */
6720message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006721 enum Operation {
6722 UNKNOWN = 0;
6723 OPEN_CHANNEL = 1;
6724 }
6725 optional Operation operation = 1;
6726 // SIMx or eSEx.
6727 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006728
Alex Salod7c3eef2019-01-25 14:43:27 -08006729 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006730}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006731
6732/**
Alex Saloa060aee2019-01-21 14:36:41 -08006733 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6734 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006735 * Logged from:
6736 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6737 */
6738message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006739 optional int64 dispatch_latency_millis = 1;
6740}
6741
6742/**
6743 * Logs AttentionManagerService attention check result.
6744 *
6745 * Logged from:
6746 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6747 */
6748message AttentionManagerServiceResultReported {
6749 // See core/java/android/service/attention/AttentionService.java
6750 enum AttentionCheckResult {
6751 UNKNOWN = 20;
6752 ATTENTION_SUCCESS_ABSENT = 0;
6753 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006754 ATTENTION_FAILURE_UNKNOWN = 2;
6755 ATTENTION_FAILURE_CANCELLED = 3;
6756 ATTENTION_FAILURE_PREEMPTED = 4;
6757 ATTENTION_FAILURE_TIMED_OUT = 5;
6758 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006759 }
6760 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006761}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006762
6763/**
6764 * Logs when an adb connection changes state.
6765 *
6766 * Logged from:
6767 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6768 */
6769message AdbConnectionChanged {
6770 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6771 // previously selected for this system.
6772 optional int64 last_connection_time_millis = 1;
6773
6774 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6775 // to reconnect via adb without user interaction.
6776 optional int64 auth_window_millis = 2;
6777
6778 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6779 optional android.debug.AdbConnectionStateEnum state = 3;
6780
6781 // True if the 'always allow' option was selected for this system.
6782 optional bool always_allow = 4;
6783}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006784
6785/*
6786 * Logs the reported speech DSP status.
6787 *
6788 * Logged from:
6789 * Vendor audio implementation.
6790 */
6791message SpeechDspStatReported {
6792 // The total Speech DSP uptime in milliseconds.
6793 optional int32 total_uptime_millis = 1;
6794 // The total Speech DSP downtime in milliseconds.
6795 optional int32 total_downtime_millis = 2;
6796 optional int32 total_crash_count = 3;
6797 optional int32 total_recover_count = 4;
6798}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006799
6800/**
6801 * Logs USB connector contaminant status.
6802 *
6803 * Logged from: USB Service.
6804 */
6805message UsbContaminantReported {
6806 optional string id = 1;
6807 optional android.service.usb.ContaminantPresenceStatus status = 2;
6808}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006809
6810/**
6811 * This atom is for debugging purpose.
6812 */
6813message DebugElapsedClock {
6814 // Monotically increasing value for each pull.
6815 optional int64 pull_count = 1;
6816 // Time from System.elapsedRealtime.
6817 optional int64 elapsed_clock_millis = 2;
6818 // Time from System.elapsedRealtime.
6819 optional int64 same_elapsed_clock_millis = 3;
6820 // Diff between current elapsed time and elapsed time from previous pull.
6821 optional int64 elapsed_clock_diff_millis = 4;
6822
6823 enum Type {
6824 TYPE_UNKNOWN = 0;
6825 ALWAYS_PRESENT = 1;
6826 PRESENT_ON_ODD_PULLS = 2;
6827 }
6828 // Type of behavior for the pulled data.
6829 optional Type type = 5;
6830}
6831
6832/**
6833 * This atom is for debugging purpose.
6834 */
6835message DebugFailingElapsedClock {
6836 // Monotically increasing value for each pull.
6837 optional int64 pull_count = 1;
6838 // Time from System.elapsedRealtime.
6839 optional int64 elapsed_clock_millis = 2;
6840 // Time from System.elapsedRealtime.
6841 optional int64 same_elapsed_clock_millis = 3;
6842 // Diff between current elapsed time and elapsed time from previous pull.
6843 optional int64 elapsed_clock_diff_millis = 4;
6844}
Steven Wuacef6bb2019-01-23 14:21:17 -05006845
6846/** Logs System UI bubbles event changed.
6847 *
6848 * Logged from:
6849 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6850 */
6851message BubbleUIChanged {
6852
6853 // The app package that is posting the bubble.
6854 optional string package_name = 1;
6855
6856 // The notification channel that is posting the bubble.
6857 optional string notification_channel = 2;
6858
6859 // The notification id associated with the posted bubble.
6860 optional int32 notification_id = 3;
6861
6862 // The position of the bubble within the bubble stack.
6863 optional int32 position = 4;
6864
6865 // The total number of bubbles within the bubble stack.
6866 optional int32 total_number = 5;
6867
6868 // User interactions with the bubble.
6869 enum Action {
6870 UNKNOWN = 0;
6871 POSTED = 1;
6872 UPDATED = 2;
6873 EXPANDED = 3;
6874 COLLAPSED = 4;
6875 DISMISSED = 5;
6876 STACK_DISMISSED = 6;
6877 STACK_MOVED = 7;
6878 HEADER_GO_TO_APP = 8;
6879 HEADER_GO_TO_SETTINGS = 9;
6880 PERMISSION_OPT_IN = 10;
6881 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006882 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006883 SWIPE_LEFT = 13;
6884 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006885 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006886 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006887 }
6888 optional Action action = 6;
6889
6890 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6891 optional float normalized_x_position = 7;
6892 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006893
6894 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6895 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006896
6897 // Whether the bubble is an on-going one.
6898 optional bool is_ongoing = 10;
6899
6900 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006901 // This is deprecated and the value should be ignored.
6902 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006903}
Kweku Adams8845d012018-12-11 20:06:45 -08006904
6905/**
Steven Wu552f63f2019-02-05 13:41:36 -05006906 * Logs System UI bubbles developer errors.
6907 *
6908 * Logged from:
6909 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6910 */
6911message BubbleDeveloperErrorReported {
6912
6913 // The app package that is posting the bubble.
6914 optional string package_name = 1;
6915
6916 // Bubble developer error type enums.
6917 enum Error {
6918 UNKNOWN = 0;
6919 ACTIVITY_INFO_MISSING = 1;
6920 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6921 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6922 }
6923 optional Error error = 2 [default = UNKNOWN];
6924}
6925
6926/**
Kweku Adams8845d012018-12-11 20:06:45 -08006927 * Logs that a constraint for a scheduled job has changed.
6928 *
6929 * Logged from:
6930 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6931 */
6932message ScheduledJobConstraintChanged {
6933 repeated AttributionNode attribution_node = 1;
6934
6935 // Name of the job.
6936 optional string job_name = 2;
6937
6938 optional com.android.server.job.ConstraintEnum constraint = 3;
6939
6940 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006941 UNKNOWN = 0;
6942 UNSATISFIED = 1;
6943 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006944 }
6945 optional State state = 4;
6946}
Alex Salod7c3eef2019-01-25 14:43:27 -08006947
6948/**
6949 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6950 * returns true.
6951 *
6952 * Logged from:
6953 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6954 */
6955message ScreenTimeoutExtensionReported {
6956 // Describes how many times in a row did the power manager reset the screen off timeout.
6957 optional uint32 consecutive_timeout_extended_count = 1;
6958}
Hui Yu885aca12019-01-10 17:11:34 -08006959
6960/*
6961* Logs number of milliseconds it takes to start a process.
6962* The definition of app process start time is from the app launch time to
6963* the time that Zygote finished forking the app process and loaded the
6964* application package's java classes.
6965
6966* This metric is different from AppStartOccurred which is for foreground
6967* activity only.
6968
6969* ProcessStartTime can report all processes (both foreground and background)
6970* start time.
6971*
6972* Logged from:
6973* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6974*/
6975message ProcessStartTime {
6976 // The uid of the ProcessRecord.
6977 optional int32 uid = 1 [(is_uid) = true];
6978
6979 // The process pid.
6980 optional int32 pid = 2;
6981
6982 // The process name.
6983 // Usually package name, "system" for system server.
6984 // Provided by ActivityManagerService.
6985 optional string process_name = 3;
6986
6987 enum StartType {
6988 UNKNOWN = 0;
6989 WARM = 1;
6990 HOT = 2;
6991 COLD = 3;
6992 }
6993
6994 // The start type.
6995 optional StartType type = 4;
6996
6997 // The elapsed realtime at the start of the process.
6998 optional int64 process_start_time_millis = 5;
6999
7000 // Number of milliseconds it takes to reach bind application.
7001 optional int32 bind_application_delay_millis = 6;
7002
7003 // Number of milliseconds it takes to finish start of the process.
7004 optional int32 process_start_delay_millis = 7;
7005
7006 // hostingType field in ProcessRecord, the component type such as "activity",
7007 // "service", "content provider", "broadcast" or other strings.
7008 optional string hosting_type = 8;
7009
7010 // hostingNameStr field in ProcessRecord. The component class name that runs
7011 // in this process.
7012 optional string hosting_name = 9;
7013}
7014
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007015/**
Ray Essick8ab04df2019-02-15 11:01:02 -08007016 * Track Media Codec usage
7017 * Logged from:
7018 * frameworks/av/media/libstagefright/MediaCodec.cpp
7019 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
7020 */
7021message MediametricsCodecReported {
7022 optional int64 timestamp_nanos = 1;
7023 optional string package_name = 2;
7024 optional int64 package_version_code = 3;
7025 optional int64 media_apex_version = 4;
7026
7027 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7028}
7029
7030/**
7031 * Track Media Extractor (pulling video/audio streams out of containers) usage
7032 * Logged from:
7033 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
7034 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
7035 */
7036message MediametricsExtractorReported {
7037 optional int64 timestamp_nanos = 1;
7038 optional string package_name = 2;
7039 optional int64 package_version_code = 3;
7040 optional int64 media_apex_version = 4;
7041
7042 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7043}
7044
7045/**
7046 * Track how we arbitrate between microphone/input requests.
7047 * Logged from
7048 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
7049 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
7050 */
7051message MediametricsAudiopolicyReported {
7052 optional int64 timestamp_nanos = 1;
7053 optional string package_name = 2;
7054 optional int64 package_version_code = 3;
7055 optional int64 media_apex_version = 4;
7056
7057 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7058}
7059
7060/**
7061 * Track how we arbitrate between microphone requests.
7062 * Logged from
7063 * frameworks/av/media/libaudioclient/AudioRecord.cpp
7064 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
7065 */
7066message MediametricsAudiorecordReported {
7067 optional int64 timestamp_nanos = 1;
7068 optional string package_name = 2;
7069 optional int64 package_version_code = 3;
7070 optional int64 media_apex_version = 4;
7071
7072 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7073}
7074
7075/**
7076 * Track how we arbitrate between microphone/input requests.
7077 * Logged from
7078 * frameworks/av/media/libnblog/ReportPerformance.cpp
7079 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
7080 */
7081message MediametricsAudiothreadReported {
7082 optional int64 timestamp_nanos = 1;
7083 optional string package_name = 2;
7084 optional int64 package_version_code = 3;
7085 optional int64 media_apex_version = 4;
7086
7087 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7088}
7089
7090/**
7091 * Track how we arbitrate between microphone/input requests.
7092 * Logged from
7093 * frameworks/av/media/libaudioclient/AudioTrack.cpp
7094 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
7095 */
7096message MediametricsAudiotrackReported {
7097 optional int64 timestamp_nanos = 1;
7098 optional string package_name = 2;
7099 optional int64 package_version_code = 3;
7100 optional int64 media_apex_version = 4;
7101
7102 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7103}
7104
7105/**
7106 * Track information about DRM framework performance
7107 * Logged from
7108 * frameworks/av/drm/libmediadrm/DrmHal.cpp
7109 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7110 */
7111message MediametricsMediadrmReported {
7112 optional int64 timestamp_nanos = 1;
7113 optional string package_name = 2;
7114 optional int64 package_version_code = 3;
7115 optional int64 media_apex_version = 4;
7116
7117 // vendor+description tell about which DRM plugin is in use on this device
7118 optional string vendor = 5;
7119 optional string description = 6;
7120 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
7121 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
7122}
7123
7124/**
7125 * Track information about the widevine DRM plugin performance
7126 * Logged from
7127 * vendor/widevine/libwvdrmengine/cdm/metrics
7128 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
7129 */
7130message MediametricsDrmWidevineReported {
7131 optional int64 timestamp_nanos = 1;
7132 optional string package_name = 2;
7133 optional int64 package_version_code = 3;
7134 optional int64 media_apex_version = 4;
7135
7136 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7137}
7138
7139/**
7140 * Track information about recordings (e.g. camcorder)
7141 * Logged from
7142 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
7143 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
7144 */
7145message MediametricsRecorderReported {
7146 optional int64 timestamp_nanos = 1;
7147 optional string package_name = 2;
7148 optional int64 package_version_code = 3;
7149 optional int64 media_apex_version = 4;
7150
7151 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7152}
7153
7154/**
7155 * Track Media Player usage
7156 * Logged from:
7157 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
7158 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
7159 */
7160message MediametricsNuPlayerReported {
7161 optional int64 timestamp_nanos = 1;
7162 optional string package_name = 2;
7163 optional int64 package_version_code = 3;
7164 optional int64 media_apex_version = 4;
7165
7166 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
7167}
7168
7169/**
Robert Shiha4beed32019-08-19 14:15:23 -07007170 * Track Legacy DRM usage
7171 * Logged from
7172 * frameworks/av/drm/drmserver/DrmManager.cpp
7173 */
7174message MediametricsDrmManagerReported {
7175 optional int64 timestamp_nanos = 1;
7176 optional string package_name = 2;
7177 optional int64 package_version_code = 3;
7178 optional int64 media_apex_version = 4;
7179
7180 enum Method {
7181 METHOD_NOT_FOUND = -1;
7182 GET_CONSTRAINTS = 0;
7183 GET_METADATA = 1;
7184 CAN_HANDLE = 2;
7185 PROCESS_DRM_INFO = 3;
7186 ACQUIRE_DRM_INFO = 4;
7187 SAVE_RIGHTS = 5;
7188 GET_ORIGINAL_MIME_TYPE = 6;
7189 GET_DRM_OBJECT_TYPE = 7;
7190 CHECK_RIGHTS_STATUS = 8;
7191 REMOVE_RIGHTS = 9;
7192 REMOVE_ALL_RIGHTS = 10;
7193 OPEN_CONVERT_SESSION = 11;
7194 OPEN_DECRYPT_SESSION = 12;
7195 }
7196
7197 // plugin_id+description inform which Legacy DRM plugins are still in use on device
7198 optional string plugin_id = 5;
7199 optional string description = 6;
7200 optional Method method = 7;
7201 optional string mime_types = 8;
Robert Shihec8e60c2020-02-08 15:20:39 -08007202
7203 optional int64 get_constraints_count = 9;
7204 optional int64 get_metadata_count = 10;
7205 optional int64 can_handle_count = 11;
7206 optional int64 process_drm_info_count = 12;
7207 optional int64 acquire_drm_info_count = 13;
7208 optional int64 save_rights_count = 14;
7209 optional int64 get_original_mime_type_count = 15;
7210 optional int64 get_drm_object_type_count = 16;
7211 optional int64 check_rights_status_count = 17;
7212 optional int64 remove_rights_count = 18;
7213 optional int64 remove_all_rights_count = 19;
7214 optional int64 open_convert_session_count = 20;
7215 optional int64 open_decrypt_session_count = 21;
Robert Shiha4beed32019-08-19 14:15:23 -07007216}
7217
7218/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007219 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007220 * Pulled from: StatsCompanionService
7221*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007222message DangerousPermissionState {
7223 // Name of the permission
7224 optional string permission_name = 1;
7225
7226 // Uid of the package
7227 optional int32 uid = 2 [(is_uid) = true];
7228
7229 // Package requesting the permission
7230 optional string package_name = 3;
7231
7232 // If the permission is granted to the uid
7233 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01007234
7235 // Permission flags as per android.content.pm.PermissionFlags
7236 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08007237}
7238
Michael Groover4a0ca942019-01-24 17:41:25 -08007239/**
7240 * Logs when a package is denied access to a device identifier based on the new access requirements.
7241 *
7242 * Logged from:
7243 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
7244 */
7245message DeviceIdentifierAccessDenied {
7246 // The name of the package denied access to the requested device identifier.
7247 optional string package_name = 1;
7248
7249 // The name of the device identifier method the package attempted to invoke.
7250 optional string method_name = 2;
7251
7252 // True if the package is preinstalled.
Meng Wange8953ae2020-01-29 10:38:58 -08007253 // Starting from Android 11, this boolean is not set and will always be false.
7254 optional bool is_preinstalled = 3 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007255
7256 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08007257 // Starting from Android 11, this boolean is not set and will always be false.
7258 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08007259}
Chenjie Yue13f44a2019-02-07 17:51:38 -08007260
7261/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08007262 * Pulls the ongoing mainline install train version code.
7263 * Pulled from StatsCompanionService
7264 */
7265message TrainInfo {
7266 optional int64 train_version_code = 1;
7267
7268 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007269
7270 optional string train_name = 3;
7271
7272 enum Status {
7273 UNKNOWN = 0;
7274 INSTALL_REQUESTED = 1;
7275 INSTALL_STARTED = 2;
7276 INSTALL_STAGED_NOT_READY = 3;
7277 INSTALL_STAGED_READY = 4;
7278 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07007279 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
7280 // and INSTALL_FAILURE_COMMIT.
7281 INSTALL_FAILURE = 6 [deprecated = true];
7282 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007283 INSTALL_CANCELLED = 7;
7284 INSTALLER_ROLLBACK_REQUESTED = 8;
7285 INSTALLER_ROLLBACK_INITIATED = 9;
7286 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
7287 INSTALLER_ROLLBACK_STAGED = 11;
7288 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
7289 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
7290 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
7291 INSTALLER_ROLLBACK_SUCCESS = 15;
7292 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07007293 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
7294 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
7295 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
7296 INSTALL_STAGED_CANCEL_REQUESTED = 20;
7297 INSTALL_STAGED_CANCEL_SUCCESS = 21;
7298 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07007299 INSTALL_FAILURE_DOWNLOAD = 23;
7300 INSTALL_FAILURE_STATE_MISMATCH = 24;
7301 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08007302 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08007303 }
7304 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08007305}
joshmccloskey8c3322e2019-01-09 18:25:57 -08007306
7307/**
7308 * Logs the gesture stage changed event.
7309 *
7310 * Logged from:
7311 * frameworks/base/packages/SystemUI/
7312 */
7313message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007314 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007315}
7316
7317/**
7318 * Logs the feedback type.
7319 *
7320 * Logged from:
7321 * frameworks/base/packages/SystemUI/
7322 */
7323message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007324 // Whether or not the gesture was used.
7325 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007326}
7327
7328/**
7329 * Logs the progress.
7330 *
7331 * Logged from:
7332 * frameworks/base/packages/SystemUI/
7333 */
7334message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08007335 // [0,100] progress for the assist gesture.
7336 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08007337}
Neil Fullerdb14b482019-02-05 19:44:44 +00007338
7339/*
7340 * Information about the time zone data on a device.
7341 */
7342message TimeZoneDataInfo {
7343 // A version identifier for the data set on device. e.g. "2018i"
7344 optional string tzdb_version = 1;
7345}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007346
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007347/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007348 * Logs the GPU stats global health information.
7349 *
7350 * Logged from:
7351 * frameworks/native/services/gpuservice/gpustats/
7352 */
7353message GpuStatsGlobalInfo {
7354 // Package name of the gpu driver.
7355 optional string driver_package_name = 1;
7356
7357 // Version name of the gpu driver.
7358 optional string driver_version_name = 2;
7359
7360 // Version code of the gpu driver.
7361 optional int64 driver_version_code = 3;
7362
7363 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
7364 optional int64 driver_build_time = 4;
7365
7366 // Total count of the gl driver gets loaded.
7367 optional int64 gl_loading_count = 5;
7368
7369 // Total count of the gl driver fails to be loaded.
7370 optional int64 gl_loading_failure_count = 6;
7371
7372 // Total count of the Vulkan driver gets loaded.
7373 optional int64 vk_loading_count = 7;
7374
7375 // Total count of the Vulkan driver fails to be loaded.
7376 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07007377
7378 // Api version of the system Vulkan driver.
7379 optional int32 vulkan_version = 9;
7380
7381 // Api version of the system CPU Vulkan driver.
7382 optional int32 cpu_vulkan_version = 10;
7383
7384 // Api version of the system GLES driver.
7385 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007386
7387 // Total count of the angle driver gets loaded.
7388 optional int64 angle_loading_count = 12;
7389
7390 // Total count of the angle driver fails to be loaded.
7391 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007392}
7393
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007394/**
7395 * GPU driver loading time info.
7396 */
7397message GpuDriverLoadingTime {
7398 // List of all the driver loading times for this app. The list size is
7399 // capped at 50.
7400 repeated int64 driver_loading_time = 1;
7401}
7402
7403/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007404 * Logs the GPU stats per app health information.
7405 *
7406 * Logged from:
7407 * frameworks/native/services/gpuservice/gpustats/
7408 */
7409message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007410 // Package name of the application that loads the gpu driver. Total number
7411 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007412 optional string app_package_name = 1;
7413
7414 // Version code of the gpu driver this app loads.
7415 optional int64 driver_version_code = 2;
7416
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007417 // gl driver loading time info.
7418 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7419 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007420
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007421 // Vulkan driver loading time info.
7422 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7423 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007424
7425 // Angle driver loading time info.
7426 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7427 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007428
7429 // CPU Vulkan implementation is in use.
7430 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007431
7432 // App is not doing pre-rotation correctly.
7433 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007434
7435 // App creates GLESv1 context.
7436 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007437}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007438
7439/*
7440 * Logs the size of the system ion heap.
7441 *
7442 * Pulled from StatsCompanionService.
7443 */
7444message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007445 // Deprecated due to limited support of ion stats in debugfs.
7446 // Use `IonHeapSize` instead.
7447 option deprecated = true;
7448
Rafal Slawikd4e87572019-03-12 13:08:38 +00007449 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007450 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007451 optional int64 size_in_bytes = 1;
7452}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007453
Rafal Slawik77987ed2019-06-17 12:28:23 +01007454/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007455 * Logs the total size of the ion heap.
7456 *
7457 * Pulled from StatsCompanionService.
7458 */
7459message IonHeapSize {
7460 // Total size of all ion heaps in kilobytes.
7461 // Read from: /sys/kernel/ion/total_heaps_kb.
7462 optional int32 total_size_kb = 1;
7463}
7464
7465/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007466 * Logs the per-process size of the system ion heap.
7467 *
7468 * Pulled from StatsCompanionService.
7469 */
7470message ProcessSystemIonHeapSize {
7471 // The uid if available. -1 means not available.
7472 optional int32 uid = 1 [(is_uid) = true];
7473
7474 // The process name (from /proc/PID/cmdline).
7475 optional string process_name = 2;
7476
7477 // Sum of sizes of all allocations.
7478 optional int32 total_size_in_kilobytes = 3;
7479
7480 // Number of allocations.
7481 optional int32 allocation_count = 4;
7482
7483 // Size of the largest allocation.
7484 optional int32 max_size_in_kilobytes = 5;
7485}
7486
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007487/**
7488 * Push network stack events.
7489 *
7490 * Log from:
7491 * frameworks/base/packages/NetworkStack/
7492 */
7493message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007494 // The id that indicates the event reported from NetworkStack.
7495 optional int32 event_id = 1;
7496 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007497 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7498}
Carmen Agimofa769c152019-03-04 14:39:14 +00007499
7500/**
7501 * Logs the apps that are installed on the external storage.
7502 * Pulled from:
7503 * StatsCompanionService
7504 */
7505message AppsOnExternalStorageInfo {
7506 // The type of the external storage.
7507 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7508 // The name of the package that is installed on the external storage.
7509 optional string package_name = 2;
7510}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007511
7512/**
7513 * Logs the settings related to Face.
7514 * Logged from:
7515 * frameworks/base/services/core/java/com/android/server/stats
7516 */
7517message FaceSettings {
7518 // Whether or not face unlock is allowed on Keyguard.
7519 optional bool unlock_keyguard_enabled = 1;
7520 // Whether or not face unlock dismisses the Keyguard.
7521 optional bool unlock_dismisses_keyguard = 2;
7522 // Whether or not face unlock requires attention.
7523 optional bool unlock_attention_required = 3;
7524 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7525 optional bool unlock_app_enabled = 4;
7526 // Whether or not face unlock always requires user confirmation.
7527 optional bool unlock_always_require_confirmation = 5;
7528 // Whether or not a diverse set of poses are required during enrollment.
7529 optional bool unlock_diversity_required = 6;
7530}
Maggie White442b6312019-04-05 16:26:44 -07007531
7532/**
7533 * Logs cooling devices maintained by the kernel.
7534 *
7535 * Pulled from StatsCompanionService.java
7536 */
7537message CoolingDevice {
7538 // The type of cooling device being reported. Eg. CPU, GPU...
7539 optional android.os.CoolingTypeEnum device_location = 1;
7540 // The name of the cooling device source. Eg. CPU0
7541 optional string device_name = 2;
7542 // Current throttle state of the cooling device. The value can any unsigned
7543 // integer between 0 and max_state defined in its driver. 0 means device is
7544 // not in throttling, higher value means deeper throttling.
7545 optional int32 state = 3;
7546}
Ben Blount763a5d52019-04-10 11:48:58 -07007547
7548/**
7549 * Intelligence has several counter-type events that don't warrant a
7550 * full separate atom. These are primarily API call counters but also include
7551 * counters for feature usage and specific failure modes.
7552 *
7553 * Logged from the Intelligence mainline module.
7554 */
7555message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007556 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007557 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007558 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007559 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007560 // How many times the event occured (to report a batch of high frequency events).
7561 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007562 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007563 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007564}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007565
7566/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007567 * Logs when Car Power state changed.
7568 *
7569 * Logged from:
7570 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7571 */
7572message CarPowerStateChanged {
7573 // States come from CpmsState in CarPowerManagementService.java.
7574 enum State {
7575 WAIT_FOR_VHAL = 0;
7576 ON = 1;
7577 SHUTDOWN_PREPARE = 2;
7578 WAIT_FOR_FINISH = 3;
7579 SUSPEND = 4;
7580 SIMULATE_SLEEP = 5;
7581 }
7582 optional State state = 1;
7583}
7584
7585/**
7586 * Logs whether GarageMode is entered.
7587 *
7588 * Logged from:
7589 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7590 */
7591message GarageModeInfo {
7592 // Whether GarageMode is entered.
7593 optional bool is_garage_mode = 1;
7594}
Martijn Coenencd95d462019-04-25 17:09:45 +02007595
7596/**
7597 * Historical app ops data per package.
7598 */
7599message AppOps {
7600 // Uid of the package requesting the op
7601 optional int32 uid = 1 [(is_uid) = true];
7602
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007603 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007604 optional string package_name = 2;
7605
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007606 // operation id
7607 optional android.app.AppOpEnum op_id = 3 [default = APP_OP_NONE];
Martijn Coenencd95d462019-04-25 17:09:45 +02007608
7609 // The number of times the op was granted while the app was in the
7610 // foreground (only for trusted requests)
7611 optional int64 trusted_foreground_granted_count = 4;
7612
7613 // The number of times the op was granted while the app was in the
7614 // background (only for trusted requests)
7615 optional int64 trusted_background_granted_count = 5;
7616
7617 // The number of times the op was rejected while the app was in the
7618 // foreground (only for trusted requests)
7619 optional int64 trusted_foreground_rejected_count = 6;
7620
7621 // The number of times the op was rejected while the app was in the
7622 // background (only for trusted requests)
7623 optional int64 trusted_background_rejected_count = 7;
7624
7625 // For long-running operations, total duration of the operation
7626 // while the app was in the foreground (only for trusted requests)
7627 optional int64 trusted_foreground_duration_millis = 8;
7628
7629 // For long-running operations, total duration of the operation
7630 // while the app was in the background (only for trusted requests)
7631 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007632
7633 // Whether AppOps is guarded by Runtime permission
7634 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007635}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007636
7637/**
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007638 * Historical app ops data per package and attribution tag.
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007639 */
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007640message AttributedAppOps {
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007641 // Uid of the package requesting the op
7642 optional int32 uid = 1 [(is_uid) = true];
7643
7644 // Name of the package performing the op
7645 optional string package_name = 2;
7646
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08007647 // tag; provided by developer when accessing related API, limited at 50 chars by API.
7648 // Attributions must be provided through manifest using <attribution> tag available in R and
7649 // above.
7650 optional string tag = 3;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007651
Stanislav Zholnin48811ee62020-03-03 16:15:55 +00007652 // operation id
7653 optional android.app.AppOpEnum op = 4 [default = APP_OP_NONE];
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007654
7655 // The number of times the op was granted while the app was in the
7656 // foreground (only for trusted requests)
7657 optional int64 trusted_foreground_granted_count = 5;
7658
7659 // The number of times the op was granted while the app was in the
7660 // background (only for trusted requests)
7661 optional int64 trusted_background_granted_count = 6;
7662
7663 // The number of times the op was rejected while the app was in the
7664 // foreground (only for trusted requests)
7665 optional int64 trusted_foreground_rejected_count = 7;
7666
7667 // The number of times the op was rejected while the app was in the
7668 // background (only for trusted requests)
7669 optional int64 trusted_background_rejected_count = 8;
7670
7671 // For long-running operations, total duration of the operation
7672 // while the app was in the foreground (only for trusted requests)
7673 optional int64 trusted_foreground_duration_millis = 9;
7674
7675 // For long-running operations, total duration of the operation
7676 // while the app was in the background (only for trusted requests)
7677 optional int64 trusted_background_duration_millis = 10;
7678
7679 // Whether AppOps is guarded by Runtime permission
7680 optional bool is_runtime_permission = 11;
Stanislav Zholnin59199132020-03-06 14:19:25 +00007681
7682 // Sampling rate used on device, from 0 to 100
7683 optional int32 sampling_rate = 12;
Stanislav Zholnin7dcc51d2020-01-29 16:53:24 +00007684}
7685
7686/**
Hongyi Zhang700137e2019-05-23 21:19:36 -07007687 * Location Manager API Usage information(e.g. API under usage,
7688 * API call's parameters).
7689 * Logged from:
7690 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7691 */
7692message LocationManagerApiUsageReported {
7693
7694 // Indicating if usage starts or usage ends.
7695 optional android.stats.location.UsageState state = 1;
7696
7697 // LocationManagerService's API in use.
7698 // We can identify which API from LocationManager is
7699 // invoking current LMS API by the combination of
7700 // API parameter(e.g. is_listener_null, is_intent_null,
7701 // is_location_request_null)
7702 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7703
7704 // Name of the package calling the API.
7705 optional string calling_package_name = 3;
7706
7707 // Type of the location provider.
7708 optional android.stats.location.ProviderType provider = 4;
7709
7710 // Quality of the location request
7711 optional android.stats.location.LocationRequestQuality quality = 5;
7712
7713 // The desired interval for active location updates, in milliseconds.
7714 // Bucketized to reduce cardinality.
7715 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7716
7717 // Minimum distance between location updates, in meters.
7718 // Bucketized to reduce cardinality.
7719 optional android.stats.location.SmallestDisplacementBucket
7720 bucketized_smallest_displacement = 7;
7721
7722 // The number of location updates.
7723 optional int64 num_updates = 8;
7724
7725 // The request expiration time, in millisecond since boot.
7726 // Bucketized to reduce cardinality.
7727 optional android.stats.location.ExpirationBucket
7728 bucketized_expire_in = 9;
7729
7730 // Type of Callback passed in for this API.
7731 optional android.stats.location.CallbackType callback_type = 10;
7732
7733 // The radius of the central point of the alert
7734 // region, in meters. Only for API REQUEST_GEOFENCE.
7735 // Bucketized to reduce cardinality.
7736 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7737
7738 // Activity Importance of API caller.
7739 // Categorized to 3 types that are interesting from location's perspective.
7740 optional android.stats.location.ActivityImportance activiy_importance = 12;
7741}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007742
7743/**
7744 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7745 */
7746message ReviewPermissionsFragmentResultReported {
7747 // unique value identifying a permission group change. A permission group change might result
7748 // in multiple of these atoms
7749 optional int64 change_id = 1;
7750
7751 // UID of package the permission belongs to
7752 optional int32 uid = 2 [(is_uid) = true];
7753
7754 // Name of package the permission belongs to
7755 optional string package_name = 3;
7756
7757 // The permission to be granted
7758 optional string permission_name = 4;
7759
7760 // The result of the permission grant
7761 optional bool permission_granted = 5;
7762}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007763
7764/**
7765* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7766* Logged from: RuntimePermissionUpdgradeController
7767*/
7768message RuntimePermissionsUpgradeResult {
7769 // Permission granted as result of upgrade
7770 optional string permission_name = 1;
7771
7772 // UID of package granted permission
7773 optional int32 uid = 2 [(is_uid) = true];
7774
7775 // Name of package granted permission
7776 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007777}
7778
7779/**
7780* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7781*/
7782message GrantPermissionsActivityButtonActions {
7783 // Permission granted as result of upgrade
7784 optional string permission_group_name = 1;
7785
7786 // UID of package granted permission
7787 optional int32 uid = 2 [(is_uid) = true];
7788
7789 // Name of package requesting permission
7790 optional string package_name = 3;
7791
7792 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7793 // LABEL_ constants in GrantPermissionActivity.java
7794 optional int32 buttons_presented = 4;
7795
7796 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7797 optional int32 button_clicked = 5;
Evan Severson5dfc0912020-02-06 14:50:23 -08007798
7799 // id which identifies single session of user interacting with permission controller
7800 optional int64 session_id = 6;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007801}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007802
7803/**
7804 * Information about LocationAccessCheck notification presented to user
7805 */
7806message LocationAccessCheckNotificationAction {
7807
7808 // id which identifies single session of user interacting with permission controller
7809 optional int64 session_id = 1;
7810
7811 // Uid of package for which location access check is presented
7812 optional int32 package_uid = 2;
7813
7814 // Name of package for which location access check is presented
7815 optional string package_name = 3;
7816
7817 enum Result {
7818 UNDEFINED = 0;
7819 // notification was presented to the user
7820 NOTIFICATION_PRESENTED = 1;
7821 // notification was declined by the user
7822 NOTIFICATION_DECLINED = 2;
7823 // notification was clicked by the user
7824 NOTIFICATION_CLICKED = 3;
7825 }
7826
7827 // View / interaction recorded
7828 optional Result result = 4;
7829}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007830
7831/**
7832 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7833 */
7834message AppPermissionFragmentActionReported {
7835 // id which identifies single session of user interacting with permission controller
7836 optional int64 session_id = 1;
7837
7838 // unique value identifying a permission group change. A permission group change might result
7839 // in multiple of these atoms
7840 optional int64 change_id = 2;
7841
7842 // UID of package the permission belongs to
7843 optional int32 uid = 3 [(is_uid) = true];
7844
7845 // Name of package the permission belongs to
7846 optional string package_name = 4;
7847
7848 // The permission to be granted
7849 optional string permission_name = 5;
7850
7851 // The result of the permission grant
7852 optional bool permission_granted = 6;
Stanislav Zholnin126da0c2020-01-28 16:50:43 +00007853
7854 // State of Permission Flags after grant as per android.content.pm.PermissionFlags
7855 optional int32 permission_flags = 7;
7856
7857 enum Button {
7858 UNDEFINED = 0;
7859 // Allow button
7860 ALLOW = 1;
7861 // Deny button
7862 DENY = 2;
7863 // Ask every time button
7864 ASK_EVERY_TIME = 3;
7865 // Allow all the time button
7866 ALLOW_ALWAYS = 4;
7867 // Allow only while using the app button
7868 ALLOW_FOREGROUND = 5;
7869 // Same is Deny button but shown in while in use dialog
7870 DENY_FOREGROUND = 6;
7871 }
7872
7873 // Button pressed in the dialog
7874 optional Button button_pressed = 8;
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007875}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007876
7877/**
7878* Information about a AppPermissionFragment viewed by user
7879*/
7880message AppPermissionFragmentViewed {
7881 // id which identifies single session of user interacting with permission controller
7882 optional int64 session_id = 1;
7883
7884 // UID of package for which permissions are viewed
7885 optional int32 uid = 2 [(is_uid) = true];
7886
7887 // Name of package for which permissions are viewed
7888 optional string package_name = 3;
7889
7890 // Permission group viewed
7891 optional string permission_group_name = 4;
7892}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007893
7894/**
7895* Information about a AppPermissionsFragment viewed by user
7896*/
7897message AppPermissionsFragmentViewed {
7898 // id which identifies single session of user interacting with permission controller
7899 optional int64 session_id = 1;
7900
7901 // id which identifies single view as every view might have several logging records
7902 // with different package information attached
7903 optional int64 view_id = 2;
7904
7905 // Permission group viewed
7906 optional string permission_group_name = 3;
7907
7908 // UID of package for which permissions are viewed
7909 optional int32 uid = 4 [(is_uid) = true];
7910
7911 // Name of package for which permissions are viewed
7912 optional string package_name = 5;
7913
7914 // Category in which permission is included
7915 enum Category {
7916 UNDEFINED = 0;
7917 ALLOWED = 1;
7918 ALLOWED_FOREGROUND = 2;
7919 DENIED = 3;
7920 }
7921 optional Category category = 6;
7922}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007923
7924/**
7925* Information about a PermissionAppsFragment viewed by user.
7926* Logged from ui/handheld/PermissionAppsFragment.java
7927*/
7928message PermissionAppsFragmentViewed {
7929 // id which identifies single session of user interacting with permission controller
7930 optional int64 session_id = 1;
7931
7932 // id which identifies single view as every view might have several logging records
7933 // with different package information attached
7934 optional int64 view_id = 2;
7935
7936 // Permission group viewed
7937 optional string permission_group_name = 3;
7938
7939 // UID of package for which permissions are viewed
7940 optional int32 uid = 4 [(is_uid) = true];
7941
7942 // Name of package for which permissions are viewed
7943 optional string package_name = 5;
7944
7945 // Category in which app is included
7946 enum Category {
7947 UNDEFINED = 0;
7948 ALLOWED = 1;
7949 ALLOWED_FOREGROUND = 2;
7950 DENIED = 3;
7951 }
7952 optional Category category = 6;
7953}
Tony Make2b1b672019-07-29 16:59:47 +01007954
7955/**
7956 * Logs when there is a smart selection related event.
7957 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7958 * Logged from: TextClassifierEventLogger.java
7959 */
7960message TextSelectionEvent {
7961 // A session ID.
7962 optional string session_id = 1;
7963
7964 // Event type of this event.
7965 optional android.stats.textclassifier.EventType event_type = 2;
7966
Tony Mak9c84bd22019-12-09 07:27:25 +00007967 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007968 optional string model_name = 3;
7969
7970 // Type of widget that was involved in triggering this event.
7971 optional android.stats.textclassifier.WidgetType widget_type = 4;
7972
7973 // Index of this event in a session.
7974 optional int32 event_index = 5;
7975
7976 // Entity type that is involved.
7977 optional string entity_type = 6;
7978
7979 // Relative word index of the start of the selection.
7980 optional int32 relative_word_start_index = 7;
7981
7982 // Relative word (exclusive) index of the end of the selection.
7983 optional int32 relative_word_end_index = 8;
7984
7985 // Relative word index of the start of the smart selection.
7986 optional int32 relative_suggested_word_start_index = 9;
7987
7988 // Relative word (exclusive) index of the end of the smart selection.
7989 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007990
7991 // Name of source package.
7992 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007993}
7994
7995/**
7996 * Logs when there is a smart linkify related event.
7997 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7998 * Logged from: TextClassifierEventLogger.java
7999 */
8000message TextLinkifyEvent {
8001 // A session ID.
8002 optional string session_id = 1;
8003
8004 // Event type of this event.
8005 optional android.stats.textclassifier.EventType event_type = 2;
8006
Tony Mak9c84bd22019-12-09 07:27:25 +00008007 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008008 optional string model_name = 3;
8009
8010 // Type of widget that was involved in triggering this event.
8011 optional android.stats.textclassifier.WidgetType widget_type = 4;
8012
8013 // Index of this event in a session.
8014 optional int32 event_index = 5;
8015
8016 // Entity type that is involved.
8017 optional string entity_type = 6;
8018
8019 // Number of links detected.
8020 optional int32 num_links = 7;
8021
8022 // The total length of all links.
8023 optional int32 linked_text_length = 8;
8024
8025 // Length of input text.
8026 optional int32 text_length = 9;
8027
8028 // Time spent on generating links in ms.
8029 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01008030
8031 // Name of source package.
8032 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01008033}
8034
8035/**
8036 * Logs when there is a conversation actions related event.
8037 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8038 * Logged from: TextClassifierEventLogger.java
8039 */
8040message ConversationActionsEvent {
8041 // A session ID.
8042 optional string session_id = 1;
8043
8044 // Event type of this event.
8045 optional android.stats.textclassifier.EventType event_type = 2;
8046
Tony Mak9c84bd22019-12-09 07:27:25 +00008047 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008048 optional string model_name = 3;
8049
8050 // Type of widget that was involved in triggering this event.
8051 optional android.stats.textclassifier.WidgetType widget_type = 4;
8052
8053 // The first entity type that is involved.
8054 optional string first_entity_type = 5;
8055
8056 // The second entity type that is involved.
8057 optional string second_entity_type = 6;
8058
8059 // The third entity type that is involved.
8060 optional string third_entity_type = 7;
8061
8062 // The score of the first entity type.
8063 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01008064
8065 // Name of source package.
8066 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00008067
8068 // Name of the annotator model that is involved in this event.
8069 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01008070}
8071
8072/**
8073 * Logs when there is a language detection related event.
8074 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
8075 * Logged from: TextClassifierEventLogger.java
8076 */
8077message LanguageDetectionEvent {
8078 // A session ID.
8079 optional string session_id = 1;
8080
8081 // Event type of this event.
8082 optional android.stats.textclassifier.EventType event_type = 2;
8083
Tony Mak9c84bd22019-12-09 07:27:25 +00008084 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01008085 optional string model_name = 3;
8086
8087 // Type of widget that was involved in triggering this event.
8088 optional android.stats.textclassifier.WidgetType widget_type = 4;
8089
8090 // Detected language.
8091 optional string language_tag = 5;
8092
8093 // Score of the detected language.
8094 optional float score = 6;
8095
8096 // Position of this action.
8097 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01008098
8099 // Name of source package.
8100 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01008101}
Tianjie Xu167c3db2019-07-22 14:25:14 -07008102
8103/**
8104 * Information about an OTA update attempt by update_engine.
8105 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8106 */
8107message UpdateEngineUpdateAttemptReported {
8108 // The number of attempts for the update engine to apply a given payload.
8109 optional int32 attempt_number = 1;
8110
8111 optional android.stats.otaupdate.PayloadType payload_type = 2;
8112
8113 // The total time in minutes for the update engine to apply a given payload.
8114 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
8115 // it's increased when the system is sleeping.
8116 optional int32 duration_boottime_in_minutes = 3;
8117
8118 // The total time in minutes for the update engine to apply a given payload.
8119 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
8120 // and it's not increased when the system is sleeping.
8121 optional int32 duration_monotonic_in_minutes = 4;
8122
8123 // The size of the payload in MiBs.
8124 optional int32 payload_size_mib = 5;
8125
8126 // The attempt result reported by the update engine for an OTA update.
8127 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
8128
8129 // The error code reported by the update engine after an OTA update attempt
8130 // on A/B devices.
8131 optional android.stats.otaupdate.ErrorCode error_code = 7;
8132
8133 // The build fingerprint of the source system. The value is read from a
8134 // system property when the device takes the update. e.g.
8135 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
8136 optional string source_fingerprint = 8;
8137}
8138
8139/**
8140 * Information about all the attempts the device make before finishing the
8141 * successful update.
8142 * Logged from platform/system/update_engine/metrics_reporter_android.cc
8143 */
8144message UpdateEngineSuccessfulUpdateReported {
8145 // The number of attempts for the update engine to apply the payload for a
8146 // successful update.
8147 optional int32 attempt_count = 1;
8148
8149 optional android.stats.otaupdate.PayloadType payload_type = 2;
8150
8151 optional int32 payload_size_mib = 3;
8152
8153 // The total number of bytes downloaded by update_engine since the last
8154 // successful update.
8155 optional int32 total_bytes_downloaded_mib = 4;
8156
8157 // The ratio in percentage of the over-downloaded bytes compared to the
8158 // total bytes needed to successfully install the update. e.g. 200 if we
8159 // download 200MiB in total for a 100MiB package.
8160 optional int32 download_overhead_percentage = 5;
8161
8162 // The total time in minutes for the update engine to apply the payload for a
8163 // successful update.
8164 optional int32 total_duration_minutes = 6;
8165
8166 // The number of reboot of the device during a successful update.
8167 optional int32 reboot_count = 7;
8168}
Alec Mourie088e762019-07-02 13:10:55 -07008169
8170/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08008171 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
8172 * key to indicate whether it was successful or not.
8173 *
8174 * Logged from:
8175 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
8176 */
8177message RebootEscrowRecoveryReported {
8178 optional bool successful = 1;
8179}
8180
8181/**
Alec Mourie088e762019-07-02 13:10:55 -07008182 * Global display pipeline metrics reported by SurfaceFlinger.
8183 * Pulled from:
8184 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8185 */
8186message SurfaceflingerStatsGlobalInfo {
8187 // Total number of frames presented during the tracing period
8188 optional int64 total_frames = 1;
8189 // Total number of frames missed
8190 optional int64 missed_frames = 2;
8191 // Total number of frames that fell back to client composition
8192 optional int64 client_composition_frames = 3;
8193 // Total time the display was turned on
8194 optional int64 display_on_millis = 4;
8195 // Total time that was spent performing animations.
8196 // This is derived from the present-to-present layer histogram
8197 optional int64 animation_millis = 5;
Alec Mouria2622452020-02-10 17:46:50 -08008198 // Total number of event connections tracked by SurfaceFlinger at the time
8199 // of this pull. If this number grows prohibitively large, then this can
8200 // cause jank due to resource contention.
8201 optional int32 event_connection_count = 6;
Alec Mouribb55b7f2020-02-12 17:35:01 -08008202 // Set of timings measured from when SurfaceFlinger began compositing a
8203 // frame, until the frame was requested to be presented to the display. This
8204 // measures SurfaceFlinger's total CPU walltime on the critical path per
8205 // frame.
8206 optional FrameTimingHistogram frame_duration = 7
8207 [(android.os.statsd.log_mode) = MODE_BYTES];
8208 // Set of timings measured from when SurfaceFlinger first began using the
8209 // GPU to composite a frame, until the GPU has finished compositing that
8210 // frame. This measures the total additional time SurfaceFlinger needed to
8211 // perform due to falling back into GPU composition.
8212 optional FrameTimingHistogram render_engine_timing = 8
8213 [(android.os.statsd.log_mode) = MODE_BYTES];
Alec Mourie088e762019-07-02 13:10:55 -07008214}
8215
8216/**
8217 * Per-layer display pipeline metrics reported by SurfaceFlinger.
8218 * The number of layers uploaded will be restricted due to size limitations.
8219 * Pulled from:
8220 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
8221 */
8222message SurfaceflingerStatsLayerInfo {
8223 // The layer for this set of metrics
8224 // For now we can infer that the package name is included in the layer
8225 // name.
8226 optional string layer_name = 1;
8227 // Total number of frames presented
8228 optional int64 total_frames = 2;
8229 // Total number of dropped frames while latching a buffer for this layer.
8230 optional int64 dropped_frames = 3;
8231 // Set of timings measured between successive presentation timestamps.
8232 optional FrameTimingHistogram present_to_present = 4
8233 [(android.os.statsd.log_mode) = MODE_BYTES];
8234 // Set of timings measured from when an app queued a buffer for
8235 // presentation, until the buffer was actually presented to the
8236 // display.
8237 optional FrameTimingHistogram post_to_present = 5
8238 [(android.os.statsd.log_mode) = MODE_BYTES];
8239 // Set of timings measured from when a buffer is ready to be presented,
8240 // until the buffer was actually presented to the display.
8241 optional FrameTimingHistogram acquire_to_present = 6
8242 [(android.os.statsd.log_mode) = MODE_BYTES];
8243 // Set of timings measured from when a buffer was latched by
8244 // SurfaceFlinger, until the buffer was presented to the display
8245 optional FrameTimingHistogram latch_to_present = 7
8246 [(android.os.statsd.log_mode) = MODE_BYTES];
8247 // Set of timings measured from the desired presentation to the actual
8248 // presentation time
8249 optional FrameTimingHistogram desired_to_present = 8
8250 [(android.os.statsd.log_mode) = MODE_BYTES];
8251 // Set of timings measured from when an app queued a buffer for
8252 // presentation, until the buffer was ready to be presented.
8253 optional FrameTimingHistogram post_to_acquire = 9
8254 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang59cdc9012020-02-10 10:58:39 -08008255 // Frames missed latch because the acquire fence didn't fire
8256 optional int64 late_acquire_frames = 10;
8257 // Frames latched early because the desired present time was bad
8258 optional int64 bad_desired_present_frames = 11;
Alec Mourie088e762019-07-02 13:10:55 -07008259}
8260
8261/**
8262 * Histogram of frame counts bucketed by time in milliseconds.
8263 * Because of size limitations, we hard-cap the number of buckets, with
8264 * buckets for corresponding to larger milliseconds being less precise.
8265 */
8266message FrameTimingHistogram {
8267 // Timings in milliseconds that describes a set of histogram buckets
8268 repeated int32 time_millis_buckets = 1;
8269 // Number of frames that match to each time_millis, i.e. the bucket
8270 // contents
8271 // It's required that len(time_millis) == len(frame_count)
8272 repeated int64 frame_counts = 2;
8273}
Emilian Peev6729f372019-08-29 09:14:09 -07008274
Emilian Peev6729f372019-08-29 09:14:09 -07008275/**
Alec Mouri5ac32622020-02-06 08:44:25 -08008276 * Janky event as reported by SurfaceFlinger.
8277 * This event is intended to be consumed by a Perfetto subscriber for
8278 * automated trace collection.
8279 *
8280 * Logged from:
8281 * frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
8282 */
8283message DisplayJankReported {
8284 // Informational field for how long the janky event lasted in milliseconds
8285 optional int64 event_duration_millis = 1;
8286 // Number of frame deadlines missed, where SurfaceFlinger failed to update
8287 // the display on time.
8288 optional int32 present_deadlines_missed = 2;
8289}
8290
8291/**
Emilian Peev6729f372019-08-29 09:14:09 -07008292 * Information about camera facing and API level usage.
8293 * Logged from:
8294 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
8295 */
8296message CameraActionEvent {
8297 // Camera session duration
Emilian Peev6ea6fe92020-02-24 15:31:34 -08008298 optional int64 duration_millis = 1;
Emilian Peev6729f372019-08-29 09:14:09 -07008299
8300 // Camera API level used
8301 optional int32 api_level = 2;
8302
8303 // Name of client package
8304 optional string package_name = 3;
8305
8306 // Camera facing
8307 enum Facing {
8308 UNKNOWN = 0;
8309 BACK = 1;
8310 FRONT = 2;
8311 EXTERNAL = 3;
8312 }
8313 optional Facing facing = 4;
8314}
atrost01a20932019-08-28 15:40:37 +01008315
8316/**
8317 * Logs when a compatibility change is affecting an app.
8318 *
8319 * Logged from:
8320 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
8321 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
8322 */
8323message AppCompatibilityChangeReported {
8324 // The UID of the app being affected by the compatibilty change.
8325 optional int32 uid = 1 [(is_uid) = true];
8326
8327 // The ID of the change affecting the app.
8328 optional int64 change_id = 2;
8329
8330 enum State {
8331 UNKNOWN_STATE = 0;
8332 ENABLED = 1;
8333 DISABLED = 2;
8334 LOGGED = 3;
8335 }
8336
8337 // The state of the change - if logged from gating whether it was enabled or disabled, or just
8338 // logged otherwise.
8339 optional State state = 3;
8340
8341 enum Source {
8342 UNKNOWN_SOURCE = 0;
8343 APP_PROCESS = 1;
8344 SYSTEM_SERVER = 2;
8345 }
8346
8347 // Where it was logged from.
8348 optional Source source = 4;
8349
8350}
Hector Dearman40579f62019-11-01 13:19:30 +00008351
8352/**
8353 * Logged from
8354 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
8355 */
8356message PerfettoUploaded {
8357 enum Event {
8358 PERFETTO_UNDEFINED = 0;
8359 PERFETTO_TRACE_BEGIN = 1;
8360 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
8361 PERFETTO_ON_CONNECT = 3;
8362 PERFETTO_ON_TRACING_DISABLED = 4;
8363 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
8364 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
8365 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
8366 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
8367 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
8368 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
8369 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
8370 PERFETTO_TRIGGER_BEGIN = 12;
8371 PERFETTO_TRIGGER_SUCCESS = 13;
8372 PERFETTO_TRIGGER_FAILURE = 14;
8373 PERFETTO_HIT_GUARDRAILS = 15;
8374 PERFETTO_ON_TIMEOUT = 16;
8375 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
8376 }
8377
8378 // Which stage of the pipeline we are reporting from.
8379 optional Event event = 1;
8380
8381 // UUID matching the one set inside the SystemInfo trace packet.
8382 optional int64 trace_uuid_lsb = 2;
8383 optional int64 trace_uuid_msb = 3;
8384}
Mark Tabrya824a642019-11-05 12:26:12 -08008385
8386/**
8387 * Pulls client metrics on data transferred via Vehicle Maps Service.
8388 * Metrics are keyed by uid + layer.
8389 *
8390 * Pulled from:
8391 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
8392 */
8393message VmsClientStats {
8394 // UID of the VMS client app
8395 optional int32 uid = 1 [(is_uid) = true];
8396
8397 // VMS layer definition
8398 optional int32 layer_type = 2;
8399 optional int32 layer_channel = 3;
8400 optional int32 layer_version = 4;
8401
8402 // Bytes and packets sent by the client for the layer
8403 optional int64 tx_bytes = 5;
8404 optional int64 tx_packets = 6;
8405
8406 // Bytes and packets received by the client for the layer
8407 optional int64 rx_bytes = 7;
8408 optional int64 rx_packets = 8;
8409
8410 // Bytes and packets dropped due to client error
8411 optional int64 dropped_bytes = 9;
8412 optional int64 dropped_packets = 10;
8413}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00008414
8415/**
8416 * State of a dangerous permission requested by a package - sampled
8417 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
8418*/
8419message DangerousPermissionStateSampled {
8420 // Name of the permission
8421 optional string permission_name = 1;
8422
8423 // Uid of the package
8424 optional int32 uid = 2 [(is_uid) = true];
8425
8426 // If the permission is granted to the uid
8427 optional bool is_granted = 3;
8428
8429 // Permission flags as per android.content.pm.PermissionFlags
8430 optional int32 permission_flags = 4;
8431}
8432
Stan Iliev637ba5e2019-08-16 13:43:08 -04008433/**
Stan Iliev637ba5e2019-08-16 13:43:08 -04008434 * HWUI stats for a given app.
8435 */
8436message GraphicsStats {
8437 // The package name of the app
8438 optional string package_name = 1;
8439
8440 // The version code of the app
8441 optional int64 version_code = 2;
8442
8443 // The start & end timestamps in UTC as
8444 // milliseconds since January 1, 1970
8445 // Compatible with java.util.Date#setTime()
Stan Ilievb6517192020-02-18 10:12:42 -05008446 optional int64 start_millis = 3;
Stan Iliev637ba5e2019-08-16 13:43:08 -04008447
Stan Ilievb6517192020-02-18 10:12:42 -05008448 optional int64 end_millis = 4;
8449
8450 // HWUI renders pipeline type: GL (1) or Vulkan (2).
8451 enum PipelineType {
8452 UNKNOWN = 0;
8453 GL = 1;
8454 VULKAN = 2;
8455 }
Stan Iliev637ba5e2019-08-16 13:43:08 -04008456
8457 // HWUI renders pipeline type: GL or Vulkan.
8458 optional PipelineType pipeline = 5;
8459
8460 // Distinct frame count.
8461 optional int32 total_frames = 6;
8462
8463 // Number of "missed vsync" events.
8464 optional int32 missed_vsync_count = 7;
8465
8466 // Number of frames in triple-buffering scenario (high input latency)
8467 optional int32 high_input_latency_count = 8;
8468
8469 // Number of "slow UI thread" events.
8470 optional int32 slow_ui_thread_count = 9;
8471
8472 // Number of "slow bitmap upload" events.
8473 optional int32 slow_bitmap_upload_count = 10;
8474
8475 // Number of "slow draw" events.
8476 optional int32 slow_draw_count = 11;
8477
8478 // Number of frames that missed their deadline (aka, visibly janked)
8479 optional int32 missed_deadline_count = 12;
8480
8481 // The frame time histogram for the package
8482 optional FrameTimingHistogram cpu_histogram = 13
8483 [(android.os.statsd.log_mode) = MODE_BYTES];
8484
8485 // The gpu frame time histogram for the package
8486 optional FrameTimingHistogram gpu_histogram = 14
8487 [(android.os.statsd.log_mode) = MODE_BYTES];
8488
8489 // UI mainline module version.
8490 optional int64 version_ui_module = 15;
8491
8492 // If true, these are HWUI stats for up to a 24h period for a given app from today.
8493 // If false, these are HWUI stats for a 24h period for a given app from the last complete
8494 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
8495 // more apps are running / rendering.
8496 optional bool is_today = 16;
8497}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008498
8499/**
8500 * Message related to dangerous (runtime) app ops access
8501 */
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008502message RuntimeAppOpAccess {
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008503 // Uid of the package accessing app op
8504 optional int32 uid = 1 [(is_uid) = true];
8505
8506 // Name of the package accessing app op
8507 optional string package_name = 2;
8508
Stanislav Zholnin88c6f322020-01-29 14:48:11 +00008509 // operation string id per OPSTR_ constants in AppOpsManager.java
8510 optional string op = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008511
Philip P. Moltmann12ac3f42020-03-05 15:01:29 -08008512 // attribution_tag; provided by developer when accessing related API, limited at 50 chars by
8513 // API.
8514 // Attributions must be provided through manifest using <attribution> tag available in R and
8515 // above.
8516 optional string attribution_tag = 4;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008517
8518 // message related to app op access, limited to 600 chars by API
8519 optional string message = 5;
8520
8521 enum SamplingStrategy {
8522 DEFAULT = 0;
8523 UNIFORM = 1;
8524 RARELY_USED = 2;
Stanislav Zholnin4c323852020-03-04 18:03:24 +00008525 BOOT_TIME_SAMPLING = 3;
Stanislav Zholnin606454c2019-11-27 15:31:49 +00008526 }
8527
8528 // sampling strategy used to collect this message
8529 optional SamplingStrategy sampling_strategy = 6;
8530}
8531
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008532/*
8533 * Logs userspace reboot outcome and duration.
8534 *
8535 * Logged from:
8536 * frameworks/base/core/java/com/android/server/BootReceiver.java
8537 */
8538message UserspaceRebootReported {
8539 // Possible outcomes of userspace reboot.
8540 enum Outcome {
8541 // Default value in case platform failed to determine the outcome.
8542 OUTCOME_UNKNOWN = 0;
8543 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8544 SUCCESS = 1;
8545 // Userspace reboot shutdown sequence was aborted.
8546 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8547 // Remounting userdata into checkpointing mode failed.
8548 FAILED_USERDATA_REMOUNT = 3;
8549 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8550 // reboot.
8551 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8552 }
8553 // Outcome of userspace reboot. Always set.
8554 optional Outcome outcome = 1;
8555 // Duration of userspace reboot in case it has a successful outcome.
8556 // Duration is measured as time between userspace reboot was initiated and until boot completed
8557 // (e.g. sys.boot_completed=1).
8558 optional int64 duration_millis = 2;
8559 // State of primary user's (user0) credential encryption storage.
8560 enum UserEncryptionState {
8561 // Default value.
8562 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8563 // Credential encrypted storage is unlocked.
8564 UNLOCKED = 1;
8565 // Credential encrypted storage is locked.
8566 LOCKED = 2;
8567 }
8568 // State of primary user's encryption storage at the moment boot completed. Always set.
8569 optional UserEncryptionState user_encryption_state = 3;
8570}
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008571
8572/*
8573 * Logs integrity check information during each install.
8574 *
8575 * Logged from:
8576 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8577 */
8578message IntegrityCheckResultReported {
8579 optional string package_name = 1;
8580 optional string app_certificate_hash = 2;
Omer Nebil Yaveroglu0ade8542020-01-24 12:47:46 +00008581 optional int64 version_code = 3;
Omer Nebil Yaveroglu06b969a2020-01-23 11:10:38 +00008582 optional string installer_package_name = 4;
8583 enum Response {
8584 UNKNOWN = 0;
8585 ALLOWED = 1;
8586 REJECTED = 2;
8587 FORCE_ALLOWED = 3;
8588 }
8589 optional Response response = 5;
8590 // An estimate on the cause of the response. This will only be populated for
8591 // REJECTED and FORCE_ALLOWED
8592 optional bool caused_by_app_cert_rule = 6;
8593 optional bool caused_by_installer_rule = 7;
8594}
8595
8596/**
8597 * Logs the information about the rules and the provider whenever rules are
8598 * pushed into AppIntegrityManager.
8599 *
8600 * Logged from:
8601 * frameworks/base/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
8602 */
8603message IntegrityRulesPushed {
8604 optional bool success = 1;
8605 // Package name of the app that pushed the rules.
8606 optional string rule_provider = 2;
8607 // Version string of arbitrary format provided by the rule provider to
8608 // identify the rules.
8609 optional string rule_version = 3;
8610}
Jordan Liubedfa702019-12-20 15:08:45 -08008611
8612/**
8613 * Logs when a cell broadcast message is received on the device.
8614 *
8615 * Logged from CellBroadcastService module:
8616 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8617 */
8618message CellBroadcastMessageReported {
8619 // The type of Cell Broadcast message
8620 enum CbType {
8621 UNKNOWN_TYPE = 0;
8622 GSM = 1;
8623 CDMA = 2;
8624 CDMA_SPC = 3;
8625 }
8626
8627 // GSM, CDMA, CDMA-SCP
8628 optional CbType type = 1;
8629}
8630
8631/**
8632 * Logs when an error occurs while handling a cell broadcast message;
8633 *
8634 * Logged from CellBroadcastService module:
8635 * packages/modules/CellBroadcastService/src/com/android/cellbroadcastservice/
8636 */
8637message CellBroadcastMessageError {
8638 // The type of error raised when trying to handle a cell broadcast message
8639 enum ErrorType {
8640 UNKNOWN_TYPE = 0;
8641 CDMA_DECODING_ERROR = 1;
8642 CDMA_SCP_EMPTY = 2;
8643 CDMA_SCP_HANDLING_ERROR = 3;
8644 GSM_INVALID_HEADER_LENGTH = 4;
8645 GSM_UNSUPPORTED_HEADER_MESSAGE_TYPE = 5;
8646 GSM_UNSUPPORTED_HEADER_DATA_CODING_SCHEME = 6;
8647 GSM_INVALID_PDU = 7;
8648 GSM_INVALID_GEO_FENCING_DATA = 8;
8649 GSM_UMTS_INVALID_WAC = 9;
8650 FAILED_TO_INSERT_TO_DB = 10;
8651 UNEXPECTED_GEOMETRY_FROM_FWK = 11;
8652 UNEXPECTED_GSM_MESSAGE_TYPE_FROM_FWK = 12;
8653 UNEXPECTED_CDMA_MESSAGE_TYPE_FROM_FWK = 13;
8654 UNEXPECTED_CDMA_SCP_MESSAGE_TYPE_FROM_FWK = 14;
8655 }
8656
8657 // What kind of error occurred
8658 optional ErrorType type = 1;
8659
8660 // Exception message (or log message) associated with the error (max 1000 chars)
8661 optional string exception_message = 2;
8662}
Anton Hansson5a48e4b2020-02-06 14:50:35 +00008663
8664/**
8665 * Logs when the SDK Extensions test app has polled the current version.
8666 * This is atom ID 354.
8667 *
8668 * Logged from:
8669 * vendor/google_testing/integration/packages/apps/SdkExtensionsTestApp/
8670 */
8671message SdkExtensionStatus {
8672 enum ApiCallStatus {
8673 CALL_NOT_ATTEMPTED = 0;
8674 CALL_SUCCESSFUL = 1;
8675 CALL_FAILED = 2;
8676 }
8677
8678 optional ApiCallStatus result = 1;
8679
8680 // The R extension version, i.e. android.os.ext.SdkExtension.getExtensionVersion(R).
8681 optional int32 r_extension_version = 2;
8682
8683 // A number identifying which particular symbol's call failed, if any. 0 means no missing symbol.
8684 // "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
8685 optional int32 failed_call_symbol = 3;
8686}
Marco Ballesio497aff42020-01-24 08:39:42 -08008687
8688/**
8689 * Logs when an app is frozen or unfrozen.
8690 *
8691 * Logged from:
8692 * frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
8693 */
8694message AppFreezeChanged {
Blake Kragten6ce382a2020-01-16 20:20:46 -08008695 // The type of event.
8696 enum Action {
8697 UNKNOWN = 0;
8698 FREEZE_APP = 1;
8699 UNFREEZE_APP = 2;
8700 }
8701 optional Action action = 1;
Marco Ballesio497aff42020-01-24 08:39:42 -08008702
Blake Kragten6ce382a2020-01-16 20:20:46 -08008703 // Pid of the process being frozen.
8704 optional int32 pid = 2;
Marco Ballesio497aff42020-01-24 08:39:42 -08008705
Blake Kragten6ce382a2020-01-16 20:20:46 -08008706 // Name of the process being frozen.
8707 optional string process_name = 3;
Marco Ballesio497aff42020-01-24 08:39:42 -08008708
Blake Kragten6ce382a2020-01-16 20:20:46 -08008709 // Time since last unfrozen.
8710 optional int64 time_unfrozen_millis = 4;
8711}
8712
8713/**
Chi Zhangbb9ed922020-03-11 10:16:47 -07008714 * Pulls information for a single voice call.
8715 *
8716 * Each pull creates multiple atoms, one for each call. The sequence is randomized when pulled.
8717 *
8718 * Pulled from:
8719 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8720 */
8721message VoiceCallSession {
8722 // Bearer (IMS or CS) when the call started.
8723 optional android.telephony.CallBearerEnum bearer_at_start = 1;
8724
8725 // Bearer (IMS or CS) when the call ended.
8726 // The bearer may change during the call, e.g. due to SRVCC.
8727 optional android.telephony.CallBearerEnum bearer_at_end = 2;
8728
8729 // Direction of the call (incoming or outgoing).
8730 optional android.telephony.CallDirectionEnum direction = 3;
8731
8732 // Time spent setting up the call.
8733 optional android.telephony.CallSetupDurationEnum setup_duration = 4;
8734
8735 // Whether the call ended before the setup was completed.
8736 optional bool setup_failed = 5;
8737
8738 // IMS reason code or CS disconnect cause.
8739 // For IMS, see: frameworks/base/telephony/java/android/telephony/ims/ImsReasonInfo.java
8740 // For CS, see: frameworks/base/telephony/java/android/telephony/DisconnectCause.java
8741 optional int32 disconnect_reason_code = 6;
8742
8743 // IMS extra code or CS precise disconnect cause.
8744 // For IMS, this code is vendor-specific
8745 // For CS, see: frameworks/base/telephony/java/android/telephony/PreciseDisconnectCause.java
8746 optional int32 disconnect_extra_code = 7;
8747
8748 // IMS extra message or CS vendor cause.
8749 optional string disconnect_extra_message = 8;
8750
8751 // Radio access technology (RAT) used when call started.
8752 optional android.telephony.NetworkTypeEnum rat_at_start = 9;
8753
8754 // Radio access technology (RAT) used when call terminated.
8755 optional android.telephony.NetworkTypeEnum rat_at_end = 10;
8756
8757 // Number of times RAT changed during the call.
8758 optional int64 rat_switch_count = 11;
8759
8760 // A bitmask of all codecs used during the call.
8761 // See: frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/VoiceCallSessionStats.java
8762 optional int64 codec_bitmask = 12;
8763
8764 // Number of other calls going on during call setup, for the same SIM slot.
8765 optional int32 concurrent_call_count_at_start = 13;
8766
8767 // Number of other calls going on during call termination, for the same SIM slot.
8768 optional int32 concurrent_call_count_at_end = 14;
8769
8770 // Index of the SIM is used, 0 for single-SIM devices.
8771 optional int32 sim_slot_index = 15;
8772
8773 // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
8774 optional bool is_multi_sim = 16;
8775
8776 // Whether the call was made with an eSIM profile.
8777 optional bool is_esim = 17;
8778
8779 // Carrier ID of the SIM card.
8780 // See https://source.android.com/devices/tech/config/carrierid.
8781 optional int32 carrier_id = 18;
8782
8783 // Whether an SRVCC has been completed successfully.
8784 // SRVCC (CS fallback) should be recorded in the IMS call since there will be no more SRVCC
8785 // events once the call is switched to CS.
8786 optional bool srvcc_completed = 19;
8787
8788 // Number of SRVCC failures.
8789 optional int64 srvcc_failure_count = 20;
8790
8791 // Number of SRVCC cancellations.
8792 optional int64 srvcc_cancellation_count = 21;
8793
8794 // Whether the Real-Time Text (RTT) was ever used in the call.
8795 optional bool rtt_enabled = 22;
8796
8797 // Whether this was an emergency call.
8798 optional bool is_emergency = 23;
8799
8800 // Whether the call was performed while roaming.
8801 optional bool is_roaming = 24;
8802}
8803
8804/**
8805 * Pulls voice call radio access technology (RAT) usage.
8806 *
8807 * Each pull creates multiple atoms, one for each carrier/RAT, the order of which is irrelevant to
8808 * time. The atom will be skipped if not enough data is available.
8809 *
8810 * Pulled from:
8811 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/PersistPullers.java
8812 */
8813message VoiceCallRatUsage {
8814 // Carrier ID (https://source.android.com/devices/tech/config/carrierid).
8815 optional int32 carrier_id = 1;
8816
8817 // Radio access technology.
8818 optional android.telephony.NetworkTypeEnum rat = 2;
8819
8820 // Total duration that voice calls spent on this carrier and RAT.
8821 optional int64 total_duration_seconds = 3;
8822
8823 // Total number of calls using this carrier and RAT.
8824 // A call is counted once even if it used the RAT multiple times.
8825 optional int64 call_count = 4;
8826}
8827
8828/**
8829 * Pulls the number of active SIM slots and SIMs/eSIM profiles.
8830 *
8831 * Pulled from:
8832 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8833 */
8834message SimSlotState {
8835 // Number of active SIM slots (both physical and eSIM profiles) in the device.
8836 optional int32 active_slot_count = 1;
8837
8838 // Number of SIM cards (both physical and active eSIM profiles).
8839 // This number is always equal to or less than the number of active SIM slots.
8840 optional int32 sim_count = 2;
8841
8842 // Number of active eSIM profiles.
8843 // This number is always equal to or less than the number of SIMs.
8844 optional int32 esim_count = 3;
8845}
8846
8847/**
8848 * Pulls supported cellular radio access technologies.
8849 *
8850 * This atom reports the capabilities of the device, rather than the network it has access to.
8851 *
8852 * Pulled from:
8853 * frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/NonPersistPullers.java
8854 */
8855message SupportedRadioAccessFamily {
8856 // A bitmask of supported radio technologies.
8857 // See android.telephony.TelephonyManager.NetworkTypeBitMask.
8858 optional int64 network_type_bitmask = 1;
8859}
8860
8861/**
Blake Kragten6ce382a2020-01-16 20:20:46 -08008862 * Logs gnss stats from location service provider
8863 *
8864 * Pulled from:
8865 * frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
8866 */
8867
8868message GnssStats {
8869 // Number of location reports since boot
8870 optional int64 location_reports = 1;
8871
8872 // Total pulled reports of Location failures since boot
8873 optional int64 location_failure_reports = 2;
8874
8875 // Number of time to first fix reports since boot
8876 optional int64 time_to_first_fix_reports = 3;
8877
8878 // Total pulled reported time to first fix (in milli-seconds) since boot
8879 optional int64 time_to_first_fix_milli_s = 4;
8880
8881 // Number of position accuracy reports since boot
8882 optional int64 position_accuracy_reports = 5;
8883
8884 // Total pulled reported position accuracy (in meters) since boot
8885 optional int64 position_accuracy_meters = 6;
8886
8887 // Number of top 4 average CN0 reports since boot
8888 optional int64 top_four_average_cn0_reports = 7;
8889
8890 // Total pulled reported of top 4 average CN0 (dB-mHz) since boot
8891 optional int64 top_four_average_cn0_db_mhz = 8;
8892
8893 // Number of l5 top 4 average CN0 reports since boot
8894 optional int64 l5_top_four_average_cn0_reports = 9;
8895
8896 // Total pulled reported of l5 top 4 average CN0 (dB-mHz) since boot
8897 optional int64 l5_top_four_average_cn0_db_mhz = 10;
8898
8899 // Total number of sv status messages reports since boot
8900 optional int64 sv_status_reports = 11;
8901
8902 // Total number of sv status messages reports, where sv is used in fix since boot
8903 optional int64 sv_status_reports_used_in_fix = 12;
8904
8905 // Total number of L5 sv status messages reports since boot
8906 optional int64 l5_sv_status_reports = 13;
8907
8908 // Total number of L5 sv status messages reports, where sv is used in fix since boot
8909 optional int64 l5_sv_status_reports_used_in_fix = 14;
Marco Ballesio497aff42020-01-24 08:39:42 -08008910}
Kweku Adams12752132020-02-18 15:36:48 -08008911
8912/**
8913 * Logs when an app is moved to a different standby bucket.
8914 *
8915 * Logged from:
8916 * frameworks/base/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
8917 */
8918message AppStandbyBucketChanged {
8919 optional string package_name = 1;
8920
8921 // Should be 0, 10, 11, 12, etc. where 0 is the owner. See UserHandle for more documentation.
8922 optional int32 user_id = 2;
8923
8924 // These enum values match the constants defined in UsageStatsManager.java.
8925 enum Bucket {
8926 BUCKET_UNKNOWN = 0;
8927 BUCKET_EXEMPTED = 5;
8928 BUCKET_ACTIVE = 10;
8929 BUCKET_WORKING_SET = 20;
8930 BUCKET_FREQUENT = 30;
8931 BUCKET_RARE = 40;
8932 BUCKET_RESTRICTED = 45;
8933 BUCKET_NEVER = 50;
8934 }
8935 optional Bucket bucket = 3;
8936
8937 enum MainReason {
8938 MAIN_UNKNOWN = 0;
8939 MAIN_DEFAULT = 0x0100;
8940 MAIN_TIMEOUT = 0x0200;
8941 MAIN_USAGE = 0x0300;
8942 MAIN_FORCED_BY_USER = 0x0400;
8943 MAIN_PREDICTED = 0x0500;
8944 MAIN_FORCED_BY_SYSTEM = 0x0600;
8945 }
8946 optional MainReason main_reason = 4;
8947
8948 // A more detailed reason for the standby bucket change. The sub reason name is dependent on
8949 // the main reason. Values are one of the REASON_SUB_XXX constants defined in
8950 // UsageStatsManager.java.
8951 optional int32 sub_reason = 5;
8952}
Susi Kharraz-Post1df7b002020-02-20 16:32:06 -05008953
8954/**
8955* Reports a started sharesheet transaction.
8956*
8957* Logged from:
8958* frameworks/base/core/java/com/android/internal/app/ChooserActivity.java
8959*/
8960message SharesheetStarted {
8961 // The event_id (as for UiEventReported).
8962 optional int32 event_id = 1;
8963 // The calling app's package name.
8964 optional string package_name = 2;
8965 // An identifier to tie together multiple logs relating to the same share event
8966 optional int32 instance_id = 3;
8967 // The mime type of the share
8968 optional string mime_type = 4;
8969 // The number of direct targets the calling app is providing that will be shown.
8970 optional int32 num_app_provided_direct_targets = 5;
8971 // The number of app targets the calling app is providing that will be shown.
8972 optional int32 num_app_provided_app_targets = 6;
8973 // True if the share originates from the workprofile
8974 optional bool is_workprofile = 7;
8975
8976 enum SharesheetPreviewType { // Constants from ChooserActivity.java
8977 CONTENT_PREVIEW_IMAGE = 1; // The preview shown in the sharesheet is an image.
8978 CONTENT_PREVIEW_FILE = 2; // The preview shown in the sharesheet is a file.
8979 CONTENT_PREVIEW_TEXT = 3; // The preview shown in the sharesheet is text.
8980 }
8981 // How the sharesheet preview is presented.
8982 optional SharesheetPreviewType previewType = 8;
8983
8984 enum ResolverActivityIntent { // Intents handled by ResolverActivity.java
8985 INTENT_DEFAULT = 0;
8986 INTENT_ACTION_VIEW = 1;
8987 INTENT_ACTION_EDIT = 2;
8988 INTENT_ACTION_SEND = 3;
8989 INTENT_ACTION_SENDTO = 4;
8990 INTENT_ACTION_SEND_MULTIPLE = 5;
8991 INTENT_ACTION_IMAGE_CAPTURE = 6;
8992 INTENT_ACTION_MAIN = 7;
8993 }
8994 // The intent being processed (only SEND and SEND_MULTIPLE are system sharesheet)
8995 optional ResolverActivityIntent intentType = 9;
8996}
8997
8998/**
8999 * Reports a ranking selection event.
9000 *
9001 * Logged from:
9002 * frameworks/base/core/java/com/android/internal/app/ChooserActivity.java (sharesheet)
9003 */
9004message RankingSelected {
9005 // The event_id (as for UiEventReported).
9006 optional int32 event_id = 1;
9007 // The relevant app's package name (can be source or picked package).
9008 optional string package_name = 2;
9009 // An identifier to tie together multiple logs relating to the same share event.
9010 optional int32 instance_id = 3;
9011 // Which of the ranked targets got picked, default starting position 0.
9012 optional int32 position_picked = 4;
9013}
Raff Tsaiea4db182020-03-06 07:45:43 +08009014
9015/**
9016 * Logs settings provider values.
9017 *
9018 * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,
9019 * then write the value to proto.
9020 *
9021 */
9022message SettingSnapshot {
9023
9024 // Setting key
9025 optional string name = 1;
9026
9027 enum SettingsValueType {
9028 NOTASSIGNED = 0;
9029 ASSIGNED_BOOL_TYPE = 1;
9030 ASSIGNED_INT_TYPE = 2;
9031 ASSIGNED_FLOAT_TYPE = 3;
9032 ASSIGNED_STRING_TYPE = 4;
9033 };
9034 // Setting value type
9035 optional SettingsValueType type = 2;
9036
9037 optional bool bool_value = 3;
9038
9039 optional int32 int_value = 4;
9040
9041 optional float float_value = 5;
9042
9043 optional string str_value = 6;
9044
9045 // Android user index. 0 for primary user, 10, 11 for secondary or profile user
9046 optional int32 user_id = 7;
9047}